Loading Android.mk +5 −4 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ LOCAL_SRC_FILES += \ core/java/android/accounts/IAccountManagerResponse.aidl \ core/java/android/accounts/IAccountAuthenticator.aidl \ core/java/android/accounts/IAccountAuthenticatorResponse.aidl \ core/java/android/app/IActivityController.aidl \ core/java/android/app/IActivityPendingResult.aidl \ core/java/android/app/IActivityWatcher.aidl \ core/java/android/app/IAlarmManager.aidl \ Loading core/java/android/app/Activity.java +30 −11 Original line number Diff line number Diff line Loading @@ -612,6 +612,7 @@ public class Activity extends ContextThemeWrapper // set by the thread after the constructor and before onCreate(Bundle savedInstanceState) is called. private Instrumentation mInstrumentation; private IBinder mToken; private int mIdent; /*package*/ String mEmbeddedID; private Application mApplication; /*package*/ Intent mIntent; Loading Loading @@ -789,9 +790,6 @@ public class Activity extends ContextThemeWrapper protected void onCreate(Bundle savedInstanceState) { mVisibleFromClient = mWindow.getWindowStyle().getBoolean( com.android.internal.R.styleable.Window_windowNoDisplay, true); // uses super.getSystemService() since this.getSystemService() looks at the // mSearchManager field. mSearchManager = (SearchManager) super.getSystemService(Context.SEARCH_SERVICE); mCalled = true; } Loading Loading @@ -2531,6 +2529,7 @@ public class Activity extends ContextThemeWrapper */ public void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData, boolean globalSearch) { ensureSearchManager(); mSearchManager.startSearch(initialQuery, selectInitialQuery, getComponentName(), appSearchData, globalSearch); } Loading Loading @@ -3241,6 +3240,24 @@ public class Activity extends ContextThemeWrapper return getSharedPreferences(getLocalClassName(), mode); } private void ensureSearchManager() { if (mSearchManager != null) { return; } // uses super.getSystemService() since this.getSystemService() looks at the // mSearchManager field. mSearchManager = (SearchManager) super.getSystemService(Context.SEARCH_SERVICE); int ident = mIdent; if (ident == 0) { if (mParent != null) ident = mParent.mIdent; if (ident == 0) { throw new IllegalArgumentException("no ident"); } } mSearchManager.setIdent(ident); } @Override public Object getSystemService(String name) { if (getBaseContext() == null) { Loading @@ -3251,6 +3268,7 @@ public class Activity extends ContextThemeWrapper if (WINDOW_SERVICE.equals(name)) { return mWindowManager; } else if (SEARCH_SERVICE.equals(name)) { ensureSearchManager(); return mSearchManager; } return super.getSystemService(name); Loading Loading @@ -3450,14 +3468,17 @@ public class Activity extends ContextThemeWrapper Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance, Configuration config) { attach(context, aThread, instr, token, application, intent, info, title, parent, id, attach(context, aThread, instr, token, 0, application, intent, info, title, parent, id, lastNonConfigurationInstance, null, config); } final void attach(Context context, ActivityThread aThread, Instrumentation instr, IBinder token, Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance, HashMap<String,Object> lastNonConfigurationChildInstances, Configuration config) { final void attach(Context context, ActivityThread aThread, Instrumentation instr, IBinder token, int ident, Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance, HashMap<String,Object> lastNonConfigurationChildInstances, Configuration config) { attachBaseContext(context); mWindow = PolicyManager.makeNewWindow(this); Loading @@ -3470,6 +3491,7 @@ public class Activity extends ContextThemeWrapper mMainThread = aThread; mInstrumentation = instr; mToken = token; mIdent = ident; mApplication = application; mIntent = intent; mComponent = intent.getComponent(); Loading Loading @@ -3554,9 +3576,6 @@ public class Activity extends ContextThemeWrapper final void performPause() { onPause(); // dismiss the search dialog if it is open mSearchManager.stopSearch(); } final void performUserLeaving() { Loading core/java/android/app/ActivityManagerNative.java +45 −5 Original line number Diff line number Diff line Loading @@ -881,11 +881,11 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } case SET_ACTIVITY_WATCHER_TRANSACTION: { case SET_ACTIVITY_CONTROLLER_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); IActivityWatcher watcher = IActivityWatcher.Stub.asInterface( IActivityController watcher = IActivityController.Stub.asInterface( data.readStrongBinder()); setActivityWatcher(watcher); setActivityController(watcher); return true; } Loading Loading @@ -1052,6 +1052,22 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM reply.writeNoException(); return true; } case REGISTER_ACTIVITY_WATCHER_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); IActivityWatcher watcher = IActivityWatcher.Stub.asInterface( data.readStrongBinder()); registerActivityWatcher(watcher); return true; } case UNREGISTER_ACTIVITY_WATCHER_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); IActivityWatcher watcher = IActivityWatcher.Stub.asInterface( data.readStrongBinder()); unregisterActivityWatcher(watcher); return true; } } return super.onTransact(code, data, reply, flags); Loading Loading @@ -2105,13 +2121,13 @@ class ActivityManagerProxy implements IActivityManager data.recycle(); reply.recycle(); } public void setActivityWatcher(IActivityWatcher watcher) throws RemoteException public void setActivityController(IActivityController watcher) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); mRemote.transact(SET_ACTIVITY_WATCHER_TRANSACTION, data, reply, 0); mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); Loading Loading @@ -2290,5 +2306,29 @@ class ActivityManagerProxy implements IActivityManager data.recycle(); } public void registerActivityWatcher(IActivityWatcher watcher) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); mRemote.transact(REGISTER_ACTIVITY_WATCHER_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } public void unregisterActivityWatcher(IActivityWatcher watcher) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); mRemote.transact(UNREGISTER_ACTIVITY_WATCHER_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } private IBinder mRemote; } core/java/android/app/ActivityThread.java +8 −16 Original line number Diff line number Diff line Loading @@ -1090,6 +1090,7 @@ public final class ActivityThread { private static final class ActivityRecord { IBinder token; int ident; Intent intent; Bundle state; Activity activity; Loading Loading @@ -1299,12 +1300,13 @@ public final class ActivityThread { // we use token to identify this activity without having to send the // activity itself back to the activity manager. (matters more with ipc) public final void scheduleLaunchActivity(Intent intent, IBinder token, public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident, ActivityInfo info, Bundle state, List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, boolean notResumed, boolean isForward) { ActivityRecord r = new ActivityRecord(); r.token = token; r.ident = ident; r.intent = intent; r.activityInfo = info; r.state = state; Loading Loading @@ -2196,22 +2198,12 @@ public final class ActivityThread { return aInfo; } public final Activity startActivityNow(Activity parent, String id, Intent intent, IBinder token, Bundle state) { ActivityInfo aInfo = resolveActivityInfo(intent); return startActivityNow(parent, id, intent, aInfo, token, state); } public final Activity startActivityNow(Activity parent, String id, Intent intent, ActivityInfo activityInfo, IBinder token, Bundle state) { return startActivityNow(parent, id, intent, activityInfo, token, state, null); } public final Activity startActivityNow(Activity parent, String id, Intent intent, ActivityInfo activityInfo, IBinder token, Bundle state, Object lastNonConfigurationInstance) { ActivityRecord r = new ActivityRecord(); r.token = token; r.ident = 0; r.intent = intent; r.state = state; r.parent = parent; Loading Loading @@ -2335,10 +2327,10 @@ public final class ActivityThread { appContext.setOuterContext(activity); CharSequence title = r.activityInfo.loadLabel(appContext.getPackageManager()); Configuration config = new Configuration(mConfiguration); activity.attach(appContext, this, getInstrumentation(), r.token, app, r.intent, r.activityInfo, title, r.parent, r.embeddedID, r.lastNonConfigurationInstance, r.lastNonConfigurationChildInstances, config); activity.attach(appContext, this, getInstrumentation(), r.token, r.ident, app, r.intent, r.activityInfo, title, r.parent, r.embeddedID, r.lastNonConfigurationInstance, r.lastNonConfigurationChildInstances, config); if (customIntent != null) { activity.mIntent = customIntent; Loading core/java/android/app/ApplicationThreadNative.java +5 −2 Original line number Diff line number Diff line Loading @@ -119,13 +119,15 @@ public abstract class ApplicationThreadNative extends Binder data.enforceInterface(IApplicationThread.descriptor); Intent intent = Intent.CREATOR.createFromParcel(data); IBinder b = data.readStrongBinder(); int ident = data.readInt(); ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data); Bundle state = data.readBundle(); List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR); List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); boolean notResumed = data.readInt() != 0; boolean isForward = data.readInt() != 0; scheduleLaunchActivity(intent, b, info, state, ri, pi, notResumed, isForward); scheduleLaunchActivity(intent, b, ident, info, state, ri, pi, notResumed, isForward); return true; } Loading Loading @@ -442,7 +444,7 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } public final void scheduleLaunchActivity(Intent intent, IBinder token, public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident, ActivityInfo info, Bundle state, List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, boolean notResumed, boolean isForward) throws RemoteException { Loading @@ -450,6 +452,7 @@ class ApplicationThreadProxy implements IApplicationThread { data.writeInterfaceToken(IApplicationThread.descriptor); intent.writeToParcel(data, 0); data.writeStrongBinder(token); data.writeInt(ident); info.writeToParcel(data, 0); data.writeBundle(state); data.writeTypedList(pendingResults); Loading Loading
Android.mk +5 −4 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ LOCAL_SRC_FILES += \ core/java/android/accounts/IAccountManagerResponse.aidl \ core/java/android/accounts/IAccountAuthenticator.aidl \ core/java/android/accounts/IAccountAuthenticatorResponse.aidl \ core/java/android/app/IActivityController.aidl \ core/java/android/app/IActivityPendingResult.aidl \ core/java/android/app/IActivityWatcher.aidl \ core/java/android/app/IAlarmManager.aidl \ Loading
core/java/android/app/Activity.java +30 −11 Original line number Diff line number Diff line Loading @@ -612,6 +612,7 @@ public class Activity extends ContextThemeWrapper // set by the thread after the constructor and before onCreate(Bundle savedInstanceState) is called. private Instrumentation mInstrumentation; private IBinder mToken; private int mIdent; /*package*/ String mEmbeddedID; private Application mApplication; /*package*/ Intent mIntent; Loading Loading @@ -789,9 +790,6 @@ public class Activity extends ContextThemeWrapper protected void onCreate(Bundle savedInstanceState) { mVisibleFromClient = mWindow.getWindowStyle().getBoolean( com.android.internal.R.styleable.Window_windowNoDisplay, true); // uses super.getSystemService() since this.getSystemService() looks at the // mSearchManager field. mSearchManager = (SearchManager) super.getSystemService(Context.SEARCH_SERVICE); mCalled = true; } Loading Loading @@ -2531,6 +2529,7 @@ public class Activity extends ContextThemeWrapper */ public void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData, boolean globalSearch) { ensureSearchManager(); mSearchManager.startSearch(initialQuery, selectInitialQuery, getComponentName(), appSearchData, globalSearch); } Loading Loading @@ -3241,6 +3240,24 @@ public class Activity extends ContextThemeWrapper return getSharedPreferences(getLocalClassName(), mode); } private void ensureSearchManager() { if (mSearchManager != null) { return; } // uses super.getSystemService() since this.getSystemService() looks at the // mSearchManager field. mSearchManager = (SearchManager) super.getSystemService(Context.SEARCH_SERVICE); int ident = mIdent; if (ident == 0) { if (mParent != null) ident = mParent.mIdent; if (ident == 0) { throw new IllegalArgumentException("no ident"); } } mSearchManager.setIdent(ident); } @Override public Object getSystemService(String name) { if (getBaseContext() == null) { Loading @@ -3251,6 +3268,7 @@ public class Activity extends ContextThemeWrapper if (WINDOW_SERVICE.equals(name)) { return mWindowManager; } else if (SEARCH_SERVICE.equals(name)) { ensureSearchManager(); return mSearchManager; } return super.getSystemService(name); Loading Loading @@ -3450,14 +3468,17 @@ public class Activity extends ContextThemeWrapper Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance, Configuration config) { attach(context, aThread, instr, token, application, intent, info, title, parent, id, attach(context, aThread, instr, token, 0, application, intent, info, title, parent, id, lastNonConfigurationInstance, null, config); } final void attach(Context context, ActivityThread aThread, Instrumentation instr, IBinder token, Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance, HashMap<String,Object> lastNonConfigurationChildInstances, Configuration config) { final void attach(Context context, ActivityThread aThread, Instrumentation instr, IBinder token, int ident, Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance, HashMap<String,Object> lastNonConfigurationChildInstances, Configuration config) { attachBaseContext(context); mWindow = PolicyManager.makeNewWindow(this); Loading @@ -3470,6 +3491,7 @@ public class Activity extends ContextThemeWrapper mMainThread = aThread; mInstrumentation = instr; mToken = token; mIdent = ident; mApplication = application; mIntent = intent; mComponent = intent.getComponent(); Loading Loading @@ -3554,9 +3576,6 @@ public class Activity extends ContextThemeWrapper final void performPause() { onPause(); // dismiss the search dialog if it is open mSearchManager.stopSearch(); } final void performUserLeaving() { Loading
core/java/android/app/ActivityManagerNative.java +45 −5 Original line number Diff line number Diff line Loading @@ -881,11 +881,11 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } case SET_ACTIVITY_WATCHER_TRANSACTION: { case SET_ACTIVITY_CONTROLLER_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); IActivityWatcher watcher = IActivityWatcher.Stub.asInterface( IActivityController watcher = IActivityController.Stub.asInterface( data.readStrongBinder()); setActivityWatcher(watcher); setActivityController(watcher); return true; } Loading Loading @@ -1052,6 +1052,22 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM reply.writeNoException(); return true; } case REGISTER_ACTIVITY_WATCHER_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); IActivityWatcher watcher = IActivityWatcher.Stub.asInterface( data.readStrongBinder()); registerActivityWatcher(watcher); return true; } case UNREGISTER_ACTIVITY_WATCHER_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); IActivityWatcher watcher = IActivityWatcher.Stub.asInterface( data.readStrongBinder()); unregisterActivityWatcher(watcher); return true; } } return super.onTransact(code, data, reply, flags); Loading Loading @@ -2105,13 +2121,13 @@ class ActivityManagerProxy implements IActivityManager data.recycle(); reply.recycle(); } public void setActivityWatcher(IActivityWatcher watcher) throws RemoteException public void setActivityController(IActivityController watcher) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); mRemote.transact(SET_ACTIVITY_WATCHER_TRANSACTION, data, reply, 0); mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); Loading Loading @@ -2290,5 +2306,29 @@ class ActivityManagerProxy implements IActivityManager data.recycle(); } public void registerActivityWatcher(IActivityWatcher watcher) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); mRemote.transact(REGISTER_ACTIVITY_WATCHER_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } public void unregisterActivityWatcher(IActivityWatcher watcher) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); mRemote.transact(UNREGISTER_ACTIVITY_WATCHER_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } private IBinder mRemote; }
core/java/android/app/ActivityThread.java +8 −16 Original line number Diff line number Diff line Loading @@ -1090,6 +1090,7 @@ public final class ActivityThread { private static final class ActivityRecord { IBinder token; int ident; Intent intent; Bundle state; Activity activity; Loading Loading @@ -1299,12 +1300,13 @@ public final class ActivityThread { // we use token to identify this activity without having to send the // activity itself back to the activity manager. (matters more with ipc) public final void scheduleLaunchActivity(Intent intent, IBinder token, public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident, ActivityInfo info, Bundle state, List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, boolean notResumed, boolean isForward) { ActivityRecord r = new ActivityRecord(); r.token = token; r.ident = ident; r.intent = intent; r.activityInfo = info; r.state = state; Loading Loading @@ -2196,22 +2198,12 @@ public final class ActivityThread { return aInfo; } public final Activity startActivityNow(Activity parent, String id, Intent intent, IBinder token, Bundle state) { ActivityInfo aInfo = resolveActivityInfo(intent); return startActivityNow(parent, id, intent, aInfo, token, state); } public final Activity startActivityNow(Activity parent, String id, Intent intent, ActivityInfo activityInfo, IBinder token, Bundle state) { return startActivityNow(parent, id, intent, activityInfo, token, state, null); } public final Activity startActivityNow(Activity parent, String id, Intent intent, ActivityInfo activityInfo, IBinder token, Bundle state, Object lastNonConfigurationInstance) { ActivityRecord r = new ActivityRecord(); r.token = token; r.ident = 0; r.intent = intent; r.state = state; r.parent = parent; Loading Loading @@ -2335,10 +2327,10 @@ public final class ActivityThread { appContext.setOuterContext(activity); CharSequence title = r.activityInfo.loadLabel(appContext.getPackageManager()); Configuration config = new Configuration(mConfiguration); activity.attach(appContext, this, getInstrumentation(), r.token, app, r.intent, r.activityInfo, title, r.parent, r.embeddedID, r.lastNonConfigurationInstance, r.lastNonConfigurationChildInstances, config); activity.attach(appContext, this, getInstrumentation(), r.token, r.ident, app, r.intent, r.activityInfo, title, r.parent, r.embeddedID, r.lastNonConfigurationInstance, r.lastNonConfigurationChildInstances, config); if (customIntent != null) { activity.mIntent = customIntent; Loading
core/java/android/app/ApplicationThreadNative.java +5 −2 Original line number Diff line number Diff line Loading @@ -119,13 +119,15 @@ public abstract class ApplicationThreadNative extends Binder data.enforceInterface(IApplicationThread.descriptor); Intent intent = Intent.CREATOR.createFromParcel(data); IBinder b = data.readStrongBinder(); int ident = data.readInt(); ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data); Bundle state = data.readBundle(); List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR); List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); boolean notResumed = data.readInt() != 0; boolean isForward = data.readInt() != 0; scheduleLaunchActivity(intent, b, info, state, ri, pi, notResumed, isForward); scheduleLaunchActivity(intent, b, ident, info, state, ri, pi, notResumed, isForward); return true; } Loading Loading @@ -442,7 +444,7 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } public final void scheduleLaunchActivity(Intent intent, IBinder token, public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident, ActivityInfo info, Bundle state, List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, boolean notResumed, boolean isForward) throws RemoteException { Loading @@ -450,6 +452,7 @@ class ApplicationThreadProxy implements IApplicationThread { data.writeInterfaceToken(IApplicationThread.descriptor); intent.writeToParcel(data, 0); data.writeStrongBinder(token); data.writeInt(ident); info.writeToParcel(data, 0); data.writeBundle(state); data.writeTypedList(pendingResults); Loading