Skip to content

Fix ColorOS Hans blocking Gmail sync jobs - #269

Open
Avi7ii wants to merge 1 commit into
kooritea:masterfrom
Avi7ii:agent/coloros16-hans-gmail-sync
Open

Avi7ii wants to merge 1 commit into
kooritea:masterfrom
Avi7ii:agent/coloros16-hans-gmail-sync

Conversation

@Avi7ii

@Avi7ii Avi7ii commented Aug 8, 2026

Copy link
Copy Markdown

What changed

  • Hook OplusSceneManager.checkJobIfRestricted(int, String, JobInfo) on ColorOS.
  • Return “not restricted” only when all of the following match:
    • the user selected Gmail in FCMFix;
    • the source and owning package are com.google.android.gm;
    • the job service is Android's SyncJobService;
    • the sync provider is gmail-ls.
  • Keep every other job and the existing FCMFix behavior unchanged.

Root cause

On ColorOS 16, FCMFix can successfully receive the FCM broadcast, unfreeze Gmail, and bypass broadcast proxying, while the expedited Gmail sync job still remains blocked. ColorOS' JobSchedulerServiceExtImpl delegates its final readiness decision to OplusSceneManager, which in turn asks Hans whether the job is restricted.

This leaves the gmail-ls job pending until an unrelated OEM process-state transition releases it, causing delayed and unpredictable notifications.

Impact

The change does not keep Gmail alive, enable autostart, or broadly bypass Hans. It only removes the vendor restriction from the selected Gmail sync job, allowing Android's normal JobScheduler and SyncManager flow to continue.

Verification

Tested on OnePlus PKX110, Android 16 / ColorOS 16.0.9.401:

  • Clean boot with Gmail never manually opened.
  • FCM cold-started Gmail after the previous Gmail process had been removed.
  • Runtime log sequence:
    • FCM broadcast proxy bypass at 22:29:14.489;
    • Hans job bypass at 22:29:14.682;
    • gmail-ls sync start at 22:29:14.684;
    • Gmail notification enqueue at 22:29:14.771;
    • sync completion at 22:29:15.839.
  • ./gradlew clean assembleDebug testDebugUnitTest completed successfully (testDebugUnitTest had no test sources).
  • The generated APK retained the official package ID and Xposed entry, and contained the new exact-match hook.

@Avi7ii
Avi7ii marked this pull request as ready for review August 11, 2026 08:35
@074807

074807 commented Aug 27, 2026

Copy link
Copy Markdown

Blocked my Gmail account Pilz unlock my Gmail

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.

2 participants