OSDN Git Service

[Fingerprint] Add fingerprint text in setup flow
authorMaurice Lam <yukl@google.com>
Wed, 1 Apr 2015 21:20:16 +0000 (14:20 -0700)
committerMaurice Lam <yukl@google.com>
Mon, 6 Apr 2015 17:09:59 +0000 (10:09 -0700)
When running in Setup Wizard, the screen to choose screen lock will
have an additional footer, telling the user that they can configure
fingerprint in Settings after completing the setup flow.

Bug: 19690335
Change-Id: Ie6268fb8738e6bbac8751d12b05c82092fe6193b

res/layout/setup_screen_lock_fingerprint_details.xml [new file with mode: 0644]
res/values/strings.xml
src/com/android/settings/SetupChooseLockGeneric.java

diff --git a/res/layout/setup_screen_lock_fingerprint_details.xml b/res/layout/setup_screen_lock_fingerprint_details.xml
new file mode 100644 (file)
index 0000000..988468f
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2015 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.
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:paddingTop="6dip"
+    android:paddingBottom="6dip"
+    android:paddingStart="@dimen/setup_wizard_margin_sides"
+    android:paddingEnd="@dimen/setup_wizard_margin_sides"
+    android:text="@string/unlock_setup_wizard_fingerprint_details" />
index 2c28beb..a7d5bd4 100644 (file)
     <!-- Summary for "Configure lockscreen" when security password is enabled [CHAR LIMIT=45] -->
     <string name="unlock_set_unlock_mode_password">Password</string>
 
+    <!-- Footer text in when choosing screen lock type during setup wizard, telling the user that
+         they can add fingerprint after they complete setup wizard. The text "Settings > Security"
+         should match settings_label and security_settings_title [CHAR LIMIT=NONE] -->
+    <string name="unlock_setup_wizard_fingerprint_details">Once you\'ve set up a screen lock, you can also set up your fingerprint in Settings &gt; Security.</string>
+
     <!-- Title for option to turn of password/pin/pattern unlock. [CHAR LIMIT=22] -->
     <string name="unlock_disable_lock_title">Turn off screen lock</string>
 
index 10bac15..a631caf 100644 (file)
@@ -24,6 +24,7 @@ import android.content.Intent;
 import android.content.res.Resources;
 import android.os.Bundle;
 import android.preference.PreferenceFragment;
+import android.hardware.fingerprint.FingerprintManager;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -82,6 +83,13 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric
                 final View header = inflater.inflate(R.layout.setup_wizard_header, list, false);
                 list.addHeaderView(header, null, false);
             }
+            final FingerprintManager fpm = (FingerprintManager)
+                    getActivity().getSystemService(Context.FINGERPRINT_SERVICE);
+            if (fpm != null && fpm.isHardwareDetected()) {
+                final View footer = inflater.inflate(
+                        R.layout.setup_screen_lock_fingerprint_details, list, false);
+                list.addFooterView(footer, null, false);
+            }
             return view;
         }