Loading core/res/res/values-watch/config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ <!-- Only show settings item due to smaller real estate. --> <string-array translatable="false" name="config_globalActionsList"> <item>settings</item> <item>voiceassist</item> </string-array> <!-- Base "touch slop" value used by ViewConfiguration as a Loading core/res/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -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 voice assist in phone options dialog [CHAR LIMIT=15]--> <string name="global_action_voice_assist">Voice Assist</string> <!-- label for item that locks the phone and enforces that it can't be unlocked without entering a credential. [CHAR LIMIT=15] --> <string name="global_action_lockdown">Lock now</string> Loading core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -1527,6 +1527,7 @@ <java-symbol type="string" name="global_action_silent_mode_on_status" /> <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="invalidPuk" /> <java-symbol type="string" name="lockscreen_carrier_default" /> <java-symbol type="style" name="Animation.LockScreen" /> Loading Loading @@ -1614,6 +1615,7 @@ <java-symbol type="drawable" name="ic_notification_ime_default" /> <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="stat_notify_car_mode" /> <java-symbol type="drawable" name="stat_notify_disabled_data" /> <java-symbol type="drawable" name="stat_notify_disk_full" /> Loading policy/src/com/android/internal/policy/impl/GlobalActions.java +25 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac private static final String GLOBAL_ACTION_KEY_USERS = "users"; 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 final Context mContext; private final WindowManagerFuncs mWindowManagerFuncs; Loading Loading @@ -291,6 +292,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac mItems.add(getSettingsAction()); } else if (GLOBAL_ACTION_KEY_LOCKDOWN.equals(actionKey)) { mItems.add(getLockdownAction()); } else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) { mItems.add(getVoiceAssistAction()); } else { Log.e(TAG, "Invalid global action key " + actionKey); } Loading Loading @@ -436,6 +439,28 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac }; } private Action getVoiceAssistAction() { return new SinglePressAction(com.android.internal.R.drawable.ic_voice_search, R.string.global_action_voice_assist) { @Override public void onPress() { Intent intent = new Intent(Intent.ACTION_VOICE_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 getLockdownAction() { return new SinglePressAction(com.android.internal.R.drawable.ic_lock_lock, R.string.global_action_lockdown) { Loading Loading
core/res/res/values-watch/config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ <!-- Only show settings item due to smaller real estate. --> <string-array translatable="false" name="config_globalActionsList"> <item>settings</item> <item>voiceassist</item> </string-array> <!-- Base "touch slop" value used by ViewConfiguration as a Loading
core/res/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -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 voice assist in phone options dialog [CHAR LIMIT=15]--> <string name="global_action_voice_assist">Voice Assist</string> <!-- label for item that locks the phone and enforces that it can't be unlocked without entering a credential. [CHAR LIMIT=15] --> <string name="global_action_lockdown">Lock now</string> Loading
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -1527,6 +1527,7 @@ <java-symbol type="string" name="global_action_silent_mode_on_status" /> <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="invalidPuk" /> <java-symbol type="string" name="lockscreen_carrier_default" /> <java-symbol type="style" name="Animation.LockScreen" /> Loading Loading @@ -1614,6 +1615,7 @@ <java-symbol type="drawable" name="ic_notification_ime_default" /> <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="stat_notify_car_mode" /> <java-symbol type="drawable" name="stat_notify_disabled_data" /> <java-symbol type="drawable" name="stat_notify_disk_full" /> Loading
policy/src/com/android/internal/policy/impl/GlobalActions.java +25 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac private static final String GLOBAL_ACTION_KEY_USERS = "users"; 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 final Context mContext; private final WindowManagerFuncs mWindowManagerFuncs; Loading Loading @@ -291,6 +292,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac mItems.add(getSettingsAction()); } else if (GLOBAL_ACTION_KEY_LOCKDOWN.equals(actionKey)) { mItems.add(getLockdownAction()); } else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) { mItems.add(getVoiceAssistAction()); } else { Log.e(TAG, "Invalid global action key " + actionKey); } Loading Loading @@ -436,6 +439,28 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac }; } private Action getVoiceAssistAction() { return new SinglePressAction(com.android.internal.R.drawable.ic_voice_search, R.string.global_action_voice_assist) { @Override public void onPress() { Intent intent = new Intent(Intent.ACTION_VOICE_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 getLockdownAction() { return new SinglePressAction(com.android.internal.R.drawable.ic_lock_lock, R.string.global_action_lockdown) { Loading