Fix the icon flash issue cause from the shared drawable icon

different time slot may have the same application entry, we should not make them share the same drawable instance to impact the states, we will use newDrawable() method to create a new one for each application entry

Bug: 198553245
Test: make SettingsRoboTests
Change-Id: I4a321133ba171817fca1ab7ad47b9af8f7450675
diff --git a/src/com/android/settings/fuelgauge/BatteryDiffEntry.java b/src/com/android/settings/fuelgauge/BatteryDiffEntry.java
index 0074f93..f7d01d9 100644
--- a/src/com/android/settings/fuelgauge/BatteryDiffEntry.java
+++ b/src/com/android/settings/fuelgauge/BatteryDiffEntry.java
@@ -113,7 +113,7 @@
     /** Gets the app icon {@link Drawable} for this entry. */
     public Drawable getAppIcon() {
         loadLabelAndIcon();
-        return mAppIcon;
+        return mAppIcon.getConstantState().newDrawable();
     }
 
     /** Gets the app icon id for this entry. */
@@ -348,8 +348,8 @@
 
     private Drawable getBadgeIconForUser(Drawable icon) {
         final int userId = UserHandle.getUserId((int) mBatteryHistEntry.mUid);
-        final UserHandle userHandle = new UserHandle(userId);
-        return mUserManager.getBadgedIconForUser(icon, userHandle);
+        return userId == UserHandle.USER_OWNER ? icon :
+            mUserManager.getBadgedIconForUser(icon, new UserHandle(userId));
     }
 
     private static boolean isSystemUid(int uid) {