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.app.admin.DevicePolicyManager;
20 import android.content.Intent;
21 import android.os.Bundle;
22 import android.os.UserHandle;
23 import android.view.View;
25 import com.android.settings.ChooseLockSettingsHelper;
26 import com.android.settings.HelpUtils;
27 import com.android.settings.R;
30 * Onboarding activity for fingerprint enrollment.
32 public class FingerprintEnrollIntroduction extends FingerprintEnrollBase {
34 private boolean mHasPassword;
37 protected void onCreate(Bundle savedInstanceState) {
38 super.onCreate(savedInstanceState);
39 setContentView(R.layout.fingerprint_enroll_introduction);
40 setHeaderText(R.string.security_settings_fingerprint_enroll_introduction_title);
41 findViewById(R.id.cancel_button).setOnClickListener(this);
42 findViewById(R.id.learn_more_button).setOnClickListener(this);
43 final double passwordQuality = new ChooseLockSettingsHelper(this).utils()
44 .getActivePasswordQuality(UserHandle.myUserId());
45 mHasPassword = passwordQuality != DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
49 protected void onNextButtonClick() {
50 Intent intent = new Intent();
53 // No fingerprints registered, launch into enrollment wizard.
54 clazz = FingerprintEnrollOnboard.class.getName();
56 // Lock thingy is already set up, launch directly into find sensor step from wizard.
57 clazz = FingerprintEnrollFindSensor.class.getName();
59 intent.setClassName("com.android.settings", clazz);
60 startActivityForResult(intent, 0);
64 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
65 if (resultCode == RESULT_FINISHED) {
68 super.onActivityResult(requestCode, resultCode, data);
73 public void onClick(View v) {
74 if (v.getId() == R.id.cancel_button) {
77 if (v.getId() == R.id.learn_more_button) {
78 launchFingerprintHelp();
83 private void launchFingerprintHelp() {
84 Intent helpIntent = HelpUtils.getHelpIntent(this,
85 getString(R.string.help_url_fingerprint), getClass().getName());
86 startActivity(helpIntent);