Merge "Do not retrive app detail if the fragment is exiting." into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
dda677cf77
@@ -112,7 +112,8 @@ public class AppInfoDashboardFragment extends DashboardFragment
|
|||||||
private UserManager mUserManager;
|
private UserManager mUserManager;
|
||||||
private PackageManager mPm;
|
private PackageManager mPm;
|
||||||
|
|
||||||
private boolean mFinishing;
|
@VisibleForTesting
|
||||||
|
boolean mFinishing;
|
||||||
private boolean mListeningToPackageRemove;
|
private boolean mListeningToPackageRemove;
|
||||||
|
|
||||||
|
|
||||||
@@ -544,7 +545,7 @@ public class AppInfoDashboardFragment extends DashboardFragment
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void retrieveAppEntry() {
|
void retrieveAppEntry() {
|
||||||
final Activity activity = getActivity();
|
final Activity activity = getActivity();
|
||||||
if (activity == null) {
|
if (activity == null || mFinishing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mState == null) {
|
if (mState == null) {
|
||||||
|
@@ -281,6 +281,13 @@ public final class AppInfoDashboardFragmentTest {
|
|||||||
assertThat(mFragment.createPreferenceControllers(mShadowContext)).isNull();
|
assertThat(mFragment.createPreferenceControllers(mShadowContext)).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getPreferenceControllers_exiting_shouldReturnNull() {
|
||||||
|
mFragment.mFinishing = true;
|
||||||
|
|
||||||
|
assertThat(mFragment.createPreferenceControllers(mShadowContext)).isNull();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getNumberOfUserWithPackageInstalled_twoUsersInstalled_shouldReturnTwo()
|
public void getNumberOfUserWithPackageInstalled_twoUsersInstalled_shouldReturnTwo()
|
||||||
throws PackageManager.NameNotFoundException {
|
throws PackageManager.NameNotFoundException {
|
||||||
|
Reference in New Issue
Block a user