OSDN Git Service

Make sure we do not make UI calls from background thread in DashboardSummary class.
authorRajeev Kumar <rajekumar@google.com>
Tue, 15 May 2018 00:56:27 +0000 (17:56 -0700)
committerRajeev Kumar <rajekumar@google.com>
Tue, 15 May 2018 00:59:59 +0000 (17:59 -0700)
Bug: 79705354
Test: make RunSettingsRoboTests -j40 and manual testing.
Change-Id: I08a08e05f3424f4a6d2100aed32d32bb15997c86

src/com/android/settings/dashboard/DashboardSummary.java

index af7c900..20033b6 100644 (file)
@@ -276,7 +276,7 @@ public class DashboardSummary extends InstrumentedFragment
         mSummaryLoader.updateSummaryToCache(category);
         mStagingCategory = category;
         if (mSuggestionControllerMixin == null) {
-            mAdapter.setCategory(mStagingCategory);
+            ThreadUtils.postOnMainThread(() -> mAdapter.setCategory(mStagingCategory));
             return;
         }
         if (mSuggestionControllerMixin.isSuggestionLoaded()) {