summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryong.zou <yong.zou@ck-telecom.com>2015-04-15 15:25:12 +0800
committerniks255 <niks255@mail.ru>2017-01-07 04:39:45 +0600
commit6c912bb24d68b6a30f629271ad90d5ba622139c3 (patch)
treeb85472bfd54bfcac3ad1f9b9d2d9c44607a82981
parent502a7bf238d4a65414b3285008fb56c90727a957 (diff)
downloadandroid_packages_apps_Trebuchet-6c912bb24d68b6a30f629271ad90d5ba622139c3.tar.gz
android_packages_apps_Trebuchet-6c912bb24d68b6a30f629271ad90d5ba622139c3.tar.bz2
android_packages_apps_Trebuchet-6c912bb24d68b6a30f629271ad90d5ba622139c3.zip
Fix wrong Settings shortcut widget title when changing system language
1.Add a Settings shortcut widget to workspace 2.Change the system language 3.Check the Settings shortcut widget title The Settings shortcut widget title should update when changing the language Change-Id: I5012a3e99b9734230a844ce20e856ff86fba773a
-rw-r--r--src/com/android/launcher3/LauncherModel.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 9f89b3a95..6e3d406c5 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -1969,6 +1969,11 @@ public class LauncherModel extends BroadcastReceiver {
iconPackageIndex, iconResourceIndex, iconIndex,
titleIndex);
+ CharSequence title = getShortcutTitle(manager, intent);
+ if (title != null) {
+ info.title = title;
+ }
+
// App shortcuts that used to be automatically added to Launcher
// didn't always have the correct intent flags set, so do that
// here
@@ -3658,4 +3663,17 @@ public class LauncherModel extends BroadcastReceiver {
Log.d(TAG, "mLoaderTask=null");
}
}
+
+ private CharSequence getShortcutTitle(PackageManager manager, Intent intent) {
+ ComponentName componentName = intent.getComponent();
+ if (componentName == null) {
+ return null;
+ }
+ ResolveInfo resolveInfo = manager.resolveActivity(intent, 0);
+ if (resolveInfo != null) {
+ return resolveInfo.activityInfo.loadLabel(manager);
+ }
+ return null;
+ }
+
}