From 96635d9fb35ee9451c2ce37848cc8d3c7793e9a1 Mon Sep 17 00:00:00 2001 From: Raff Tsai Date: Wed, 23 Oct 2019 11:34:18 +0800 Subject: [PATCH] Use Resources.getDrawable(int, Theme) - Resources.getDrawable(int) is deprecated. Use new function to replace the old one. Fixes: 143078105 Test: manual Change-Id: Ieea5b415d1a771b253401d826bfdb9d9a26f5ff2 --- .../shortcut/CreateShortcutPreferenceController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/android/settings/shortcut/CreateShortcutPreferenceController.java b/src/com/android/settings/shortcut/CreateShortcutPreferenceController.java index 6b95b92f1b2..c0f7e1ffc37 100644 --- a/src/com/android/settings/shortcut/CreateShortcutPreferenceController.java +++ b/src/com/android/settings/shortcut/CreateShortcutPreferenceController.java @@ -38,6 +38,11 @@ import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; +import androidx.annotation.VisibleForTesting; +import androidx.preference.Preference; +import androidx.preference.PreferenceCategory; +import androidx.preference.PreferenceGroup; + import com.android.settings.R; import com.android.settings.Settings.TetherSettingsActivity; import com.android.settings.core.BasePreferenceController; @@ -49,11 +54,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; -import androidx.annotation.VisibleForTesting; -import androidx.preference.Preference; -import androidx.preference.PreferenceCategory; -import androidx.preference.PreferenceGroup; - /** * {@link BasePreferenceController} that populates a list of widgets that Settings app support. */ @@ -245,7 +245,7 @@ public class CreateShortcutPreferenceController extends BasePreferenceController Drawable iconDrawable; try { iconDrawable = context.getPackageManager().getResourcesForApplication(app) - .getDrawable(resource); + .getDrawable(resource, themedContext.getTheme()); if (iconDrawable instanceof LayerDrawable) { iconDrawable = ((LayerDrawable) iconDrawable).getDrawable(1); }