Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4149,6 +4149,7 @@ package android.app { method public abstract void onActivityCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityDestroyed(android.app.Activity); method public abstract void onActivityPaused(android.app.Activity); method public default void onActivityPreCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityResumed(android.app.Activity); method public abstract void onActivitySaveInstanceState(android.app.Activity, android.os.Bundle); method public abstract void onActivityStarted(android.app.Activity); api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4291,6 +4291,7 @@ package android.app { method public abstract void onActivityCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityDestroyed(android.app.Activity); method public abstract void onActivityPaused(android.app.Activity); method public default void onActivityPreCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityResumed(android.app.Activity); method public abstract void onActivitySaveInstanceState(android.app.Activity, android.os.Bundle); method public abstract void onActivityStarted(android.app.Activity); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4159,6 +4159,7 @@ package android.app { method public abstract void onActivityCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityDestroyed(android.app.Activity); method public abstract void onActivityPaused(android.app.Activity); method public default void onActivityPreCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityResumed(android.app.Activity); method public abstract void onActivitySaveInstanceState(android.app.Activity, android.os.Bundle); method public abstract void onActivityStarted(android.app.Activity); core/java/android/app/Activity.java +60 −17 Original line number Diff line number Diff line Loading @@ -969,7 +969,9 @@ public class Activity extends ContextThemeWrapper ? mLastNonConfigurationInstances.fragments : null); } mFragments.dispatchCreate(); if (!isAtLeastO()) { getApplication().dispatchActivityCreated(this, savedInstanceState); } if (mVoiceInteractor != null) { mVoiceInteractor.attachActivity(this); } Loading Loading @@ -1197,9 +1199,10 @@ public class Activity extends ContextThemeWrapper mCalled = true; mFragments.doLoaderStart(); if (!isAtLeastO()) { getApplication().dispatchActivityStarted(this); } } /** * Called after {@link #onStop} when the current activity is being Loading Loading @@ -1259,7 +1262,9 @@ public class Activity extends ContextThemeWrapper @CallSuper protected void onResume() { if (DEBUG_LIFECYCLE) Slog.v(TAG, "onResume " + this); if (!isAtLeastO()) { getApplication().dispatchActivityResumed(this); } mActivityTransitionState.onResume(this, isTopOfTask()); mCalled = true; } Loading Loading @@ -1426,6 +1431,9 @@ public class Activity extends ContextThemeWrapper saveManagedDialogs(outState); mActivityTransitionState.saveState(outState); storeHasCurrentPermissionRequest(outState); if (isAtLeastO()) { getApplication().dispatchActivitySaveInstanceState(this, outState); } if (DEBUG_LIFECYCLE) Slog.v(TAG, "onSaveInstanceState " + this + ": " + outState); } Loading @@ -1442,6 +1450,9 @@ public class Activity extends ContextThemeWrapper onSaveInstanceState(outState, outPersistentState); saveManagedDialogs(outState); storeHasCurrentPermissionRequest(outState); if (isAtLeastO()) { getApplication().dispatchActivitySaveInstanceState(this, outState); } if (DEBUG_LIFECYCLE) Slog.v(TAG, "onSaveInstanceState " + this + ": " + outState + ", " + outPersistentState); } Loading Loading @@ -1497,8 +1508,10 @@ public class Activity extends ContextThemeWrapper if (p != null) { outState.putParcelable(FRAGMENTS_TAG, p); } if (!isAtLeastO()) { getApplication().dispatchActivitySaveInstanceState(this, outState); } } /** * This is the same as {@link #onSaveInstanceState} but is called for activities Loading Loading @@ -1595,7 +1608,9 @@ public class Activity extends ContextThemeWrapper @CallSuper protected void onPause() { if (DEBUG_LIFECYCLE) Slog.v(TAG, "onPause " + this); if (!isAtLeastO()) { getApplication().dispatchActivityPaused(this); } mCalled = true; } Loading Loading @@ -1795,7 +1810,9 @@ public class Activity extends ContextThemeWrapper if (DEBUG_LIFECYCLE) Slog.v(TAG, "onStop " + this); if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(false); mActivityTransitionState.onStop(); if (!isAtLeastO()) { getApplication().dispatchActivityStopped(this); } mTranslucentCallback = null; mCalled = true; } Loading Loading @@ -1865,9 +1882,10 @@ public class Activity extends ContextThemeWrapper if (mActionBar != null) { mActionBar.onDestroy(); } if (!isAtLeastO()) { getApplication().dispatchActivityDestroyed(this); } } /** * Report to the system that your app is now fully drawn, purely for diagnostic Loading Loading @@ -6738,25 +6756,33 @@ public class Activity extends ContextThemeWrapper return mParent != null ? mParent.getActivityToken() : mToken; } final void performCreateCommon() { final void performCreateCommon(Bundle icicle) { mActivityTransitionState.readState(icicle); mVisibleFromClient = !mWindow.getWindowStyle().getBoolean( com.android.internal.R.styleable.Window_windowNoDisplay, false); mFragments.dispatchActivityCreated(); mActivityTransitionState.setEnterActivityOptions(this, getActivityOptions()); if (isAtLeastO()) { getApplication().dispatchActivityCreated(this, icicle); } } final void performCreate(Bundle icicle) { restoreHasCurrentPermissionRequest(icicle); if (isAtLeastO()) { getApplication().dispatchActivityPreCreated(this, icicle); } onCreate(icicle); mActivityTransitionState.readState(icicle); performCreateCommon(); performCreateCommon(icicle); } final void performCreate(Bundle icicle, PersistableBundle persistentState) { restoreHasCurrentPermissionRequest(icicle); if (isAtLeastO()) { getApplication().dispatchActivityPreCreated(this, icicle); } onCreate(icicle, persistentState); mActivityTransitionState.readState(icicle); performCreateCommon(); performCreateCommon(icicle); } final void performStart() { Loading Loading @@ -6799,6 +6825,9 @@ public class Activity extends ContextThemeWrapper } mActivityTransitionState.enterReady(this); if (isAtLeastO()) { getApplication().dispatchActivityStarted(this); } } final void performRestart() { Loading Loading @@ -6874,7 +6903,9 @@ public class Activity extends ContextThemeWrapper mFragments.dispatchResume(); mFragments.execPendingActions(); if (isAtLeastO()) { getApplication().dispatchActivityResumed(this); } onPostResume(); if (!mCalled) { throw new SuperNotCalledException( Loading @@ -6889,13 +6920,15 @@ public class Activity extends ContextThemeWrapper mCalled = false; onPause(); mResumed = false; if (isAtLeastO()) { getApplication().dispatchActivityPaused(this); } if (!mCalled && getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES.GINGERBREAD) { throw new SuperNotCalledException( "Activity " + mComponent.toShortString() + " did not call through to super.onPause()"); } mResumed = false; } final void performUserLeaving() { Loading @@ -6906,7 +6939,7 @@ public class Activity extends ContextThemeWrapper final void performStop(boolean preserveWindow) { mDoReportFullyDrawn = false; mFragments.doLoaderStop(mChangingConfigurations /*retain*/); boolean dispatchActivityStopped = !mStopped; if (!mStopped) { if (mWindow != null) { mWindow.closeAllPanels(); Loading Loading @@ -6943,6 +6976,9 @@ public class Activity extends ContextThemeWrapper mStopped = true; } mResumed = false; if (dispatchActivityStopped && isAtLeastO()) { getApplication().dispatchActivityStopped(this); } } final void performDestroy() { Loading @@ -6954,6 +6990,13 @@ public class Activity extends ContextThemeWrapper if (mVoiceInteractor != null) { mVoiceInteractor.detachActivity(); } if (isAtLeastO()) { getApplication().dispatchActivityDestroyed(this); } } private boolean isAtLeastO() { return getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.O; } final void dispatchMultiWindowModeChanged(boolean isInMultiWindowMode) { Loading core/java/android/app/Application.java +11 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ public class Application extends ContextWrapper implements ComponentCallbacks2 { public LoadedApk mLoadedApk; public interface ActivityLifecycleCallbacks { default void onActivityPreCreated(Activity activity, Bundle savedInstanceState) {} void onActivityCreated(Activity activity, Bundle savedInstanceState); void onActivityStarted(Activity activity); void onActivityResumed(Activity activity); Loading Loading @@ -190,6 +191,16 @@ public class Application extends ContextWrapper implements ComponentCallbacks2 { mLoadedApk = ContextImpl.getImpl(context).mPackageInfo; } /* package */ void dispatchActivityPreCreated(Activity activity, Bundle savedInstanceState) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { for (int i = 0; i < callbacks.length; i++) { ((ActivityLifecycleCallbacks) callbacks[i]).onActivityPreCreated(activity, savedInstanceState); } } } /* package */ void dispatchActivityCreated(Activity activity, Bundle savedInstanceState) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4149,6 +4149,7 @@ package android.app { method public abstract void onActivityCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityDestroyed(android.app.Activity); method public abstract void onActivityPaused(android.app.Activity); method public default void onActivityPreCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityResumed(android.app.Activity); method public abstract void onActivitySaveInstanceState(android.app.Activity, android.os.Bundle); method public abstract void onActivityStarted(android.app.Activity);
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4291,6 +4291,7 @@ package android.app { method public abstract void onActivityCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityDestroyed(android.app.Activity); method public abstract void onActivityPaused(android.app.Activity); method public default void onActivityPreCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityResumed(android.app.Activity); method public abstract void onActivitySaveInstanceState(android.app.Activity, android.os.Bundle); method public abstract void onActivityStarted(android.app.Activity);
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4159,6 +4159,7 @@ package android.app { method public abstract void onActivityCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityDestroyed(android.app.Activity); method public abstract void onActivityPaused(android.app.Activity); method public default void onActivityPreCreated(android.app.Activity, android.os.Bundle); method public abstract void onActivityResumed(android.app.Activity); method public abstract void onActivitySaveInstanceState(android.app.Activity, android.os.Bundle); method public abstract void onActivityStarted(android.app.Activity);
core/java/android/app/Activity.java +60 −17 Original line number Diff line number Diff line Loading @@ -969,7 +969,9 @@ public class Activity extends ContextThemeWrapper ? mLastNonConfigurationInstances.fragments : null); } mFragments.dispatchCreate(); if (!isAtLeastO()) { getApplication().dispatchActivityCreated(this, savedInstanceState); } if (mVoiceInteractor != null) { mVoiceInteractor.attachActivity(this); } Loading Loading @@ -1197,9 +1199,10 @@ public class Activity extends ContextThemeWrapper mCalled = true; mFragments.doLoaderStart(); if (!isAtLeastO()) { getApplication().dispatchActivityStarted(this); } } /** * Called after {@link #onStop} when the current activity is being Loading Loading @@ -1259,7 +1262,9 @@ public class Activity extends ContextThemeWrapper @CallSuper protected void onResume() { if (DEBUG_LIFECYCLE) Slog.v(TAG, "onResume " + this); if (!isAtLeastO()) { getApplication().dispatchActivityResumed(this); } mActivityTransitionState.onResume(this, isTopOfTask()); mCalled = true; } Loading Loading @@ -1426,6 +1431,9 @@ public class Activity extends ContextThemeWrapper saveManagedDialogs(outState); mActivityTransitionState.saveState(outState); storeHasCurrentPermissionRequest(outState); if (isAtLeastO()) { getApplication().dispatchActivitySaveInstanceState(this, outState); } if (DEBUG_LIFECYCLE) Slog.v(TAG, "onSaveInstanceState " + this + ": " + outState); } Loading @@ -1442,6 +1450,9 @@ public class Activity extends ContextThemeWrapper onSaveInstanceState(outState, outPersistentState); saveManagedDialogs(outState); storeHasCurrentPermissionRequest(outState); if (isAtLeastO()) { getApplication().dispatchActivitySaveInstanceState(this, outState); } if (DEBUG_LIFECYCLE) Slog.v(TAG, "onSaveInstanceState " + this + ": " + outState + ", " + outPersistentState); } Loading Loading @@ -1497,8 +1508,10 @@ public class Activity extends ContextThemeWrapper if (p != null) { outState.putParcelable(FRAGMENTS_TAG, p); } if (!isAtLeastO()) { getApplication().dispatchActivitySaveInstanceState(this, outState); } } /** * This is the same as {@link #onSaveInstanceState} but is called for activities Loading Loading @@ -1595,7 +1608,9 @@ public class Activity extends ContextThemeWrapper @CallSuper protected void onPause() { if (DEBUG_LIFECYCLE) Slog.v(TAG, "onPause " + this); if (!isAtLeastO()) { getApplication().dispatchActivityPaused(this); } mCalled = true; } Loading Loading @@ -1795,7 +1810,9 @@ public class Activity extends ContextThemeWrapper if (DEBUG_LIFECYCLE) Slog.v(TAG, "onStop " + this); if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(false); mActivityTransitionState.onStop(); if (!isAtLeastO()) { getApplication().dispatchActivityStopped(this); } mTranslucentCallback = null; mCalled = true; } Loading Loading @@ -1865,9 +1882,10 @@ public class Activity extends ContextThemeWrapper if (mActionBar != null) { mActionBar.onDestroy(); } if (!isAtLeastO()) { getApplication().dispatchActivityDestroyed(this); } } /** * Report to the system that your app is now fully drawn, purely for diagnostic Loading Loading @@ -6738,25 +6756,33 @@ public class Activity extends ContextThemeWrapper return mParent != null ? mParent.getActivityToken() : mToken; } final void performCreateCommon() { final void performCreateCommon(Bundle icicle) { mActivityTransitionState.readState(icicle); mVisibleFromClient = !mWindow.getWindowStyle().getBoolean( com.android.internal.R.styleable.Window_windowNoDisplay, false); mFragments.dispatchActivityCreated(); mActivityTransitionState.setEnterActivityOptions(this, getActivityOptions()); if (isAtLeastO()) { getApplication().dispatchActivityCreated(this, icicle); } } final void performCreate(Bundle icicle) { restoreHasCurrentPermissionRequest(icicle); if (isAtLeastO()) { getApplication().dispatchActivityPreCreated(this, icicle); } onCreate(icicle); mActivityTransitionState.readState(icicle); performCreateCommon(); performCreateCommon(icicle); } final void performCreate(Bundle icicle, PersistableBundle persistentState) { restoreHasCurrentPermissionRequest(icicle); if (isAtLeastO()) { getApplication().dispatchActivityPreCreated(this, icicle); } onCreate(icicle, persistentState); mActivityTransitionState.readState(icicle); performCreateCommon(); performCreateCommon(icicle); } final void performStart() { Loading Loading @@ -6799,6 +6825,9 @@ public class Activity extends ContextThemeWrapper } mActivityTransitionState.enterReady(this); if (isAtLeastO()) { getApplication().dispatchActivityStarted(this); } } final void performRestart() { Loading Loading @@ -6874,7 +6903,9 @@ public class Activity extends ContextThemeWrapper mFragments.dispatchResume(); mFragments.execPendingActions(); if (isAtLeastO()) { getApplication().dispatchActivityResumed(this); } onPostResume(); if (!mCalled) { throw new SuperNotCalledException( Loading @@ -6889,13 +6920,15 @@ public class Activity extends ContextThemeWrapper mCalled = false; onPause(); mResumed = false; if (isAtLeastO()) { getApplication().dispatchActivityPaused(this); } if (!mCalled && getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES.GINGERBREAD) { throw new SuperNotCalledException( "Activity " + mComponent.toShortString() + " did not call through to super.onPause()"); } mResumed = false; } final void performUserLeaving() { Loading @@ -6906,7 +6939,7 @@ public class Activity extends ContextThemeWrapper final void performStop(boolean preserveWindow) { mDoReportFullyDrawn = false; mFragments.doLoaderStop(mChangingConfigurations /*retain*/); boolean dispatchActivityStopped = !mStopped; if (!mStopped) { if (mWindow != null) { mWindow.closeAllPanels(); Loading Loading @@ -6943,6 +6976,9 @@ public class Activity extends ContextThemeWrapper mStopped = true; } mResumed = false; if (dispatchActivityStopped && isAtLeastO()) { getApplication().dispatchActivityStopped(this); } } final void performDestroy() { Loading @@ -6954,6 +6990,13 @@ public class Activity extends ContextThemeWrapper if (mVoiceInteractor != null) { mVoiceInteractor.detachActivity(); } if (isAtLeastO()) { getApplication().dispatchActivityDestroyed(this); } } private boolean isAtLeastO() { return getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.O; } final void dispatchMultiWindowModeChanged(boolean isInMultiWindowMode) { Loading
core/java/android/app/Application.java +11 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ public class Application extends ContextWrapper implements ComponentCallbacks2 { public LoadedApk mLoadedApk; public interface ActivityLifecycleCallbacks { default void onActivityPreCreated(Activity activity, Bundle savedInstanceState) {} void onActivityCreated(Activity activity, Bundle savedInstanceState); void onActivityStarted(Activity activity); void onActivityResumed(Activity activity); Loading Loading @@ -190,6 +191,16 @@ public class Application extends ContextWrapper implements ComponentCallbacks2 { mLoadedApk = ContextImpl.getImpl(context).mPackageInfo; } /* package */ void dispatchActivityPreCreated(Activity activity, Bundle savedInstanceState) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { for (int i = 0; i < callbacks.length; i++) { ((ActivityLifecycleCallbacks) callbacks[i]).onActivityPreCreated(activity, savedInstanceState); } } } /* package */ void dispatchActivityCreated(Activity activity, Bundle savedInstanceState) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { Loading