OSDN Git Service

update summary change no matter whether summary is equal
authorjackqdyulei <jackqdyulei@google.com>
Fri, 28 Oct 2016 20:23:10 +0000 (13:23 -0700)
committerjackqdyulei <jackqdyulei@google.com>
Wed, 2 Nov 2016 23:45:57 +0000 (16:45 -0700)
Since the method parameter tile and tile in adpater is the same
instance, it is useless to check whether summary has changed.

Test: Run SettingsRoboTests
The function used in notifySummaryChanged already has testcases
in DashboardDataTest

Change-Id: I8c8969fcd2c89f368ca507808910fc7a9852f192

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

index baea164..6659ab4 100644 (file)
@@ -163,13 +163,9 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
     public void notifySummaryChanged(Tile tile) {
         final int position = mDashboardData.getPositionByTile(tile);
         if (position != DashboardData.POSITION_NOT_FOUND) {
-            final Tile targetTile = (Tile) mDashboardData.getItemEntityByPosition(position);
-            if (!TextUtils.equals(tile.summary, targetTile.summary)) {
-
-                // Since usually tile in parameter and tile in mCategories are same instance,
-                // which is hard to be detected by DiffUtil, so we notifyItemChanged directly.
-                notifyItemChanged(position);
-            }
+            // Since usually tile in parameter and tile in mCategories are same instance,
+            // which is hard to be detected by DiffUtil, so we notifyItemChanged directly.
+            notifyItemChanged(position);
         }
     }