Removed flag from environment

This flag should never have been there in the first place. The
environment is essentially a library, and the features that are built on
top of this library should be gaurded by flags.

Flag: EXEMPT not needed
Fixes: 369161783
Test: Manual
Change-Id: Id165bec98bd5f2669ccfde51e4755e47e5e88e06
This commit is contained in:
Joshua McCloskey
2024-09-23 17:36:16 +00:00
committed by Joshua Mccloskey
parent 17476190b7
commit 407e3c9e2f

View File

@@ -24,6 +24,7 @@ import android.hardware.fingerprint.FingerprintManager;
import android.net.Uri;
import android.provider.Settings;
import android.util.FeatureFlagUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -58,8 +59,9 @@ import java.util.List;
)
public class SettingsApplication extends Application {
private static final String TAG = "SettingsApplication";
private WeakReference<SettingsHomepageActivity> mHomeActivity = new WeakReference<>(null);
@Nullable private BiometricsEnvironment mBiometricsEnvironment;
@Nullable volatile private BiometricsEnvironment mBiometricsEnvironment;
@Override
protected void attachBaseContext(Context base) {
@@ -138,20 +140,23 @@ public class SettingsApplication extends Application {
@Nullable
public BiometricsEnvironment getBiometricEnvironment() {
if (Flags.fingerprintV2Enrollment()) {
if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
BiometricsEnvironment localEnvironment = mBiometricsEnvironment;
if (localEnvironment == null) {
synchronized (this) {
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
return null;
}
final FingerprintManager fpm = getSystemService(FingerprintManager.class);
if (mBiometricsEnvironment == null) {
mBiometricsEnvironment = new BiometricsEnvironment(this, fpm);
}
return mBiometricsEnvironment;
localEnvironment = mBiometricsEnvironment;
if (fpm != null && localEnvironment == null) {
mBiometricsEnvironment = localEnvironment = new BiometricsEnvironment(this,
fpm);
} else {
return null;
Log.e(TAG, "Error when creating environment, fingerprint manager was null");
}
}
return null;
}
return localEnvironment;
}
@Override