Loading core/java/android/app/BackStackRecord.java +1 −0 Original line number Diff line number Diff line Loading @@ -890,6 +890,7 @@ final class BackStackRecord extends FragmentTransaction implements * this set of ops * @return the new oldPrimaryNav fragment after this record's ops would be run */ @SuppressWarnings("ReferenceEquality") Fragment expandOps(ArrayList<Fragment> added, Fragment oldPrimaryNav) { for (int opNum = 0; opNum < mOps.size(); opNum++) { final Op op = mOps.get(opNum); Loading core/java/android/app/Fragment.java +8 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import android.widget.AdapterView; import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.reflect.InvocationTargetException; final class FragmentState implements Parcelable { final String mClassName; Loading Loading @@ -620,7 +621,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene } sClassMap.put(fname, clazz); } Fragment f = (Fragment)clazz.newInstance(); Fragment f = (Fragment) clazz.getConstructor().newInstance(); if (args != null) { args.setClassLoader(f.getClass().getClassLoader()); f.setArguments(args); Loading @@ -638,6 +639,12 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene throw new InstantiationException("Unable to instantiate fragment " + fname + ": make sure class name exists, is public, and has an" + " empty constructor that is public", e); } catch (NoSuchMethodException e) { throw new InstantiationException("Unable to instantiate fragment " + fname + ": could not find Fragment constructor", e); } catch (InvocationTargetException e) { throw new InstantiationException("Unable to instantiate fragment " + fname + ": calling Fragment constructor caused an exception", e); } } Loading core/java/android/app/FragmentManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -1123,6 +1123,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate return mCurState >= state; } @SuppressWarnings("ReferenceEquality") void moveToState(Fragment f, int newState, int transit, int transitionStyle, boolean keepActive) { if (DEBUG && false) Log.v(TAG, "moveToState: " + f Loading Loading @@ -1226,6 +1227,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate } f.mRetaining = false; } // fall through case Fragment.CREATED: // This is outside the if statement below on purpose; we want this to run // even if we do a moveToState from CREATED => *, CREATED => CREATED, and Loading Loading @@ -1286,16 +1288,19 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate } f.mSavedFragmentState = null; } // fall through case Fragment.ACTIVITY_CREATED: if (newState > Fragment.ACTIVITY_CREATED) { f.mState = Fragment.STOPPED; } // fall through case Fragment.STOPPED: if (newState > Fragment.STOPPED) { if (DEBUG) Log.v(TAG, "moveto STARTED: " + f); f.performStart(); dispatchOnFragmentStarted(f, false); } // fall through case Fragment.STARTED: if (newState > Fragment.STARTED) { if (DEBUG) Log.v(TAG, "moveto RESUMED: " + f); Loading @@ -1314,12 +1319,14 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate f.performPause(); dispatchOnFragmentPaused(f, false); } // fall through case Fragment.STARTED: if (newState < Fragment.STARTED) { if (DEBUG) Log.v(TAG, "movefrom STARTED: " + f); f.performStop(); dispatchOnFragmentStopped(f, false); } // fall through case Fragment.STOPPED: case Fragment.ACTIVITY_CREATED: if (newState < Fragment.ACTIVITY_CREATED) { Loading Loading @@ -1374,6 +1381,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate f.mView = null; f.mInLayout = false; } // fall through case Fragment.CREATED: if (newState < Fragment.CREATED) { if (mDestroyed) { Loading Loading @@ -3192,6 +3200,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate } } @SuppressWarnings("ReferenceEquality") public void setPrimaryNavigationFragment(Fragment f) { if (f != null && (mActive.get(f.mIndex) != f || (f.mHost != null && f.getFragmentManager() != this))) { Loading core/java/android/app/FragmentTransition.java +2 −1 Original line number Diff line number Diff line Loading @@ -1236,6 +1236,7 @@ class FragmentTransition { * added fragments have Views in the hierarchy or false if the * operations haven't been executed yet. */ @SuppressWarnings("ReferenceEquality") private static void addToFirstInLastOut(BackStackRecord transaction, BackStackRecord.Op op, SparseArray<FragmentContainerTransition> transitioningFragments, boolean isPop, boolean isOptimizedTransaction) { Loading Loading @@ -1305,7 +1306,7 @@ class FragmentTransition { containerTransition.firstOut = null; } /** /* * Ensure that fragments that are entering are at least at the CREATED state * so that they may load Transitions using TransitionInflater. */ Loading Loading
core/java/android/app/BackStackRecord.java +1 −0 Original line number Diff line number Diff line Loading @@ -890,6 +890,7 @@ final class BackStackRecord extends FragmentTransaction implements * this set of ops * @return the new oldPrimaryNav fragment after this record's ops would be run */ @SuppressWarnings("ReferenceEquality") Fragment expandOps(ArrayList<Fragment> added, Fragment oldPrimaryNav) { for (int opNum = 0; opNum < mOps.size(); opNum++) { final Op op = mOps.get(opNum); Loading
core/java/android/app/Fragment.java +8 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import android.widget.AdapterView; import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.reflect.InvocationTargetException; final class FragmentState implements Parcelable { final String mClassName; Loading Loading @@ -620,7 +621,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene } sClassMap.put(fname, clazz); } Fragment f = (Fragment)clazz.newInstance(); Fragment f = (Fragment) clazz.getConstructor().newInstance(); if (args != null) { args.setClassLoader(f.getClass().getClassLoader()); f.setArguments(args); Loading @@ -638,6 +639,12 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene throw new InstantiationException("Unable to instantiate fragment " + fname + ": make sure class name exists, is public, and has an" + " empty constructor that is public", e); } catch (NoSuchMethodException e) { throw new InstantiationException("Unable to instantiate fragment " + fname + ": could not find Fragment constructor", e); } catch (InvocationTargetException e) { throw new InstantiationException("Unable to instantiate fragment " + fname + ": calling Fragment constructor caused an exception", e); } } Loading
core/java/android/app/FragmentManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -1123,6 +1123,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate return mCurState >= state; } @SuppressWarnings("ReferenceEquality") void moveToState(Fragment f, int newState, int transit, int transitionStyle, boolean keepActive) { if (DEBUG && false) Log.v(TAG, "moveToState: " + f Loading Loading @@ -1226,6 +1227,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate } f.mRetaining = false; } // fall through case Fragment.CREATED: // This is outside the if statement below on purpose; we want this to run // even if we do a moveToState from CREATED => *, CREATED => CREATED, and Loading Loading @@ -1286,16 +1288,19 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate } f.mSavedFragmentState = null; } // fall through case Fragment.ACTIVITY_CREATED: if (newState > Fragment.ACTIVITY_CREATED) { f.mState = Fragment.STOPPED; } // fall through case Fragment.STOPPED: if (newState > Fragment.STOPPED) { if (DEBUG) Log.v(TAG, "moveto STARTED: " + f); f.performStart(); dispatchOnFragmentStarted(f, false); } // fall through case Fragment.STARTED: if (newState > Fragment.STARTED) { if (DEBUG) Log.v(TAG, "moveto RESUMED: " + f); Loading @@ -1314,12 +1319,14 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate f.performPause(); dispatchOnFragmentPaused(f, false); } // fall through case Fragment.STARTED: if (newState < Fragment.STARTED) { if (DEBUG) Log.v(TAG, "movefrom STARTED: " + f); f.performStop(); dispatchOnFragmentStopped(f, false); } // fall through case Fragment.STOPPED: case Fragment.ACTIVITY_CREATED: if (newState < Fragment.ACTIVITY_CREATED) { Loading Loading @@ -1374,6 +1381,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate f.mView = null; f.mInLayout = false; } // fall through case Fragment.CREATED: if (newState < Fragment.CREATED) { if (mDestroyed) { Loading Loading @@ -3192,6 +3200,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate } } @SuppressWarnings("ReferenceEquality") public void setPrimaryNavigationFragment(Fragment f) { if (f != null && (mActive.get(f.mIndex) != f || (f.mHost != null && f.getFragmentManager() != this))) { Loading
core/java/android/app/FragmentTransition.java +2 −1 Original line number Diff line number Diff line Loading @@ -1236,6 +1236,7 @@ class FragmentTransition { * added fragments have Views in the hierarchy or false if the * operations haven't been executed yet. */ @SuppressWarnings("ReferenceEquality") private static void addToFirstInLastOut(BackStackRecord transaction, BackStackRecord.Op op, SparseArray<FragmentContainerTransition> transitioningFragments, boolean isPop, boolean isOptimizedTransaction) { Loading Loading @@ -1305,7 +1306,7 @@ class FragmentTransition { containerTransition.firstOut = null; } /** /* * Ensure that fragments that are entering are at least at the CREATED state * so that they may load Transitions using TransitionInflater. */ Loading