Show tracker activity that is recorded but currently undisplayable (#694) - #695
Draft
kasnder wants to merge 1 commit into
Draft
Show tracker activity that is recorded but currently undisplayable (#694)#695kasnder wants to merge 1 commit into
kasnder wants to merge 1 commit into
Conversation
) Two ways the Timeline can stay empty while tracker access is being recorded and blocked normally. Unresolvable UIDs were dropped at display time. ServiceSinkhole's shouldTrackApp() deliberately defaults a UID whose package cannot be resolved to tracked ("Unknown UID, default to tracking"), so its tracker access is recorded and blocked — but both readers of the access table then discarded those rows: TimelineFragment skipped entries without a package name and InsightsDataProvider did the same. On Android 16 getPackagesForUid() throws SecurityException for UIDs of other users (work profile, Secure Folder, private space, cloned apps), which Util maps to null, so that activity was recorded and permanently invisible. List it under a UID label instead; entries without a package are not clickable, since the details screen is per package. The empty state could not say that recording is off. With "Search new trackers" (log_app) disabled, trackers are still blocked but no access row is ever written, so the Timeline stays empty forever while claiming "Watching for trackers…". Report that state separately and offer a way into settings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkoZNtELmKmfNMxLump749
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.
Investigating #694 (Timeline blank while blocking and the Traffic Log work) surfaced two states in which tracker activity is recorded — or deliberately not recorded — but the Timeline gives no sign of it. Neither is confirmed as that reporter's root cause yet; both are real on their own.
1. UIDs without a resolvable package were dropped at display time
ServiceSinkhole.shouldTrackApp()defaults a UID whose package cannot be resolved to tracked ("Unknown UID, default to tracking"), so its tracker access is blocked and written to theaccesstable. Both readers of that table then threw those rows away:TimelineFragment.buildTimeline()—if (appInfo == null || appInfo[1] == null) continueInsightsDataProvider.computeInsights()—if (packageName == null) continueOn Android 16
getPackagesForUid()throwsSecurityExceptionfor UIDs belonging to another user — work profile, Secure Folder, private space, cloned apps — whichUtil.getPackagesForUid()maps tonull(see #664). Activity from those apps was therefore recorded and permanently invisible, with no indication that anything had been hidden.Now such entries are listed under an "Unidentified app (UID …)" label and counted in insights. They are not clickable, because the details screen is keyed by package name, and the per-package preference checks in insights (VPN exclusion, tracker protection) are skipped for them — mirroring what the recorder already does.
2. The empty state could not say that recording is off
With Search new trackers (
log_app) disabled, trackers are still blocked but noaccessrow is ever written, so the Timeline stays empty permanently — while showing "Watching for trackers…", which implies it will fill up. That is precisely the shape of #694: blocking works, the Traffic Log works (separatelogpref), Timeline and all tracker counts stay at zero.TimelineEmptyAdapternow distinguishes three states — TrackerControl off, recording off, watching — and the recording-off card links into settings so the user can recover.Notes
stateFor()helper with a unit test (TimelineEmptyStateTest).javacand the rest reviewed by hand.:app:compileGithubDebugJavaWithJavacand:app:testGithubDebugUnitTeststill need a run on a machine with the SDK.Generated by Claude Code