Merge "Guard against flickering of dynamic injection items" into rvc-qpr-dev am: 28b05910d8 am: d2f2f4b13e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12682503
Change-Id: I5fa97bb1a3feac16a64fd74696aa6713b8aeb2aa
diff --git a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
index 40d26f7..82c3668 100644
--- a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
+++ b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
@@ -248,7 +248,9 @@
final Map<String, IContentProvider> providerMap = new ArrayMap<>();
final String titleFromUri = TileUtils.getTextFromUri(
mContext, uri, providerMap, META_DATA_PREFERENCE_TITLE);
- ThreadUtils.postOnMainThread(() -> preference.setTitle(titleFromUri));
+ if (!TextUtils.equals(titleFromUri, preference.getTitle())) {
+ ThreadUtils.postOnMainThread(() -> preference.setTitle(titleFromUri));
+ }
});
}
@@ -277,7 +279,9 @@
final Map<String, IContentProvider> providerMap = new ArrayMap<>();
final String summaryFromUri = TileUtils.getTextFromUri(
mContext, uri, providerMap, META_DATA_PREFERENCE_SUMMARY);
- ThreadUtils.postOnMainThread(() -> preference.setSummary(summaryFromUri));
+ if (!TextUtils.equals(summaryFromUri, preference.getSummary())) {
+ ThreadUtils.postOnMainThread(() -> preference.setSummary(summaryFromUri));
+ }
});
}