Loading core/java/android/app/Activity.java +8 −0 Original line number Diff line number Diff line Loading @@ -5284,6 +5284,14 @@ public class Activity extends ContextThemeWrapper } } /** @hide */ public void onNewActivityOptions(ActivityOptions options) { mActivityTransitionState.setEnterActivityOptions(this, options); if (!mStopped) { mActivityTransitionState.enterReady(this); } } /** * Retrieve the ActivityOptions passed in from the launching activity or passed back * from an activity launched by this activity in its call to {@link Loading core/java/android/app/ActivityThread.java +19 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; import android.util.LogPrinter; import android.util.Pair; import android.util.PrintWriterPrinter; import android.util.Slog; import android.util.SuperNotCalledException; Loading Loading @@ -1113,6 +1114,11 @@ public final class ActivityThread { sendMessage(H.TRANSLUCENT_CONVERSION_COMPLETE, token, drawComplete ? 1 : 0); } public void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options) { sendMessage(H.ON_NEW_ACTIVITY_OPTIONS, new Pair<IBinder, ActivityOptions>(token, options)); } public void setProcessState(int state) { updateProcessState(state, true); } Loading Loading @@ -1196,6 +1202,7 @@ public final class ActivityThread { public static final int REQUEST_ASSIST_CONTEXT_EXTRAS = 143; public static final int TRANSLUCENT_CONVERSION_COMPLETE = 144; public static final int INSTALL_PROVIDER = 145; public static final int ON_NEW_ACTIVITY_OPTIONS = 146; String codeToString(int code) { if (DEBUG_MESSAGES) { Loading Loading @@ -1245,6 +1252,7 @@ public final class ActivityThread { case REQUEST_ASSIST_CONTEXT_EXTRAS: return "REQUEST_ASSIST_CONTEXT_EXTRAS"; case TRANSLUCENT_CONVERSION_COMPLETE: return "TRANSLUCENT_CONVERSION_COMPLETE"; case INSTALL_PROVIDER: return "INSTALL_PROVIDER"; case ON_NEW_ACTIVITY_OPTIONS: return "ON_NEW_ACTIVITY_OPTIONS"; } } return Integer.toString(code); Loading Loading @@ -1459,6 +1467,10 @@ public final class ActivityThread { case INSTALL_PROVIDER: handleInstallProvider((ProviderInfo) msg.obj); break; case ON_NEW_ACTIVITY_OPTIONS: Pair<IBinder, ActivityOptions> pair = (Pair<IBinder, ActivityOptions>) msg.obj; onNewActivityOptions(pair.first, pair.second); break; } if (DEBUG_MESSAGES) Slog.v(TAG, "<<< done: " + codeToString(msg.what)); } Loading Loading @@ -2435,6 +2447,13 @@ public final class ActivityThread { } } public void onNewActivityOptions(IBinder token, ActivityOptions options) { ActivityClientRecord r = mActivities.get(token); if (r != null) { r.activity.onNewActivityOptions(options); } } public void handleInstallProvider(ProviderInfo info) { installContentProviders(mInitialApplication, Lists.newArrayList(info)); } Loading core/java/android/app/ApplicationThreadNative.java +24 −1 Original line number Diff line number Diff line Loading @@ -611,6 +611,16 @@ public abstract class ApplicationThreadNative extends Binder return true; } case SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); IBinder token = data.readStrongBinder(); ActivityOptions options = new ActivityOptions(data.readBundle()); scheduleOnNewActivityOptions(token, options); reply.writeNoException(); return true; } case SET_PROCESS_STATE_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); Loading Loading @@ -1251,7 +1261,20 @@ class ApplicationThreadProxy implements IApplicationThread { data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(token); data.writeInt(timeout ? 1 : 0); mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); } @Override public void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(token); data.writeBundle(options == null ? null : options.toBundle()); mRemote.transact(SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); } Loading core/java/android/app/IApplicationThread.java +3 −1 Original line number Diff line number Diff line Loading @@ -140,6 +140,8 @@ public interface IApplicationThread extends IInterface { throws RemoteException; void scheduleTranslucentConversionComplete(IBinder token, boolean timeout) throws RemoteException; void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options) throws RemoteException; void setProcessState(int state) throws RemoteException; void scheduleInstallProvider(ProviderInfo provider) throws RemoteException; void updateTimePrefs(boolean is24Hour) throws RemoteException; Loading Loading @@ -176,7 +178,7 @@ public interface IApplicationThread extends IInterface { int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28; int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29; int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30; int SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31; int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32; int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33; int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34; Loading services/core/java/com/android/server/am/ActivityManagerService.java +4 −1 Original line number Diff line number Diff line Loading @@ -9370,9 +9370,12 @@ public final class ActivityManagerService extends ActivityManagerNative mWindowManager.setAppFullscreen(token, false); mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); return true; } } else { r.task.stack.mReturningActivityOptions = options; mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); return false; } } } finally { Binder.restoreCallingIdentity(origId); } Loading Loading
core/java/android/app/Activity.java +8 −0 Original line number Diff line number Diff line Loading @@ -5284,6 +5284,14 @@ public class Activity extends ContextThemeWrapper } } /** @hide */ public void onNewActivityOptions(ActivityOptions options) { mActivityTransitionState.setEnterActivityOptions(this, options); if (!mStopped) { mActivityTransitionState.enterReady(this); } } /** * Retrieve the ActivityOptions passed in from the launching activity or passed back * from an activity launched by this activity in its call to {@link Loading
core/java/android/app/ActivityThread.java +19 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; import android.util.LogPrinter; import android.util.Pair; import android.util.PrintWriterPrinter; import android.util.Slog; import android.util.SuperNotCalledException; Loading Loading @@ -1113,6 +1114,11 @@ public final class ActivityThread { sendMessage(H.TRANSLUCENT_CONVERSION_COMPLETE, token, drawComplete ? 1 : 0); } public void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options) { sendMessage(H.ON_NEW_ACTIVITY_OPTIONS, new Pair<IBinder, ActivityOptions>(token, options)); } public void setProcessState(int state) { updateProcessState(state, true); } Loading Loading @@ -1196,6 +1202,7 @@ public final class ActivityThread { public static final int REQUEST_ASSIST_CONTEXT_EXTRAS = 143; public static final int TRANSLUCENT_CONVERSION_COMPLETE = 144; public static final int INSTALL_PROVIDER = 145; public static final int ON_NEW_ACTIVITY_OPTIONS = 146; String codeToString(int code) { if (DEBUG_MESSAGES) { Loading Loading @@ -1245,6 +1252,7 @@ public final class ActivityThread { case REQUEST_ASSIST_CONTEXT_EXTRAS: return "REQUEST_ASSIST_CONTEXT_EXTRAS"; case TRANSLUCENT_CONVERSION_COMPLETE: return "TRANSLUCENT_CONVERSION_COMPLETE"; case INSTALL_PROVIDER: return "INSTALL_PROVIDER"; case ON_NEW_ACTIVITY_OPTIONS: return "ON_NEW_ACTIVITY_OPTIONS"; } } return Integer.toString(code); Loading Loading @@ -1459,6 +1467,10 @@ public final class ActivityThread { case INSTALL_PROVIDER: handleInstallProvider((ProviderInfo) msg.obj); break; case ON_NEW_ACTIVITY_OPTIONS: Pair<IBinder, ActivityOptions> pair = (Pair<IBinder, ActivityOptions>) msg.obj; onNewActivityOptions(pair.first, pair.second); break; } if (DEBUG_MESSAGES) Slog.v(TAG, "<<< done: " + codeToString(msg.what)); } Loading Loading @@ -2435,6 +2447,13 @@ public final class ActivityThread { } } public void onNewActivityOptions(IBinder token, ActivityOptions options) { ActivityClientRecord r = mActivities.get(token); if (r != null) { r.activity.onNewActivityOptions(options); } } public void handleInstallProvider(ProviderInfo info) { installContentProviders(mInitialApplication, Lists.newArrayList(info)); } Loading
core/java/android/app/ApplicationThreadNative.java +24 −1 Original line number Diff line number Diff line Loading @@ -611,6 +611,16 @@ public abstract class ApplicationThreadNative extends Binder return true; } case SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); IBinder token = data.readStrongBinder(); ActivityOptions options = new ActivityOptions(data.readBundle()); scheduleOnNewActivityOptions(token, options); reply.writeNoException(); return true; } case SET_PROCESS_STATE_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); Loading Loading @@ -1251,7 +1261,20 @@ class ApplicationThreadProxy implements IApplicationThread { data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(token); data.writeInt(timeout ? 1 : 0); mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); } @Override public void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(token); data.writeBundle(options == null ? null : options.toBundle()); mRemote.transact(SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); } Loading
core/java/android/app/IApplicationThread.java +3 −1 Original line number Diff line number Diff line Loading @@ -140,6 +140,8 @@ public interface IApplicationThread extends IInterface { throws RemoteException; void scheduleTranslucentConversionComplete(IBinder token, boolean timeout) throws RemoteException; void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options) throws RemoteException; void setProcessState(int state) throws RemoteException; void scheduleInstallProvider(ProviderInfo provider) throws RemoteException; void updateTimePrefs(boolean is24Hour) throws RemoteException; Loading Loading @@ -176,7 +178,7 @@ public interface IApplicationThread extends IInterface { int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28; int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29; int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30; int SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31; int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32; int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33; int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34; Loading
services/core/java/com/android/server/am/ActivityManagerService.java +4 −1 Original line number Diff line number Diff line Loading @@ -9370,9 +9370,12 @@ public final class ActivityManagerService extends ActivityManagerNative mWindowManager.setAppFullscreen(token, false); mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); return true; } } else { r.task.stack.mReturningActivityOptions = options; mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); return false; } } } finally { Binder.restoreCallingIdentity(origId); } Loading