Loading packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java +18 −4 Original line number Diff line number Diff line Loading @@ -534,6 +534,7 @@ public class ApplicationsState { Comparator<AppEntry> mRebuildComparator; ArrayList<AppEntry> mRebuildResult; ArrayList<AppEntry> mLastAppList; boolean mRebuildForeground; Session(Callbacks callbacks) { mCallbacks = callbacks; Loading Loading @@ -572,6 +573,11 @@ public class ApplicationsState { // Creates a new list of app entries with the given filter and comparator. public ArrayList<AppEntry> rebuild(AppFilter filter, Comparator<AppEntry> comparator) { return rebuild(filter, comparator, true); } public ArrayList<AppEntry> rebuild(AppFilter filter, Comparator<AppEntry> comparator, boolean foreground) { synchronized (mRebuildSync) { synchronized (mEntriesMap) { mRebuildingSessions.add(this); Loading @@ -579,6 +585,7 @@ public class ApplicationsState { mRebuildAsync = false; mRebuildFilter = filter; mRebuildComparator = comparator; mRebuildForeground = foreground; mRebuildResult = null; if (!mBackgroundHandler.hasMessages(BackgroundHandler.MSG_REBUILD_LIST)) { Message msg = mBackgroundHandler.obtainMessage( Loading Loading @@ -620,9 +627,11 @@ public class ApplicationsState { mRebuildRequested = false; mRebuildFilter = null; mRebuildComparator = null; } if (mRebuildForeground) { Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND); mRebuildForeground = false; } } if (filter != null) { filter.init(); Loading @@ -640,7 +649,10 @@ public class ApplicationsState { if (filter == null || filter.filterApp(entry)) { synchronized (mEntriesMap) { if (DEBUG_LOCKING) Log.v(TAG, "rebuild acquired lock"); if (comparator != null) { // Only need the label if we are going to be sorting. entry.ensureLabel(mContext); } if (DEBUG) Log.i(TAG, "Using " + entry.info.packageName + ": " + entry); filteredApps.add(entry); if (DEBUG_LOCKING) Log.v(TAG, "rebuild releasing lock"); Loading @@ -648,7 +660,9 @@ public class ApplicationsState { } } if (comparator != null) { Collections.sort(filteredApps, comparator); } synchronized (mRebuildSync) { if (!mRebuildRequested) { Loading packages/SettingsLib/src/com/android/settingslib/drawer/SettingsDrawerActivity.java +2 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,8 @@ public class SettingsDrawerActivity extends Activity { if (sDashboardCategories == null) { sTileCache = new HashMap<>(); sConfigTracker = new InterestingConfigChanges(); // Apply initial current config. sConfigTracker.applyNewConfig(getResources()); sDashboardCategories = TileUtils.getCategories(this, sTileCache); } return sDashboardCategories; Loading Loading
packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java +18 −4 Original line number Diff line number Diff line Loading @@ -534,6 +534,7 @@ public class ApplicationsState { Comparator<AppEntry> mRebuildComparator; ArrayList<AppEntry> mRebuildResult; ArrayList<AppEntry> mLastAppList; boolean mRebuildForeground; Session(Callbacks callbacks) { mCallbacks = callbacks; Loading Loading @@ -572,6 +573,11 @@ public class ApplicationsState { // Creates a new list of app entries with the given filter and comparator. public ArrayList<AppEntry> rebuild(AppFilter filter, Comparator<AppEntry> comparator) { return rebuild(filter, comparator, true); } public ArrayList<AppEntry> rebuild(AppFilter filter, Comparator<AppEntry> comparator, boolean foreground) { synchronized (mRebuildSync) { synchronized (mEntriesMap) { mRebuildingSessions.add(this); Loading @@ -579,6 +585,7 @@ public class ApplicationsState { mRebuildAsync = false; mRebuildFilter = filter; mRebuildComparator = comparator; mRebuildForeground = foreground; mRebuildResult = null; if (!mBackgroundHandler.hasMessages(BackgroundHandler.MSG_REBUILD_LIST)) { Message msg = mBackgroundHandler.obtainMessage( Loading Loading @@ -620,9 +627,11 @@ public class ApplicationsState { mRebuildRequested = false; mRebuildFilter = null; mRebuildComparator = null; } if (mRebuildForeground) { Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND); mRebuildForeground = false; } } if (filter != null) { filter.init(); Loading @@ -640,7 +649,10 @@ public class ApplicationsState { if (filter == null || filter.filterApp(entry)) { synchronized (mEntriesMap) { if (DEBUG_LOCKING) Log.v(TAG, "rebuild acquired lock"); if (comparator != null) { // Only need the label if we are going to be sorting. entry.ensureLabel(mContext); } if (DEBUG) Log.i(TAG, "Using " + entry.info.packageName + ": " + entry); filteredApps.add(entry); if (DEBUG_LOCKING) Log.v(TAG, "rebuild releasing lock"); Loading @@ -648,7 +660,9 @@ public class ApplicationsState { } } if (comparator != null) { Collections.sort(filteredApps, comparator); } synchronized (mRebuildSync) { if (!mRebuildRequested) { Loading
packages/SettingsLib/src/com/android/settingslib/drawer/SettingsDrawerActivity.java +2 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,8 @@ public class SettingsDrawerActivity extends Activity { if (sDashboardCategories == null) { sTileCache = new HashMap<>(); sConfigTracker = new InterestingConfigChanges(); // Apply initial current config. sConfigTracker.applyNewConfig(getResources()); sDashboardCategories = TileUtils.getCategories(this, sTileCache); } return sDashboardCategories; Loading