Loading packages/Keyguard/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -303,4 +303,7 @@ <!-- Description of airplane mode --> <string name="airplane_mode">Airplane mode</string> <!-- Fingerprint hint message when finger was not recognized.--> <string name="fingerprint_not_recognized">Not recognized</string> </resources> packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +51 −19 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private boolean mScreenOn; private SubscriptionManager mSubscriptionManager; private List<SubscriptionInfo> mSubscriptionInfo; private boolean mFingerprintDetectionRunning; private final Handler mHandler = new Handler() { @Override Loading Loading @@ -332,8 +333,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private void handleFingerprintAuthenticated(int fingerId, int groupId) { if (fingerId == 0) return; // not a valid fingerprint if (fingerId == 0) { // not a valid fingerprint handleFingerprintHelp(-1, mContext.getString(R.string.fingerprint_not_recognized)); return; } try { final int userId; try { userId = ActivityManagerNative.getDefault().getCurrentUser().id; Loading @@ -354,6 +360,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { onFingerprintAuthenticated(userId); } } } finally { setFingerprintRunningDetectionRunning(false); } } private void handleFingerprintHelp(int msgId, String helpString) { Loading @@ -366,6 +375,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private void handleFingerprintError(int msgId, String errString) { setFingerprintRunningDetectionRunning(false); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { Loading @@ -374,6 +384,21 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } private void setFingerprintRunningDetectionRunning(boolean running) { if (running != mFingerprintDetectionRunning) { mFingerprintDetectionRunning = running; notifyFingerprintRunningStateChanged(); } } private void notifyFingerprintRunningStateChanged() { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onFingerprintRunningStateChanged(mFingerprintDetectionRunning); } } } private void handleFaceUnlockStateChanged(boolean running, int userId) { mUserFaceUnlockRunning.put(userId, running); for (int i = 0; i < mCallbacks.size(); i++) { Loading @@ -388,6 +413,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { return mUserFaceUnlockRunning.get(userId); } public boolean isFingerprintDetectionRunning() { return mFingerprintDetectionRunning; } private boolean isTrustDisabled(int userId) { // Don't allow trust agent if device is secured with a SIM PIN. This is here // mainly because there's no other way to prompt the user to enter their SIM PIN Loading Loading @@ -736,13 +765,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private void startListeningForFingerprint(Context context) { if (mFpm != null && mFpm.isHardwareDetected()) { if (mFpm != null && mFpm.isHardwareDetected() && mFpm.getEnrolledFingerprints().size() > 0) { if (mFingerprintCancelSignal == null) { mFingerprintCancelSignal = new CancellationSignal(); } else { mFingerprintCancelSignal.cancel(); } mFpm.authenticate(null, mAuthenticationCallback, mFingerprintCancelSignal, 0); setFingerprintRunningDetectionRunning(true); } } Loading @@ -750,6 +781,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { if (mFingerprintCancelSignal != null) { mFingerprintCancelSignal.cancel(); } setFingerprintRunningDetectionRunning(false); } private boolean isDeviceProvisionedInSettingsDb() { Loading packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +5 −0 Original line number Diff line number Diff line Loading @@ -200,4 +200,9 @@ public class KeyguardUpdateMonitorCallback { * Called when the state of face unlock changed. */ public void onFaceUnlockStateChanged(boolean running, int userId) { } /** * Called when the fingerprint running state changed. */ public void onFingerprintRunningStateChanged(boolean running) { } } packages/SystemUI/res/drawable/ic_fingerprint.xml 0 → 100644 +36 −0 Original line number Diff line number Diff line <!-- ~ 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 --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="32.0dp" android:height="32.0dp" android:viewportWidth="32.0" android:viewportHeight="32.0"> <path android:fillColor="#80ffffff" android:pathData="M23.7,5.9c-0.1,0.0 -0.2,0.0 -0.3,-0.1C21.0,4.5 18.6,3.9 16.0,3.9c-2.5,0.0 -4.6,0.6 -6.9,1.9C8.8,6.0 8.3,5.9 8.1,5.5C7.9,5.2 8.0,4.7 8.4,4.5c2.5,-1.4 4.9,-2.1 7.7,-2.1c2.8,0.0 5.4,0.7 8.0,2.1c0.4,0.2 0.5,0.6 0.3,1.0C24.2,5.7 24.0,5.9 23.7,5.9z"/> <path android:fillColor="#80ffffff" android:pathData="M5.3,13.2c-0.1,0.0 -0.3,0.0 -0.4,-0.1c-0.3,-0.2 -0.4,-0.7 -0.2,-1.0c1.3,-1.9 2.9,-3.4 4.9,-4.5c4.1,-2.2 9.3,-2.2 13.4,0.0c1.9,1.1 3.6,2.5 4.9,4.4c0.2,0.3 0.1,0.8 -0.2,1.0c-0.3,0.2 -0.8,0.1 -1.0,-0.2c-1.2,-1.7 -2.6,-3.0 -4.3,-4.0c-3.7,-2.0 -8.3,-2.0 -12.0,0.0c-1.7,0.9 -3.2,2.3 -4.3,4.0C5.7,13.1 5.5,13.2 5.3,13.2z"/> <path android:fillColor="#80ffffff" android:pathData="M13.3,29.6c-0.2,0.0 -0.4,-0.1 -0.5,-0.2c-1.1,-1.2 -1.7,-2.0 -2.6,-3.6c-0.9,-1.7 -1.4,-3.7 -1.4,-5.9c0.0,-4.1 3.3,-7.4 7.4,-7.4c4.1,0.0 7.4,3.3 7.4,7.4c0.0,0.4 -0.3,0.7 -0.7,0.7s-0.7,-0.3 -0.7,-0.7c0.0,-3.3 -2.7,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,4.5 2.4,6.1c1.2,1.3 2.4,2.0 4.2,2.5c0.4,0.1 0.6,0.5 0.5,0.9C20.6,29.7 20.3,29.9 20.0,29.9z"/> </vector> packages/SystemUI/res/drawable/ic_fingerprint_error.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <!-- 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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="32.0dp" android:height="32.0dp" android:viewportWidth="32.0" android:viewportHeight="32.0"> <path android:fillColor="@color/system_warning_color" android:pathData="M15.99,2.5C8.53,2.5 2.5,8.54 2.5,16.0s6.03,13.5 13.49,13.5S29.5,23.46 29.5,16.0S23.45,2.5 15.99,2.5zM16.0,26.8c-5.97,0.0 -10.8,-4.83 -10.8,-10.8S10.03,5.2 16.0,5.2S26.8,10.03 26.8,16.0S21.97,26.8 16.0,26.8z"/> <path android:fillColor="@color/system_warning_color" android:pathData="M14.65,20.05l2.7,0.0l0.0,2.7l-2.7,0.0z"/> <path android:fillColor="@color/system_warning_color" android:pathData="M14.65,9.25l2.7,0.0l0.0,8.1l-2.7,0.0z"/> </vector> Loading
packages/Keyguard/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -303,4 +303,7 @@ <!-- Description of airplane mode --> <string name="airplane_mode">Airplane mode</string> <!-- Fingerprint hint message when finger was not recognized.--> <string name="fingerprint_not_recognized">Not recognized</string> </resources>
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +51 −19 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private boolean mScreenOn; private SubscriptionManager mSubscriptionManager; private List<SubscriptionInfo> mSubscriptionInfo; private boolean mFingerprintDetectionRunning; private final Handler mHandler = new Handler() { @Override Loading Loading @@ -332,8 +333,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private void handleFingerprintAuthenticated(int fingerId, int groupId) { if (fingerId == 0) return; // not a valid fingerprint if (fingerId == 0) { // not a valid fingerprint handleFingerprintHelp(-1, mContext.getString(R.string.fingerprint_not_recognized)); return; } try { final int userId; try { userId = ActivityManagerNative.getDefault().getCurrentUser().id; Loading @@ -354,6 +360,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { onFingerprintAuthenticated(userId); } } } finally { setFingerprintRunningDetectionRunning(false); } } private void handleFingerprintHelp(int msgId, String helpString) { Loading @@ -366,6 +375,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private void handleFingerprintError(int msgId, String errString) { setFingerprintRunningDetectionRunning(false); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { Loading @@ -374,6 +384,21 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } private void setFingerprintRunningDetectionRunning(boolean running) { if (running != mFingerprintDetectionRunning) { mFingerprintDetectionRunning = running; notifyFingerprintRunningStateChanged(); } } private void notifyFingerprintRunningStateChanged() { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onFingerprintRunningStateChanged(mFingerprintDetectionRunning); } } } private void handleFaceUnlockStateChanged(boolean running, int userId) { mUserFaceUnlockRunning.put(userId, running); for (int i = 0; i < mCallbacks.size(); i++) { Loading @@ -388,6 +413,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { return mUserFaceUnlockRunning.get(userId); } public boolean isFingerprintDetectionRunning() { return mFingerprintDetectionRunning; } private boolean isTrustDisabled(int userId) { // Don't allow trust agent if device is secured with a SIM PIN. This is here // mainly because there's no other way to prompt the user to enter their SIM PIN Loading Loading @@ -736,13 +765,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private void startListeningForFingerprint(Context context) { if (mFpm != null && mFpm.isHardwareDetected()) { if (mFpm != null && mFpm.isHardwareDetected() && mFpm.getEnrolledFingerprints().size() > 0) { if (mFingerprintCancelSignal == null) { mFingerprintCancelSignal = new CancellationSignal(); } else { mFingerprintCancelSignal.cancel(); } mFpm.authenticate(null, mAuthenticationCallback, mFingerprintCancelSignal, 0); setFingerprintRunningDetectionRunning(true); } } Loading @@ -750,6 +781,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { if (mFingerprintCancelSignal != null) { mFingerprintCancelSignal.cancel(); } setFingerprintRunningDetectionRunning(false); } private boolean isDeviceProvisionedInSettingsDb() { Loading
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +5 −0 Original line number Diff line number Diff line Loading @@ -200,4 +200,9 @@ public class KeyguardUpdateMonitorCallback { * Called when the state of face unlock changed. */ public void onFaceUnlockStateChanged(boolean running, int userId) { } /** * Called when the fingerprint running state changed. */ public void onFingerprintRunningStateChanged(boolean running) { } }
packages/SystemUI/res/drawable/ic_fingerprint.xml 0 → 100644 +36 −0 Original line number Diff line number Diff line <!-- ~ 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 --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="32.0dp" android:height="32.0dp" android:viewportWidth="32.0" android:viewportHeight="32.0"> <path android:fillColor="#80ffffff" android:pathData="M23.7,5.9c-0.1,0.0 -0.2,0.0 -0.3,-0.1C21.0,4.5 18.6,3.9 16.0,3.9c-2.5,0.0 -4.6,0.6 -6.9,1.9C8.8,6.0 8.3,5.9 8.1,5.5C7.9,5.2 8.0,4.7 8.4,4.5c2.5,-1.4 4.9,-2.1 7.7,-2.1c2.8,0.0 5.4,0.7 8.0,2.1c0.4,0.2 0.5,0.6 0.3,1.0C24.2,5.7 24.0,5.9 23.7,5.9z"/> <path android:fillColor="#80ffffff" android:pathData="M5.3,13.2c-0.1,0.0 -0.3,0.0 -0.4,-0.1c-0.3,-0.2 -0.4,-0.7 -0.2,-1.0c1.3,-1.9 2.9,-3.4 4.9,-4.5c4.1,-2.2 9.3,-2.2 13.4,0.0c1.9,1.1 3.6,2.5 4.9,4.4c0.2,0.3 0.1,0.8 -0.2,1.0c-0.3,0.2 -0.8,0.1 -1.0,-0.2c-1.2,-1.7 -2.6,-3.0 -4.3,-4.0c-3.7,-2.0 -8.3,-2.0 -12.0,0.0c-1.7,0.9 -3.2,2.3 -4.3,4.0C5.7,13.1 5.5,13.2 5.3,13.2z"/> <path android:fillColor="#80ffffff" android:pathData="M13.3,29.6c-0.2,0.0 -0.4,-0.1 -0.5,-0.2c-1.1,-1.2 -1.7,-2.0 -2.6,-3.6c-0.9,-1.7 -1.4,-3.7 -1.4,-5.9c0.0,-4.1 3.3,-7.4 7.4,-7.4c4.1,0.0 7.4,3.3 7.4,7.4c0.0,0.4 -0.3,0.7 -0.7,0.7s-0.7,-0.3 -0.7,-0.7c0.0,-3.3 -2.7,-5.9 -5.9,-5.9c-3.3,0.0 -5.9,2.7 -5.9,5.9c0.0,2.0 0.4,3.8 1.2,5.2c0.8,1.6 1.4,2.2 2.4,3.3c0.3,0.3 0.3,0.8 0.0,1.0C13.7,29.5 13.5,29.6 13.3,29.6z"/> <path android:fillColor="#80ffffff" android:pathData="M22.6,27.1c-1.6,0.0 -2.9,-0.4 -4.1,-1.2c-1.9,-1.4 -3.1,-3.6 -3.1,-6.0c0.0,-0.4 0.3,-0.7 0.7,-0.7s0.7,0.3 0.7,0.7c0.0,1.9 0.9,3.7 2.5,4.8c0.9,0.6 1.9,1.0 3.2,1.0c0.3,0.0 0.8,0.0 1.3,-0.1c0.4,-0.1 0.8,0.2 0.8,0.6c0.1,0.4 -0.2,0.8 -0.6,0.8C23.4,27.1 22.8,27.1 22.6,27.1z"/> <path android:fillColor="#80ffffff" android:pathData="M20.0,29.9c-0.1,0.0 -0.1,0.0 -0.2,0.0c-2.1,-0.6 -3.4,-1.4 -4.8,-2.9c-1.8,-1.9 -2.8,-4.4 -2.8,-7.1c0.0,-2.2 1.8,-4.1 4.1,-4.1c2.2,0.0 4.1,1.8 4.1,4.1c0.0,1.4 1.2,2.6 2.6,2.6c1.4,0.0 2.6,-1.2 2.6,-2.6c0.0,-5.1 -4.2,-9.3 -9.3,-9.3c-3.6,0.0 -6.9,2.1 -8.4,5.4C7.3,17.1 7.0,18.4 7.0,19.8c0.0,1.1 0.1,2.7 0.9,4.9c0.1,0.4 -0.1,0.8 -0.4,0.9c-0.4,0.1 -0.8,-0.1 -0.9,-0.4c-0.6,-1.8 -0.9,-3.6 -0.9,-5.4c0.0,-1.6 0.3,-3.1 0.9,-4.4c1.7,-3.8 5.6,-6.3 9.8,-6.3c5.9,0.0 10.7,4.8 10.7,10.7c0.0,2.2 -1.8,4.1 -4.1,4.1s-4.0,-1.8 -4.0,-4.1c0.0,-1.4 -1.2,-2.6 -2.6,-2.6c-1.4,0.0 -2.6,1.2 -2.6,2.6c0.0,2.3 0.9,4.5 2.4,6.1c1.2,1.3 2.4,2.0 4.2,2.5c0.4,0.1 0.6,0.5 0.5,0.9C20.6,29.7 20.3,29.9 20.0,29.9z"/> </vector>
packages/SystemUI/res/drawable/ic_fingerprint_error.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <!-- 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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="32.0dp" android:height="32.0dp" android:viewportWidth="32.0" android:viewportHeight="32.0"> <path android:fillColor="@color/system_warning_color" android:pathData="M15.99,2.5C8.53,2.5 2.5,8.54 2.5,16.0s6.03,13.5 13.49,13.5S29.5,23.46 29.5,16.0S23.45,2.5 15.99,2.5zM16.0,26.8c-5.97,0.0 -10.8,-4.83 -10.8,-10.8S10.03,5.2 16.0,5.2S26.8,10.03 26.8,16.0S21.97,26.8 16.0,26.8z"/> <path android:fillColor="@color/system_warning_color" android:pathData="M14.65,20.05l2.7,0.0l0.0,2.7l-2.7,0.0z"/> <path android:fillColor="@color/system_warning_color" android:pathData="M14.65,9.25l2.7,0.0l0.0,8.1l-2.7,0.0z"/> </vector>