OSDN Git Service

Adds handle to NanoAppInstanceInfo Parcel
authorArthur Ishiguro <arthuri@google.com>
Mon, 18 Sep 2017 19:07:44 +0000 (12:07 -0700)
committerArthur Ishiguro <arthuri@google.com>
Tue, 19 Sep 2017 17:52:12 +0000 (10:52 -0700)
- Since mHandle (UID) was not recorded in writeToParcel, it always
returned 0 as the UID. This resulted in error messages claiming
mismatches between the reported and actual UID of nanoapps when called
from an external process.
- Also fixes the Parcel constructor to actually read the mContexthubId
field.

Bug: 37785458
Test: Compile and load, verify error message doesn't appear
Change-Id: I2ff75f510aae549c741786f5746862256ea5a877

core/java/android/hardware/location/NanoAppInstanceInfo.java

index ac6d83f..2623830 100644 (file)
@@ -287,8 +287,10 @@ public class NanoAppInstanceInfo {
         mPublisher = in.readString();
         mName = in.readString();
 
+        mHandle = in.readInt();
         mAppId = in.readLong();
         mAppVersion = in.readInt();
+        mContexthubId = in.readInt();
         mNeededReadMemBytes = in.readInt();
         mNeededWriteMemBytes = in.readInt();
         mNeededExecMemBytes = in.readInt();
@@ -309,6 +311,8 @@ public class NanoAppInstanceInfo {
     public void writeToParcel(Parcel out, int flags) {
         out.writeString(mPublisher);
         out.writeString(mName);
+
+        out.writeInt(mHandle);
         out.writeLong(mAppId);
         out.writeInt(mAppVersion);
         out.writeInt(mContexthubId);