diff options
-rw-r--r-- | core/res/res/values-watch/config.xml | 2 | ||||
-rw-r--r-- | core/res/res/values/strings.xml | 3 | ||||
-rwxr-xr-x | core/res/res/values/symbols.xml | 2 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/GlobalActions.java | 25 |
4 files changed, 31 insertions, 1 deletions
diff --git a/core/res/res/values-watch/config.xml b/core/res/res/values-watch/config.xml index 745aa73..9044802 100644 --- a/core/res/res/values-watch/config.xml +++ b/core/res/res/values-watch/config.xml @@ -23,7 +23,7 @@ <!-- Only show settings item due to smaller real estate. --> <string-array translatable="false" name="config_globalActionsList"> - <item>voiceassist</item> + <item>assist</item> </string-array> <!-- Base "touch slop" value used by ViewConfiguration as a diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index d30d36e..3649400 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -482,6 +482,9 @@ <!-- label for item that launches settings in phone options dialog [CHAR LIMIT=15]--> <string name="global_action_settings">Settings</string> + <!-- label for item that launches assist in phone options dialog [CHAR LIMIT=15]--> + <string name="global_action_assist">Assist</string> + <!-- label for item that launches voice assist in phone options dialog [CHAR LIMIT=15]--> <string name="global_action_voice_assist">Voice Assist</string> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 26f8009..83be371 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1538,6 +1538,7 @@ <java-symbol type="string" name="global_action_toggle_silent_mode" /> <java-symbol type="string" name="global_action_lockdown" /> <java-symbol type="string" name="global_action_voice_assist" /> + <java-symbol type="string" name="global_action_assist" /> <java-symbol type="string" name="invalidPuk" /> <java-symbol type="string" name="lockscreen_carrier_default" /> <java-symbol type="style" name="Animation.LockScreen" /> @@ -1628,6 +1629,7 @@ <java-symbol type="drawable" name="ic_menu_refresh" /> <java-symbol type="drawable" name="ic_settings" /> <java-symbol type="drawable" name="ic_voice_search" /> + <java-symbol type="drawable" name="ic_action_assist_focused" /> <java-symbol type="drawable" name="stat_notify_car_mode" /> <java-symbol type="drawable" name="stat_notify_disabled_data" /> <java-symbol type="drawable" name="stat_notify_disk_full" /> diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java index 20a2c9f..07fc4c7 100644 --- a/policy/src/com/android/internal/policy/impl/GlobalActions.java +++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java @@ -101,6 +101,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac private static final String GLOBAL_ACTION_KEY_SETTINGS = "settings"; private static final String GLOBAL_ACTION_KEY_LOCKDOWN = "lockdown"; private static final String GLOBAL_ACTION_KEY_VOICEASSIST = "voiceassist"; + private static final String GLOBAL_ACTION_KEY_ASSIST = "assist"; private final Context mContext; private final WindowManagerFuncs mWindowManagerFuncs; @@ -294,6 +295,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac mItems.add(getLockdownAction()); } else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) { mItems.add(getVoiceAssistAction()); + } else if (GLOBAL_ACTION_KEY_ASSIST.equals(actionKey)) { + mItems.add(getAssistAction()); } else { Log.e(TAG, "Invalid global action key " + actionKey); } @@ -439,6 +442,28 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac }; } + private Action getAssistAction() { + return new SinglePressAction(com.android.internal.R.drawable.ic_action_assist_focused, + R.string.global_action_assist) { + @Override + public void onPress() { + Intent intent = new Intent(Intent.ACTION_ASSIST); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + mContext.startActivity(intent); + } + + @Override + public boolean showDuringKeyguard() { + return true; + } + + @Override + public boolean showBeforeProvisioning() { + return true; + } + }; + } + private Action getVoiceAssistAction() { return new SinglePressAction(com.android.internal.R.drawable.ic_voice_search, R.string.global_action_voice_assist) { |