diff options
author | Bryce Lee <brycelee@google.com> | 2015-03-14 07:57:48 -0700 |
---|---|---|
committer | Bryce Lee <brycelee@google.com> | 2015-03-14 07:57:48 -0700 |
commit | 8326554788c78f47d7b5f266a074fd2d24fb7fd0 (patch) | |
tree | c4c65b4436397616d498d792b0e00caa1a2d6a04 | |
parent | d9eb3881f452ecb4b77062eb6505a3d7601d0a8c (diff) | |
download | frameworks_base-8326554788c78f47d7b5f266a074fd2d24fb7fd0.zip frameworks_base-8326554788c78f47d7b5f266a074fd2d24fb7fd0.tar.gz frameworks_base-8326554788c78f47d7b5f266a074fd2d24fb7fd0.tar.bz2 |
Add Assist global action for wear to different from VOICE_ASSIST
Bug: 19722315
Change-Id: I0b1e5625a2eaabfe0015a4d730b25e84d60a3714
-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 e7bd90a..7ba6ec2 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1537,6 +1537,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" /> @@ -1627,6 +1628,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) { |