summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2016-06-23 11:21:45 -0700
committerd34d <clark@cyngn.com>2016-06-30 10:04:31 -0700
commite40a0c583c91fc2175a1813d5ed42ee2a3ce93ef (patch)
treea3806008390dffb5835bfa1b33e06fd3e4deadab /src/com/android
parent58cdd7495b6cdd5c67947e978189749d81f4a11f (diff)
downloadpackages_apps_Settings-e40a0c583c91fc2175a1813d5ed42ee2a3ce93ef.zip
packages_apps_Settings-e40a0c583c91fc2175a1813d5ed42ee2a3ce93ef.tar.gz
packages_apps_Settings-e40a0c583c91fc2175a1813d5ed42ee2a3ce93ef.tar.bz2
fingerpint: Allow devices to configure sensor location
The text for enrolling a fingerprint always assumes the sensor is located on the back. This patch adds a config integer that defines where the sensor is located on the device. 0 = back 1 = front 2 = left side 3 = right side This patch also adds a new drawable that shows the front of the device when applicable. Change-Id: Ia8f5f8ff4ba4d13d35aed3052f60ff665dd4f294 TICKET: CYNGNOS-3089
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java b/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java
index 63d9335..df3646e 100644
--- a/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java
+++ b/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java
@@ -19,6 +19,8 @@ package com.android.settings.fingerprint;
import android.content.Intent;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
import com.android.internal.logging.MetricsLogger;
import com.android.settings.ChooseLockSettingsHelper;
@@ -31,6 +33,10 @@ public class FingerprintEnrollFindSensor extends FingerprintEnrollBase {
private static final int CONFIRM_REQUEST = 1;
private static final int ENROLLING = 2;
+ private static final int SENSOR_LOCATION_BACK = 0;
+ private static final int SENSOR_LOCATION_FRONT = 1;
+ private static final int SENSOR_LOCATION_LEFT = 2;
+ private static final int SENSOR_LOCATION_RIGHT = 3;
public static final String EXTRA_KEY_LAUNCHED_CONFIRM = "launched_confirm_lock";
private FingerprintLocationAnimationView mAnimation;
@@ -48,6 +54,21 @@ public class FingerprintEnrollFindSensor extends FingerprintEnrollBase {
}
mAnimation = (FingerprintLocationAnimationView) findViewById(
R.id.fingerprint_sensor_location_animation);
+
+ int sensorLocation = getResources().getInteger(R.integer.config_fingerprintSensorLocation);
+ if (sensorLocation < SENSOR_LOCATION_BACK || sensorLocation > SENSOR_LOCATION_RIGHT) {
+ sensorLocation = SENSOR_LOCATION_BACK;
+ }
+ final String location = getResources().getStringArray(
+ R.array.security_settings_fingerprint_sensor_locations)[sensorLocation];
+ TextView message = (TextView) findViewById(R.id.find_sensor_message);
+ message.setText(getString(
+ R.string.security_settings_fingerprint_enroll_find_sensor_message_cm,
+ location));
+ if (sensorLocation != SENSOR_LOCATION_BACK) {
+ findViewById(R.id.fingerprint_sensor_location_front_overlay)
+ .setVisibility(View.VISIBLE);
+ }
}
@Override