Add generateChallenge() in onResume()
Fixes: 133498264
Fixes: 133440610
Test: open FaceSettings from Settings with and without an enrolled face
Test: open FaceSettings from the notification that asks to re-enroll
Change-Id: I80ca7644f96a538614962232fb3951d1a91d87c7
(cherry picked from commit d59150eca6
)
This commit is contained in:
committed by
android-build-team Robot
parent
4bcd858aa8
commit
7e8cb7bed9
@@ -145,7 +145,11 @@ public class FaceSettings extends DashboardFragment {
|
||||
if (savedInstanceState != null) {
|
||||
mToken = savedInstanceState.getByteArray(KEY_TOKEN);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (mToken == null) {
|
||||
final long challenge = mFaceManager.generateChallenge();
|
||||
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
|
||||
@@ -155,13 +159,7 @@ public class FaceSettings extends DashboardFragment {
|
||||
Log.e(TAG, "Password not set");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (mToken != null) {
|
||||
} else {
|
||||
mAttentionController.setToken(mToken);
|
||||
mEnrollController.setToken(mToken);
|
||||
}
|
||||
@@ -196,15 +194,14 @@ public class FaceSettings extends DashboardFragment {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (getActivity().isFinishing()) {
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
mToken = null;
|
||||
final int result = mFaceManager.revokeChallenge();
|
||||
if (result < 0) {
|
||||
Log.w(TAG, "revokeChallenge failed, result: " + result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
||||
|
Reference in New Issue
Block a user