diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-21 21:04:08 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-21 21:04:08 +0000 |
commit | 51ce41016ced51d23f24005d22e092356ae7833a (patch) | |
tree | 87c35bace53128296284a69498185f4ec733b1d6 | |
parent | fc0f47d20a6c9fd6bfa19774af12535e793c9396 (diff) | |
parent | aed6b5949ecddd4ab6443eb2c20a36f521bbdeb0 (diff) | |
download | TvSettings-oreo-r2-release.tar.gz |
Merge cherrypicks of [2938796, 2938330, 2938331, 2938853, 2938854, 2938005, 2938834] into oc-r2-releaseandroid-8.0.0_r29oreo-r2-release
Change-Id: I5859adc1a1084ac6d40519e12826fb0dd1ad65e3
-rw-r--r-- | Settings/src/com/android/tv/settings/MainFragment.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Settings/src/com/android/tv/settings/MainFragment.java b/Settings/src/com/android/tv/settings/MainFragment.java index 9d61b62ec..a48a73409 100644 --- a/Settings/src/com/android/tv/settings/MainFragment.java +++ b/Settings/src/com/android/tv/settings/MainFragment.java @@ -445,16 +445,11 @@ public class MainFragment extends LeanbackPreferenceFragment { final ResolveInfo info = systemIntentIsHandled(getContext(), googleSettingsPref.getIntent()); googleSettingsPref.setVisible(info != null); - if (info != null) { - try { - final Context targetContext = getContext() - .createPackageContext(info.resolvePackageName != null ? - info.resolvePackageName : info.activityInfo.packageName, 0); - googleSettingsPref.setIcon(targetContext.getDrawable(info.iconResourceId)); - } catch (Resources.NotFoundException | PackageManager.NameNotFoundException - | SecurityException e) { - Log.e(TAG, "Google settings icon not found", e); - } + if (info != null && info.activityInfo != null) { + googleSettingsPref.setIcon( + info.activityInfo.loadIcon(getContext().getPackageManager())); + googleSettingsPref.setTitle( + info.activityInfo.loadLabel(getContext().getPackageManager())); } final Preference speechPref = findPreference(KEY_SPEECH_SETTINGS); |