From 90960c8a122bb16c49bd7e7c51f71d493b5c52e7 Mon Sep 17 00:00:00 2001 From: Bonian Chen Date: Sun, 31 Jul 2022 15:07:58 +0000 Subject: [PATCH] [Settings] Cleanup unused code Remove unused code since mRebuildAsync is always set to true. Bug: 240851254 Change-Id: I8f40d9beb6658e1d8cb649bef99f41ac510dfb1c Test: build pass --- .../applications/ApplicationsState.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java b/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java index cf23a5446f916..7913c16b6b98b 100644 --- a/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java +++ b/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java @@ -792,10 +792,8 @@ public class ApplicationsState { // Rebuilding of app list. Synchronized on mRebuildSync. final Object mRebuildSync = new Object(); boolean mRebuildRequested; - boolean mRebuildAsync; AppFilter mRebuildFilter; Comparator mRebuildComparator; - ArrayList mRebuildResult; ArrayList mLastAppList; boolean mRebuildForeground; @@ -901,11 +899,9 @@ public class ApplicationsState { synchronized (mRebuildingSessions) { mRebuildingSessions.add(this); mRebuildRequested = true; - mRebuildAsync = true; mRebuildFilter = filter; mRebuildComparator = comparator; mRebuildForeground = foreground; - mRebuildResult = null; if (!mBackgroundHandler.hasMessages(BackgroundHandler.MSG_REBUILD_LIST)) { Message msg = mBackgroundHandler.obtainMessage( BackgroundHandler.MSG_REBUILD_LIST); @@ -985,15 +981,10 @@ public class ApplicationsState { synchronized (mRebuildSync) { if (!mRebuildRequested) { mLastAppList = filteredApps; - if (!mRebuildAsync) { - mRebuildResult = filteredApps; - mRebuildSync.notifyAll(); - } else { - if (!mMainHandler.hasMessages(MainHandler.MSG_REBUILD_COMPLETE, this)) { - Message msg = mMainHandler.obtainMessage( - MainHandler.MSG_REBUILD_COMPLETE, this); - mMainHandler.sendMessage(msg); - } + if (!mMainHandler.hasMessages(MainHandler.MSG_REBUILD_COMPLETE, this)) { + Message msg = mMainHandler.obtainMessage( + MainHandler.MSG_REBUILD_COMPLETE, this); + mMainHandler.sendMessage(msg); } } }