am 5482ab01: Merge "Throw exception in FragmentManager when queuing to a destroyed activity" into klp-dev

* commit '5482ab01e37accb4f5559af80f8d5d6e92b353ff':
  Throw exception in FragmentManager when queuing to a destroyed activity
This commit is contained in:
Alan Viverette
2013-08-14 16:00:27 -07:00
committed by Android Git Automerger

View File

@@ -1328,12 +1328,19 @@ final class FragmentManagerImpl extends FragmentManager {
}
}
/**
* Adds an action to the queue of pending actions.
*
* @param action the action to add
* @param allowStateLoss whether to allow loss of state information
* @throws IllegalStateException if the activity has been destroyed
*/
public void enqueueAction(Runnable action, boolean allowStateLoss) {
if (!allowStateLoss) {
checkStateLoss();
}
synchronized (this) {
if (mActivity == null) {
if (mDestroyed || mActivity == null) {
throw new IllegalStateException("Activity has been destroyed");
}
if (mPendingActions == null) {