Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e716ce10 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Revert "Add generateChallenge() in onResume()"

This reverts commit d59150ec.

Bug: 133498264
Bug: 133440610

Reason for revert: Fixing in a different way

Change-Id: Ie444278a9e8b8aac259c31d311757ab8a39567f4
parent 7f8a269a
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -145,11 +145,7 @@ 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);
@@ -159,7 +155,13 @@ public class FaceSettings extends DashboardFragment {
                Log.e(TAG, "Password not set");
                finish();
            }
        } else {
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        if (mToken != null) {
            mAttentionController.setToken(mToken);
            mEnrollController.setToken(mToken);
        }
@@ -194,14 +196,15 @@ public class FaceSettings extends DashboardFragment {
    }

    @Override
    public void onStop() {
        super.onStop();
        mToken = null;
    public void onDestroy() {
        super.onDestroy();
        if (getActivity().isFinishing()) {
            final int result = mFaceManager.revokeChallenge();
            if (result < 0) {
                Log.w(TAG, "revokeChallenge failed, result: " + result);
            }
        }
    }

    @Override
    protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {