Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-qpr-dev
diff --git a/res/values-zh-rCN/arrays.xml b/res/values-zh-rCN/arrays.xml
index 7b68493..e00210d 100644
--- a/res/values-zh-rCN/arrays.xml
+++ b/res/values-zh-rCN/arrays.xml
@@ -105,7 +105,7 @@
     <!-- no translation found for wifi_tether_security:2 (6851763638266088835) -->
     <!-- no translation found for wifi_tether_security:3 (5512131148045414341) -->
   <string-array name="eap_ocsp_type">
-    <item msgid="8568170800958331461">"不要验证"</item>
+    <item msgid="8568170800958331461">"不验证"</item>
     <item msgid="5703177653586269306">"要求证书状态(非强制)"</item>
     <item msgid="326388247868439528">"需要证书状态"</item>
   </string-array>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 29130eb..28b35b3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1628,7 +1628,11 @@
     <!-- Title for preference that guides the user to skip fingerprint setup [CHAR LIMIT=60]-->
     <string name="fingerprint_unlock_skip_fingerprint">Continue without fingerprint</string>
     <!-- Message shown in screen lock picker while setting up the new screen lock with fingerprint option. [CHAR LIMIT=NONE]-->
-    <string name="fingerprint_unlock_title">You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock.</string>
+    <string name="fingerprint_unlock_title" product="default">You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock.</string>
+    <!-- Message shown in screen lock picker while setting up the new screen lock with fingerprint option. [CHAR LIMIT=NONE]-->
+    <string name="fingerprint_unlock_title" product="tablet">You can unlock your tablet using your fingerprint. For security, this option requires a backup screen lock.</string>
+    <!-- Message shown in screen lock picker while setting up the new screen lock with fingerprint option. [CHAR LIMIT=NONE]-->
+    <string name="fingerprint_unlock_title" product="device">You can unlock your device using your fingerprint. For security, this option requires a backup screen lock.</string>
 
     <!-- Title for preference that guides the user through creating a backup unlock pattern for Face Unlock [CHAR LIMIT=45]-->
     <string name="face_unlock_set_unlock_pattern">Face Unlock + Pattern</string>
@@ -1639,7 +1643,11 @@
     <!-- Title for preference that guides the user to skip Face Unlock setup [CHAR LIMIT=60]-->
     <string name="face_unlock_skip_face">Continue without Face Unlock</string>
     <!-- Message shown in screen lock picker while setting up the new screen lock with face unlock option. [CHAR LIMIT=NONE] -->
-    <string name="face_unlock_title">You can unlock your phone using your face. For security, this option requires a backup screen lock.</string>
+    <string name="face_unlock_title" product="default">You can unlock your phone using your face. For security, this option requires a backup screen lock.</string>
+    <!-- Message shown in screen lock picker while setting up the new screen lock with face unlock option. [CHAR LIMIT=NONE] -->
+    <string name="face_unlock_title" product="tablet">You can unlock your tablet using your face. For security, this option requires a backup screen lock.</string>
+    <!-- Message shown in screen lock picker while setting up the new screen lock with face unlock option. [CHAR LIMIT=NONE] -->
+    <string name="face_unlock_title" product="device">You can unlock your device using your face. For security, this option requires a backup screen lock.</string>
 
     <!-- Title for preference that guides the user through creating a backup unlock pattern for biometrics unlock [CHAR LIMIT=45]-->
     <string name="biometrics_unlock_set_unlock_pattern">Pattern \u2022 Face \u2022 Fingerprint</string>
@@ -1650,7 +1658,11 @@
     <!-- Title for preference that guides the user to skip face unlock setup [CHAR LIMIT=60]-->
     <string name="biometrics_unlock_skip_biometrics">Continue without face or fingerprint</string>
     <!-- Message shown in screen lock picker while setting up the new screen lock with biometrics option. [CHAR LIMIT=NONE] -->
-    <string name="biometrics_unlock_title">You can unlock your phone using your face or fingerprint. For security, this option requires a backup screen lock.</string>
+    <string name="biometrics_unlock_title" product="default">You can unlock your phone using your face or fingerprint. For security, this option requires a backup screen lock.</string>
+    <!-- Message shown in screen lock picker while setting up the new screen lock with biometrics option. [CHAR LIMIT=NONE] -->
+    <string name="biometrics_unlock_title" product="tablet">You can unlock your tablet using your face or fingerprint. For security, this option requires a backup screen lock.</string>
+    <!-- Message shown in screen lock picker while setting up the new screen lock with biometrics option. [CHAR LIMIT=NONE] -->
+    <string name="biometrics_unlock_title" product="device">You can unlock your device using your face or fingerprint. For security, this option requires a backup screen lock.</string>
 
     <!-- Summary for preference that has been disabled by because of the DevicePolicyAdmin, or because device encryption is enabled, or because there are credentials in the credential storage [CHAR LIMIT=50] -->
     <string name="unlock_set_unlock_disabled_summary">Disabled by admin, encryption policy, or
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java
index 778ee5c..89bda20 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java
@@ -73,6 +73,7 @@
     private int mPreviousRotation = 0;
     private ScreenSizeFoldProvider mScreenSizeFoldProvider;
     private boolean mIsFolded;
+    private boolean mIsReverseDefaultRotation;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -120,6 +121,8 @@
         } else if (mCanAssumeSfps) {
             setHeaderText(R.string.security_settings_sfps_enroll_find_sensor_title);
             setDescriptionText(R.string.security_settings_sfps_enroll_find_sensor_message);
+            mIsReverseDefaultRotation = getApplicationContext().getResources().getBoolean(
+                    com.android.internal.R.bool.config_reverseDefaultRotation);
         } else {
             setHeaderText(R.string.security_settings_fingerprint_enroll_find_sensor_title);
             setDescriptionText(R.string.security_settings_fingerprint_enroll_find_sensor_message);
@@ -175,11 +178,20 @@
         }
     }
 
+    private int getRotationFromDefault(int rotation) {
+        if (mIsReverseDefaultRotation) {
+            return (rotation + 1) % 4;
+        } else {
+            return rotation;
+        }
+    }
+
     private void updateSfpsFindSensorAnimationAsset() {
         mScreenSizeFoldProvider
                 .onConfigurationChange(getApplicationContext().getResources().getConfiguration());
         mIllustrationLottie = findViewById(R.id.illustration_lottie);
-        final int rotation = getApplicationContext().getDisplay().getRotation();
+        final int rotation = getRotationFromDefault(
+                getApplicationContext().getDisplay().getRotation());
 
         switch (rotation) {
             case Surface.ROTATION_90:
@@ -441,7 +453,7 @@
         mOrientationEventListener = new OrientationEventListener(this) {
             @Override
             public void onOrientationChanged(int orientation) {
-                final int currentRotation = getDisplay().getRotation();
+                final int currentRotation = getRotationFromDefault(getDisplay().getRotation());
                 if ((currentRotation + 2) % 4 == mPreviousRotation) {
                     mPreviousRotation = currentRotation;
                     recreate();
@@ -449,7 +461,7 @@
             }
         };
         mOrientationEventListener.enable();
-        mPreviousRotation = getDisplay().getRotation();
+        mPreviousRotation = getRotationFromDefault(getDisplay().getRotation());
     }
 
     private void stopListenOrientationEvent() {