WmTests: fix natural rotation tests - #1341
Open
CeRRiLLo89 wants to merge 1019 commits into
Open
Conversation
Remove the delayed dismiss message when LogAccessDialogActivity is destroyed and guard the final dialog dismiss in onClick(). This prevents stale timeout callbacks from interacting with a detached DecorView after configuration changes. Change-Id: Ib8abe68cb4c7aa95dd90b9c67d1b6ac7cd3706b3 Signed-off-by: Quince <quinceroms@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I64d455835389acb2e591ff0b623797e1e122f06d Signed-off-by: rmp22 <195054967+rmp22@users.noreply.github.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
During USB headset disconnection, AudioDeviceBroker synchronously restores mBluetoothA2dpEnabled=true, but mGlobalBluetoothA2dpOn in MediaRouterService is only updated later via the asynchronous dispatchAudioRoutesChanged callback. A playback state change in this transient window causes restoreBluetoothA2dp() to read the stale mGlobalBluetoothA2dpOn=false and call setBluetoothA2dpOn(false), overriding the already-restored A2DP state and suppressing Bluetooth audio output. Fix by cross-checking with AudioService.isBluetoothA2dpOn() before setting A2DP off. When the two states are inconsistent (local says off but AudioService says on), skip the stale request. Bug: 498786084 Test: 1. Connect Bluetooth headphones and play music. 2. Plug in USB headphones. 3. Unplug USB headphones. Flag: EXEMPT bug fix Change-Id: I98a64166f0f130347cb90cebf362c6d1a9935024 Signed-off-by: chenxin20 <chenxin20@xiaomi.com>
…in scenarios involving dual instances of the app. Perform a backup for each user. Test: atest Bug:498471068 Change-Id: Ib3cd2fbd58a8039a9c0a598e9d6346ff3b00e01c Signed-off-by: luanzhuang <luanzhuang@xiaomi.corp-partner.google.com>
… for lock screen unlocking Bug: 499150034 Test: 1. Set PIN unlock method 2. Lock it and press the unlock button 3. Intentionally enter the wrong password and wait for the countdown. 4. During the countdown, repeatedly open and close the unlock disc 5. Check if the countdown is correct Change-Id: I7c15a95a7871a04ec0a71f5405be2d014aadfe45
Change-Id: I2aaa9e526b6f1a35d45e96b6d23e3db972d82733 Signed-off-by: Joey Huab <joey@evolution-x.org> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
A leak can occur for any app that uses StrictMode#enableDefaults or sets
StrictMode.VmPolicy.Builder's detectBlockedBackgroundActivityLaunch or detectAll. If any of those
are called or set, every call to StrictMode#setVmPolicy (this is used in core framework code like
LoadedApk) will trigger StrictMode#registerBackgroundActivityLaunchCallback. This registers a brand
new callback every time.
In system_server, these new callbacks are just stored in an ArrayMap in
BackgroundActivityStartController's addStrictModeCallback which uses the IBinder as the map key.
Since every new BackgroundActivityLaunchCallback is a distinct IBinder, containsKey(callback) never
returns true for a new callback instance from StrictMode.
For userdebug/eng builds, this leak can also occur in any bundled system app due to the logic in
StrictMode#initVmDefaults. In particular, SystemUI can crash because of this leak. When such a crash
occurs, the following is printed out (UID 10126 is SystemUI):
V Binder : BinderProxy descriptor histogram (top 10):
V Binder : # 1: android.app.IBackgroundActivityLaunchCallback x5698
V Binder : # 2: android.content.IIntentReceiver x471
V Binder : # 3: android.content.IContentProvider x304
V Binder : # 4: android.database.IContentObserver x237
V Binder : # 5: android.app.IApplicationThread x140
V Binder : # 6: com.android.internal.os.IResultReceiver x135
V Binder : # 7: android.app.IUnsafeIntentStrictModeCallback x92
V Binder : # 8: x86
V Binder : # 9: <cleared weak-ref> x83
V Binder : # 10: <proxy to dead node> x54
D Binder : Per Uid Binder Proxy Counts:
...
D Binder : UID : 10126 count = 6006
...
E BpBinder: Too many binder proxy objects sent to uid 1000 from uid 10126 (... proxies held)
E ActivityManager: Uid 10126 sent too many Binders to uid 1000
...
I ActivityManager: Killing 2145:com.android.systemui/u0a126 (adj -800): Too many Binders sent to SYSTEM
I am_kill : [User=0,PID=2145,Process Name=com.android.systemui,OomAdj=-800,Reason=Too many Binders sent to SYSTEM,Rss=477156B]
StrictMode#initVmDefaults calls builder.detectAll() for all bundled system apps on userdebug and eng
builds. detectAll() includes DETECT_VM_BACKGROUND_ACTIVITY_LAUNCH_ABORTED. SystemUI is a bundled
system app, so it gets this flag at startup. With this flag, every call to StrictMode#setVmPolicy
will trigger StrictMode#registerBackgroundActivityLaunchCallback.
A hot path is in LoadedApk which SystemUI calls very often when managing notification UI. In
LoadedApk#canAccessDataDir, the following pattern is used which should demonstrate how this leak
can happen:
StrictMode.VmPolicy old = StrictMode.allowVmViolations();
try {
// StrictMode violation code
} finally {
StrictMode.setVmPolicy(old); // re-registers a new BAL callback every time
}
It's not unexpected for other apps to be following this pattern as well.
The following is a stacktrace of how SystemUI adds new BAL callbacks. This runs on every
notification that gets posted:
```
W StrictMode: java.lang.Throwable
W StrictMode: at android.os.StrictMode.registerBackgroundActivityLaunchCallback(StrictMode.java:2230)
W StrictMode: at android.os.StrictMode.setVmPolicy(StrictMode.java:2222)
W StrictMode: at android.app.LoadedApk.setVmPolicy(LoadedApk.java:875)
W StrictMode: at android.app.LoadedApk.canAccessDataDir(LoadedApk.java:1170)
W StrictMode: at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:962)
W StrictMode: at android.app.LoadedApk.getClassLoader(LoadedApk.java:1183)
W StrictMode: at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:3169)
W StrictMode: at android.app.ApplicationPackageManager.getResourcesForApplication(ApplicationPackageManager.java:2199)
W StrictMode: at android.app.ApplicationPackageManager.getResourcesForApplication(ApplicationPackageManager.java:2182)
W StrictMode: at android.app.ApplicationPackageManager.getResourcesForApplication(ApplicationPackageManager.java:2218)
W StrictMode: at android.graphics.drawable.Icon.loadDrawableAsUser(Icon.java:616)
W StrictMode: at com.android.systemui.statusbar.StatusBarIconView.getIcon(StatusBarIconView.java)
W StrictMode: at com.android.systemui.statusbar.StatusBarIconView.updateDrawable(StatusBarIconView.java)
W StrictMode: at com.android.systemui.statusbar.StatusBarIconView.set(StatusBarIconView.java)
W StrictMode: at com.android.systemui.statusbar.notification.icon.IconManager.setIcon(IconManager.java)
W StrictMode: at com.android.systemui.statusbar.notification.icon.IconManager.createIcons(IconManager.java)
W StrictMode: at com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl.inflateViews(NotificationRowBinderImpl.java)
W StrictMode: at com.android.systemui.statusbar.notification.collection.NotifInflaterImpl.inflateViewsImpl(NotifInflaterImpl.java)
W StrictMode: at com.android.systemui.statusbar.notification.collection.coordinator.PreparationCoordinator.inflateEntry(PreparationCoordinator.java)
W StrictMode: at com.android.systemui.statusbar.notification.collection.coordinator.PreparationCoordinator.inflateRequiredNotifViews(PreparationCoordinator.java)
W StrictMode: at com.android.systemui.statusbar.notification.collection.coordinator.PreparationCoordinator.inflateRequiredGroupViews(PreparationCoordinator.java)
W StrictMode: at com.android.systemui.statusbar.notification.collection.coordinator.PreparationCoordinator$$ExternalSyntheticLambda2.onBeforeFinalizeFilter(PreparationCoordinator.java)
W StrictMode: at com.android.systemui.statusbar.notification.collection.ShadeListBuilder$$ExternalSyntheticLambda12.accept(ShadeListBuilder.java)
W StrictMode: at com.android.systemui.util.NamedListenerSet.forEachTraced(NamedListenerSet.java)
W StrictMode: at com.android.systemui.statusbar.notification.collection.ShadeListBuilder$$ExternalSyntheticLambda7.run(ShadeListBuilder.java)
W StrictMode: at com.android.systemui.statusbar.notification.collection.NotifPipelineChoreographerImpl$frameCallback$1.doFrame(NotifPipelineChoreographerImpl.kt)
W StrictMode: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1628)
W StrictMode: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1639)
W StrictMode: at android.view.Choreographer.doCallbacks(Choreographer.java:1235)
W StrictMode: at android.view.Choreographer.doFrame(Choreographer.java:1160)
W StrictMode: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1613)
```
There's also another path from
com.android.systemui.statusbar.notification.collection.coordinator.MediaCoordinator.shouldFilterOut
not shown here.
The SystemUI crash only occurs on userdebug/eng, but any app using the BAL StrictMode methods or the
StrictMode#enableDefaults will have this leak as well.
Note that StrictMode's BackgroundActivityLaunchCallback only calls static methods, so there's really
no point in making new instances for every call. system_server doesn't do anything with newly added
callbacks other than add it to an ArrayMap and link a death recipient. This also follows the
approach of StrictMode's existing usage of sUnsafeIntentCallback.
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
fix for mtk and low-end devices perf regression caused by fixed dp translate and fade animation Change-Id: Ibaf8a426b6e1d819dde9f131c8ef50b0268d24e9 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I0bc91f3c97af7995fc3174f72dedd6febb291ec6 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
preloading the animations during application bind, makes the activity loading way more faster, removing the latency during activity launch click Change-Id: I8ae7e6c950d710593e695e94ae152d6815637d67 Signed-off-by: rmp22 <195054967+rmp22@users.noreply.github.com>
Change-Id: Ieec1869bac37104cd8733278865cf44e773b8971 Signed-off-by: rmp22 <195054967+rmp22@users.noreply.github.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I8c436985a1c7c2a96453f5163022ff279e82af90 Signed-off-by: Saikrishna1504 <saikrishna26918@gmail.com>
…margin On devices with a low-positioned UDFPS icon, the lockscreen chip can overlap and render behind it in collapsed mode. Align the chip with the keyguard indication margin and use the `keyguard_indication_margin_bottom` overlay to adjust placement per device as needed. Change-Id: I4f253bc37ba3f565f4c480ce30a4f3beabfc7d9e
fix notification animation oscillation during expansion - use aosp transition api fix resource usage when showing media chip - remove waveform animation and use 1 iteration marquee low udfps position algorithm chip content changes transform animaton Change-Id: I9087d504bf126c7d8b5d35486f9d39e6b0564026
AxionAOSP/issue_tracker#110 Change-Id: Ib95eb4807a374d362734c940c3f82a118b3a301b Signed-off-by: rmp22 <195054967+rmp22@users.noreply.github.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I3777f3899ede8b2bc94e64aeaeac7fa4dd262ab1 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I29bca3b6435ac95bf4dc76ac95bf4dc76ac95bf5 Signed-off-by: Saikrishna1504 <saikrishna26918@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I29bca3b6435ac95bf4dc76ac95bf4dc76ac95bf6 Signed-off-by: Saikrishna1504 <saikrishna26918@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: Iec04c3b59cfb0200ddd33e7ee92c212a1a6f44ae Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
removing unncecessary events | rewiring to aosp status bar chip Change-Id: Ib1c2bbcd09c871ff14a2c18f485bee22874679a1 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
[neobuddy89: This is trimmed version for dynamic bar usage.] Co-authored-by: Pranav Vashi <neobuddy89@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
adding hooks to reduce ax platform apps boilerplate [neobuddy89: Hook in SystemUICoreStartableModule.] Change-Id: Ibdbd59a11ea8375c8698bef65a971a6c522fbe3e Signed-off-by: rmp22 <195054967+rmp22@users.noreply.github.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* Added periodic ticker which refreshes charging info. * Added customization to disable static battery chip on lock screen. Change-Id: Ie81f1e975d3955a85437f864ef8ad8f774bd8f53 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Refactor charging info construction to use a list-based model with
TextUtils.join(" · ", …), replacing manual string concatenation.
This improves readability and makes future metric additions easier.
Introduce formatChargingString() to normalize emitted text while
preserving existing state semantics. Unlike the previous approach,
this avoids emitting empty values when not charging and instead
retains the current indication string, preventing UI resets on
the lockscreen during transient state changes.
Additionally, fix formatting correctness by:
- Using Locale.US for deterministic numeric output
- Ensuring floating-point division for accurate metric values
This keeps the data flow behavior introduced earlier intact while
making the formatting logic more robust and maintainable.
Change-Id: I255d6658c8f488b58e277184e6551a644a2ac3d8
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Refactor and enhance charging information handling in the Dynamic Bar keyguard chip to improve readability, stability, and UI behavior. Key changes: - Split extended charging metrics into a structured 2-line layout: primary (charging status) and secondary (current, wattage, voltage, temperature). - Replace single-line text rendering with a Column-based layout to properly support multi-line content and visual hierarchy. - Dynamically adjust chip height and use flexible width constraints with animateContentSize for smoother transitions. - Normalize and sanitize charging strings using a centralized helper (rememberChargingParts), ensuring consistent parsing across all call sites. - Harden parsing logic with trimming, filtering, and bounded splitting (limit = 3) to prevent malformed or unexpected upstream strings from breaking UI layout. - Improve fallback handling to avoid empty or invalid text states. This results in a cleaner, more readable charging UI while maintaining backward compatibility and stable behavior under edge cases. Change-Id: I7453d8658c8f488b58e277184e6551a644a2ac3d8 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: Ief617c2e09f6fd7dd6fcdd4fccad792994a89e8f Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* This follows AOSP implementation. * Shows animation only when playing. Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* Add and activate dismiss swipe lock when seekbar is dragged. Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Flag: com.android.systemui.flashlight_strength Bug: 446110051 Test: manual. open flashlight dilaog, verify separator has enough contrast from the background. Change-Id: Iaaaecfdd0941e75e519358546c9b1e74e00ac848 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
When removing a media card, pagerState.currentPage could be updated out of sync with the viewModel cards, causing a crash. This change adds viewModel.cards.size as a key so that we get both relevant updates, and only call onCardSelected when valid. Fixes: 452266758 Test: QSMediaControllerUmoInQqsAndQs Test: manual - add/remove multiple media players Flag: com.android.systemui.scene_container Flag: com.android.systemui.media_controls_in_compose Change-Id: I555b8a80651e79296cb4809c52306d741e6bd06d Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Flag: com.android.systemui.scene_container Flag: com.android.systemui.media_controls_in_compose Fix: 468267280 Test: Checked UI - taps on playPause button on UMO. Change-Id: I013a7e51e0b4f0f741e8c6d80c39345cdf227df7 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I99b63bb159bf501049d9b16b755141c8d06a53f7 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I253aeb9c6f1344cfd1e637aa96b3e8f9d68ecb30 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I6c927575d1ccd0a5af1f1d43fa6ca6e949380583 Signed-off-by: Ghosuto <clash.raja10@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I1c2201b2eac267c1af7b65ad31327c517c8803c8 Signed-off-by: Ghosuto <clash.raja10@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I684dc77bd89fcab8fb51b342a3dc76c3b6afe687 Signed-off-by: Ghosuto <clash.raja10@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: I14a14ab89afbecaca4b2af59403ed3b5b1eda37c Signed-off-by: Ghosuto <clash.raja10@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
the backdrop was heavy and messy, mtk hates complex fade animations, programatically load app start animation to reduce pressure during splash screen animation, simpleperf shows parsing the animation from xml consumes high cpu usage due to resource lookup. Change-Id: Icc38c2d3db1a05ceedf41433d13cc75a8de7732f Signed-off-by: rmp22 <195054967+rmp22@users.noreply.github.com> Signed-off-by: Ghosuto <clash.raja10@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Ghosuto <clash.raja10@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* New translations cr_strings.xml (Vietnamese) [ci skip] * New translations cr_strings.xml (Japanese) [ci skip] * New translations cr_strings.xml (Japanese) [ci skip] * New translations cr_strings.xml (Japanese) [ci skip] * New translations cr_strings.xml (French) [ci skip] * New translations cr_strings.xml (German) [ci skip] * New translations cr_strings.xml (Persian) [ci skip] * New translations cr_strings.xml (Vietnamese) [ci skip] * New translations cr_strings.xml (Chinese Traditional) [ci skip] * New translations cr_strings.xml (Persian) [ci skip] * New translations cr_strings.xml (Persian) [ci skip] * New translations cr_strings.xml (Spanish) [ci skip] * New translations cr_strings.xml (Korean) [ci skip]
Parse optional id attributes on java-symbol entries and preserve private resource IDs while merging resource tables. Pin the contextual search framework resources to the IDs expected by the Pixel Launcher prebuilt. Without this, resource ID 0x01040241 resolves to config_defaultContextualSearchLegacyEnabled instead of config_defaultContextualSearchPackageName, causing contextual search availability checks to fail.
System compaction unconditionally applies the CompactFull process profile to non-application processes. On devices without a valid memory.reclaim memcg profile this produces repeated failed cgroup operations. Reuse the existing cached profile validation before scheduling global system compaction. Per-process compaction and the process_madvise fallback remain unchanged.
…earch-resource-ids aapt2: support explicit IDs for private symbols
…tsystem-fix CachedAppOptimizer: skip unsupported system memcg compaction
Fixes: crdroidandroid/issue_tracker#1079 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* followup for 7d00865ae9250da503410ddb1763183526833ba2 reference: https://android-review.googlesource.com/c/platform/frameworks/base/+/2492460 Signed-off-by: minaripenguin <minaripenguin@users.noreply.github.com> Signed-off-by: Dmitrii <bankersenator@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Compaction flags are used as a bitmask, with FILE set to 1 and ANON set to 2. FULL therefore has the value 3. compactionFlagsValidForMemcg() uses the flags directly as an index, but its cache only has three entries, causing FULL compaction to be rejected as invalid and crash system_server. Size the cache from the maximum valid flag combination so all valid values from NONE through FULL can be cached. Fixes: 4ec6b89 ("CachedAppOptimizer: Fallback to process_madvise when memcg doesn't support compaction")
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
…imizer-full-compaction CachedAppOptimizer: Fix FULL memcg compaction validation
The Camera2 rewrite adds the preview as a fullscreen TYPE_APPLICATION_OVERLAY window without FLAG_NOT_TOUCHABLE. A fullscreen touchable window consumes every pointer event within its bounds, so nothing reaches the UI beneath it and the screen is effectively frozen while OnTheGo is active. Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
CeRRiLLo89
marked this pull request as ready for review
August 3, 2026 12:09
neobuddy89
force-pushed
the
16.0
branch
3 times, most recently
from
August 8, 2026 16:31
bf065ba to
708e793
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getNaturalRotation()method at the three affected test sites instead of referencing it as a value.foldableConfigFalse_locksRotation_usesNaturalRotationdeterministic by configuring the fake settings provider so the current rotation is not eligible.Root cause
The test source referenced
getNaturalRotationwithout invoking it, which preventsWmTestsfrom compiling. After correcting those calls, the natural-rotation test could still selectUSE_CURRENT_ROTATIONbecause the default allowed-rotation mask includes the device's current rotation. SettingACCELEROMETER_ROTATION_ANGLESto0in the fake resolver isolates the natural-rotation branch the test is intended to cover.This changes test code only; no production behavior is modified.
Validation
m -j6 WmTests— passedatest --serial 112eb247 'WmTests:com.android.server.wm.DeviceStateAutoRotateSettingControllerTests#foldableConfigFalse_locksRotation_usesNaturalRotation'— 1 passed, 0 failedatest --serial 112eb247 WmTests:com.android.server.wm.DeviceStateAutoRotateSettingControllerTests— 28 passed, 0 failedValidation device: Xiaomi Mi 9T Pro / Redmi K20 Pro (
raphael), Android 16.