OSDN Git Service

Merge "Re-enable continue button for accessibility flow" into qt-dev
authorJoshua Mccloskey <joshmccloskey@google.com>
Mon, 13 May 2019 22:05:36 +0000 (22:05 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Mon, 13 May 2019 22:05:36 +0000 (22:05 +0000)
1  2 
src/com/android/settings/biometrics/face/FaceEnrollEducation.java

@@@ -57,7 -57,6 +57,7 @@@ public class FaceEnrollEducation extend
      private IllustrationVideoView mIllustrationNormal;
      private View mIllustrationAccessibility;
      private Handler mHandler;
 +    private Intent mResultIntent;
  
      private CompoundButton.OnCheckedChangeListener mSwitchDiversityListener =
              new CompoundButton.OnCheckedChangeListener() {
          mHandler = new Handler();
  
          mFaceManager = Utils.getFaceManagerOrNull(this);
-         final Button accessibilityButton = findViewById(R.id.accessibility_button);
-         accessibilityButton.setOnClickListener(view -> {
-             mSwitchDiversity.setChecked(true);
-             accessibilityButton.setVisibility(View.GONE);
-             mSwitchDiversity.setVisibility(View.VISIBLE);
-         });
-         mSwitchDiversity = findViewById(R.id.toggle_diversity);
-         mSwitchDiversity.setListener(mSwitchDiversityListener);
  
          mIllustrationNormal = findViewById(R.id.illustration_normal);
          mIllustrationAccessibility = findViewById(R.id.illustration_accessibility);
                  footerButton.setEnabled(true);
              }, FACE_ENROLL_EDUCATION_DELAY);
          }
+         final Button accessibilityButton = findViewById(R.id.accessibility_button);
+         accessibilityButton.setOnClickListener(view -> {
+             footerButton.setEnabled(true);
+             mSwitchDiversity.setChecked(true);
+             accessibilityButton.setVisibility(View.GONE);
+             mSwitchDiversity.setVisibility(View.VISIBLE);
+         });
+         mSwitchDiversity = findViewById(R.id.toggle_diversity);
+         mSwitchDiversity.setListener(mSwitchDiversityListener);
      }
  
      @Override
              intent.setClass(this, FaceEnrollEnrolling.class);
          }
          intent.putExtra(EXTRA_KEY_REQUIRE_DIVERSITY, !mSwitchDiversity.isChecked());
 +        if (mResultIntent != null) {
 +            intent.putExtras(mResultIntent);
 +        }
          WizardManagerHelper.copyWizardManagerExtras(getIntent(), intent);
          startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
 +        mResultIntent = data;
          if (requestCode == BIOMETRIC_FIND_SENSOR_REQUEST) {
 -            setResult(resultCode);
 -            finish();
 +            // If the user finished or skipped enrollment, finish this activity
 +            if (resultCode == RESULT_SKIP || resultCode == RESULT_FINISHED) {
 +                setResult(resultCode);
 +                finish();
 +            }
          }
      }