diff options
author | Amith Yamasani <yamasani@google.com> | 2013-09-23 11:16:28 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2013-09-23 13:35:46 -0700 |
commit | c2be0d61830dd867f3092923e149e0cc251cdfc5 (patch) | |
tree | 75cde786c895c2d55bc1a53fd68667eeb24a4810 /core/java | |
parent | 562ce888af21fc18d1610545ff6373ee2ecbbb13 (diff) | |
download | frameworks_base-c2be0d61830dd867f3092923e149e0cc251cdfc5.zip frameworks_base-c2be0d61830dd867f3092923e149e0cc251cdfc5.tar.gz frameworks_base-c2be0d61830dd867f3092923e149e0cc251cdfc5.tar.bz2 |
Unmarshall PFDs properly when hand-crafting interface stubs
ParcelFileDescriptors now carry an optional socket fd to communicate
close events. So, make sure that the correct creator is called when
reconstructing parceled PFDs.
Bug: 10759966
Change-Id: Ic6b9ffb8cb7af5f3a12440def595f74682231866
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/app/ActivityManagerNative.java | 8 | ||||
-rw-r--r-- | core/java/android/app/ApplicationThreadNative.java | 8 | ||||
-rw-r--r-- | core/java/android/preference/PreferenceActivity.java | 5 |
3 files changed, 11 insertions, 10 deletions
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index a727b07..7d4d57c 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -152,7 +152,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM int startFlags = data.readInt(); String profileFile = data.readString(); ParcelFileDescriptor profileFd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; Bundle options = data.readInt() != 0 ? Bundle.CREATOR.createFromParcel(data) : null; int userId = data.readInt(); @@ -178,7 +178,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM int startFlags = data.readInt(); String profileFile = data.readString(); ParcelFileDescriptor profileFd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; Bundle options = data.readInt() != 0 ? Bundle.CREATOR.createFromParcel(data) : null; int userId = data.readInt(); @@ -1354,7 +1354,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM int profileType = data.readInt(); String path = data.readString(); ParcelFileDescriptor fd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; boolean res = profileControl(process, userId, start, path, fd, profileType); reply.writeNoException(); reply.writeInt(res ? 1 : 0); @@ -1608,7 +1608,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM boolean managed = data.readInt() != 0; String path = data.readString(); ParcelFileDescriptor fd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; boolean res = dumpHeap(process, userId, managed, path, fd); reply.writeNoException(); reply.writeInt(res ? 1 : 0); diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index 876bf78..e40a04b 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -143,7 +143,7 @@ public abstract class ApplicationThreadNative extends Binder boolean isForward = data.readInt() != 0; String profileName = data.readString(); ParcelFileDescriptor profileFd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; boolean autoStopProfiler = data.readInt() != 0; scheduleLaunchActivity(intent, b, ident, info, curConfig, compatInfo, procState, state, ri, pi, notResumed, isForward, profileName, profileFd, autoStopProfiler); @@ -267,7 +267,7 @@ public abstract class ApplicationThreadNative extends Binder ? new ComponentName(data) : null; String profileName = data.readString(); ParcelFileDescriptor profileFd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; boolean autoStopProfiler = data.readInt() != 0; Bundle testArgs = data.readBundle(); IBinder binder = data.readStrongBinder(); @@ -418,7 +418,7 @@ public abstract class ApplicationThreadNative extends Binder int profileType = data.readInt(); String path = data.readString(); ParcelFileDescriptor fd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; profilerControl(start, path, fd, profileType); return true; } @@ -473,7 +473,7 @@ public abstract class ApplicationThreadNative extends Binder boolean managed = data.readInt() != 0; String path = data.readString(); ParcelFileDescriptor fd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; dumpHeap(managed, path, fd); return true; } diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java index a99705b..2ab5a91 100644 --- a/core/java/android/preference/PreferenceActivity.java +++ b/core/java/android/preference/PreferenceActivity.java @@ -887,8 +887,9 @@ public abstract class PreferenceActivity extends ListActivity implements /** * Subclasses should override this method and verify that the given fragment is a valid type - * to be attached to this activity. The default implementation returns <code>true</code> prior - * to Key Lime Pie, <code>false</code> otherwise. + * to be attached to this activity. The default implementation returns <code>true</code> for + * apps built for <code>android:targetSdkVersion</code> older than + * {@link android.os.Build.VERSION_CODES#KITKAT}. For later versions, it will throw an exception. * @param fragmentName the class name of the Fragment about to be attached to this activity. * @return true if the fragment class name is valid for this Activity and false otherwise. */ |