Try not to crash while AppInfo is finishing
Bug: 21025020 Change-Id: Iebb9e6b24ca503f87b5648f0aaf02dde01903488
This commit is contained in:
@@ -69,9 +69,12 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
|
||||
// Dialog identifiers used in showDialog
|
||||
protected static final int DLG_BASE = 0;
|
||||
|
||||
protected boolean mFinishing;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mFinishing = false;
|
||||
|
||||
mState = ApplicationsState.getInstance(getActivity().getApplication());
|
||||
mSession = mState.newSession(this);
|
||||
@@ -147,6 +150,7 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
|
||||
intent.putExtra(ManageApplications.APP_CHG, appChanged);
|
||||
SettingsActivity sa = (SettingsActivity)getActivity();
|
||||
sa.finishPreferencePanel(this, Activity.RESULT_OK, intent);
|
||||
mFinishing = true;
|
||||
}
|
||||
|
||||
protected void showDialogInner(int id, int moveErrorCode) {
|
||||
|
@@ -244,14 +244,15 @@ public class InstalledAppDetails extends AppInfoBase
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (mFinishing) {
|
||||
return;
|
||||
}
|
||||
AppItem app = new AppItem(mAppEntry.info.uid);
|
||||
app.addUid(mAppEntry.info.uid);
|
||||
getLoaderManager().restartLoader(LOADER_CHART_DATA,
|
||||
ChartDataLoader.buildArgs(getTemplate(getContext()), app),
|
||||
mDataCallbacks);
|
||||
if (mPackageInfo != null) {
|
||||
new BatteryUpdater().execute();
|
||||
}
|
||||
new BatteryUpdater().execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -269,6 +270,9 @@ public class InstalledAppDetails extends AppInfoBase
|
||||
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
if (mFinishing) {
|
||||
return;
|
||||
}
|
||||
handleHeader();
|
||||
|
||||
mNotificationPreference = findPreference(KEY_NOTIFICATION);
|
||||
|
Reference in New Issue
Block a user