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 an interesting part of the configuration has changed, we
|
||||
// should completely reload the app entries.
|
||||
for (int i = 0; i < mEntriesMap.size(); i++) {
|
||||
mEntriesMap.valueAt(i).clear();
|
||||
}
|
||||
mAppEntries.clear();
|
||||
clearEntries();
|
||||
} else {
|
||||
for (int i=0; i<mAppEntries.size(); i++) {
|
||||
mAppEntries.get(i).sizeStale = true;
|
||||
@@ -831,12 +828,23 @@ public class ApplicationsState {
|
||||
entry.info = info;
|
||||
}
|
||||
}
|
||||
if (mAppEntries.size() > mApplications.size()) {
|
||||
// There are less apps now, some must have been uninstalled.
|
||||
clearEntries();
|
||||
}
|
||||
mCurComputingSizePkg = null;
|
||||
if (!mBackgroundHandler.hasMessages(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() {
|
||||
return mHaveDisabledApps;
|
||||
}
|
||||
@@ -1179,7 +1187,7 @@ public class ApplicationsState {
|
||||
int numDone = 0;
|
||||
synchronized (mEntriesMap) {
|
||||
if (DEBUG_LOCKING) Log.v(TAG, "MSG_LOAD_ENTRIES acquired lock");
|
||||
for (int i=0; i<mApplications.size() && numDone<6; i++) {
|
||||
for (int i = 0; i < mApplications.size() && numDone < 6; i++) {
|
||||
if (!mRunning) {
|
||||
mRunning = true;
|
||||
Message m = mMainHandler.obtainMessage(
|
||||
|
@@ -162,7 +162,6 @@ public class ManageApplications extends InstrumentedFragment
|
||||
|
||||
// whether showing system apps.
|
||||
private boolean mShowSystem;
|
||||
private boolean mHasDisabledApps;
|
||||
|
||||
private ApplicationsState mApplicationsState;
|
||||
|
||||
@@ -559,7 +558,6 @@ public class ManageApplications extends InstrumentedFragment
|
||||
}
|
||||
|
||||
public void setHasDisabled(boolean hasDisabledApps) {
|
||||
mHasDisabledApps = hasDisabledApps;
|
||||
mFilterAdapter.setFilterEnabled(FILTER_APPS_ENABLED, hasDisabledApps);
|
||||
mFilterAdapter.setFilterEnabled(FILTER_APPS_DISABLED, hasDisabledApps);
|
||||
}
|
||||
@@ -817,7 +815,7 @@ public class ManageApplications extends InstrumentedFragment
|
||||
return;
|
||||
}
|
||||
|
||||
mManageApplications.setHasDisabled(hasDisabledApps());
|
||||
mManageApplications.setHasDisabled(mState.haveDisabledApps());
|
||||
}
|
||||
|
||||
private void updateLoading() {
|
||||
|
Reference in New Issue
Block a user