Loading packages/SystemUI/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,9 @@ filegroup { srcs: [ /* Status bar fakes */ "tests/src/com/android/systemui/statusbar/pipeline/airplane/data/repository/FakeAirplaneModeRepository.kt", "tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionRepository.kt", "tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionsRepository.kt", "tests/src/com/android/systemui/statusbar/pipeline/mobile/util/FakeMobileMappingsProxy.kt", "tests/src/com/android/systemui/statusbar/pipeline/shared/data/repository/FakeConnectivityRepository.kt", "tests/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/FakeWifiRepository.kt", Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepository.kt +13 −8 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.os.UserHandle import android.util.Log import com.android.internal.widget.LockPatternUtils import com.android.systemui.Dumpable import com.android.systemui.res.R import com.android.systemui.biometrics.AuthController import com.android.systemui.biometrics.data.repository.FacePropertyRepository import com.android.systemui.biometrics.data.repository.FingerprintPropertyRepository Loading @@ -40,6 +39,8 @@ import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.shared.model.AuthenticationFlags import com.android.systemui.keyguard.shared.model.DevicePosture import com.android.systemui.res.R import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionsRepository import com.android.systemui.user.data.repository.UserRepository import java.io.PrintWriter import javax.inject.Inject Loading Loading @@ -133,6 +134,7 @@ constructor( devicePostureRepository: DevicePostureRepository, facePropertyRepository: FacePropertyRepository, fingerprintPropertyRepository: FingerprintPropertyRepository, mobileConnectionsRepository: MobileConnectionsRepository, dumpManager: DumpManager, ) : BiometricSettingsRepository, Dumpable { Loading Loading @@ -346,11 +348,12 @@ constructor( .and(isFingerprintBiometricAllowed) .stateIn(scope, SharingStarted.Eagerly, false) override val isFaceAuthEnrolledAndEnabled: Flow<Boolean> get() = isFaceAuthenticationEnabled.and(isFaceEnrolled) override val isFaceAuthEnrolledAndEnabled: Flow<Boolean> = isFaceAuthenticationEnabled .and(isFaceEnrolled) .and(mobileConnectionsRepository.isAnySimSecure.isFalse()) override val isFaceAuthCurrentlyAllowed: Flow<Boolean> get() = override val isFaceAuthCurrentlyAllowed: Flow<Boolean> = isFaceAuthEnrolledAndEnabled .and(isFaceBiometricsAllowed) .and(isFaceAuthSupportedInCurrentPosture) Loading Loading @@ -426,3 +429,5 @@ private fun DevicePolicyManager.isNotActive(userId: Int, policy: Int): Boolean = private fun Flow<Boolean>.and(anotherFlow: Flow<Boolean>): Flow<Boolean> = this.combine(anotherFlow) { a, b -> a && b } private fun Flow<Boolean>.isFalse(): Flow<Boolean> = this.map { !it } packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/MobileInputLogger.kt +4 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,10 @@ constructor( } ) } fun logOnSimStateChanged() { buffer.log(TAG, LogLevel.INFO, "onSimStateChanged") } } private const val TAG = "MobileInputLog" packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionsRepository.kt +8 −0 Original line number Diff line number Diff line Loading @@ -90,4 +90,12 @@ interface MobileConnectionsRepository { /** Fallback [MobileIconGroup] in the case where there is no icon in the mapping */ val defaultMobileIconGroup: Flow<MobileIconGroup> /** * If any active SIM on the device is in * [android.telephony.TelephonyManager.SIM_STATE_PIN_REQUIRED] or * [android.telephony.TelephonyManager.SIM_STATE_PUK_REQUIRED] or * [android.telephony.TelephonyManager.SIM_STATE_PERM_DISABLED] */ val isAnySimSecure: Flow<Boolean> } packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcher.kt +2 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,8 @@ constructor( override val defaultMobileIconGroup: Flow<SignalIcon.MobileIconGroup> = activeRepo.flatMapLatest { it.defaultMobileIconGroup } override val isAnySimSecure: Flow<Boolean> = activeRepo.flatMapLatest { it.isAnySimSecure } override val defaultDataSubId: StateFlow<Int> = activeRepo .flatMapLatest { it.defaultDataSubId } Loading Loading
packages/SystemUI/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,9 @@ filegroup { srcs: [ /* Status bar fakes */ "tests/src/com/android/systemui/statusbar/pipeline/airplane/data/repository/FakeAirplaneModeRepository.kt", "tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionRepository.kt", "tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionsRepository.kt", "tests/src/com/android/systemui/statusbar/pipeline/mobile/util/FakeMobileMappingsProxy.kt", "tests/src/com/android/systemui/statusbar/pipeline/shared/data/repository/FakeConnectivityRepository.kt", "tests/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/FakeWifiRepository.kt", Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepository.kt +13 −8 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.os.UserHandle import android.util.Log import com.android.internal.widget.LockPatternUtils import com.android.systemui.Dumpable import com.android.systemui.res.R import com.android.systemui.biometrics.AuthController import com.android.systemui.biometrics.data.repository.FacePropertyRepository import com.android.systemui.biometrics.data.repository.FingerprintPropertyRepository Loading @@ -40,6 +39,8 @@ import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.shared.model.AuthenticationFlags import com.android.systemui.keyguard.shared.model.DevicePosture import com.android.systemui.res.R import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionsRepository import com.android.systemui.user.data.repository.UserRepository import java.io.PrintWriter import javax.inject.Inject Loading Loading @@ -133,6 +134,7 @@ constructor( devicePostureRepository: DevicePostureRepository, facePropertyRepository: FacePropertyRepository, fingerprintPropertyRepository: FingerprintPropertyRepository, mobileConnectionsRepository: MobileConnectionsRepository, dumpManager: DumpManager, ) : BiometricSettingsRepository, Dumpable { Loading Loading @@ -346,11 +348,12 @@ constructor( .and(isFingerprintBiometricAllowed) .stateIn(scope, SharingStarted.Eagerly, false) override val isFaceAuthEnrolledAndEnabled: Flow<Boolean> get() = isFaceAuthenticationEnabled.and(isFaceEnrolled) override val isFaceAuthEnrolledAndEnabled: Flow<Boolean> = isFaceAuthenticationEnabled .and(isFaceEnrolled) .and(mobileConnectionsRepository.isAnySimSecure.isFalse()) override val isFaceAuthCurrentlyAllowed: Flow<Boolean> get() = override val isFaceAuthCurrentlyAllowed: Flow<Boolean> = isFaceAuthEnrolledAndEnabled .and(isFaceBiometricsAllowed) .and(isFaceAuthSupportedInCurrentPosture) Loading Loading @@ -426,3 +429,5 @@ private fun DevicePolicyManager.isNotActive(userId: Int, policy: Int): Boolean = private fun Flow<Boolean>.and(anotherFlow: Flow<Boolean>): Flow<Boolean> = this.combine(anotherFlow) { a, b -> a && b } private fun Flow<Boolean>.isFalse(): Flow<Boolean> = this.map { !it }
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/MobileInputLogger.kt +4 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,10 @@ constructor( } ) } fun logOnSimStateChanged() { buffer.log(TAG, LogLevel.INFO, "onSimStateChanged") } } private const val TAG = "MobileInputLog"
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionsRepository.kt +8 −0 Original line number Diff line number Diff line Loading @@ -90,4 +90,12 @@ interface MobileConnectionsRepository { /** Fallback [MobileIconGroup] in the case where there is no icon in the mapping */ val defaultMobileIconGroup: Flow<MobileIconGroup> /** * If any active SIM on the device is in * [android.telephony.TelephonyManager.SIM_STATE_PIN_REQUIRED] or * [android.telephony.TelephonyManager.SIM_STATE_PUK_REQUIRED] or * [android.telephony.TelephonyManager.SIM_STATE_PERM_DISABLED] */ val isAnySimSecure: Flow<Boolean> }
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcher.kt +2 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,8 @@ constructor( override val defaultMobileIconGroup: Flow<SignalIcon.MobileIconGroup> = activeRepo.flatMapLatest { it.defaultMobileIconGroup } override val isAnySimSecure: Flow<Boolean> = activeRepo.flatMapLatest { it.isAnySimSecure } override val defaultDataSubId: StateFlow<Int> = activeRepo .flatMapLatest { it.defaultDataSubId } Loading