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