diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2013-11-22 11:18:57 -0800 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2013-11-22 11:18:57 -0800 |
| commit | dbccd44a638ae8705a5b14bff8b2dd74abc26045 (patch) | |
| tree | 14bfabaf3f3c7be86dfc064e919e00433a0cf2bb /core/java/android/app/ApplicationThreadNative.java | |
| parent | ecfae4f899873f224e1aeed076dc8a41f8884487 (diff) | |
| parent | b873a17ce7be0a9771c24999adca6964431728f6 (diff) | |
Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD
Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
Diffstat (limited to 'core/java/android/app/ApplicationThreadNative.java')
| -rw-r--r-- | core/java/android/app/ApplicationThreadNative.java | 165 |
1 files changed, 109 insertions, 56 deletions
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index b1c58f234c39..347d43f63a69 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -111,8 +111,9 @@ public abstract class ApplicationThreadNative extends Binder { data.enforceInterface(IApplicationThread.descriptor); IBinder b = data.readStrongBinder(); + int procState = data.readInt(); boolean isForward = data.readInt() != 0; - scheduleResumeActivity(b, isForward); + scheduleResumeActivity(b, procState, isForward); return true; } @@ -134,6 +135,7 @@ public abstract class ApplicationThreadNative extends Binder ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data); Configuration curConfig = Configuration.CREATOR.createFromParcel(data); CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data); + int procState = data.readInt(); Bundle state = data.readBundle(); List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR); List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); @@ -141,10 +143,10 @@ 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, state, ri, pi, - notResumed, isForward, profileName, profileFd, autoStopProfiler); + scheduleLaunchActivity(intent, b, ident, info, curConfig, compatInfo, procState, state, + ri, pi, notResumed, isForward, profileName, profileFd, autoStopProfiler); return true; } @@ -194,8 +196,9 @@ public abstract class ApplicationThreadNative extends Binder Bundle resultExtras = data.readBundle(); boolean sync = data.readInt() != 0; int sendingUser = data.readInt(); + int processState = data.readInt(); scheduleReceiver(intent, info, compatInfo, resultCode, resultData, - resultExtras, sync, sendingUser); + resultExtras, sync, sendingUser, processState); return true; } @@ -204,7 +207,8 @@ public abstract class ApplicationThreadNative extends Binder IBinder token = data.readStrongBinder(); ServiceInfo info = ServiceInfo.CREATOR.createFromParcel(data); CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data); - scheduleCreateService(token, info, compatInfo); + int processState = data.readInt(); + scheduleCreateService(token, info, compatInfo, processState); return true; } @@ -213,7 +217,8 @@ public abstract class ApplicationThreadNative extends Binder IBinder token = data.readStrongBinder(); Intent intent = Intent.CREATOR.createFromParcel(data); boolean rebind = data.readInt() != 0; - scheduleBindService(token, intent, rebind); + int processState = data.readInt(); + scheduleBindService(token, intent, rebind, processState); return true; } @@ -262,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(); @@ -333,7 +338,8 @@ public abstract class ApplicationThreadNative extends Binder final String proxy = data.readString(); final String port = data.readString(); final String exclList = data.readString(); - setHttpProxy(proxy, port, exclList); + final String pacFileUrl = data.readString(); + setHttpProxy(proxy, port, exclList, pacFileUrl); return true; } @@ -384,8 +390,9 @@ public abstract class ApplicationThreadNative extends Binder boolean ordered = data.readInt() != 0; boolean sticky = data.readInt() != 0; int sendingUser = data.readInt(); + int processState = data.readInt(); scheduleRegisteredReceiver(receiver, intent, - resultCode, dataStr, extras, ordered, sticky, sendingUser); + resultCode, dataStr, extras, ordered, sticky, sendingUser, processState); return true; } @@ -411,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; } @@ -443,16 +450,6 @@ public abstract class ApplicationThreadNative extends Binder return true; } - case GET_MEMORY_INFO_TRANSACTION: - { - data.enforceInterface(IApplicationThread.descriptor); - Debug.MemoryInfo mi = new Debug.MemoryInfo(); - getMemoryInfo(mi); - reply.writeNoException(); - mi.writeToParcel(reply, 0); - return true; - } - case DISPATCH_PACKAGE_BROADCAST_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); @@ -476,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; } @@ -523,13 +520,14 @@ public abstract class ApplicationThreadNative extends Binder { data.enforceInterface(IApplicationThread.descriptor); ParcelFileDescriptor fd = data.readFileDescriptor(); + Debug.MemoryInfo mi = Debug.MemoryInfo.CREATOR.createFromParcel(data); boolean checkin = data.readInt() != 0; - boolean all = data.readInt() != 0; + boolean dumpInfo = data.readInt() != 0; + boolean dumpDalvik = data.readInt() != 0; String[] args = data.readStringArray(); - Debug.MemoryInfo mi = null; if (fd != null) { try { - mi = dumpMemInfo(fd.getFileDescriptor(), checkin, all, args); + dumpMemInfo(fd.getFileDescriptor(), mi, checkin, dumpInfo, dumpDalvik, args); } finally { try { fd.close(); @@ -539,7 +537,6 @@ public abstract class ApplicationThreadNative extends Binder } } reply.writeNoException(); - mi.writeToParcel(reply, 0); return true; } @@ -592,13 +589,41 @@ public abstract class ApplicationThreadNative extends Binder return true; } - case REQUEST_ACTIVITY_EXTRAS_TRANSACTION: + case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); IBinder activityToken = data.readStrongBinder(); IBinder requestToken = data.readStrongBinder(); int requestType = data.readInt(); - requestActivityExtras(activityToken, requestToken, requestType); + requestAssistContextExtras(activityToken, requestToken, requestType); + reply.writeNoException(); + return true; + } + + case SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION: + { + data.enforceInterface(IApplicationThread.descriptor); + IBinder token = data.readStrongBinder(); + boolean timeout = data.readInt() == 1; + scheduleTranslucentConversionComplete(token, timeout); + reply.writeNoException(); + return true; + } + + case SET_PROCESS_STATE_TRANSACTION: + { + data.enforceInterface(IApplicationThread.descriptor); + int state = data.readInt(); + setProcessState(state); + reply.writeNoException(); + return true; + } + + case SCHEDULE_INSTALL_PROVIDER_TRANSACTION: + { + data.enforceInterface(IApplicationThread.descriptor); + ProviderInfo provider = ProviderInfo.CREATOR.createFromParcel(data); + scheduleInstallProvider(provider); reply.writeNoException(); return true; } @@ -671,11 +696,12 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } - public final void scheduleResumeActivity(IBinder token, boolean isForward) + public final void scheduleResumeActivity(IBinder token, int procState, boolean isForward) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(token); + data.writeInt(procState); data.writeInt(isForward ? 1 : 0); mRemote.transact(SCHEDULE_RESUME_ACTIVITY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); @@ -695,7 +721,7 @@ class ApplicationThreadProxy implements IApplicationThread { public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident, ActivityInfo info, Configuration curConfig, CompatibilityInfo compatInfo, - Bundle state, List<ResultInfo> pendingResults, + int procState, Bundle state, List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, boolean notResumed, boolean isForward, String profileName, ParcelFileDescriptor profileFd, boolean autoStopProfiler) throws RemoteException { @@ -707,6 +733,7 @@ class ApplicationThreadProxy implements IApplicationThread { info.writeToParcel(data, 0); curConfig.writeToParcel(data, 0); compatInfo.writeToParcel(data, 0); + data.writeInt(procState); data.writeBundle(state); data.writeTypedList(pendingResults); data.writeTypedList(pendingNewIntents); @@ -772,7 +799,7 @@ class ApplicationThreadProxy implements IApplicationThread { public final void scheduleReceiver(Intent intent, ActivityInfo info, CompatibilityInfo compatInfo, int resultCode, String resultData, - Bundle map, boolean sync, int sendingUser) throws RemoteException { + Bundle map, boolean sync, int sendingUser, int processState) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); intent.writeToParcel(data, 0); @@ -783,6 +810,7 @@ class ApplicationThreadProxy implements IApplicationThread { data.writeBundle(map); data.writeInt(sync ? 1 : 0); data.writeInt(sendingUser); + data.writeInt(processState); mRemote.transact(SCHEDULE_RECEIVER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); @@ -812,24 +840,26 @@ class ApplicationThreadProxy implements IApplicationThread { } public final void scheduleCreateService(IBinder token, ServiceInfo info, - CompatibilityInfo compatInfo) throws RemoteException { + CompatibilityInfo compatInfo, int processState) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(token); info.writeToParcel(data, 0); compatInfo.writeToParcel(data, 0); + data.writeInt(processState); mRemote.transact(SCHEDULE_CREATE_SERVICE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); } - public final void scheduleBindService(IBinder token, Intent intent, boolean rebind) - throws RemoteException { + public final void scheduleBindService(IBinder token, Intent intent, boolean rebind, + int processState) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(token); intent.writeToParcel(data, 0); data.writeInt(rebind ? 1 : 0); + data.writeInt(processState); mRemote.transact(SCHEDULE_BIND_SERVICE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); @@ -970,12 +1000,14 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } - public void setHttpProxy(String proxy, String port, String exclList) throws RemoteException { + public void setHttpProxy(String proxy, String port, String exclList, + String pacFileUrl) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeString(proxy); data.writeString(port); data.writeString(exclList); + data.writeString(pacFileUrl); mRemote.transact(SET_HTTP_PROXY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); } @@ -1012,7 +1044,7 @@ class ApplicationThreadProxy implements IApplicationThread { public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent, int resultCode, String dataStr, Bundle extras, boolean ordered, - boolean sticky, int sendingUser) throws RemoteException { + boolean sticky, int sendingUser, int processState) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(receiver.asBinder()); @@ -1023,6 +1055,7 @@ class ApplicationThreadProxy implements IApplicationThread { data.writeInt(ordered ? 1 : 0); data.writeInt(sticky ? 1 : 0); data.writeInt(sendingUser); + data.writeInt(processState); mRemote.transact(SCHEDULE_REGISTERED_RECEIVER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); @@ -1073,17 +1106,6 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } - public void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException { - Parcel data = Parcel.obtain(); - Parcel reply = Parcel.obtain(); - data.writeInterfaceToken(IApplicationThread.descriptor); - mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); - reply.readException(); - outInfo.readFromParcel(reply); - data.recycle(); - reply.recycle(); - } - public void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); @@ -1159,22 +1181,21 @@ class ApplicationThreadProxy implements IApplicationThread { IBinder.FLAG_ONEWAY); } - public Debug.MemoryInfo dumpMemInfo(FileDescriptor fd, boolean checkin, boolean all, - String[] args) throws RemoteException { + public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin, + boolean dumpInfo, boolean dumpDalvik, String[] args) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeFileDescriptor(fd); + mem.writeToParcel(data, 0); data.writeInt(checkin ? 1 : 0); - data.writeInt(all ? 1 : 0); + data.writeInt(dumpInfo ? 1 : 0); + data.writeInt(dumpDalvik ? 1 : 0); data.writeStringArray(args); mRemote.transact(DUMP_MEM_INFO_TRANSACTION, data, reply, 0); reply.readException(); - Debug.MemoryInfo info = new Debug.MemoryInfo(); - info.readFromParcel(reply); data.recycle(); reply.recycle(); - return info; } public void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException { @@ -1195,6 +1216,7 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } + @Override public void unstableProviderDied(IBinder provider) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); @@ -1203,14 +1225,45 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } - public void requestActivityExtras(IBinder activityToken, IBinder requestToken, int requestType) - throws RemoteException { + @Override + public void requestAssistContextExtras(IBinder activityToken, IBinder requestToken, + int requestType) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(activityToken); data.writeStrongBinder(requestToken); data.writeInt(requestType); - mRemote.transact(REQUEST_ACTIVITY_EXTRAS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); + mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, null, + IBinder.FLAG_ONEWAY); + data.recycle(); + } + + @Override + public void scheduleTranslucentConversionComplete(IBinder token, boolean timeout) + throws RemoteException { + Parcel data = Parcel.obtain(); + data.writeInterfaceToken(IApplicationThread.descriptor); + data.writeStrongBinder(token); + data.writeInt(timeout ? 1 : 0); + mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); + data.recycle(); + } + + @Override + public void setProcessState(int state) throws RemoteException { + Parcel data = Parcel.obtain(); + data.writeInterfaceToken(IApplicationThread.descriptor); + data.writeInt(state); + mRemote.transact(SET_PROCESS_STATE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); + data.recycle(); + } + + @Override + public void scheduleInstallProvider(ProviderInfo provider) throws RemoteException { + Parcel data = Parcel.obtain(); + data.writeInterfaceToken(IApplicationThread.descriptor); + provider.writeToParcel(data, 0); + mRemote.transact(SCHEDULE_INSTALL_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); } } |
