From 1de9533eda26dec0b005c1c268689e651e648df5 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sun, 11 Jun 2023 14:08:36 +0900 Subject: [PATCH 1/2] ParanoidSystemUI: Expose legacy Wi-Fi and cellular data QS tiles We'll still use Android 12's unified internet settings and the Internet tile by default, but expose the legacy Wi-Fi and cellular data tiles so that users can add them with the QS customizer. Change-Id: I65902b38c99f61782bd9aa0ea604848fbd068bda Signed-off-by: Omkar Chandorkar --- res/values/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/values/config.xml b/res/values/config.xml index 72e54ca..692ce5e 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -8,7 +8,7 @@ - internet,bt,flashlight,dnd,alarm,airplane,nfc,controls,wallet,rotation,battery,cast,screenrecord,mictoggle,cameratoggle,location,hotspot,inversion,saver,dark,work,night,reverse,reduce_brightness,qr_code_scanner,onehanded,color_correction,dream,caffeine,dataswitch,heads_up,dc_dimming,aod,powershare + internet,wifi,cell,bt,flashlight,dnd,alarm,airplane,nfc,controls,wallet,rotation,battery,cast,screenrecord,mictoggle,cameratoggle,location,hotspot,inversion,saver,dark,work,night,reverse,reduce_brightness,qr_code_scanner,onehanded,color_correction,dream,caffeine,dataswitch,heads_up,dc_dimming,aod,powershare From 4d7c453da7fae7916f94e1a3c7fb27d1617142c1 Mon Sep 17 00:00:00 2001 From: Adithya R Date: Sat, 8 Jul 2023 21:34:44 -0400 Subject: [PATCH 2/2] ParanoidSystemUI: Add FingerprintInteractiveToAuthProvider implementation This is required for the "touch to unlock anytime" setting on devices with side mounted fingerprint sensor. Ref: 66a048d646fd816e7757e300c62fa5cebf04761d Change-Id: If3308860a428d9966f2b0a0024764df95f8f9a8b --- ...ingerprintInteractiveToAuthProviderImpl.kt | 41 +++++++++++++++++++ .../dagger/ParanoidSystemUIModule.java | 5 +++ 2 files changed, 46 insertions(+) create mode 100644 src/co/aospa/systemui/biometrics/FingerprintInteractiveToAuthProviderImpl.kt diff --git a/src/co/aospa/systemui/biometrics/FingerprintInteractiveToAuthProviderImpl.kt b/src/co/aospa/systemui/biometrics/FingerprintInteractiveToAuthProviderImpl.kt new file mode 100644 index 0000000..b5a787c --- /dev/null +++ b/src/co/aospa/systemui/biometrics/FingerprintInteractiveToAuthProviderImpl.kt @@ -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 + } +} diff --git a/src/co/aospa/systemui/dagger/ParanoidSystemUIModule.java b/src/co/aospa/systemui/dagger/ParanoidSystemUIModule.java index 13d229d..a6a5f48 100644 --- a/src/co/aospa/systemui/dagger/ParanoidSystemUIModule.java +++ b/src/co/aospa/systemui/dagger/ParanoidSystemUIModule.java @@ -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); }