Loading api/current.xml +30 −0 Original line number Diff line number Diff line Loading @@ -102426,6 +102426,36 @@ deprecated="not deprecated" visibility="public" > <method name="disableForegroundDispatch" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="activity" type="android.app.Activity"> </parameter> </method> <method name="enableForegroundDispatch" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="activity" type="android.app.Activity"> </parameter> <parameter name="intent" type="android.app.PendingIntent"> </parameter> <parameter name="filters" type="android.content.IntentFilter..."> </parameter> </method> <method name="getDefaultAdapter" return="android.nfc.NfcAdapter" abstract="false" core/java/android/app/Activity.java +7 −6 Original line number Diff line number Diff line Loading @@ -632,7 +632,7 @@ public class Activity extends ContextThemeWrapper /*package*/ HashMap<String,Object> mLastNonConfigurationChildInstances; Activity mParent; boolean mCalled; private boolean mResumed; /*package*/ boolean mResumed; private boolean mStopped; boolean mFinished; boolean mStartedActivity; Loading Loading @@ -3827,9 +3827,8 @@ public class Activity extends ContextThemeWrapper mLastNonConfigurationInstance = null; // First call onResume() -before- setting mResumed, so we don't // send out any status bar / menu notifications the client makes. mCalled = false; // mResumed is set by the instrumentation mInstrumentation.callActivityOnResume(this); if (!mCalled) { throw new SuperNotCalledException( Loading @@ -3838,7 +3837,6 @@ public class Activity extends ContextThemeWrapper } // Now really resume, and install the current status bar and menu. mResumed = true; mCalled = false; onPostResume(); if (!mCalled) { Loading @@ -3857,6 +3855,7 @@ public class Activity extends ContextThemeWrapper "Activity " + mComponent.toShortString() + " did not call through to super.onPause()"); } mResumed = false; } final void performUserLeaving() { Loading Loading @@ -3891,10 +3890,12 @@ public class Activity extends ContextThemeWrapper mStopped = true; } mResumed = false; } final boolean isResumed() { /** * @hide */ public final boolean isResumed() { return mResumed; } Loading core/java/android/app/ActivityThread.java +26 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,9 @@ public final class ActivityThread { final HashMap<IBinder, ProviderClientRecord> mLocalProviders = new HashMap<IBinder, ProviderClientRecord>(); final HashMap<Activity, ArrayList<OnActivityPausedListener>> mOnPauseListeners = new HashMap<Activity, ArrayList<OnActivityPausedListener>>(); final GcIdler mGcIdler = new GcIdler(); boolean mGcIdlerScheduled = false; Loading Loading @@ -1424,6 +1427,18 @@ public final class ActivityThread { } } public void registerOnActivityPausedListener(Activity activity, OnActivityPausedListener listener) { synchronized (mOnPauseListeners) { ArrayList<OnActivityPausedListener> list = mOnPauseListeners.get(activity); if (list == null) { list = new ArrayList<OnActivityPausedListener>(); mOnPauseListeners.put(activity, list); } list.add(listener); } } public final ActivityInfo resolveActivityInfo(Intent intent) { ActivityInfo aInfo = intent.resolveActivityInfo( mInitialApplication.getPackageManager(), PackageManager.GET_SHARED_LIBRARY_FILES); Loading Loading @@ -2333,6 +2348,17 @@ public final class ActivityThread { } } r.paused = true; // Notify any outstanding on paused listeners ArrayList<OnActivityPausedListener> listeners; synchronized (mOnPauseListeners) { listeners = mOnPauseListeners.remove(r.activity); } int size = (listeners != null ? listeners.size() : 0); for (int i = 0; i < size; i++) { listeners.get(i).onPaused(r.activity); } return state; } Loading core/java/android/app/Instrumentation.java +1 −0 Original line number Diff line number Diff line Loading @@ -1146,6 +1146,7 @@ public class Instrumentation { * @param activity The activity being resumed. */ public void callActivityOnResume(Activity activity) { activity.mResumed = true; activity.onResume(); if (mActivityMonitors != null) { Loading core/java/android/app/OnActivityPausedListener.java 0 → 100644 +31 −0 Original line number Diff line number Diff line /* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package android.app; /** * A listener that is called when an Activity is paused. Since this is tracked client side * it should not be trusted to represent the exact current state, but can be used as a hint * for cleanup. * * @hide */ public interface OnActivityPausedListener { /** * Called when the given activity is paused. */ public void onPaused(Activity activity); } Loading
api/current.xml +30 −0 Original line number Diff line number Diff line Loading @@ -102426,6 +102426,36 @@ deprecated="not deprecated" visibility="public" > <method name="disableForegroundDispatch" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="activity" type="android.app.Activity"> </parameter> </method> <method name="enableForegroundDispatch" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="activity" type="android.app.Activity"> </parameter> <parameter name="intent" type="android.app.PendingIntent"> </parameter> <parameter name="filters" type="android.content.IntentFilter..."> </parameter> </method> <method name="getDefaultAdapter" return="android.nfc.NfcAdapter" abstract="false"
core/java/android/app/Activity.java +7 −6 Original line number Diff line number Diff line Loading @@ -632,7 +632,7 @@ public class Activity extends ContextThemeWrapper /*package*/ HashMap<String,Object> mLastNonConfigurationChildInstances; Activity mParent; boolean mCalled; private boolean mResumed; /*package*/ boolean mResumed; private boolean mStopped; boolean mFinished; boolean mStartedActivity; Loading Loading @@ -3827,9 +3827,8 @@ public class Activity extends ContextThemeWrapper mLastNonConfigurationInstance = null; // First call onResume() -before- setting mResumed, so we don't // send out any status bar / menu notifications the client makes. mCalled = false; // mResumed is set by the instrumentation mInstrumentation.callActivityOnResume(this); if (!mCalled) { throw new SuperNotCalledException( Loading @@ -3838,7 +3837,6 @@ public class Activity extends ContextThemeWrapper } // Now really resume, and install the current status bar and menu. mResumed = true; mCalled = false; onPostResume(); if (!mCalled) { Loading @@ -3857,6 +3855,7 @@ public class Activity extends ContextThemeWrapper "Activity " + mComponent.toShortString() + " did not call through to super.onPause()"); } mResumed = false; } final void performUserLeaving() { Loading Loading @@ -3891,10 +3890,12 @@ public class Activity extends ContextThemeWrapper mStopped = true; } mResumed = false; } final boolean isResumed() { /** * @hide */ public final boolean isResumed() { return mResumed; } Loading
core/java/android/app/ActivityThread.java +26 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,9 @@ public final class ActivityThread { final HashMap<IBinder, ProviderClientRecord> mLocalProviders = new HashMap<IBinder, ProviderClientRecord>(); final HashMap<Activity, ArrayList<OnActivityPausedListener>> mOnPauseListeners = new HashMap<Activity, ArrayList<OnActivityPausedListener>>(); final GcIdler mGcIdler = new GcIdler(); boolean mGcIdlerScheduled = false; Loading Loading @@ -1424,6 +1427,18 @@ public final class ActivityThread { } } public void registerOnActivityPausedListener(Activity activity, OnActivityPausedListener listener) { synchronized (mOnPauseListeners) { ArrayList<OnActivityPausedListener> list = mOnPauseListeners.get(activity); if (list == null) { list = new ArrayList<OnActivityPausedListener>(); mOnPauseListeners.put(activity, list); } list.add(listener); } } public final ActivityInfo resolveActivityInfo(Intent intent) { ActivityInfo aInfo = intent.resolveActivityInfo( mInitialApplication.getPackageManager(), PackageManager.GET_SHARED_LIBRARY_FILES); Loading Loading @@ -2333,6 +2348,17 @@ public final class ActivityThread { } } r.paused = true; // Notify any outstanding on paused listeners ArrayList<OnActivityPausedListener> listeners; synchronized (mOnPauseListeners) { listeners = mOnPauseListeners.remove(r.activity); } int size = (listeners != null ? listeners.size() : 0); for (int i = 0; i < size; i++) { listeners.get(i).onPaused(r.activity); } return state; } Loading
core/java/android/app/Instrumentation.java +1 −0 Original line number Diff line number Diff line Loading @@ -1146,6 +1146,7 @@ public class Instrumentation { * @param activity The activity being resumed. */ public void callActivityOnResume(Activity activity) { activity.mResumed = true; activity.onResume(); if (mActivityMonitors != null) { Loading
core/java/android/app/OnActivityPausedListener.java 0 → 100644 +31 −0 Original line number Diff line number Diff line /* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package android.app; /** * A listener that is called when an Activity is paused. Since this is tracked client side * it should not be trusted to represent the exact current state, but can be used as a hint * for cleanup. * * @hide */ public interface OnActivityPausedListener { /** * Called when the given activity is paused. */ public void onPaused(Activity activity); }