Snap for 9257771 from bc38bacaf2 to tm-qpr2-release
Change-Id: Ie592c9b64452a233a37a8876c54fbe00aba22482
This commit is contained in:
@@ -88,6 +88,7 @@ android_library {
|
|||||||
"WifiTrackerLib",
|
"WifiTrackerLib",
|
||||||
"SettingsLibActivityEmbedding",
|
"SettingsLibActivityEmbedding",
|
||||||
"Settings-change-ids",
|
"Settings-change-ids",
|
||||||
|
"SystemUIUnfoldLib",
|
||||||
],
|
],
|
||||||
|
|
||||||
libs: [
|
libs: [
|
||||||
|
|||||||
@@ -2976,6 +2976,7 @@
|
|||||||
android:taskAffinity="com.android.settings.FallbackHome"
|
android:taskAffinity="com.android.settings.FallbackHome"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:theme="@style/FallbackHome"
|
android:theme="@style/FallbackHome"
|
||||||
|
android:permission="android.permission.DEVICE_POWER"
|
||||||
android:configChanges="keyboardHidden">
|
android:configChanges="keyboardHidden">
|
||||||
<intent-filter android:priority="-1000">
|
<intent-filter android:priority="-1000">
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|||||||
@@ -30,12 +30,14 @@
|
|||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:clipChildren="false">
|
android:clipChildren="false">
|
||||||
|
|
||||||
<LinearLayout
|
<com.android.settings.biometrics.fingerprint.FingerprintRequireScreenOnToAuthToggle
|
||||||
android:layout_width="match_parent"
|
style="@style/SudSwitchStyle"
|
||||||
android:layout_height="0dp"
|
android:id="@+id/require_screen_on_to_auth_toggle"
|
||||||
android:layout_weight="1"
|
android:layout_gravity="start"
|
||||||
android:gravity="center"
|
android:paddingLeft="0dp"
|
||||||
android:orientation="vertical">
|
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"
|
||||||
@@ -54,21 +56,6 @@
|
|||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
android:src="@drawable/sfps_enroll_finish" />
|
android:src="@drawable/sfps_enroll_finish" />
|
||||||
</com.google.android.setupdesign.view.FillContentLayout>
|
</com.google.android.setupdesign.view.FillContentLayout>
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<com.android.settings.biometrics.fingerprint.FingerprintRequireScreenOnToAuthToggle
|
|
||||||
style="@style/SudSwitchStyle"
|
|
||||||
android:id="@+id/require_screen_on_to_auth_toggle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_horizontal|bottom" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</com.google.android.setupdesign.GlifLayout>
|
</com.google.android.setupdesign.GlifLayout>
|
||||||
@@ -19,24 +19,16 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="start"
|
||||||
style="?attr/fingerprint_layout_theme">
|
style="?attr/fingerprint_layout_theme">
|
||||||
|
|
||||||
<!-- Top divider -->
|
|
||||||
<View
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:background="?android:attr/listDivider" />
|
|
||||||
|
|
||||||
<!-- Title -->
|
<!-- Title -->
|
||||||
<com.google.android.setupdesign.view.RichTextView
|
<com.google.android.setupdesign.view.RichTextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
android:paddingHorizontal="8dp"
|
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="4dp"
|
android:paddingBottom="4dp"
|
||||||
android:gravity="start"
|
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_toStartOf="@+id/toggle"
|
android:textAlignment="viewStart"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/security_settings_require_screen_on_to_auth_title"
|
android:text="@string/security_settings_require_screen_on_to_auth_title"
|
||||||
@@ -47,9 +39,9 @@
|
|||||||
<!-- Subtitle -->
|
<!-- Subtitle -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/subtitle"
|
android:id="@+id/subtitle"
|
||||||
android:paddingHorizontal="8dp"
|
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
android:layout_toStartOf="@+id/toggle"
|
android:layout_toStartOf="@+id/toggle"
|
||||||
android:layout_below="@+id/title"
|
android:layout_below="@+id/title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -57,16 +49,6 @@
|
|||||||
android:text="@string/security_settings_require_screen_on_to_auth_description"
|
android:text="@string/security_settings_require_screen_on_to_auth_description"
|
||||||
android:textColor="?android:attr/textColorSecondary"/>
|
android:textColor="?android:attr/textColorSecondary"/>
|
||||||
|
|
||||||
<!-- Vertical divider -->
|
|
||||||
<View
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_alignTop="@+id/toggle"
|
|
||||||
android:layout_alignBottom="@+id/toggle"
|
|
||||||
android:layout_toStartOf="@+id/toggle"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?android:attr/listDivider" />
|
|
||||||
|
|
||||||
<!-- Toggle -->
|
<!-- Toggle -->
|
||||||
<Switch
|
<Switch
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
@@ -74,6 +56,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/toggle"
|
android:id="@+id/toggle"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:checked="false"/>
|
android:checked="false"
|
||||||
|
style="@style/SudSwitchStyle"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
File diff suppressed because one or more lines are too long
1
res/raw/fingerprint_edu_lottie_folded_bottom_left.json
Normal file
1
res/raw/fingerprint_edu_lottie_folded_bottom_left.json
Normal file
File diff suppressed because one or more lines are too long
1
res/raw/fingerprint_edu_lottie_folded_bottom_right.json
Normal file
1
res/raw/fingerprint_edu_lottie_folded_bottom_right.json
Normal file
File diff suppressed because one or more lines are too long
1
res/raw/fingerprint_edu_lottie_folded_top_left.json
Normal file
1
res/raw/fingerprint_edu_lottie_folded_top_left.json
Normal file
File diff suppressed because one or more lines are too long
1
res/raw/fingerprint_edu_lottie_folded_top_right.json
Normal file
1
res/raw/fingerprint_edu_lottie_folded_top_right.json
Normal file
File diff suppressed because one or more lines are too long
@@ -18,6 +18,7 @@ package com.android.settings.biometrics.fingerprint;
|
|||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.hardware.fingerprint.FingerprintManager;
|
import android.hardware.fingerprint.FingerprintManager;
|
||||||
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
|
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
|
||||||
@@ -29,6 +30,7 @@ import android.view.View;
|
|||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.accessibility.AccessibilityManager;
|
import android.view.accessibility.AccessibilityManager;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
@@ -38,6 +40,8 @@ import com.android.settings.biometrics.BiometricEnrollSidecar;
|
|||||||
import com.android.settings.biometrics.BiometricUtils;
|
import com.android.settings.biometrics.BiometricUtils;
|
||||||
import com.android.settings.password.ChooseLockSettingsHelper;
|
import com.android.settings.password.ChooseLockSettingsHelper;
|
||||||
import com.android.settingslib.widget.LottieColorUtils;
|
import com.android.settingslib.widget.LottieColorUtils;
|
||||||
|
import com.android.systemui.unfold.compat.ScreenSizeFoldProvider;
|
||||||
|
import com.android.systemui.unfold.updates.FoldProvider;
|
||||||
|
|
||||||
import com.airbnb.lottie.LottieAnimationView;
|
import com.airbnb.lottie.LottieAnimationView;
|
||||||
import com.google.android.setupcompat.template.FooterBarMixin;
|
import com.google.android.setupcompat.template.FooterBarMixin;
|
||||||
@@ -49,7 +53,7 @@ import java.util.List;
|
|||||||
* Activity explaining the fingerprint sensor location for fingerprint enrollment.
|
* Activity explaining the fingerprint sensor location for fingerprint enrollment.
|
||||||
*/
|
*/
|
||||||
public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
||||||
BiometricEnrollSidecar.Listener {
|
BiometricEnrollSidecar.Listener, FoldProvider.FoldCallback {
|
||||||
|
|
||||||
private static final String TAG = "FingerprintEnrollFindSensor";
|
private static final String TAG = "FingerprintEnrollFindSensor";
|
||||||
private static final String SAVED_STATE_IS_NEXT_CLICKED = "is_next_clicked";
|
private static final String SAVED_STATE_IS_NEXT_CLICKED = "is_next_clicked";
|
||||||
@@ -67,6 +71,8 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
|||||||
|
|
||||||
private OrientationEventListener mOrientationEventListener;
|
private OrientationEventListener mOrientationEventListener;
|
||||||
private int mPreviousRotation = 0;
|
private int mPreviousRotation = 0;
|
||||||
|
private ScreenSizeFoldProvider mScreenSizeFoldProvider;
|
||||||
|
private boolean mIsFolded;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -78,6 +84,10 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
|||||||
mCanAssumeUdfps = props != null && props.size() == 1 && props.get(0).isAnyUdfpsType();
|
mCanAssumeUdfps = props != null && props.size() == 1 && props.get(0).isAnyUdfpsType();
|
||||||
mCanAssumeSfps = props != null && props.size() == 1 && props.get(0).isAnySidefpsType();
|
mCanAssumeSfps = props != null && props.size() == 1 && props.get(0).isAnySidefpsType();
|
||||||
setContentView(getContentView());
|
setContentView(getContentView());
|
||||||
|
mScreenSizeFoldProvider = new ScreenSizeFoldProvider(getApplicationContext());
|
||||||
|
mScreenSizeFoldProvider.registerCallback(this, getApplicationContext().getMainExecutor());
|
||||||
|
mScreenSizeFoldProvider
|
||||||
|
.onConfigurationChange(getApplicationContext().getResources().getConfiguration());
|
||||||
mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
|
mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
|
||||||
mFooterBarMixin.setSecondaryButton(
|
mFooterBarMixin.setSecondaryButton(
|
||||||
new FooterButton.Builder(this)
|
new FooterButton.Builder(this)
|
||||||
@@ -166,25 +176,47 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateSfpsFindSensorAnimationAsset() {
|
private void updateSfpsFindSensorAnimationAsset() {
|
||||||
|
mScreenSizeFoldProvider
|
||||||
|
.onConfigurationChange(getApplicationContext().getResources().getConfiguration());
|
||||||
mIllustrationLottie = findViewById(R.id.illustration_lottie);
|
mIllustrationLottie = findViewById(R.id.illustration_lottie);
|
||||||
final int rotation = getApplicationContext().getDisplay().getRotation();
|
final int rotation = getApplicationContext().getDisplay().getRotation();
|
||||||
|
|
||||||
switch (rotation) {
|
switch (rotation) {
|
||||||
case Surface.ROTATION_90:
|
case Surface.ROTATION_90:
|
||||||
|
if (mIsFolded) {
|
||||||
|
mIllustrationLottie.setAnimation(
|
||||||
|
R.raw.fingerprint_edu_lottie_folded_top_left);
|
||||||
|
} else {
|
||||||
mIllustrationLottie.setAnimation(
|
mIllustrationLottie.setAnimation(
|
||||||
R.raw.fingerprint_edu_lottie_portrait_top_left);
|
R.raw.fingerprint_edu_lottie_portrait_top_left);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Surface.ROTATION_180:
|
case Surface.ROTATION_180:
|
||||||
|
if (mIsFolded) {
|
||||||
|
mIllustrationLottie.setAnimation(
|
||||||
|
R.raw.fingerprint_edu_lottie_folded_bottom_left);
|
||||||
|
} else {
|
||||||
mIllustrationLottie.setAnimation(
|
mIllustrationLottie.setAnimation(
|
||||||
R.raw.fingerprint_edu_lottie_landscape_bottom_left);
|
R.raw.fingerprint_edu_lottie_landscape_bottom_left);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Surface.ROTATION_270:
|
case Surface.ROTATION_270:
|
||||||
|
if (mIsFolded) {
|
||||||
|
mIllustrationLottie.setAnimation(
|
||||||
|
R.raw.fingerprint_edu_lottie_folded_bottom_right);
|
||||||
|
} else {
|
||||||
mIllustrationLottie.setAnimation(
|
mIllustrationLottie.setAnimation(
|
||||||
R.raw.fingerprint_edu_lottie_portrait_bottom_right);
|
R.raw.fingerprint_edu_lottie_portrait_bottom_right);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
if (mIsFolded) {
|
||||||
|
mIllustrationLottie.setAnimation(
|
||||||
|
R.raw.fingerprint_edu_lottie_folded_top_right);
|
||||||
|
} else {
|
||||||
mIllustrationLottie.setAnimation(
|
mIllustrationLottie.setAnimation(
|
||||||
R.raw.fingerprint_edu_lottie_landscape_top_right);
|
R.raw.fingerprint_edu_lottie_landscape_top_right);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,6 +225,12 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
|||||||
mIllustrationLottie.playAnimation();
|
mIllustrationLottie.playAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||||
|
super.onConfigurationChanged(newConfig);
|
||||||
|
mScreenSizeFoldProvider.onConfigurationChange(newConfig);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
@@ -286,6 +324,7 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
|||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
|
mScreenSizeFoldProvider.unregisterCallback(this);
|
||||||
if (mAnimation != null) {
|
if (mAnimation != null) {
|
||||||
mAnimation.pauseAnimation();
|
mAnimation.pauseAnimation();
|
||||||
}
|
}
|
||||||
@@ -423,4 +462,10 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
|
|||||||
}
|
}
|
||||||
mOrientationEventListener = null;
|
mOrientationEventListener = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFoldUpdated(boolean isFolded) {
|
||||||
|
Log.d(TAG, "onFoldUpdated= " + isFolded);
|
||||||
|
mIsFolded = isFolded;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,7 +243,9 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateDialog() {
|
private void updateDialog() {
|
||||||
|
if (isSfps()) {
|
||||||
setRequireScreenOnToAuthVisibility();
|
setRequireScreenOnToAuthVisibility();
|
||||||
|
}
|
||||||
RenameDialog renameDialog = (RenameDialog) getFragmentManager().
|
RenameDialog renameDialog = (RenameDialog) getFragmentManager().
|
||||||
findFragmentByTag(RenameDialog.class.getName());
|
findFragmentByTag(RenameDialog.class.getName());
|
||||||
if (renameDialog != null) {
|
if (renameDialog != null) {
|
||||||
@@ -455,6 +457,15 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isSfps() {
|
||||||
|
for (FingerprintSensorPropertiesInternal prop : mSensorProperties) {
|
||||||
|
if (prop.isAnySidefpsType()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected void removeFingerprintPreference(int fingerprintId) {
|
protected void removeFingerprintPreference(int fingerprintId) {
|
||||||
String name = genKey(fingerprintId);
|
String name = genKey(fingerprintId);
|
||||||
Preference prefToRemove = findPreference(name);
|
Preference prefToRemove = findPreference(name);
|
||||||
@@ -493,6 +504,10 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
mRequireScreenOnToAuthPreferenceController.setChecked(!isChecked);
|
mRequireScreenOnToAuthPreferenceController.setChecked(!isChecked);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
mRequireScreenOnToAuthPreference.setVisible(false);
|
||||||
|
if (isSfps()) {
|
||||||
|
setRequireScreenOnToAuthVisibility();
|
||||||
|
}
|
||||||
setPreferenceScreen(root);
|
setPreferenceScreen(root);
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1681,7 +1681,10 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||||
Bitmap icon = BitmapFactory.decodeStream(avatarDataStream);
|
Bitmap decodedIcon = BitmapFactory.decodeStream(avatarDataStream);
|
||||||
|
CircleFramedDrawable drawable = CircleFramedDrawable.getInstance(context, decodedIcon);
|
||||||
|
Bitmap icon = UserIcons.convertToBitmapAtUserIconSize(context.getResources(), drawable);
|
||||||
|
|
||||||
um.setUserIcon(userId, icon);
|
um.setUserIcon(userId, icon);
|
||||||
try {
|
try {
|
||||||
avatarDataStream.close();
|
avatarDataStream.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user