Merge "Add Assist global action for wear to different from VOICE_ASSIST" into lmp-mr1-modular-dev
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<!-- Only show settings item due to smaller real estate. -->
|
<!-- Only show settings item due to smaller real estate. -->
|
||||||
<string-array translatable="false" name="config_globalActionsList">
|
<string-array translatable="false" name="config_globalActionsList">
|
||||||
<item>voiceassist</item>
|
<item>assist</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- Base "touch slop" value used by ViewConfiguration as a
|
<!-- Base "touch slop" value used by ViewConfiguration as a
|
||||||
|
|||||||
@@ -482,6 +482,9 @@
|
|||||||
<!-- label for item that launches settings in phone options dialog [CHAR LIMIT=15]-->
|
<!-- label for item that launches settings in phone options dialog [CHAR LIMIT=15]-->
|
||||||
<string name="global_action_settings">Settings</string>
|
<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]-->
|
<!-- label for item that launches voice assist in phone options dialog [CHAR LIMIT=15]-->
|
||||||
<string name="global_action_voice_assist">Voice Assist</string>
|
<string name="global_action_voice_assist">Voice Assist</string>
|
||||||
|
|
||||||
|
|||||||
@@ -1538,6 +1538,7 @@
|
|||||||
<java-symbol type="string" name="global_action_toggle_silent_mode" />
|
<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_lockdown" />
|
||||||
<java-symbol type="string" name="global_action_voice_assist" />
|
<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="invalidPuk" />
|
||||||
<java-symbol type="string" name="lockscreen_carrier_default" />
|
<java-symbol type="string" name="lockscreen_carrier_default" />
|
||||||
<java-symbol type="style" name="Animation.LockScreen" />
|
<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_menu_refresh" />
|
||||||
<java-symbol type="drawable" name="ic_settings" />
|
<java-symbol type="drawable" name="ic_settings" />
|
||||||
<java-symbol type="drawable" name="ic_voice_search" />
|
<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_car_mode" />
|
||||||
<java-symbol type="drawable" name="stat_notify_disabled_data" />
|
<java-symbol type="drawable" name="stat_notify_disabled_data" />
|
||||||
<java-symbol type="drawable" name="stat_notify_disk_full" />
|
<java-symbol type="drawable" name="stat_notify_disk_full" />
|
||||||
|
|||||||
@@ -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_SETTINGS = "settings";
|
||||||
private static final String GLOBAL_ACTION_KEY_LOCKDOWN = "lockdown";
|
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_VOICEASSIST = "voiceassist";
|
||||||
|
private static final String GLOBAL_ACTION_KEY_ASSIST = "assist";
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final WindowManagerFuncs mWindowManagerFuncs;
|
private final WindowManagerFuncs mWindowManagerFuncs;
|
||||||
@@ -294,6 +295,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
|
|||||||
mItems.add(getLockdownAction());
|
mItems.add(getLockdownAction());
|
||||||
} else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) {
|
} else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) {
|
||||||
mItems.add(getVoiceAssistAction());
|
mItems.add(getVoiceAssistAction());
|
||||||
|
} else if (GLOBAL_ACTION_KEY_ASSIST.equals(actionKey)) {
|
||||||
|
mItems.add(getAssistAction());
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "Invalid global action key " + actionKey);
|
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() {
|
private Action getVoiceAssistAction() {
|
||||||
return new SinglePressAction(com.android.internal.R.drawable.ic_voice_search,
|
return new SinglePressAction(com.android.internal.R.drawable.ic_voice_search,
|
||||||
R.string.global_action_voice_assist) {
|
R.string.global_action_voice_assist) {
|
||||||
|
|||||||
Reference in New Issue
Block a user