Skip to content

Bypass the SystemUI notification flags on Android 15 too - #882

Merged
JingMatrix merged 1 commit into
masterfrom
notification-flags-android-15
Aug 6, 2026
Merged

Bypass the SystemUI notification flags on Android 15 too#882
JingMatrix merged 1 commit into
masterfrom
notification-flags-android-15

Conversation

@JingMatrix

@JingMatrix JingMatrix commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Constructing a Notification reads an aconfig flag of the systemui container (Notification() on android16-release, flag declaration). The generated FeatureFlagsImpl caches that read behind systemui_is_cached, and the read itself queries content://settings/config, which the daemon cannot obtain: it holds an ActivityThread but no application record, so ActivityManagerService refuses it a provider (ContentProviderHelper) and the constructor throws SecurityException. The field is set only after the read returns, so the failure never converges and every later construction repeats it. Setting it in advance leaves the flags at their compiled defaults and removes the read (feature flagging).

The bypass dates from 1b98e55cf and was gated on SDK_INT >= VANILLA_ICE_CREAM. The read belongs to Android 16, but the gate was wider on purpose: #96 was a Xiaomi HyperOS device failing this way on Android 15, filed four days before Android 16 DP1 was published, the vendor having taken the platform change without the SDK level. #597 rewrote the gate as SDK_INT == 36 and that case was lost. #880 is the same report as #96, same vendor and same version, and its reporter confirms 2.0 (3021) predates #597 and works while 2.2 (3080) does not.

Android 17 sets the fields unconditionally and the flag is gone from the class (Notification() on android17-release), so the test spans 35 to 36: the versions in which the field can exist, rather than the version that introduced it. A device that never carried it fails with the ClassNotFoundException already ignored there. The unguarded builders in NotificationManager are left as they are.

Constructing a Notification on Android 16 reads an aconfig flag of the
systemui container, and the daemon cannot serve that read: it holds an
ActivityThread but no application record, so the settings provider is
refused it and the constructor throws SecurityException. Setting
systemui_is_cached ahead of the first read avoids it.

The gate has been SDK_INT == 36 since the Kotlin refactor. It was
originally >= VANILLA_ICE_CREAM, because Xiaomi shipped the change on
Android 15 without the SDK level, which is #96 and now #880 again.
Android 17 drops the read, so the test now spans 35 to 36.
@JingMatrix
JingMatrix force-pushed the notification-flags-android-15 branch from f96d3ce to ed77923 Compare August 6, 2026 12:24
@JingMatrix
JingMatrix merged commit 077131d into master Aug 6, 2026
1 check passed
@JingMatrix
JingMatrix deleted the notification-flags-android-15 branch August 7, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daemon notifications never post on Android 15: Notification.<init> reads a DeviceConfig flag the daemon cannot reach

1 participant