summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Utilities.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-05-13 13:48:44 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-05-18 15:00:52 -0700
commit3f732190cc6c8feef53383d369b66dcf38f06e44 (patch)
treea72d3ed0be92ecad506ae4a2f64a8920b3d79881 /src/com/android/launcher3/Utilities.java
parenta40102f5d5049d6656f98122bf23d7f27ecc6593 (diff)
downloadandroid_packages_apps_Trebuchet-3f732190cc6c8feef53383d369b66dcf38f06e44.tar.gz
android_packages_apps_Trebuchet-3f732190cc6c8feef53383d369b66dcf38f06e44.tar.bz2
android_packages_apps_Trebuchet-3f732190cc6c8feef53383d369b66dcf38f06e44.zip
Preventing unnecessary options update to QSB provider
by checking if the options have changed before calling update Bug: 28586377 Change-Id: Idf263b7a32ca85f23f728fa29b9c8ac84289052e
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r--src/com/android/launcher3/Utilities.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index e3b959b39..00ee387b3 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -869,6 +869,26 @@ public final class Utilities {
}
/**
+ * Returns true if {@param original} contains all entries defined in {@param updates} and
+ * have the same value.
+ * The comparison uses {@link Object#equals(Object)} to compare the values.
+ */
+ public static boolean containsAll(Bundle original, Bundle updates) {
+ for (String key : updates.keySet()) {
+ Object value1 = updates.get(key);
+ Object value2 = original.get(key);
+ if (value1 == null) {
+ if (value2 != null) {
+ return false;
+ }
+ } else if (!value1.equals(value2)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
* An extension of {@link BitmapDrawable} which returns the bitmap pixel size as intrinsic size.
* This allows the badging to be done based on the action bitmap size rather than
* the scaled bitmap size.