diff options
| author | Roland Levillain <rpl@google.com> | 2021-02-10 18:23:48 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-02-10 18:23:48 +0000 |
| commit | a7f6e5ea404f952ff5072d2c7e06283ae9cc169b (patch) | |
| tree | 074a0062a12747ce5a107354902907ee5d65a806 /core/java/android | |
| parent | e4d66ae2fe2f35635258c4a28c2bcba6924c355b (diff) | |
| parent | ac711f9fbff9086e32520ade678d527b75e05c4d (diff) | |
Merge changes from topic "cherrypick-android_util-a0ae5zk4cb" into sc-dev
* changes:
[Mainline] android.system package APIs migration
Use public android.system.Int64Ref instead of Int32Ref which is hidden (CorePlatformApi) type of libcore
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/content/ContentResolver.java | 4 | ||||
| -rw-r--r-- | core/java/android/net/LocalSocketImpl.java | 12 |
2 files changed, 6 insertions, 10 deletions
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index d7dc86a5c59f..46d8900e59a1 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -63,7 +63,7 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; import android.os.UserHandle; -import android.system.Int32Ref; +import android.system.Int64Ref; import android.text.TextUtils; import android.util.EventLog; import android.util.Log; @@ -4050,7 +4050,7 @@ public abstract class ContentResolver implements ContentInterface { // Convert to Point, since that's what the API is defined as final Bundle opts = new Bundle(); opts.putParcelable(EXTRA_SIZE, new Point(size.getWidth(), size.getHeight())); - final Int32Ref orientation = new Int32Ref(0); + final Int64Ref orientation = new Int64Ref(0); Bitmap bitmap = ImageDecoder.decodeBitmap(ImageDecoder.createSource(() -> { final AssetFileDescriptor afd = content.openTypedAssetFile(uri, "image/*", opts, diff --git a/core/java/android/net/LocalSocketImpl.java b/core/java/android/net/LocalSocketImpl.java index e01e5aecc7e6..f7c1c4bb6d96 100644 --- a/core/java/android/net/LocalSocketImpl.java +++ b/core/java/android/net/LocalSocketImpl.java @@ -19,7 +19,6 @@ package android.net; import android.compat.annotation.UnsupportedAppUsage; import android.os.Build; import android.system.ErrnoException; -import android.system.Int32Ref; import android.system.Os; import android.system.OsConstants; import android.system.StructLinger; @@ -65,14 +64,11 @@ class LocalSocketImpl public int available() throws IOException { FileDescriptor myFd = fd; if (myFd == null) throw new IOException("socket closed"); - - Int32Ref avail = new Int32Ref(0); try { - Os.ioctlInt(myFd, OsConstants.FIONREAD, avail); + return Os.ioctlInt(myFd, OsConstants.FIONREAD); } catch (ErrnoException e) { throw e.rethrowAsIOException(); } - return avail.value; } /** {@inheritDoc} */ @@ -134,7 +130,7 @@ class LocalSocketImpl public void write (byte[] b) throws IOException { write(b, 0, b.length); } - + /** {@inheritDoc} */ @Override public void write (byte[] b, int off, int len) throws IOException { @@ -255,7 +251,7 @@ class LocalSocketImpl /** note timeout presently ignored */ protected void connect(LocalSocketAddress address, int timeout) throws IOException - { + { if (fd == null) { throw new IOException("socket not created"); } @@ -339,7 +335,7 @@ class LocalSocketImpl * @throws IOException if socket has been closed or cannot be created. */ protected OutputStream getOutputStream() throws IOException - { + { if (fd == null) { throw new IOException("socket not created"); } |
