下面是原始碼,可以看出鎖屏界面的左下圖示預留了電話和語音助手?請問怎么設定才能切換成語音助手(默認是電話)
private class DefaultLeftButton implements IntentButton {
private IconState mIconState = new IconState();
@Override
public IconState getIcon() {
mLeftIsVoiceAssist = canLaunchVoiceAssist();
//mLeftIsVoiceAssist = true;
final boolean showAffordance =
getResources().getBoolean(R.bool.config_keyguardShowLeftAffordance);
if (mLeftIsVoiceAssist) {
mIconState.isVisible = mUserSetupComplete && showAffordance;
if (mLeftAssistIcon == null) {
mIconState.drawable = mContext.getDrawable(R.drawable.ic_mic_26dp);
} else {
mIconState.drawable = mLeftAssistIcon;
}
mIconState.contentDescription = mContext.getString(
R.string.accessibility_voice_assist_button);
} else {
mIconState.isVisible = mUserSetupComplete && showAffordance && isPhoneVisible();
mIconState.drawable = mContext.getDrawable(R.drawable.ic_phone_24dp);
mIconState.contentDescription = mContext.getString(
R.string.accessibility_phone_button);
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/108458.html
標籤:Android
上一篇:java.lang.IllegalArgumentException: unknown client android.os.BinderProxy@45f1f8
