Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dda677cf authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not retrive app detail if the fragment is exiting." into qt-dev

parents 5840e1e1 276edc8d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -112,7 +112,8 @@ public class AppInfoDashboardFragment extends DashboardFragment
    private UserManager mUserManager;
    private PackageManager mPm;

    private boolean mFinishing;
    @VisibleForTesting
    boolean mFinishing;
    private boolean mListeningToPackageRemove;


@@ -544,7 +545,7 @@ public class AppInfoDashboardFragment extends DashboardFragment
    @VisibleForTesting
    void retrieveAppEntry() {
        final Activity activity = getActivity();
        if (activity == null) {
        if (activity == null || mFinishing) {
            return;
        }
        if (mState == null) {
+7 −0
Original line number Diff line number Diff line
@@ -281,6 +281,13 @@ public final class AppInfoDashboardFragmentTest {
        assertThat(mFragment.createPreferenceControllers(mShadowContext)).isNull();
    }

    @Test
    public void getPreferenceControllers_exiting_shouldReturnNull() {
        mFragment.mFinishing = true;

        assertThat(mFragment.createPreferenceControllers(mShadowContext)).isNull();
    }

    @Test
    public void getNumberOfUserWithPackageInstalled_twoUsersInstalled_shouldReturnTwo()
            throws PackageManager.NameNotFoundException {