Merge "Remove sidefps toggle from SUW." into tm-qpr-dev

This commit is contained in:
Joshua Mccloskey
2022-11-15 01:14:01 +00:00
committed by Android (Google) Code Review
4 changed files with 0 additions and 181 deletions

View File

@@ -30,15 +30,6 @@
android:clipToPadding="false" android:clipToPadding="false"
android:clipChildren="false"> android:clipChildren="false">
<com.android.settings.biometrics.fingerprint.FingerprintRequireScreenOnToAuthToggle
style="@style/SudSwitchStyle"
android:id="@+id/require_screen_on_to_auth_toggle"
android:layout_gravity="start"
android:paddingLeft="0dp"
android:paddingStart="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.google.android.setupdesign.view.FillContentLayout <com.google.android.setupdesign.view.FillContentLayout
android:layout_width="@dimen/sfps_enrollment_finished_icon_max_size" android:layout_width="@dimen/sfps_enrollment_finished_icon_max_size"
android:layout_height="@dimen/sfps_enrollment_finished_icon_max_size" android:layout_height="@dimen/sfps_enrollment_finished_icon_max_size"

View File

@@ -1,62 +0,0 @@
<!--
~ Copyright (C) 2022 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.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
style="?attr/fingerprint_layout_theme">
<!-- Title -->
<com.google.android.setupdesign.view.RichTextView
android:id="@+id/title"
android:paddingTop="8dp"
android:paddingBottom="4dp"
android:layout_alignParentStart="true"
android:textAlignment="viewStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/security_settings_require_screen_on_to_auth_title"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/sud_description_text_size"
/>
<!-- Subtitle -->
<TextView
android:id="@+id/subtitle"
android:paddingBottom="8dp"
android:layout_alignParentStart="true"
android:textAlignment="viewStart"
android:layout_toStartOf="@+id/toggle"
android:layout_below="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/security_settings_require_screen_on_to_auth_description"
android:textColor="?android:attr/textColorSecondary"/>
<!-- Toggle -->
<Switch
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/toggle"
android:layout_centerVertical="true"
android:checked="false"
style="@style/SudSwitchStyle"/>
</RelativeLayout>

View File

@@ -25,7 +25,6 @@ import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.CompoundButton;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
@@ -45,7 +44,6 @@ import java.util.List;
public class FingerprintEnrollFinish extends BiometricEnrollBase { public class FingerprintEnrollFinish extends BiometricEnrollBase {
private static final String TAG = "FingerprintEnrollFinish"; private static final String TAG = "FingerprintEnrollFinish";
private static final String KEY_REQUIRE_SCREEN_ON_TO_AUTH = "require_screen_on_to_auth_toggle";
private static final String ACTION_FINGERPRINT_SETTINGS = private static final String ACTION_FINGERPRINT_SETTINGS =
"android.settings.FINGERPRINT_SETTINGS"; "android.settings.FINGERPRINT_SETTINGS";
@VisibleForTesting @VisibleForTesting
@@ -54,15 +52,10 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
private FingerprintManager mFingerprintManager; private FingerprintManager mFingerprintManager;
private FingerprintSettingsRequireScreenOnToAuthPreferenceController
mRequireScreenOnToAuthPreferenceController;
private FingerprintRequireScreenOnToAuthToggle mRequireScreenOnToAuthToggle;
private boolean mCanAssumeSfps; private boolean mCanAssumeSfps;
private boolean mIsAddAnotherOrFinish; private boolean mIsAddAnotherOrFinish;
private CompoundButton.OnCheckedChangeListener mRequireScreenOnToAuthToggleListener;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@@ -72,11 +65,6 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
mCanAssumeSfps = props != null && props.size() == 1 && props.get(0).isAnySidefpsType(); mCanAssumeSfps = props != null && props.size() == 1 && props.get(0).isAnySidefpsType();
if (mCanAssumeSfps) { if (mCanAssumeSfps) {
setContentView(R.layout.sfps_enroll_finish); setContentView(R.layout.sfps_enroll_finish);
mRequireScreenOnToAuthPreferenceController =
new FingerprintSettingsRequireScreenOnToAuthPreferenceController(
getApplicationContext(),
KEY_REQUIRE_SCREEN_ON_TO_AUTH
);
} else { } else {
setContentView(R.layout.fingerprint_enroll_finish); setContentView(R.layout.fingerprint_enroll_finish);
} }
@@ -100,20 +88,6 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
.setTheme(R.style.SudGlifButton_Primary) .setTheme(R.style.SudGlifButton_Primary)
.build() .build()
); );
if (mCanAssumeSfps) {
mRequireScreenOnToAuthToggleListener =
(buttonView, isChecked) -> {
mRequireScreenOnToAuthPreferenceController.setChecked(isChecked);
};
mRequireScreenOnToAuthToggle = findViewById(R.id.require_screen_on_to_auth_toggle);
mRequireScreenOnToAuthToggle.setChecked(
mRequireScreenOnToAuthPreferenceController.isChecked());
mRequireScreenOnToAuthToggle.setListener(mRequireScreenOnToAuthToggleListener);
mRequireScreenOnToAuthToggle.setOnClickListener(v -> {
mRequireScreenOnToAuthToggle.getSwitch().toggle();
});
}
} }
@Override @Override
@@ -127,13 +101,6 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (mCanAssumeSfps) {
mRequireScreenOnToAuthToggleListener.onCheckedChanged(
mRequireScreenOnToAuthToggle.getSwitch(),
mRequireScreenOnToAuthToggle.isChecked()
);
}
FooterButton addButton = mFooterBarMixin.getSecondaryButton(); FooterButton addButton = mFooterBarMixin.getSecondaryButton();
final FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this); final FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this);

View File

@@ -1,77 +0,0 @@
/*
* Copyright (C) 2022 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.
*/
package com.android.settings.biometrics.fingerprint;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.Switch;
import com.android.settings.R;
/**
* A layout that contains a start-justified title, and an end-justified switch.
*/
public class FingerprintRequireScreenOnToAuthToggle extends LinearLayout {
private Switch mSwitch;
public FingerprintRequireScreenOnToAuthToggle(Context context) {
this(context, null /* attrs */);
}
public FingerprintRequireScreenOnToAuthToggle(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public FingerprintRequireScreenOnToAuthToggle(
Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
LayoutInflater.from(context).inflate(R.layout.sfps_require_screen_on_to_auth_toggle,
this, true /* attachToRoot */);
mSwitch = findViewById(R.id.toggle);
mSwitch.setClickable(true);
mSwitch.setFocusable(false);
}
public boolean isChecked() {
return mSwitch.isChecked();
}
/**
*
* @param checked
*/
public void setChecked(boolean checked) {
mSwitch.setChecked(checked);
}
/**
*
* @param listener
*/
public void setListener(CompoundButton.OnCheckedChangeListener listener) {
mSwitch.setOnCheckedChangeListener(listener);
}
public Switch getSwitch() {
return mSwitch;
}
}