Loading core/java/android/hardware/biometrics/BiometricPrompt.java +13 −0 Original line number Diff line number Diff line Loading @@ -465,6 +465,19 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan } // LINT.ThenChange(frameworks/base/core/java/android/hardware/biometrics/PromptInfo.java) /** * Set if emergency call button should show, for example if biometrics are * required to access the dialer app * @param showEmergencyCallButton if true, shows emergency call button * @return This builder. * @hide */ @NonNull public Builder setShowEmergencyCallButton(boolean showEmergencyCallButton) { mPromptInfo.setShowEmergencyCallButton(showEmergencyCallButton); return this; } /** * Creates a {@link BiometricPrompt}. * Loading core/java/android/hardware/biometrics/PromptInfo.java +11 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public class PromptInfo implements Parcelable { private boolean mAllowBackgroundAuthentication; private boolean mIgnoreEnrollmentState; private boolean mIsForLegacyFingerprintManager = false; private boolean mShowEmergencyCallButton = false; public PromptInfo() { Loading @@ -72,6 +73,7 @@ public class PromptInfo implements Parcelable { mAllowBackgroundAuthentication = in.readBoolean(); mIgnoreEnrollmentState = in.readBoolean(); mIsForLegacyFingerprintManager = in.readBoolean(); mShowEmergencyCallButton = in.readBoolean(); } public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() { Loading Loading @@ -111,6 +113,7 @@ public class PromptInfo implements Parcelable { dest.writeBoolean(mAllowBackgroundAuthentication); dest.writeBoolean(mIgnoreEnrollmentState); dest.writeBoolean(mIsForLegacyFingerprintManager); dest.writeBoolean(mShowEmergencyCallButton); } // LINT.IfChange Loading Loading @@ -228,6 +231,10 @@ public class PromptInfo implements Parcelable { mAllowedSensorIds.add(sensorId); } public void setShowEmergencyCallButton(boolean showEmergencyCallButton) { mShowEmergencyCallButton = showEmergencyCallButton; } // Getters public CharSequence getTitle() { Loading Loading @@ -309,4 +316,8 @@ public class PromptInfo implements Parcelable { public boolean isForLegacyFingerprintManager() { return mIsForLegacyFingerprintManager; } public boolean isShowEmergencyCallButton() { return mShowEmergencyCallButton; } } packages/SystemUI/res/drawable/auth_credential_emergency_button_background.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <inset xmlns:android="http://schemas.android.com/apk/res/android"> <shape android:shape="rectangle"> <corners android:radius="25dp"/> <solid android:color="@android:color/system_accent3_100" /> </shape> </inset> packages/SystemUI/res/layout-land/auth_credential_password_view.xml +34 −17 Original line number Diff line number Diff line Loading @@ -61,10 +61,16 @@ </RelativeLayout> <LinearLayout <FrameLayout android:id="@+id/auth_credential_input" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|top" android:orientation="vertical"> <ImeAwareEditText Loading @@ -72,7 +78,7 @@ style="?passwordTextAppearance" android:layout_width="208dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_gravity="center_horizontal" android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii" android:inputType="textPassword" android:minHeight="48dp"/> Loading @@ -80,10 +86,21 @@ <TextView android:id="@+id/error" style="?errorTextAppearance" android:layout_gravity="center" android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> <Button android:id="@+id/emergencyCallButton" style="@style/AuthCredentialEmergencyButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_horizontal|bottom" android:layout_marginTop="12dp" android:layout_marginBottom="12dp" android:text="@string/work_challenge_emergency_button_text"/> </FrameLayout> </com.android.systemui.biometrics.ui.CredentialPasswordView> No newline at end of file packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml +31 −14 Original line number Diff line number Diff line Loading @@ -60,27 +60,44 @@ android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/error" style="?errorTextAppearanceLand" android:layout_below="@id/description" android:layout_alignParentLeft="true" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </RelativeLayout> <FrameLayout <RelativeLayout android:layout_weight="1" style="?containerStyle" android:layout_width="0dp" android:layout_height="match_parent"> <FrameLayout style="?containerStyle" android:layout_above="@id/emergencyCallButton" android:layout_width="match_parent" android:layout_height="match_parent"> <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern" android:layout_gravity="center" android:layout_width="@dimen/biometric_auth_pattern_view_size" android:layout_height="@dimen/biometric_auth_pattern_view_size"/> </FrameLayout> <TextView android:id="@+id/error" style="?errorTextAppearance" android:layout_width="match_parent" <Button android:id="@+id/emergencyCallButton" style="@style/AuthCredentialEmergencyButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|bottom"/> </FrameLayout> android:layout_marginBottom="35dp" android:visibility="gone" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:text="@string/work_challenge_emergency_button_text"/> </RelativeLayout> </com.android.systemui.biometrics.ui.CredentialPatternView> No newline at end of file Loading
core/java/android/hardware/biometrics/BiometricPrompt.java +13 −0 Original line number Diff line number Diff line Loading @@ -465,6 +465,19 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan } // LINT.ThenChange(frameworks/base/core/java/android/hardware/biometrics/PromptInfo.java) /** * Set if emergency call button should show, for example if biometrics are * required to access the dialer app * @param showEmergencyCallButton if true, shows emergency call button * @return This builder. * @hide */ @NonNull public Builder setShowEmergencyCallButton(boolean showEmergencyCallButton) { mPromptInfo.setShowEmergencyCallButton(showEmergencyCallButton); return this; } /** * Creates a {@link BiometricPrompt}. * Loading
core/java/android/hardware/biometrics/PromptInfo.java +11 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public class PromptInfo implements Parcelable { private boolean mAllowBackgroundAuthentication; private boolean mIgnoreEnrollmentState; private boolean mIsForLegacyFingerprintManager = false; private boolean mShowEmergencyCallButton = false; public PromptInfo() { Loading @@ -72,6 +73,7 @@ public class PromptInfo implements Parcelable { mAllowBackgroundAuthentication = in.readBoolean(); mIgnoreEnrollmentState = in.readBoolean(); mIsForLegacyFingerprintManager = in.readBoolean(); mShowEmergencyCallButton = in.readBoolean(); } public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() { Loading Loading @@ -111,6 +113,7 @@ public class PromptInfo implements Parcelable { dest.writeBoolean(mAllowBackgroundAuthentication); dest.writeBoolean(mIgnoreEnrollmentState); dest.writeBoolean(mIsForLegacyFingerprintManager); dest.writeBoolean(mShowEmergencyCallButton); } // LINT.IfChange Loading Loading @@ -228,6 +231,10 @@ public class PromptInfo implements Parcelable { mAllowedSensorIds.add(sensorId); } public void setShowEmergencyCallButton(boolean showEmergencyCallButton) { mShowEmergencyCallButton = showEmergencyCallButton; } // Getters public CharSequence getTitle() { Loading Loading @@ -309,4 +316,8 @@ public class PromptInfo implements Parcelable { public boolean isForLegacyFingerprintManager() { return mIsForLegacyFingerprintManager; } public boolean isShowEmergencyCallButton() { return mShowEmergencyCallButton; } }
packages/SystemUI/res/drawable/auth_credential_emergency_button_background.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <inset xmlns:android="http://schemas.android.com/apk/res/android"> <shape android:shape="rectangle"> <corners android:radius="25dp"/> <solid android:color="@android:color/system_accent3_100" /> </shape> </inset>
packages/SystemUI/res/layout-land/auth_credential_password_view.xml +34 −17 Original line number Diff line number Diff line Loading @@ -61,10 +61,16 @@ </RelativeLayout> <LinearLayout <FrameLayout android:id="@+id/auth_credential_input" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|top" android:orientation="vertical"> <ImeAwareEditText Loading @@ -72,7 +78,7 @@ style="?passwordTextAppearance" android:layout_width="208dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_gravity="center_horizontal" android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii" android:inputType="textPassword" android:minHeight="48dp"/> Loading @@ -80,10 +86,21 @@ <TextView android:id="@+id/error" style="?errorTextAppearance" android:layout_gravity="center" android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> <Button android:id="@+id/emergencyCallButton" style="@style/AuthCredentialEmergencyButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_horizontal|bottom" android:layout_marginTop="12dp" android:layout_marginBottom="12dp" android:text="@string/work_challenge_emergency_button_text"/> </FrameLayout> </com.android.systemui.biometrics.ui.CredentialPasswordView> No newline at end of file
packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml +31 −14 Original line number Diff line number Diff line Loading @@ -60,27 +60,44 @@ android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/error" style="?errorTextAppearanceLand" android:layout_below="@id/description" android:layout_alignParentLeft="true" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </RelativeLayout> <FrameLayout <RelativeLayout android:layout_weight="1" style="?containerStyle" android:layout_width="0dp" android:layout_height="match_parent"> <FrameLayout style="?containerStyle" android:layout_above="@id/emergencyCallButton" android:layout_width="match_parent" android:layout_height="match_parent"> <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern" android:layout_gravity="center" android:layout_width="@dimen/biometric_auth_pattern_view_size" android:layout_height="@dimen/biometric_auth_pattern_view_size"/> </FrameLayout> <TextView android:id="@+id/error" style="?errorTextAppearance" android:layout_width="match_parent" <Button android:id="@+id/emergencyCallButton" style="@style/AuthCredentialEmergencyButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|bottom"/> </FrameLayout> android:layout_marginBottom="35dp" android:visibility="gone" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:text="@string/work_challenge_emergency_button_text"/> </RelativeLayout> </com.android.systemui.biometrics.ui.CredentialPatternView> No newline at end of file