2 * Copyright (C) 2015 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
17 package com.android.settings.fingerprint;
19 import android.content.Intent;
20 import android.content.res.Resources;
21 import android.os.UserHandle;
22 import android.widget.Button;
23 import android.widget.TextView;
25 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
26 import com.android.internal.widget.LockPatternUtils;
27 import com.android.settings.R;
28 import com.android.settings.SetupChooseLockGeneric;
29 import com.android.settings.SetupWizardUtils;
31 public class SetupFingerprintEnrollIntroduction extends FingerprintEnrollIntroduction {
34 protected Intent getChooseLockIntent() {
35 Intent intent = new Intent(this, SetupChooseLockGeneric.class);
36 SetupWizardUtils.copySetupExtras(getIntent(), intent);
41 protected Intent getFindSensorIntent() {
42 final Intent intent = new Intent(this, SetupFingerprintEnrollFindSensor.class);
43 SetupWizardUtils.copySetupExtras(getIntent(), intent);
48 protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
49 resid = SetupWizardUtils.getTheme(getIntent());
50 super.onApplyThemeResource(theme, resid, first);
54 protected void initViews() {
57 TextView description = (TextView) findViewById(R.id.description_text);
59 R.string.security_settings_fingerprint_enroll_introduction_message_setup);
61 Button nextButton = getNextButton();
63 R.string.security_settings_fingerprint_enroll_introduction_continue_setup);
65 final Button cancelButton = (Button) findViewById(R.id.fingerprint_cancel_button);
67 R.string.security_settings_fingerprint_enroll_introduction_cancel_setup);
71 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
72 if (requestCode == FINGERPRINT_FIND_SENSOR_REQUEST) {
76 LockPatternUtils lockPatternUtils = new LockPatternUtils(this);
77 data.putExtra(SetupChooseLockGeneric.
78 SetupChooseLockGenericFragment.EXTRA_PASSWORD_QUALITY,
79 lockPatternUtils.getKeyguardStoredPasswordQuality(UserHandle.myUserId()));
81 super.onActivityResult(requestCode, resultCode, data);
85 protected void onCancelButtonClick() {
86 SetupSkipDialog dialog = SetupSkipDialog.newInstance(
87 getIntent().getBooleanExtra(SetupSkipDialog.EXTRA_FRP_SUPPORTED, false));
88 dialog.show(getFragmentManager());
92 public int getMetricsCategory() {
93 return MetricsEvent.FINGERPRINT_ENROLL_INTRO_SETUP;