Partial revert of ag/10482633
SUW is using activity result codes already. Let's stick with the old behavior until/if there's a way to make it work nicely. Fixes: 151058692 Test: Skip fingerprint in SUW. Fingerprint not shown again in SUW. Change-Id: I3c52cddd568dc5ded6bf810272ffb77f0841c692
This commit is contained in:
@@ -47,7 +47,6 @@ import com.google.android.setupcompat.util.WizardManagerHelper;
|
|||||||
public class BiometricEnrollActivity extends InstrumentedActivity {
|
public class BiometricEnrollActivity extends InstrumentedActivity {
|
||||||
|
|
||||||
private static final String TAG = "BiometricEnrollActivity";
|
private static final String TAG = "BiometricEnrollActivity";
|
||||||
private static final int REQUEST_ENROLL = 1;
|
|
||||||
|
|
||||||
public static final String EXTRA_SKIP_INTRO = "skip_intro";
|
public static final String EXTRA_SKIP_INTRO = "skip_intro";
|
||||||
|
|
||||||
@@ -72,7 +71,6 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
|||||||
if (result == BiometricManager.BIOMETRIC_SUCCESS
|
if (result == BiometricManager.BIOMETRIC_SUCCESS
|
||||||
|| result == BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE) {
|
|| result == BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE) {
|
||||||
Log.e(TAG, "Unexpected result: " + result);
|
Log.e(TAG, "Unexpected result: " + result);
|
||||||
setResult(RESULT_CANCELED);
|
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -96,6 +94,8 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
|
||||||
|
|
||||||
if (this instanceof InternalActivity) {
|
if (this instanceof InternalActivity) {
|
||||||
// Propagate challenge and user Id from ChooseLockGeneric.
|
// Propagate challenge and user Id from ChooseLockGeneric.
|
||||||
final byte[] token = getIntent()
|
final byte[] token = getIntent()
|
||||||
@@ -107,18 +107,10 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
|||||||
intent.putExtra(Intent.EXTRA_USER_ID, userId);
|
intent.putExtra(Intent.EXTRA_USER_ID, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
startActivityForResult(intent, REQUEST_ENROLL);
|
startActivity(intent);
|
||||||
} else {
|
|
||||||
Log.e(TAG, "Intent was null, finishing with RESULT_CANCELED");
|
|
||||||
setResult(RESULT_CANCELED);
|
|
||||||
finish();
|
finish();
|
||||||
}
|
} else {
|
||||||
}
|
Log.e(TAG, "Intent was null, finishing");
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
||||||
if (requestCode == REQUEST_ENROLL) {
|
|
||||||
setResult(RESULT_OK);
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user