Merge "Detect uninstalled apps during resume" into mnc-dev
This commit is contained in:
@@ -802,10 +802,7 @@ public class ApplicationsState {
|
|||||||
if (mInterestingConfigChanges.applyNewConfig(mContext.getResources())) {
|
if (mInterestingConfigChanges.applyNewConfig(mContext.getResources())) {
|
||||||
// If an interesting part of the configuration has changed, we
|
// If an interesting part of the configuration has changed, we
|
||||||
// should completely reload the app entries.
|
// should completely reload the app entries.
|
||||||
for (int i = 0; i < mEntriesMap.size(); i++) {
|
clearEntries();
|
||||||
mEntriesMap.valueAt(i).clear();
|
|
||||||
}
|
|
||||||
mAppEntries.clear();
|
|
||||||
} else {
|
} else {
|
||||||
for (int i=0; i<mAppEntries.size(); i++) {
|
for (int i=0; i<mAppEntries.size(); i++) {
|
||||||
mAppEntries.get(i).sizeStale = true;
|
mAppEntries.get(i).sizeStale = true;
|
||||||
@@ -831,12 +828,23 @@ public class ApplicationsState {
|
|||||||
entry.info = info;
|
entry.info = info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mAppEntries.size() > mApplications.size()) {
|
||||||
|
// There are less apps now, some must have been uninstalled.
|
||||||
|
clearEntries();
|
||||||
|
}
|
||||||
mCurComputingSizePkg = null;
|
mCurComputingSizePkg = null;
|
||||||
if (!mBackgroundHandler.hasMessages(BackgroundHandler.MSG_LOAD_ENTRIES)) {
|
if (!mBackgroundHandler.hasMessages(BackgroundHandler.MSG_LOAD_ENTRIES)) {
|
||||||
mBackgroundHandler.sendEmptyMessage(BackgroundHandler.MSG_LOAD_ENTRIES);
|
mBackgroundHandler.sendEmptyMessage(BackgroundHandler.MSG_LOAD_ENTRIES);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void clearEntries() {
|
||||||
|
for (int i = 0; i < mEntriesMap.size(); i++) {
|
||||||
|
mEntriesMap.valueAt(i).clear();
|
||||||
|
}
|
||||||
|
mAppEntries.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean haveDisabledApps() {
|
public boolean haveDisabledApps() {
|
||||||
return mHaveDisabledApps;
|
return mHaveDisabledApps;
|
||||||
}
|
}
|
||||||
|
@@ -162,7 +162,6 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
|
|
||||||
// whether showing system apps.
|
// whether showing system apps.
|
||||||
private boolean mShowSystem;
|
private boolean mShowSystem;
|
||||||
private boolean mHasDisabledApps;
|
|
||||||
|
|
||||||
private ApplicationsState mApplicationsState;
|
private ApplicationsState mApplicationsState;
|
||||||
|
|
||||||
@@ -559,7 +558,6 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setHasDisabled(boolean hasDisabledApps) {
|
public void setHasDisabled(boolean hasDisabledApps) {
|
||||||
mHasDisabledApps = hasDisabledApps;
|
|
||||||
mFilterAdapter.setFilterEnabled(FILTER_APPS_ENABLED, hasDisabledApps);
|
mFilterAdapter.setFilterEnabled(FILTER_APPS_ENABLED, hasDisabledApps);
|
||||||
mFilterAdapter.setFilterEnabled(FILTER_APPS_DISABLED, hasDisabledApps);
|
mFilterAdapter.setFilterEnabled(FILTER_APPS_DISABLED, hasDisabledApps);
|
||||||
}
|
}
|
||||||
@@ -817,7 +815,7 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mManageApplications.setHasDisabled(hasDisabledApps());
|
mManageApplications.setHasDisabled(mState.haveDisabledApps());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateLoading() {
|
private void updateLoading() {
|
||||||
|
Reference in New Issue
Block a user