Merge branch 'AOSPA:topaz' into qpr3

This commit is contained in:
fazilsheik96 2023-09-17 10:36:12 +05:30 committed by GitHub
commit cd65d278bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2023 ArrowOS
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package co.aospa.systemui.biometrics
import android.content.Context
import android.provider.Settings
import com.android.systemui.biometrics.FingerprintInteractiveToAuthProvider
import javax.inject.Inject
class FingerprintInteractiveToAuthProviderImpl @Inject constructor(private val context: Context) : FingerprintInteractiveToAuthProvider {
private val defaultValue = if (context.getResources().getBoolean(
com.android.internal.R.bool.config_performantAuthDefault)) 1 else 0
override fun isEnabled(userId: Int): Boolean {
var value = Settings.Secure.getIntForUser(context.contentResolver,
Settings.Secure.SFPS_PERFORMANT_AUTH_ENABLED, -1, userId)
if (value == -1) {
value = defaultValue
Settings.Secure.putIntForUser(context.contentResolver,
Settings.Secure.SFPS_PERFORMANT_AUTH_ENABLED, value, userId)
}
return value == 0
}
}

View File

@ -27,6 +27,7 @@ import android.os.Handler;
import com.android.internal.logging.UiEventLogger;
import com.android.keyguard.KeyguardViewController;
import com.android.systemui.battery.BatterySaverModule;
import com.android.systemui.biometrics.FingerprintInteractiveToAuthProvider;
import com.android.systemui.controls.controller.ControlsTileResourceConfiguration;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
@ -73,6 +74,7 @@ import com.android.systemui.statusbar.policy.SensorPrivacyControllerImpl;
import javax.inject.Named;
import co.aospa.systemui.biometrics.FingerprintInteractiveToAuthProviderImpl;
import co.aospa.systemui.controls.AospaControlsTileResourceConfigurationImpl;
import co.aospa.systemui.qs.tileimpl.ParanoidQSFactoryImpl;
import co.aospa.systemui.qs.tileimpl.ParanoidQSModule;
@ -208,4 +210,7 @@ public abstract class ParanoidSystemUIModule {
@Binds
abstract ControlsTileResourceConfiguration bindControlsTileResourceConfiguration(AospaControlsTileResourceConfigurationImpl configuration);
@Binds
abstract FingerprintInteractiveToAuthProvider bindFingerprintInteractiveToAuthProviderImpl(FingerprintInteractiveToAuthProviderImpl impl);
}