From 35e05765ec2ed9b3f71ef3ff3bf4996ec8ea0c5e Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sun, 28 Dec 2025 22:49:08 +0100 Subject: [PATCH 001/723] SystemUI: Bring back good ol' circle battery style once again Change-Id: I0357c8d71f15f71d86bf0e4fab8b7f4487e6efb3 --- .../ui/view/BatteryStatusEventComposeChip.kt | 5 + .../data/repository/BatteryRepository.kt | 80 +++++++- .../domain/interactor/BatteryInteractor.kt | 3 + .../battery/ui/composable/UnifiedBattery.kt | 183 +++++++++++++++--- .../battery/ui/viewmodel/BatteryViewModel.kt | 15 ++ 5 files changed, 260 insertions(+), 26 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/events/ui/view/BatteryStatusEventComposeChip.kt b/packages/SystemUI/src/com/android/systemui/statusbar/events/ui/view/BatteryStatusEventComposeChip.kt index 5b04ec64910b..bb2255a69364 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/events/ui/view/BatteryStatusEventComposeChip.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/events/ui/view/BatteryStatusEventComposeChip.kt @@ -41,6 +41,7 @@ import com.android.systemui.res.R import com.android.systemui.statusbar.core.NewStatusBarIcons import com.android.systemui.statusbar.core.RudimentaryBattery import com.android.systemui.statusbar.events.BackgroundAnimatableView +import com.android.systemui.statusbar.pipeline.battery.data.repository.BatteryRepository import com.android.systemui.statusbar.pipeline.battery.domain.interactor.BatteryInteractor import com.android.systemui.statusbar.pipeline.battery.shared.ui.BatteryColors import com.android.systemui.statusbar.pipeline.battery.shared.ui.BatteryGlyph @@ -106,7 +107,9 @@ private fun UnifiedBatteryChip(level: Int) { val height = with(LocalDensity.current) { BatteryViewModel.STATUS_BAR_BATTERY_HEIGHT.toDp() } BatteryLayout( attribution = BatteryGlyph.Bolt, // Always charging + iconStyleProvider = { BatteryRepository.ICON_STYLE_DEFAULT }, levelProvider = { level }, + showLevelProvider = { false }, isFullProvider = { isFull }, glyphsProvider = { level.glyphRepresentation() }, colorsProvider = { BatteryColors.DarkTheme.Charging }, @@ -124,7 +127,9 @@ private fun BatteryAndPercentChip(level: Int) { Row(verticalAlignment = Alignment.CenterVertically) { BatteryLayout( attribution = BatteryGlyph.Bolt, // Always charging + iconStyleProvider = { BatteryRepository.ICON_STYLE_DEFAULT }, levelProvider = { level }, + showLevelProvider = { false }, isFullProvider = { isFull }, glyphsProvider = { emptyList() }, colorsProvider = { BatteryColors.DarkTheme.Charging }, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/data/repository/BatteryRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/data/repository/BatteryRepository.kt index c52f9ce702fa..04d35c99aeff 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/data/repository/BatteryRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/data/repository/BatteryRepository.kt @@ -69,6 +69,12 @@ interface BatteryRepository { /** State unknown means that we can't detect a battery */ val isStateUnknown: Flow + /** + * [LineageSettings.System.STATUS_BAR_BATTERY_STYLE]. A user setting to indicate the battery + * style in the home screen status bar + */ + val batteryIconStyle: StateFlow + /** * [LineageSettings.System.STATUS_BAR_SHOW_BATTERY_PERCENT]. A user setting to indicate whether * we should show the battery percentage in the home screen status bar @@ -76,6 +82,10 @@ interface BatteryRepository { val showBatteryPercentMode: StateFlow companion object { + const val ICON_STYLE_DEFAULT = 0 + const val ICON_STYLE_CIRCLE = 1 + const val ICON_STYLE_TEXT = 2 + const val ICON_STYLE_CIRCLE_DOTTED = 3 const val SHOW_PERCENT_HIDDEN = 0 const val SHOW_PERCENT_INSIDE = 1 const val SHOW_PERCENT_NEXT_TO = 2 @@ -165,19 +175,19 @@ constructor( override val isStateUnknown = batteryState.map { it.isStateUnknown } - override val showBatteryPercentMode = + override val batteryIconStyle = callbackFlow { val resolver = context.contentResolver val uri = LineageSettings.System.getUriFor( - LineageSettings.System.STATUS_BAR_SHOW_BATTERY_PERCENT + LineageSettings.System.STATUS_BAR_BATTERY_STYLE ) fun readMode(): Int { return LineageSettings.System.getIntForUser( resolver, - LineageSettings.System.STATUS_BAR_SHOW_BATTERY_PERCENT, - BatteryRepository.SHOW_PERCENT_HIDDEN, + LineageSettings.System.STATUS_BAR_BATTERY_STYLE, + BatteryRepository.ICON_STYLE_DEFAULT, UserHandle.USER_CURRENT, ) } @@ -203,6 +213,68 @@ constructor( } .distinctUntilChanged() .flowOn(bgDispatcher) + .stateIn( + scope = scope, + started = SharingStarted.Lazily, + initialValue = BatteryRepository.ICON_STYLE_DEFAULT, + ) + + override val showBatteryPercentMode = + callbackFlow { + val resolver = context.contentResolver + val uris = + listOf( + LineageSettings.System.getUriFor( + LineageSettings.System.STATUS_BAR_BATTERY_STYLE + ), + LineageSettings.System.getUriFor( + LineageSettings.System.STATUS_BAR_SHOW_BATTERY_PERCENT + ), + ) + + fun readMode(): Int { + val iconStyle = + LineageSettings.System.getIntForUser( + resolver, + LineageSettings.System.STATUS_BAR_BATTERY_STYLE, + BatteryRepository.ICON_STYLE_DEFAULT, + UserHandle.USER_CURRENT, + ) + return if (iconStyle == BatteryRepository.ICON_STYLE_TEXT) { + BatteryRepository.SHOW_PERCENT_NEXT_TO + } else { + LineageSettings.System.getIntForUser( + resolver, + LineageSettings.System.STATUS_BAR_SHOW_BATTERY_PERCENT, + BatteryRepository.SHOW_PERCENT_HIDDEN, + UserHandle.USER_CURRENT, + ) + } + } + + val observer = + object : ContentObserver(Handler(Looper.getMainLooper())) { + override fun onChange(selfChange: Boolean) { + trySend(readMode()) + } + } + + for (uri in uris) { + resolver.registerContentObserver( + uri, + /* notifyForDescendants = */ false, + observer, + UserHandle.USER_ALL, + ) + } + + // Emit current value immediately + trySend(readMode()) + + awaitClose { resolver.unregisterContentObserver(observer) } + } + .distinctUntilChanged() + .flowOn(bgDispatcher) .stateIn( scope = scope, started = SharingStarted.Lazily, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/domain/interactor/BatteryInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/domain/interactor/BatteryInteractor.kt index a1c9d95680d6..6251deaf03aa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/domain/interactor/BatteryInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/domain/interactor/BatteryInteractor.kt @@ -74,6 +74,9 @@ class BatteryInteractor @Inject constructor( /** @see [BatteryRepository.isPowerSaveEnabled] */ val powerSave = repo.isPowerSaveEnabled + /** @see [BatteryRepository.batteryIconStyle] */ + val batteryIconStyle: StateFlow = repo.batteryIconStyle + /** @see [BatteryRepository.showBatteryPercentMode] */ val showBatteryPercentMode: StateFlow = repo.showBatteryPercentMode diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/ui/composable/UnifiedBattery.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/ui/composable/UnifiedBattery.kt index 39bb6c01f21c..ed2797bea089 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/ui/composable/UnifiedBattery.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/ui/composable/UnifiedBattery.kt @@ -32,10 +32,12 @@ import androidx.compose.ui.geometry.Size import androidx.compose.ui.graphics.BlendMode import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.CompositingStrategy +import androidx.compose.ui.graphics.PathEffect import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.graphics.drawscope.clipRect import androidx.compose.ui.graphics.drawscope.inset import androidx.compose.ui.graphics.drawscope.scale +import androidx.compose.ui.graphics.drawscope.withTransform import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.layout.Layout import androidx.compose.ui.layout.Measurable @@ -44,12 +46,17 @@ import androidx.compose.ui.layout.MeasureResult import androidx.compose.ui.layout.MeasureScope import androidx.compose.ui.layout.layoutId import androidx.compose.ui.layout.onLayoutRectChanged +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.drawText +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.rememberTextMeasurer import androidx.compose.ui.unit.Constraints -import androidx.compose.ui.util.fastFirst +import androidx.compose.ui.unit.sp import androidx.compose.ui.util.fastFirstOrNull import com.android.systemui.common.ui.compose.load import com.android.systemui.compose.modifiers.sysuiResTag import com.android.systemui.statusbar.phone.domain.interactor.IsAreaDark +import com.android.systemui.statusbar.pipeline.battery.data.repository.BatteryRepository import com.android.systemui.statusbar.pipeline.battery.shared.ui.BatteryColors import com.android.systemui.statusbar.pipeline.battery.shared.ui.BatteryFrame import com.android.systemui.statusbar.pipeline.battery.shared.ui.BatteryGlyph @@ -175,7 +182,9 @@ fun UnifiedBattery( BatteryLayout( attribution = viewModel.attribution, + iconStyleProvider = { viewModel.batteryIconStyle }, levelProvider = { viewModel.level }, + showLevelProvider = { viewModel.isBatteryPercentInsideIconSettingEnabled }, isFullProvider = { viewModel.isFull }, glyphsProvider = { viewModel.glyphList }, colorsProvider = colorProvider, @@ -192,7 +201,9 @@ fun UnifiedBattery( @Composable fun BatteryLayout( attribution: BatteryGlyph?, + iconStyleProvider: () -> Int, levelProvider: () -> Int?, + showLevelProvider: () -> Boolean, isFullProvider: () -> Boolean, glyphsProvider: () -> List, colorsProvider: () -> BatteryColors, @@ -201,30 +212,49 @@ fun BatteryLayout( ) { Layout( content = { - BatteryBody( - pathSpec = BatteryFrame.bodyPathSpec, - levelProvider = levelProvider, - glyphsProvider = glyphsProvider, - isFullProvider = isFullProvider, - colorsProvider = colorsProvider, - modifier = Modifier.layoutId(BatteryMeasurePolicy.LayoutId.Frame), - contentDescription = contentDescription, - ) - if (attribution != null) { - BatteryAttribution( + val iconStyle = iconStyleProvider() + + if ( + iconStyle == BatteryRepository.ICON_STYLE_CIRCLE || + iconStyle == BatteryRepository.ICON_STYLE_CIRCLE_DOTTED + ) { + CircleBatteryBody( attr = attribution, + iconStyleProvider = iconStyleProvider, + levelProvider = levelProvider, + showLevelProvider = showLevelProvider, colorsProvider = colorsProvider, - modifier = - Modifier.layoutId( - BatteryMeasurePolicy.LayoutId.Attribution(wrapped = attribution) - ), + modifier = Modifier.layoutId(BatteryMeasurePolicy.LayoutId.FrameCircle), + contentDescription = contentDescription, ) + } else if (iconStyle == BatteryRepository.ICON_STYLE_TEXT) { + // Empty on purpose } else { - BatteryCap( - colorsProvider = colorsProvider, + BatteryBody( + pathSpec = BatteryFrame.bodyPathSpec, + levelProvider = levelProvider, + glyphsProvider = glyphsProvider, isFullProvider = isFullProvider, - modifier = Modifier.layoutId(BatteryMeasurePolicy.LayoutId.Cap), + colorsProvider = colorsProvider, + modifier = Modifier.layoutId(BatteryMeasurePolicy.LayoutId.Frame), + contentDescription = contentDescription, ) + if (attribution != null) { + BatteryAttribution( + attr = attribution, + colorsProvider = colorsProvider, + modifier = + Modifier.layoutId( + BatteryMeasurePolicy.LayoutId.Attribution(wrapped = attribution) + ), + ) + } else { + BatteryCap( + colorsProvider = colorsProvider, + isFullProvider = isFullProvider, + modifier = Modifier.layoutId(BatteryMeasurePolicy.LayoutId.Cap), + ) + } } }, measurePolicy = BatteryMeasurePolicy(), @@ -237,6 +267,8 @@ class BatteryMeasurePolicy : MeasurePolicy { sealed class LayoutId { data object Frame : LayoutId() + data object FrameCircle : LayoutId() + data object Cap : LayoutId() // We don't have to depend on the whole [BatteryGlyph] here, we just need to know the @@ -248,7 +280,10 @@ class BatteryMeasurePolicy : MeasurePolicy { measurables: List, constraints: Constraints, ): MeasureResult { - val batteryFrame = measurables.fastFirst { it.layoutId == LayoutId.Frame } + val batteryFrame = + measurables.fastFirstOrNull { + it.layoutId == LayoutId.Frame || it.layoutId == LayoutId.FrameCircle + } ?: return layout(0, 0) {} // We will scale the entire battery icon based on the given height val scale = constraints.maxHeight / BatteryFrame.innerHeight @@ -258,8 +293,18 @@ class BatteryMeasurePolicy : MeasurePolicy { batteryFrame.measure( constraints = constraints.copy( - minWidth = batterySize.width.roundToInt(), - maxWidth = batterySize.width.roundToInt(), + minWidth = + if (batteryFrame.layoutId == LayoutId.FrameCircle) { + batterySize.height.roundToInt() + } else { + batterySize.width.roundToInt() + }, + maxWidth = + if (batteryFrame.layoutId == LayoutId.FrameCircle) { + batterySize.height.roundToInt() + } else { + batterySize.width.roundToInt() + }, minHeight = batterySize.height.roundToInt(), maxHeight = batterySize.height.roundToInt(), ) @@ -322,6 +367,100 @@ class BatteryMeasurePolicy : MeasurePolicy { } } +@Composable +fun CircleBatteryBody( + attr: BatteryGlyph?, + iconStyleProvider: () -> Int, + levelProvider: () -> Int?, + showLevelProvider: () -> Boolean, + colorsProvider: () -> BatteryColors, + modifier: Modifier = Modifier, + contentDescription: String = "", +) { + val textMeasurer = rememberTextMeasurer() + + Canvas(modifier = modifier, contentDescription = contentDescription) { + val iconStyle = iconStyleProvider() + val level = levelProvider() + val showLevel = showLevelProvider() + val colors = colorsProvider() + + val strokeWidth = size.height / 6.5f + val radius = size.height / 2f - strokeWidth / 2f + val center = Offset(size.width / 2, size.height / 2) + + // Draw thin gray ring first + drawCircle(colors.backgroundOnly, radius, center, style = Stroke(strokeWidth)) + + // Draw colored arc representing charge level + if (level != null && level > 0) { + drawArc( + colors.attribution, + 270f, + 3.6f * level, + useCenter = false, + topLeft = Offset(center.x - radius, center.y - radius), + size = Size(radius * 2, radius * 2), + style = + Stroke( + strokeWidth, + pathEffect = + if (iconStyle == BatteryRepository.ICON_STYLE_CIRCLE_DOTTED) { + PathEffect.dashPathEffect(floatArrayOf(3f, 2f), 0f) + } else { + null + }, + ), + ) + } + + if (attr != null) { + // Draw attribution + inset(strokeWidth * 2f) { + val attrScale = attr.scaleTo(size.width, size.height) + val pathBounds = attr.path.getBounds() + + withTransform({ + scale(attrScale, Offset.Zero) + translate( + (size.width - (pathBounds.width * attrScale)) / 2f, + (size.height - (pathBounds.height * attrScale)) / 2f, + ) + }) { + drawPath( + path = attr.path, + color = Color.Black, + style = Stroke(2f), + blendMode = BlendMode.Clear, + ) + drawPath(attr.path, colors.attribution) + } + } + } else if (showLevel && level != null && level < 100) { + // Draw charge level + val textLayoutResult = + textMeasurer.measure( + text = level.toString(), + style = + TextStyle( + color = colors.attribution, + fontSize = 6.sp, + fontWeight = FontWeight.Bold, + ), + ) + + drawText( + textLayoutResult = textLayoutResult, + topLeft = + Offset( + size.width / 2 - textLayoutResult.size.width / 2f, + size.height / 2 - textLayoutResult.size.height / 2f, + ), + ) + } + } +} + /** * Draws just the round-rect piece of the battery frame. If [glyphsProvider] is non-empty, then this * composable also renders the glyphs centered in the frame. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/ui/viewmodel/BatteryViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/ui/viewmodel/BatteryViewModel.kt index 1f271dae9c36..2a3e7c0827d2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/ui/viewmodel/BatteryViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/battery/ui/viewmodel/BatteryViewModel.kt @@ -24,6 +24,7 @@ import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.lifecycle.ExclusiveActivatable import com.android.systemui.lifecycle.Hydrator import com.android.systemui.res.R +import com.android.systemui.statusbar.pipeline.battery.data.repository.BatteryRepository import com.android.systemui.statusbar.pipeline.battery.domain.interactor.BatteryAttributionModel.Charging import com.android.systemui.statusbar.pipeline.battery.domain.interactor.BatteryAttributionModel.Defend import com.android.systemui.statusbar.pipeline.battery.domain.interactor.BatteryAttributionModel.PowerSave @@ -78,6 +79,13 @@ sealed class BatteryViewModel( source = interactor.showPercentNextToIcon, ) + val isBatteryPercentInsideIconSettingEnabled: Boolean by + hydrator.hydratedStateOf( + traceName = "isBatteryPercentInsideIconSettingEnabled", + initialValue = interactor.showPercentInsideIcon.value, + source = interactor.showPercentInsideIcon, + ) + /** A [List] representation of the current [level] */ private val levelGlyphs: Flow> = interactor.level.map { it?.glyphRepresentation() ?: emptyList() } @@ -213,6 +221,13 @@ sealed class BatteryViewModel( }, ) + val batteryIconStyle: Int by + hydrator.hydratedStateOf( + traceName = "batteryIconStyle", + initialValue = BatteryRepository.ICON_STYLE_DEFAULT, + source = interactor.batteryIconStyle, + ) + /** For use in the shade, where we might need to show an estimate */ val batteryTimeRemainingEstimate: String? by hydrator.hydratedStateOf( From 44cdd55810d09d0978ca12eb928387f9e96e56d5 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sun, 23 Nov 2025 20:10:41 +0100 Subject: [PATCH 002/723] aconfig: Use old storage if /metadata is not available Change-Id: I71e74f07b358679f693cbd5e1f9a0ad1647d505d --- .../com/android/internal/pm/pkg/component/AconfigFlags.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/com/android/internal/pm/pkg/component/AconfigFlags.java b/core/java/com/android/internal/pm/pkg/component/AconfigFlags.java index 13b71e71bab4..dc58171f59f5 100644 --- a/core/java/com/android/internal/pm/pkg/component/AconfigFlags.java +++ b/core/java/com/android/internal/pm/pkg/component/AconfigFlags.java @@ -101,7 +101,8 @@ public AconfigFlags() { } private static boolean useNewStorage() { - return newStoragePublicApi() && Flags.useNewAconfigStorage(); + return newStoragePublicApi() && Flags.useNewAconfigStorage() && + Environment.getMetadataDirectory().exists(); } private void loadServerOverrides() { From 7912c86c413976494c00b5f6f917d42fbf4f0bae Mon Sep 17 00:00:00 2001 From: Oliver Scott Date: Thu, 24 Oct 2024 17:33:50 -0400 Subject: [PATCH 003/723] Stop domain verification delegated from UIDs blocked by network policy Issue: calyxos#889 Change-Id: I00278802bdf9e9d2ff2c8e94304a14cceb1a2c0d --- data/etc/Android.bp | 2 +- packages/StatementService/Android.bp | 4 +-- packages/StatementService/AndroidManifest.xml | 1 + .../StatementServiceApplication.kt | 1 + .../domain/BootCompletedReceiver.kt | 1 + .../domain/DomainVerificationUtils.kt | 32 +++++++++++++++++++ .../statementservice/domain/DomainVerifier.kt | 12 +++++++ 7 files changed, 50 insertions(+), 3 deletions(-) diff --git a/data/etc/Android.bp b/data/etc/Android.bp index 272e891b1d5d..98278f4529ff 100644 --- a/data/etc/Android.bp +++ b/data/etc/Android.bp @@ -185,7 +185,7 @@ prebuilt_etc { prebuilt_etc { name: "privapp_whitelist_com.android.statementservice", - product_specific: true, + system_ext_specific: true, sub_dir: "permissions", src: "com.android.statementservice.xml", filename_from_src: true, diff --git a/packages/StatementService/Android.bp b/packages/StatementService/Android.bp index a1422c0b40d8..f0ddf4b6d84e 100644 --- a/packages/StatementService/Android.bp +++ b/packages/StatementService/Android.bp @@ -31,8 +31,8 @@ android_app { proguard_flags_files: ["proguard.flags"], }, target_sdk_version: "29", - sdk_version: "system_current", - product_specific: true, + platform_apis: true, + system_ext_specific: true, privileged: true, required: [ "privapp_whitelist_com.android.statementservice", diff --git a/packages/StatementService/AndroidManifest.xml b/packages/StatementService/AndroidManifest.xml index 42cd14314954..0cc5b210f33c 100644 --- a/packages/StatementService/AndroidManifest.xml +++ b/packages/StatementService/AndroidManifest.xml @@ -26,6 +26,7 @@ + diff --git a/packages/StatementService/src/com/android/statementservice/StatementServiceApplication.kt b/packages/StatementService/src/com/android/statementservice/StatementServiceApplication.kt index 6af8004c4015..fabe07eebdf9 100644 --- a/packages/StatementService/src/com/android/statementservice/StatementServiceApplication.kt +++ b/packages/StatementService/src/com/android/statementservice/StatementServiceApplication.kt @@ -29,6 +29,7 @@ class StatementServiceApplication : Application() { if (userManager.isUserUnlocked) { // WorkManager can only schedule when the user data directories are unencrypted (after // the user has entered their lock password. + DomainVerificationUtils.registerNetworkPolicyListener(this) DomainVerificationUtils.schedulePeriodicCheckUnlocked(WorkManager.getInstance(this)) DomainVerificationUtils.schedulePeriodicUpdateUnlocked(WorkManager.getInstance(this)) } diff --git a/packages/StatementService/src/com/android/statementservice/domain/BootCompletedReceiver.kt b/packages/StatementService/src/com/android/statementservice/domain/BootCompletedReceiver.kt index 7b5da832b9d7..3f13469910cb 100644 --- a/packages/StatementService/src/com/android/statementservice/domain/BootCompletedReceiver.kt +++ b/packages/StatementService/src/com/android/statementservice/domain/BootCompletedReceiver.kt @@ -43,6 +43,7 @@ class BootCompletedReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { if (intent.action != Intent.ACTION_BOOT_COMPLETED) return val workManager = WorkManager.getInstance(context) + DomainVerificationUtils.registerNetworkPolicyListener(context) DomainVerificationUtils.schedulePeriodicCheckUnlocked(workManager) workManager.beginUniqueWork( PACKAGE_BOOT_REQUEST_KEY, diff --git a/packages/StatementService/src/com/android/statementservice/domain/DomainVerificationUtils.kt b/packages/StatementService/src/com/android/statementservice/domain/DomainVerificationUtils.kt index 157a800d0e09..0ebe06ea656b 100644 --- a/packages/StatementService/src/com/android/statementservice/domain/DomainVerificationUtils.kt +++ b/packages/StatementService/src/com/android/statementservice/domain/DomainVerificationUtils.kt @@ -16,6 +16,8 @@ package com.android.statementservice.domain +import android.content.Context +import android.net.NetworkPolicyManager import androidx.work.Constraints import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.NetworkType @@ -36,6 +38,9 @@ object DomainVerificationUtils { private const val UPDATE_WORKER_ENABLED = false + private val uidBlockedReasons = mutableMapOf() + private var networkPolicyListener: NetworkPolicyManager.Listener? = null + /** * In a majority of cases, the initial requests will be enough to verify domains, since they * are also restricted to [NetworkType.CONNECTED], but for cases where they aren't sufficient, @@ -113,4 +118,31 @@ object DomainVerificationUtils { } } } + + fun getUidBlockedReasons(uid: Int) : Int? { + return uidBlockedReasons[uid] + } + + fun registerNetworkPolicyListener(context: Context) { + if (networkPolicyListener != null) { + unregisterNetworkPolicyListener(context) + } + networkPolicyListener = object : NetworkPolicyManager.Listener() { + override fun onBlockedReasonChanged( + uid: Int, + oldBlockedReasons: Int, + newBlockedReasons: Int + ) { + uidBlockedReasons[uid] = newBlockedReasons + } + } + val networkPolicyManager = context.getSystemService(NetworkPolicyManager::class.java) + networkPolicyManager?.registerListener(networkPolicyListener) + } + + private fun unregisterNetworkPolicyListener(context: Context) { + val networkPolicyManager = context.getSystemService(NetworkPolicyManager::class.java) + networkPolicyManager?.unregisterListener(networkPolicyListener) + networkPolicyListener = null + } } diff --git a/packages/StatementService/src/com/android/statementservice/domain/DomainVerifier.kt b/packages/StatementService/src/com/android/statementservice/domain/DomainVerifier.kt index c7f6c184fd22..b0858629b085 100644 --- a/packages/StatementService/src/com/android/statementservice/domain/DomainVerifier.kt +++ b/packages/StatementService/src/com/android/statementservice/domain/DomainVerifier.kt @@ -17,7 +17,10 @@ package com.android.statementservice.domain import android.content.Context +import android.content.pm.PackageManager import android.content.pm.verify.domain.DomainVerificationManager +import android.net.ConnectivityManager.BLOCKED_REASON_APP_BACKGROUND +import android.net.ConnectivityManager.BLOCKED_REASON_NONE import android.net.Network import android.util.Log import androidx.collection.LruCache @@ -92,6 +95,15 @@ class DomainVerifier private constructor( val assetMatcher = synchronized(targetAssetCache) { targetAssetCache[packageName] } .takeIf { it!!.isPresent } ?: return Triple(WorkResult.failure(), VerifyStatus.FAILURE_PACKAGE_MANAGER, null) + val packageUid = appContext.packageManager.getPackageUid( + packageName, + PackageManager.PackageInfoFlags.of(0) + ) + // Fail if no blocked reason is set or for any reason other than APP_BACKGROUND and NONE + if (DomainVerificationUtils.getUidBlockedReasons(packageUid) + ?.and(BLOCKED_REASON_APP_BACKGROUND.inv())?.and(BLOCKED_REASON_NONE.inv()) != 0) { + return Triple(WorkResult.failure(), VerifyStatus.NO_RESPONSE, null) + } return verifyHost(host, assetMatcher.get(), network) } From 7d73d58bb3659a8ac0421ac17700b30e6de9b9a4 Mon Sep 17 00:00:00 2001 From: HZ <99131470+hustler-not-chatty@users.noreply.github.com> Date: Wed, 2 Nov 2022 20:24:42 +0800 Subject: [PATCH 004/723] AlertWindowNotification: Correctly load app label Passes User ID to AlertWindowNotification to make sure that we can correctly load app label for the ones installed in work profile. Test: Install an app that can display over other apps in the work profile, watch the notification title and content when it's drawing over other apps. It should now display app label, rather than its package name. Change-Id: I872c0c0f6870a09c4ef1c372d7a87dec156f91fc --- .../server/wm/AlertWindowNotification.java | 15 +++++++++++---- .../core/java/com/android/server/wm/Session.java | 3 ++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/wm/AlertWindowNotification.java b/services/core/java/com/android/server/wm/AlertWindowNotification.java index c589feae56ca..51c93a6293b4 100644 --- a/services/core/java/com/android/server/wm/AlertWindowNotification.java +++ b/services/core/java/com/android/server/wm/AlertWindowNotification.java @@ -24,6 +24,7 @@ import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.provider.Settings.ACTION_MANAGE_APP_OVERLAY_PERMISSION; +import android.annotation.UserIdInt; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationChannelGroup; @@ -37,6 +38,7 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; +import android.os.UserHandle; import com.android.internal.R; import com.android.internal.util.ImageUtils; @@ -53,11 +55,14 @@ class AlertWindowNotification { private String mNotificationTag; private final NotificationManager mNotificationManager; private final String mPackageName; + private final @UserIdInt int mUserId; private boolean mPosted; - AlertWindowNotification(WindowManagerService service, String packageName) { + AlertWindowNotification(WindowManagerService service, String packageName, + @UserIdInt int userId) { mService = service; mPackageName = packageName; + mUserId = userId; mNotificationManager = (NotificationManager) mService.mContext.getSystemService(NOTIFICATION_SERVICE); mNotificationTag = CHANNEL_PREFIX + mPackageName; @@ -100,7 +105,7 @@ private void onPostNotification() { final Context context = mService.mContext; final PackageManager pm = context.getPackageManager(); - final ApplicationInfo aInfo = getApplicationInfo(pm, mPackageName); + final ApplicationInfo aInfo = getApplicationInfoAsUser(pm, mPackageName, mUserId); final String appName = (aInfo != null) ? pm.getApplicationLabel(aInfo).toString() : mPackageName; @@ -138,6 +143,7 @@ private PendingIntent getContentIntent(Context context, String packageName) { final Intent intent = new Intent(ACTION_MANAGE_APP_OVERLAY_PERMISSION, Uri.fromParts("package", packageName, null)); intent.setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); + intent.putExtra(Intent.EXTRA_USER_HANDLE, UserHandle.of(mUserId)); // Calls into activity manager... return PendingIntent.getActivity(context, mRequestCode, intent, FLAG_CANCEL_CURRENT | FLAG_IMMUTABLE); @@ -168,9 +174,10 @@ private void createNotificationChannel(Context context, String appName) { } - private ApplicationInfo getApplicationInfo(PackageManager pm, String packageName) { + private ApplicationInfo getApplicationInfoAsUser(PackageManager pm, String packageName, + @UserIdInt int userId) { try { - return pm.getApplicationInfo(packageName, 0); + return pm.getApplicationInfoAsUser(packageName, 0, userId); } catch (PackageManager.NameNotFoundException e) { return null; } diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java index 5b36a9b089bd..1c69365f5c4b 100644 --- a/services/core/java/com/android/server/wm/Session.java +++ b/services/core/java/com/android/server/wm/Session.java @@ -814,7 +814,8 @@ void onWindowSurfaceVisibilityChanged(WindowState window, boolean visible) { if (mAlertWindows.isEmpty()) { cancelAlertWindowNotification(); } else if (mAlertWindowNotification == null && !isSatellitePointingUiPackage()) { - mAlertWindowNotification = new AlertWindowNotification(mService, mPackageName); + mAlertWindowNotification = new AlertWindowNotification(mService, mPackageName, + UserHandle.getUserId(mUid)); if (mShowingAlertWindowNotificationAllowed) { mAlertWindowNotification.post(); } From 3d6e0b731bfb64cba8b0a2ca181a04b23e06b111 Mon Sep 17 00:00:00 2001 From: SuperDroidBond Date: Sun, 11 Sep 2022 15:59:12 +0530 Subject: [PATCH 005/723] toast: fix bg color not changing with theme change Signed-off-by: SuperDroidBond Change-Id: I0d3a1995fa35d47e246cedef670357d31e004b50 --- core/res/res/drawable/toast_frame.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/res/res/drawable/toast_frame.xml b/core/res/res/drawable/toast_frame.xml index a8cdef6d05f1..34987394b2ec 100644 --- a/core/res/res/drawable/toast_frame.xml +++ b/core/res/res/drawable/toast_frame.xml @@ -17,7 +17,7 @@ --> - + From a1d9b53c57a48d47c84a60f3a6fa41009afe5407 Mon Sep 17 00:00:00 2001 From: Luca Stefani Date: Thu, 22 May 2025 17:13:25 +0200 Subject: [PATCH 006/723] fixup! Firewall: Transport-based toggle support (1/3) Strip unwanted policies when updating background restriction rules and fix one strict equality with a bit check. Change-Id: I51628940f64fe98c930168dc0fe2e487f63ccfde --- .../server/net/NetworkPolicyManagerService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java index c75bcfed0d1b..0b726e46c25d 100644 --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java @@ -3461,10 +3461,10 @@ private void setUidPolicyUncheckedUL(int uid, int oldPolicy, int policy, boolean if (!isUidValidForAllowlistRulesUL(uid)) { notifyApp = false; } else { - final boolean wasDenied = oldPolicy == POLICY_REJECT_METERED_BACKGROUND; - final boolean isDenied = policy == POLICY_REJECT_METERED_BACKGROUND; - final boolean wasAllowed = oldPolicy == POLICY_ALLOW_METERED_BACKGROUND; - final boolean isAllowed = policy == POLICY_ALLOW_METERED_BACKGROUND; + final boolean wasDenied = (oldPolicy & POLICY_REJECT_METERED_BACKGROUND) != 0; + final boolean isDenied = (policy & POLICY_REJECT_METERED_BACKGROUND) != 0; + final boolean wasAllowed = (oldPolicy & POLICY_ALLOW_METERED_BACKGROUND) != 0; + final boolean isAllowed = (policy & POLICY_ALLOW_METERED_BACKGROUND) != 0; final boolean wasBlocked = wasDenied || (mRestrictBackground && !wasAllowed); final boolean isBlocked = isDenied || (mRestrictBackground && !isAllowed); if ((wasAllowed && (!isAllowed || isDenied)) @@ -3874,7 +3874,7 @@ private int getRestrictBackgroundStatusInternal(int uid) { } finally { Binder.restoreCallingIdentity(token); } - if (policy == POLICY_REJECT_METERED_BACKGROUND) { + if ((policy & POLICY_REJECT_METERED_BACKGROUND) != 0) { // App is restricted. return RESTRICT_BACKGROUND_STATUS_ENABLED; } From 307d499d516150395fa2e4bf5d527e5658ba15e9 Mon Sep 17 00:00:00 2001 From: Sam Mortimer Date: Sat, 13 Jan 2018 23:26:48 -0800 Subject: [PATCH 007/723] SystemUI: Network Traffic [1/3] Co-authored-by: LuK1337 Co-authored-by: Wolfram Liebchen Change-Id: Ib947832860970a3bccfac70d27a4761f6164d3d5 --- packages/SystemUI/LineageManifest.xml | 5 +- packages/SystemUI/res/layout/status_bar.xml | 53 +++++++++++++++++++ .../phone/PhoneStatusBarTransitions.java | 15 ++++++ .../fragment/CollapsedStatusBarFragment.java | 51 ++++++++++++++++++ 4 files changed, 123 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/LineageManifest.xml b/packages/SystemUI/LineageManifest.xml index 09d3e1006ae5..b39dcfe5e272 100644 --- a/packages/SystemUI/LineageManifest.xml +++ b/packages/SystemUI/LineageManifest.xml @@ -1,7 +1,7 @@ + + diff --git a/packages/SystemUI/res/layout/status_bar.xml b/packages/SystemUI/res/layout/status_bar.xml index 01eddd75ce66..127bde6cdd36 100644 --- a/packages/SystemUI/res/layout/status_bar.xml +++ b/packages/SystemUI/res/layout/status_bar.xml @@ -118,6 +118,24 @@ android:orientation="horizontal" android:clipChildren="false"/> + + + + + + @@ -130,6 +148,23 @@ android:gravity="center_horizontal|center_vertical" /> + + + + + + + + + + + + { mEndSideAlphaController.setAlpha(alpha, SOURCE_SYSTEM_EVENT_ANIMATOR); + mNetworkTrafficStartAlphaController.setAlpha(alpha, SOURCE_SYSTEM_EVENT_ANIMATOR); + mNetworkTrafficCenterAlphaController.setAlpha(alpha, SOURCE_SYSTEM_EVENT_ANIMATOR); + mNetworkTrafficEndAlphaController.setAlpha(alpha, SOURCE_SYSTEM_EVENT_ANIMATOR); return Unit.INSTANCE; }, (translationX) -> { mEndSideContent.setTranslationX(translationX); + mNetworkTrafficHolderStart.setTranslationX(translationX); + mNetworkTrafficHolderCenter.setTranslationX(translationX); + mNetworkTrafficHolderEnd.setTranslationX(translationX); return Unit.INSTANCE; }, /*isAnimationRunning*/ false); } From a05f295abd74073ff561dc886675bb6f27969f7d Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sun, 12 Dec 2021 15:12:23 +0100 Subject: [PATCH 008/723] Don't pass repeated back key events to app if custom action is set up Some apps may react to back key long press and it doesn't make sense to allow them to do that if 'Back long press action' is set to anything other than 'No action'. Change-Id: Iacac909d6a288cacf964c89d9586d572d14d1871 --- .../java/com/android/server/policy/PhoneWindowManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 5b983599f1f9..1d13ca4af41b 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -5058,6 +5058,12 @@ && isWakeKeyWhenScreenOff(keyCode)) { // focus before processing the back event. mWindowManagerInternal.moveFocusToAdjacentEmbeddedActivityIfNeeded(); mBackKeyHandled = false; + + // Don't pass repeated events to app if user has custom long press action + // set up in settings + if (event.getRepeatCount() > 0 && hasLongPressOnBackBehavior()) { + result &= ~ACTION_PASS_TO_USER; + } } else { if (!hasLongPressOnBackBehavior()) { mBackKeyHandled |= backKeyPress(); From e7f3220019f2805f771f5e0435aa5ddee4333e6e Mon Sep 17 00:00:00 2001 From: Pranav Vashi Date: Sun, 14 Sep 2025 20:28:05 +0530 Subject: [PATCH 009/723] SystemUI: Plug in non-MSDL haptic feedback for QS tiles Change-Id: I75fe2e39df4433b40836fb4526d52845dab36178 Signed-off-by: Pranav Vashi --- .../haptics/msdl/qs/TileHapticsViewModel.kt | 83 +++++++++++++++---- 1 file changed, 67 insertions(+), 16 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/haptics/msdl/qs/TileHapticsViewModel.kt b/packages/SystemUI/src/com/android/systemui/haptics/msdl/qs/TileHapticsViewModel.kt index 70a40d933724..745ea3430bef 100644 --- a/packages/SystemUI/src/com/android/systemui/haptics/msdl/qs/TileHapticsViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/haptics/msdl/qs/TileHapticsViewModel.kt @@ -16,6 +16,8 @@ package com.android.systemui.haptics.msdl.qs +import android.os.VibrationAttributes +import android.os.VibrationEffect import android.service.quicksettings.Tile import androidx.compose.runtime.Stable import com.android.systemui.Flags @@ -23,6 +25,7 @@ import com.android.systemui.animation.Expandable import com.android.systemui.dagger.SysUISingleton import com.android.systemui.lifecycle.ExclusiveActivatable import com.android.systemui.qs.panels.ui.viewmodel.TileViewModel +import com.android.systemui.statusbar.VibratorHelper import com.android.systemui.util.kotlin.pairwise import com.google.android.msdl.data.model.MSDLToken import com.google.android.msdl.domain.MSDLPlayer @@ -44,6 +47,7 @@ class TileHapticsViewModel @AssistedInject constructor( private val msdlPlayer: MSDLPlayer, + private val vibratorHelper: VibratorHelper, @Assisted private val tileViewModel: TileViewModel, ) : ExclusiveActivatable() { @@ -91,20 +95,72 @@ constructor( private val hapticsState: Flow = merge(toggleHapticsState, interactionHapticsState) + private val vibrationAttrs = + VibrationAttributes.Builder() + .setUsage(VibrationAttributes.USAGE_TOUCH) + .setFlags(VibrationAttributes.FLAG_PIPELINED_EFFECT) + .build() + + private val clickEffect = VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK) + private val heavyClick = VibrationEffect.createPredefined(VibrationEffect.EFFECT_HEAVY_CLICK) + + private val areAllPrimitivesSupported by lazy { + vibratorHelper.areAllPrimitivesSupported( + VibrationEffect.Composition.PRIMITIVE_CLICK, + VibrationEffect.Composition.PRIMITIVE_THUD, + ) ?: false + } + + private val composedHeavyClick by lazy { + VibrationEffect.startComposition() + .addPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD, 1f) + .compose() + } + + private val composedClick by lazy { + VibrationEffect.startComposition() + .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK) + .compose() + } + + private fun vibrateToggle() = vibratorHelper.vibrate(composedClick, vibrationAttrs) + + private fun vibrateLongPress() = vibratorHelper.vibrate(composedHeavyClick, vibrationAttrs) + override suspend fun onActivated(): Nothing { try { - hapticsState.collect { hapticsState -> - val tokenToPlay: MSDLToken? = - when (hapticsState) { - TileHapticsState.TOGGLE_ON -> MSDLToken.SWITCH_ON - TileHapticsState.TOGGLE_OFF -> MSDLToken.SWITCH_OFF - TileHapticsState.LONG_PRESS -> MSDLToken.LONG_PRESS - TileHapticsState.NO_HAPTICS -> null + hapticsState.collect { state -> + if (state == TileHapticsState.NO_HAPTICS) return@collect + + if (Flags.msdlFeedback()) { + val token = + when (state) { + TileHapticsState.TOGGLE_ON -> MSDLToken.SWITCH_ON + TileHapticsState.TOGGLE_OFF -> MSDLToken.SWITCH_OFF + TileHapticsState.LONG_PRESS -> MSDLToken.LONG_PRESS + else -> null + } + token?.let { msdlPlayer.playToken(it) } + } else { + if (areAllPrimitivesSupported) { + when (state) { + TileHapticsState.TOGGLE_ON, + TileHapticsState.TOGGLE_OFF -> vibrateToggle() + TileHapticsState.LONG_PRESS -> vibrateLongPress() + else -> Unit + } + } else { + when (state) { + TileHapticsState.TOGGLE_ON, + TileHapticsState.TOGGLE_OFF -> + vibratorHelper.vibrate(clickEffect, vibrationAttrs) + TileHapticsState.LONG_PRESS -> + vibratorHelper.vibrate(heavyClick, vibrationAttrs) + else -> Unit + } } - tokenToPlay?.let { - msdlPlayer.playToken(it) - resetStates() } + resetStates() } awaitCancellation() } finally { @@ -178,10 +234,5 @@ constructor( class TileHapticsViewModelFactoryProvider @Inject constructor(private val tileHapticsViewModelFactory: TileHapticsViewModel.Factory) { - fun getHapticsViewModelFactory(): TileHapticsViewModel.Factory? = - if (Flags.msdlFeedback()) { - tileHapticsViewModelFactory - } else { - null - } + fun getHapticsViewModelFactory(): TileHapticsViewModel.Factory? = tileHapticsViewModelFactory } From abe2fdca905e79f42fb1cb7e487e23d935926868 Mon Sep 17 00:00:00 2001 From: pjgowtham Date: Sun, 22 Jun 2025 11:00:08 +0530 Subject: [PATCH 010/723] UdfpsHelper: Track brightness mirror to hide/show Udfps dim layer This provides a much deeper integration with Udfps dim layer and the new brightness slider such that we don't need to look for APIs that can track temporary brightness. That is because when the brightness mirror is shown, there is no necessity for the Udfps dim layer to be present. This change also isn't functional with the legacy slider. It also fixes the issue where the dim layer is hidden with QS expansion -> Device Control where the alternate bouncer is brought up. Tests : Ensure that appropriate transparency of the dim layer is set when dragging or selecting the preferred brightness with the slider. Change-Id: I53f78cbcfd3b42a3b5dbe6110424687ebfac102d Signed-off-by: Pranav Vashi --- .../systemui/biometrics/UdfpsController.java | 5 ++ .../biometrics/UdfpsControllerOverlay.kt | 5 +- .../systemui/biometrics/UdfpsHelper.kt | 48 ++++++------------- 3 files changed, 24 insertions(+), 34 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java index 13094fc12629..9ebb79e41cf3 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java @@ -99,6 +99,7 @@ import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.power.domain.interactor.PowerInteractor; +import com.android.systemui.settings.brightness.domain.interactor.BrightnessMirrorShowingInteractor; import com.android.systemui.shade.ShadeDisplayAware; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.shared.system.SysUiStatsLog; @@ -185,6 +186,7 @@ public class UdfpsController implements DozeReceiver, Dumpable { @NonNull private final AlternateBouncerInteractor mAlternateBouncerInteractor; @NonNull private final UdfpsOverlayInteractor mUdfpsOverlayInteractor; @NonNull private final PowerInteractor mPowerInteractor; + @NonNull private final BrightnessMirrorShowingInteractor mBrightnessMirrorShowingInteractor; @NonNull private final CoroutineScope mScope; @NonNull private final InputManager mInputManager; @NonNull private final SelectedUserInteractor mSelectedUserInteractor; @@ -297,6 +299,7 @@ public void showUdfpsOverlay(long requestId, int sensorId, int reason, mShadeInteractor, mUdfpsOverlayInteractor, mPowerInteractor, + mBrightnessMirrorShowingInteractor, mScope ))); } @@ -695,6 +698,7 @@ public UdfpsController(@NonNull @Main Context context, Lazy promptUdfpsTouchOverlayViewModel, @NonNull UdfpsOverlayInteractor udfpsOverlayInteractor, @NonNull PowerInteractor powerInteractor, + @NonNull BrightnessMirrorShowingInteractor brightnessMirrorShowingInteractor, @Application CoroutineScope scope, UserActivityNotifier userActivityNotifier) { mContext = context; @@ -739,6 +743,7 @@ public UdfpsController(@NonNull @Main Context context, mAlternateBouncerInteractor = alternateBouncerInteractor; mUdfpsOverlayInteractor = udfpsOverlayInteractor; mPowerInteractor = powerInteractor; + mBrightnessMirrorShowingInteractor = brightnessMirrorShowingInteractor; mScope = scope; mInputManager = inputManager; mSelectedUserInteractor = selectedUserInteractor; diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt index 0ec0a91eb328..c3eef1f06aa6 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt @@ -52,6 +52,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInterac import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.res.R +import com.android.systemui.settings.brightness.domain.interactor.BrightnessMirrorShowingInteractor import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.statusbar.policy.KeyguardStateController import dagger.Lazy @@ -88,6 +89,7 @@ constructor( private val shadeInteractor: ShadeInteractor, private val udfpsOverlayInteractor: UdfpsOverlayInteractor, private val powerInteractor: PowerInteractor, + private val brightnessMirrorShowingInteractor: BrightnessMirrorShowingInteractor, @Application private val scope: CoroutineScope, ) { private val currentStateUpdatedToOffAodOrDozing: Flow = @@ -119,7 +121,8 @@ constructor( ) private val udfpsHelper: UdfpsHelper? = if (useFrameworkDimming) { - UdfpsHelper(context, windowManager, shadeInteractor, requestReason) + UdfpsHelper(context, windowManager, shadeInteractor, requestReason, + brightnessMirrorShowingInteractor) } else { null } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsHelper.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsHelper.kt index d16db5e8cbfe..cd44c14db3de 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsHelper.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsHelper.kt @@ -1,17 +1,6 @@ /* - * Copyright (C) 2024 The LineageOS Project - * - * 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. + * SPDX-FileCopyrightText: 2024-2025 The LineageOS Project + * SPDX-License-Identifier: Apache-2.0 */ package com.android.systemui.biometrics @@ -32,6 +21,7 @@ import androidx.core.view.isVisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.systemui.lifecycle.repeatWhenAttached +import com.android.systemui.settings.brightness.domain.interactor.BrightnessMirrorShowingInteractor import com.android.systemui.shade.domain.interactor.ShadeInteractor import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job @@ -49,6 +39,7 @@ class UdfpsHelper( private val windowManager: WindowManager, private val shadeInteractor: ShadeInteractor, @RequestReason val requestReason: Int, + private val brightnessMirrorShowingInteractor: BrightnessMirrorShowingInteractor, private var view: View = View(context).apply { setBackgroundColor(Color.BLACK) visibility = View.GONE @@ -56,7 +47,6 @@ class UdfpsHelper( ) { private val displayManager = context.getSystemService(DisplayManager::class.java)!! private val isKeyguard = requestReason == REASON_AUTH_KEYGUARD - private var newIsQsExpanded = false private val currentBrightness: Float get() = displayManager.getBrightness(Display.DEFAULT_DISPLAY) @@ -165,16 +155,23 @@ class UdfpsHelper( fun addDimLayer() { brightnessToAlpha() windowManager.addView(view, dimLayoutParams) + displayManager.registerDisplayListener( + displayListener, + null, + /* eventFlags */ 0, + DisplayManager.PRIVATE_EVENT_TYPE_DISPLAY_BRIGHTNESS, + ) } fun removeDimLayer() { windowManager.removeView(view) + displayManager.unregisterDisplayListener(displayListener) } init { view.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.CREATED) { - listenForQsExpansion(this) + listenForBrightnessMirror(this) if (isKeyguard) { listenForShadeTouchability(this) @@ -187,25 +184,10 @@ class UdfpsHelper( } } - // We don't have ways to get temporary brightness when operating the brightness slider. - // Therefore, the dim layer is hidden when the slider is expected to be utilized. - private suspend fun listenForQsExpansion(scope: CoroutineScope): Job { + private suspend fun listenForBrightnessMirror(scope: CoroutineScope): Job { return scope.launch { - shadeInteractor.qsExpansion.collect { qsExpansion -> - if (qsExpansion == 1f && !newIsQsExpanded) { - newIsQsExpanded = true - displayManager.registerDisplayListener( - displayListener, - null, - /* eventFlags */ 0, - DisplayManager.PRIVATE_EVENT_TYPE_DISPLAY_BRIGHTNESS, - ) - view.isVisible = false - } else if (qsExpansion == 0f && newIsQsExpanded) { - newIsQsExpanded = false - displayManager.unregisterDisplayListener(displayListener) - view.isVisible = true - } + brightnessMirrorShowingInteractor.isShowing.collect { + view.isVisible = !it } } } From 9aa9ada6f4fcbd3783d7a69215f6ee381e905360 Mon Sep 17 00:00:00 2001 From: basamaryan Date: Sun, 14 Dec 2025 18:41:47 -0800 Subject: [PATCH 011/723] SettingsProvider: Add default resource for disable_window_blurs Enable device-specific overlay to change the default state of cross-window blurs. Change-Id: Ia2c921435e5eae33be450e7ddb48ac41e75c3961 --- packages/SettingsProvider/res/values/defaults.xml | 3 +++ .../src/com/android/providers/settings/DatabaseHelper.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 94aa955f0282..55d35d4e1755 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -224,6 +224,9 @@ false + + false + 1 diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index a3eab5da1100..113c98d1310a 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -2342,6 +2342,9 @@ private void loadGlobalSettings(SQLiteDatabase db) { loadIntegerSetting(stmt, Settings.Global.CELL_ON, R.integer.def_cell_on); + loadBooleanSetting(stmt, Settings.Global.DISABLE_WINDOW_BLURS, + R.bool.def_disable_window_blurs); + // Enable or disable Cell Broadcast SMS loadSetting(stmt, Settings.Global.CDMA_CELL_BROADCAST_SMS, RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED); From 2ec29837ae69d056ea76067c39bc669825acd04f Mon Sep 17 00:00:00 2001 From: Quallenauge Date: Sat, 19 Feb 2022 22:28:20 +0100 Subject: [PATCH 012/723] Biometrics: Allow disabling of fingerprint cleanups Don't schedule cleanups at all if the driver doesn't support enumerate function. Change-Id: If9e1b82bc551e2fd06218b1720f5986633c1ab55 --- .../sensors/fingerprint/aidl/FingerprintProvider.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java index 45f49669a054..3b178ec75102 100644 --- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java +++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java @@ -137,6 +137,8 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi @Nullable private IVirtualHal mVhal; @Nullable private String mHalInstanceNameCurrent; + private boolean mCleanup; + private final class BiometricTaskStackListener extends TaskStackListener { @Override public void onTaskStackChanged() { @@ -206,6 +208,9 @@ public FingerprintProvider(@NonNull Context context, mTestHalEnabled = testHalEnabled; mBiometricHandlerProvider = biometricHandlerProvider; + mCleanup = context.getResources().getBoolean( + org.lineageos.platform.internal.R.bool.config_cleanupUnusedFingerprints); + initAuthenticationBroadcastReceiver(); initFingerprintDanglingBroadcastReceiver(); initSensors(resetLockoutRequiresHardwareAuthToken, props, gestureAvailabilityDispatcher); @@ -674,6 +679,9 @@ public void scheduleInternalCleanup(int sensorId, int userId, @Override public void scheduleInternalCleanup(int sensorId, int userId, @Nullable ClientMonitorCallback callback, boolean favorHalEnrollments) { + if (!mCleanup) { + return; + } mHandler.post(() -> { final FingerprintInternalCleanupClient client = new FingerprintInternalCleanupClient(mContext, From 70530683d081e89a41eb8106b4eefc3fff95c342 Mon Sep 17 00:00:00 2001 From: Pranav Vashi Date: Thu, 7 Sep 2023 21:42:22 +0530 Subject: [PATCH 013/723] base: Add stub files Signed-off-by: Pranav Vashi --- core/res/res/values/cr_arrays.xml | 8 ++++++++ core/res/res/values/cr_attrs.xml | 12 ++++++++++++ core/res/res/values/cr_colors.xml | 8 ++++++++ core/res/res/values/cr_config.xml | 8 ++++++++ core/res/res/values/cr_dimens.xml | 8 ++++++++ core/res/res/values/cr_strings.xml | 8 ++++++++ core/res/res/values/cr_styles.xml | 8 ++++++++ core/res/res/values/cr_symbols.xml | 8 ++++++++ packages/SystemUI/res/values-night/cr_colors.xml | 8 ++++++++ packages/SystemUI/res/values/cr_arrays.xml | 8 ++++++++ packages/SystemUI/res/values/cr_attrs.xml | 8 ++++++++ packages/SystemUI/res/values/cr_colors.xml | 8 ++++++++ packages/SystemUI/res/values/cr_config.xml | 8 ++++++++ packages/SystemUI/res/values/cr_dimens.xml | 8 ++++++++ packages/SystemUI/res/values/cr_strings.xml | 8 ++++++++ packages/SystemUI/res/values/cr_styles.xml | 8 ++++++++ packages/SystemUI/res/values/cr_symbols.xml | 8 ++++++++ 17 files changed, 140 insertions(+) create mode 100644 core/res/res/values/cr_arrays.xml create mode 100644 core/res/res/values/cr_attrs.xml create mode 100644 core/res/res/values/cr_colors.xml create mode 100644 core/res/res/values/cr_config.xml create mode 100644 core/res/res/values/cr_dimens.xml create mode 100644 core/res/res/values/cr_strings.xml create mode 100644 core/res/res/values/cr_styles.xml create mode 100644 core/res/res/values/cr_symbols.xml create mode 100644 packages/SystemUI/res/values-night/cr_colors.xml create mode 100644 packages/SystemUI/res/values/cr_arrays.xml create mode 100644 packages/SystemUI/res/values/cr_attrs.xml create mode 100644 packages/SystemUI/res/values/cr_colors.xml create mode 100644 packages/SystemUI/res/values/cr_config.xml create mode 100644 packages/SystemUI/res/values/cr_dimens.xml create mode 100644 packages/SystemUI/res/values/cr_strings.xml create mode 100644 packages/SystemUI/res/values/cr_styles.xml create mode 100644 packages/SystemUI/res/values/cr_symbols.xml diff --git a/core/res/res/values/cr_arrays.xml b/core/res/res/values/cr_arrays.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/core/res/res/values/cr_arrays.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/core/res/res/values/cr_attrs.xml b/core/res/res/values/cr_attrs.xml new file mode 100644 index 000000000000..359efbead321 --- /dev/null +++ b/core/res/res/values/cr_attrs.xml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/core/res/res/values/cr_colors.xml b/core/res/res/values/cr_colors.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/core/res/res/values/cr_colors.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/core/res/res/values/cr_config.xml b/core/res/res/values/cr_config.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/core/res/res/values/cr_config.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/core/res/res/values/cr_dimens.xml b/core/res/res/values/cr_dimens.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/core/res/res/values/cr_dimens.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/core/res/res/values/cr_strings.xml b/core/res/res/values/cr_strings.xml new file mode 100644 index 000000000000..f64316a150bb --- /dev/null +++ b/core/res/res/values/cr_strings.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/core/res/res/values/cr_styles.xml b/core/res/res/values/cr_styles.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/core/res/res/values/cr_styles.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/core/res/res/values/cr_symbols.xml b/core/res/res/values/cr_symbols.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/core/res/res/values/cr_symbols.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/SystemUI/res/values-night/cr_colors.xml b/packages/SystemUI/res/values-night/cr_colors.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/packages/SystemUI/res/values-night/cr_colors.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/SystemUI/res/values/cr_arrays.xml b/packages/SystemUI/res/values/cr_arrays.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/packages/SystemUI/res/values/cr_arrays.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/SystemUI/res/values/cr_attrs.xml b/packages/SystemUI/res/values/cr_attrs.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/packages/SystemUI/res/values/cr_attrs.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/SystemUI/res/values/cr_colors.xml b/packages/SystemUI/res/values/cr_colors.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/packages/SystemUI/res/values/cr_colors.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/SystemUI/res/values/cr_config.xml b/packages/SystemUI/res/values/cr_config.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/packages/SystemUI/res/values/cr_config.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/SystemUI/res/values/cr_dimens.xml b/packages/SystemUI/res/values/cr_dimens.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/packages/SystemUI/res/values/cr_dimens.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/SystemUI/res/values/cr_strings.xml b/packages/SystemUI/res/values/cr_strings.xml new file mode 100644 index 000000000000..f64316a150bb --- /dev/null +++ b/packages/SystemUI/res/values/cr_strings.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/SystemUI/res/values/cr_styles.xml b/packages/SystemUI/res/values/cr_styles.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/packages/SystemUI/res/values/cr_styles.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/packages/SystemUI/res/values/cr_symbols.xml b/packages/SystemUI/res/values/cr_symbols.xml new file mode 100644 index 000000000000..ae31375594fe --- /dev/null +++ b/packages/SystemUI/res/values/cr_symbols.xml @@ -0,0 +1,8 @@ + + + + + From 15e3051e13c36b67457da236017395daf60e144a Mon Sep 17 00:00:00 2001 From: Pranav Vashi Date: Wed, 13 Jul 2022 21:05:54 +0530 Subject: [PATCH 014/723] SystemUI: Update black theme package overlay Signed-off-by: Pranav Vashi --- .../src/com/android/systemui/theme/ThemeOverlayApplier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayApplier.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayApplier.java index fe928c381156..9bfc193a508e 100644 --- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayApplier.java +++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayApplier.java @@ -68,7 +68,7 @@ public class ThemeOverlayApplier implements Dumpable { static final String SYSUI_PACKAGE = "com.android.systemui"; static final String OVERLAY_BLACK_THEME = - "org.lineageos.overlay.customization.blacktheme"; + "com.android.system.theme.black"; static final String OVERLAY_CATEGORY_DYNAMIC_COLOR = "android.theme.customization.dynamic_color"; From 0800658126e4392febbcfc4835681f5ca9e2b1df Mon Sep 17 00:00:00 2001 From: Pranav Vashi Date: Wed, 7 Oct 2020 13:11:29 +0530 Subject: [PATCH 015/723] base: Export bodyFontFamily and bodyFontFamilyMedium symbols * So that they can be used in apps like launcher and settings. Signed-off-by: Pranav Vashi --- core/res/res/values/symbols.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index a0ae922789e2..0ce6e1ed859e 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -4193,6 +4193,8 @@ + + From ac73810aaf6cdf03c185b2f47c3bd47d7e7c9563 Mon Sep 17 00:00:00 2001 From: Pranav Vashi Date: Sun, 29 Dec 2019 19:31:38 +0530 Subject: [PATCH 016/723] Wire up default fonts with config Signed-off-by: Pranav Vashi --- core/res/res/layout/time_picker_material.xml | 2 +- core/res/res/values/config.xml | 4 ++-- .../res/values/donottranslate_material.xml | 24 +++++++++---------- core/res/res/values/styles.xml | 4 ++-- core/res/res/values/styles_material.xml | 16 ++++++------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/core/res/res/layout/time_picker_material.xml b/core/res/res/layout/time_picker_material.xml index 75973798219e..ee733f1f39e8 100644 --- a/core/res/res/layout/time_picker_material.xml +++ b/core/res/res/layout/time_picker_material.xml @@ -44,7 +44,7 @@ android:paddingTop="20dp" android:paddingBottom="20dp" android:includeFontPadding="false" - android:fontFamily="sans-serif-medium" + android:fontFamily="@string/config_bodyFontFamilyMedium" android:textSize="34sp" android:textColor="@color/white" android:text="@string/time_picker_header_text"/> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 2bffe6d3972d..110367f2ea9f 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -5298,7 +5298,7 @@ 90 - + sans-serif @@ -5383,7 +5383,7 @@ true - @string/font_family_button_material + sans-serif-medium sans-serif diff --git a/core/res/res/values/donottranslate_material.xml b/core/res/res/values/donottranslate_material.xml index 9cf9f6cfa86d..24ae4d430a94 100644 --- a/core/res/res/values/donottranslate_material.xml +++ b/core/res/res/values/donottranslate_material.xml @@ -16,17 +16,17 @@ - sans-serif-light - sans-serif - sans-serif - sans-serif - sans-serif - sans-serif-medium - sans-serif - sans-serif - sans-serif-medium - sans-serif - sans-serif - sans-serif-medium + @string/config_lightFontFamily + @string/config_bodyFontFamily + @string/config_bodyFontFamily + @string/config_bodyFontFamily + @string/config_headlineFontFamily + @string/config_headlineFontFamilyMedium + @string/config_headlineFontFamily + @string/config_bodyFontFamily + @string/config_bodyFontFamilyMedium + @string/config_bodyFontFamily + @string/config_bodyFontFamily + @string/config_headlineFontFamilyMedium diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 3f75fd90284b..840b3f5ed0f1 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -283,7 +283,7 @@ please see styles_device_defaults.xml. @@ -999,7 +999,7 @@ please see styles_device_defaults.xml. diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml index 4f714af08e2a..9c32b1fd8a8e 100644 --- a/core/res/res/values/styles_material.xml +++ b/core/res/res/values/styles_material.xml @@ -429,7 +429,7 @@ please see styles_device_defaults.xml. From 59e80fde2a0c8f207285c13d941cedd669da6250 Mon Sep 17 00:00:00 2001 From: Pranav Vashi Date: Sun, 5 Jun 2022 01:53:48 +0530 Subject: [PATCH 017/723] base: Use font configs instead hardcoded fonts Signed-off-by: Pranav Vashi Signed-off-by: AnierinB --- .../res/layout/accessibility_button_chooser_item.xml | 2 +- .../layout/accessibility_enable_service_warning.xml | 12 ++++++------ .../layout/accessibility_shortcut_chooser_item.xml | 4 ++-- core/res/res/layout/immersive_mode_cling.xml | 6 +++--- .../res/layout/input_method_switch_dialog_new.xml | 2 +- .../res/layout/input_method_switch_item_header.xml | 2 +- core/res/res/layout/input_method_switch_item_new.xml | 4 ++-- packages/SystemUI/res/layout/contaminant_dialog.xml | 4 ++-- .../SystemUI/res/layout/immersive_mode_cling.xml | 6 +++--- .../res/layout/shutdown_dialog_finder_active.xml | 6 +++--- packages/SystemUI/res/layout/smart_action_button.xml | 2 +- packages/SystemUI/res/layout/smart_reply_button.xml | 2 +- packages/SystemUI/res/values/styles.xml | 6 +++--- .../android/systemui/volume/SegmentedButtons.java | 10 ++++++++-- 14 files changed, 37 insertions(+), 31 deletions(-) diff --git a/core/res/res/layout/accessibility_button_chooser_item.xml b/core/res/res/layout/accessibility_button_chooser_item.xml index 33d6fa2862f7..70905ca19192 100644 --- a/core/res/res/layout/accessibility_button_chooser_item.xml +++ b/core/res/res/layout/accessibility_button_chooser_item.xml @@ -45,7 +45,7 @@ android:textAppearance="?attr/textAppearanceSmall" android:textColor="?attr/textColorPrimary" android:textSize="12sp" - android:fontFamily="sans-serif-condensed" + android:fontFamily="@*android:string/config_bodyFontFamily" android:gravity="top|center_horizontal" android:minLines="2" android:maxLines="2" diff --git a/core/res/res/layout/accessibility_enable_service_warning.xml b/core/res/res/layout/accessibility_enable_service_warning.xml index 01ef10177c5a..fc6f49837519 100644 --- a/core/res/res/layout/accessibility_enable_service_warning.xml +++ b/core/res/res/layout/accessibility_enable_service_warning.xml @@ -51,7 +51,7 @@ android:gravity="center" android:textSize="20sp" android:textColor="?android:attr/textColorPrimary" - android:fontFamily="google-sans-medium"/> + android:fontFamily="@*android:string/config_headlineFontFamily"/> + android:fontFamily="@*android:string/config_bodyFontFamily"/> + android:fontFamily="@*android:string/config_headlineFontFamily"/> + android:fontFamily="@*android:string/config_bodyFontFamily"/> + android:fontFamily="@*android:string/config_headlineFontFamily"/> + android:fontFamily="@*android:string/config_bodyFontFamily" /> + android:fontFamily="@*android:string/config_bodyFontFamily"/> + android:fontFamily="@*android:string/config_bodyFontFamily"/> diff --git a/core/res/res/layout/immersive_mode_cling.xml b/core/res/res/layout/immersive_mode_cling.xml index 4e869b76b510..385c7191365c 100644 --- a/core/res/res/layout/immersive_mode_cling.xml +++ b/core/res/res/layout/immersive_mode_cling.xml @@ -44,7 +44,7 @@ android:text="@string/immersive_cling_title" android:textColor="@androidprv:color/materialColorOnSurface" android:textSize="24sp" - android:fontFamily="google-sans" /> + android:fontFamily="@*android:string/config_headlineFontFamily" /> + android:fontFamily="@*android:string/config_bodyFontFamily" />