Home > Mobile >  Lower left phone android9 lock screen interface icon switch to voice assistant
Lower left phone android9 lock screen interface icon switch to voice assistant

Time:10-04

Here is the source code, you can see the lock screen interface, bottom icon reserved telephone and voice assistant? How can I set to switch to voice assistant (default is telephone)
Private class DefaultLeftButton implements IntentButton {

Private IconState mIconState=new IconState ();

@ Override
Public IconState getIcon () {
MLeftIsVoiceAssist=canLaunchVoiceAssist ();
//mLeftIsVoiceAssist=true;
Final Boolean showAffordance=
GetResources (). GetBoolean (r. ool. Config_keyguardShowLeftAffordance);
If (mLeftIsVoiceAssist) {
MIconState. IsVisible=mUserSetupComplete & amp; & ShowAffordance;
If (mLeftAssistIcon==null) {
MIconState. Drawable=mContext. GetDrawable (R.d rawable. Ic_mic_26dp);
} else {
MIconState. Drawable=mLeftAssistIcon;
}
MIconState. ContentDescription=mContext. Get string (
R.s tring. Accessibility_voice_assist_button);
} else {
MIconState. IsVisible=mUserSetupComplete & amp; & ShowAffordance & amp; & IsPhoneVisible ();
MIconState. Drawable=mContext. GetDrawable (R.d rawable. Ic_phone_24dp);
MIconState. ContentDescription=mContext. Get string (
R.s tring. Accessibility_phone_button);
}
  • Related