Loading src/com/android/settings/biometrics/face/FaceEnroll.kt +30 −11 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.util.Log import androidx.appcompat.app.AppCompatActivity import com.android.settings.biometrics.BiometricEnrollBase.RESULT_FINISHED import com.android.settings.biometrics.combination.CombinedBiometricStatusUtils import com.android.settings.overlay.FeatureFactory.Companion.featureFactory class FaceEnroll: AppCompatActivity() { Loading @@ -39,9 +38,16 @@ class FaceEnroll: AppCompatActivity() { private val enrollActivityProvider: FaceEnrollActivityClassProvider get() = featureFactory.faceFeatureProvider.enrollActivityClassProvider private var isLaunched = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (savedInstanceState != null) { isLaunched = savedInstanceState.getBoolean(KEY_IS_LAUNCHED, isLaunched) } if (!isLaunched) { /** * Logs the next activity to be launched, creates an intent for that activity, * adds flags to forward the result, includes any existing extras from the current intent, Loading @@ -51,6 +57,14 @@ class FaceEnroll: AppCompatActivity() { val nextIntent = Intent(this, nextActivityClass) nextIntent.putExtras(intent) startActivityForResult(nextIntent, 0) isLaunched = true } } override fun onSaveInstanceState(outState: Bundle) { outState.putBoolean(KEY_IS_LAUNCHED, isLaunched) super.onSaveInstanceState(outState) } override fun onActivityResult( Loading @@ -60,6 +74,7 @@ class FaceEnroll: AppCompatActivity() { caller: ComponentCaller ) { super.onActivityResult(requestCode, resultCode, data, caller) isLaunched = false if (intent.getBooleanExtra( CombinedBiometricStatusUtils.EXTRA_LAUNCH_FROM_SAFETY_SOURCE_ISSUE, false) && resultCode != RESULT_FINISHED) { Loading @@ -68,4 +83,8 @@ class FaceEnroll: AppCompatActivity() { setResult(resultCode, data) finish() } private companion object { const val KEY_IS_LAUNCHED = "isLaunched" } } src/com/android/settings/biometrics/fingerprint/FingerprintEnroll.kt +29 −9 Original line number Diff line number Diff line Loading @@ -62,9 +62,16 @@ open class FingerprintEnroll: AppCompatActivity() { protected val enrollActivityProvider: FingerprintEnrollActivityClassProvider get() = featureFactory.fingerprintFeatureProvider.getEnrollActivityClassProvider(this) private var isLaunched = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (savedInstanceState != null) { isLaunched = savedInstanceState.getBoolean(KEY_IS_LAUNCHED, isLaunched) } if (!isLaunched) { /** * Logs the next activity to be launched, creates an intent for that activity, * adds flags to forward the result, includes any existing extras from the current intent, Loading @@ -74,6 +81,14 @@ open class FingerprintEnroll: AppCompatActivity() { val nextIntent = Intent(this, nextActivityClass) nextIntent.putExtras(intent) startActivityForResult(nextIntent, 0) isLaunched = true } } override fun onSaveInstanceState(outState: Bundle) { outState.putBoolean(KEY_IS_LAUNCHED, isLaunched) super.onSaveInstanceState(outState) } override fun onActivityResult( Loading @@ -83,6 +98,7 @@ open class FingerprintEnroll: AppCompatActivity() { caller: ComponentCaller ) { super.onActivityResult(requestCode, resultCode, data, caller) isLaunched = false if (intent.getBooleanExtra( CombinedBiometricStatusUtils.EXTRA_LAUNCH_FROM_SAFETY_SOURCE_ISSUE, false) && resultCode != BiometricEnrollBase.RESULT_FINISHED Loading @@ -92,4 +108,8 @@ open class FingerprintEnroll: AppCompatActivity() { setResult(resultCode, data) finish() } private companion object { const val KEY_IS_LAUNCHED = "isLaunched" } } No newline at end of file Loading
src/com/android/settings/biometrics/face/FaceEnroll.kt +30 −11 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.util.Log import androidx.appcompat.app.AppCompatActivity import com.android.settings.biometrics.BiometricEnrollBase.RESULT_FINISHED import com.android.settings.biometrics.combination.CombinedBiometricStatusUtils import com.android.settings.overlay.FeatureFactory.Companion.featureFactory class FaceEnroll: AppCompatActivity() { Loading @@ -39,9 +38,16 @@ class FaceEnroll: AppCompatActivity() { private val enrollActivityProvider: FaceEnrollActivityClassProvider get() = featureFactory.faceFeatureProvider.enrollActivityClassProvider private var isLaunched = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (savedInstanceState != null) { isLaunched = savedInstanceState.getBoolean(KEY_IS_LAUNCHED, isLaunched) } if (!isLaunched) { /** * Logs the next activity to be launched, creates an intent for that activity, * adds flags to forward the result, includes any existing extras from the current intent, Loading @@ -51,6 +57,14 @@ class FaceEnroll: AppCompatActivity() { val nextIntent = Intent(this, nextActivityClass) nextIntent.putExtras(intent) startActivityForResult(nextIntent, 0) isLaunched = true } } override fun onSaveInstanceState(outState: Bundle) { outState.putBoolean(KEY_IS_LAUNCHED, isLaunched) super.onSaveInstanceState(outState) } override fun onActivityResult( Loading @@ -60,6 +74,7 @@ class FaceEnroll: AppCompatActivity() { caller: ComponentCaller ) { super.onActivityResult(requestCode, resultCode, data, caller) isLaunched = false if (intent.getBooleanExtra( CombinedBiometricStatusUtils.EXTRA_LAUNCH_FROM_SAFETY_SOURCE_ISSUE, false) && resultCode != RESULT_FINISHED) { Loading @@ -68,4 +83,8 @@ class FaceEnroll: AppCompatActivity() { setResult(resultCode, data) finish() } private companion object { const val KEY_IS_LAUNCHED = "isLaunched" } }
src/com/android/settings/biometrics/fingerprint/FingerprintEnroll.kt +29 −9 Original line number Diff line number Diff line Loading @@ -62,9 +62,16 @@ open class FingerprintEnroll: AppCompatActivity() { protected val enrollActivityProvider: FingerprintEnrollActivityClassProvider get() = featureFactory.fingerprintFeatureProvider.getEnrollActivityClassProvider(this) private var isLaunched = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (savedInstanceState != null) { isLaunched = savedInstanceState.getBoolean(KEY_IS_LAUNCHED, isLaunched) } if (!isLaunched) { /** * Logs the next activity to be launched, creates an intent for that activity, * adds flags to forward the result, includes any existing extras from the current intent, Loading @@ -74,6 +81,14 @@ open class FingerprintEnroll: AppCompatActivity() { val nextIntent = Intent(this, nextActivityClass) nextIntent.putExtras(intent) startActivityForResult(nextIntent, 0) isLaunched = true } } override fun onSaveInstanceState(outState: Bundle) { outState.putBoolean(KEY_IS_LAUNCHED, isLaunched) super.onSaveInstanceState(outState) } override fun onActivityResult( Loading @@ -83,6 +98,7 @@ open class FingerprintEnroll: AppCompatActivity() { caller: ComponentCaller ) { super.onActivityResult(requestCode, resultCode, data, caller) isLaunched = false if (intent.getBooleanExtra( CombinedBiometricStatusUtils.EXTRA_LAUNCH_FROM_SAFETY_SOURCE_ISSUE, false) && resultCode != BiometricEnrollBase.RESULT_FINISHED Loading @@ -92,4 +108,8 @@ open class FingerprintEnroll: AppCompatActivity() { setResult(resultCode, data) finish() } private companion object { const val KEY_IS_LAUNCHED = "isLaunched" } } No newline at end of file