Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
230 commits
Select commit Hold shift + click to select a range
d89431e
ADFA-7082: Vendor sqlite-js 1.3.7 with our patches
davidschachterADFA Nov 12, 2026
ae04160
ADFA-7082: Build the sqlite-js AAR for apps in subprojects:sqlite-js
davidschachterADFA Nov 12, 2026
f766299
ADFA-7082: Release the sqlite-js AAR to sqlite-js-latest
davidschachterADFA Nov 12, 2026
3372d3b
ADFA-7082: Build the sqlite-js AAR for arm64-v8a and armeabi-v7a only
davidschachterADFA Nov 12, 2026
1391c4b
ADFA-7082: Run no stored code by default; test sqlite-js on pull requ…
davidschachterADFA Nov 12, 2026
e0f400a
ADFA-7082: Update sqlite-js-latest in place, out of latest-release se…
davidschachterADFA Nov 12, 2026
362ad7f
ADFA-7082: Sort the QuickJS copyright lines the same on every machine
davidschachterADFA Nov 12, 2026
2f3460f
ADFA-7082: Log stored functions that cannot be listed; guard the tag …
davidschachterADFA Nov 12, 2026
401a052
ADFA-7082: Vendor the reviewed sqlite-js patches
davidschachterADFA Nov 12, 2026
44a6e88
ADFA-7082: Put back both the assets and the tag if a release update f…
davidschachterADFA Nov 12, 2026
3c93bda
ADFA-7082: Find js_functions in any case; sync the cancel test; doc c…
davidschachterADFA Nov 12, 2026
0d1f9db
ADFA-7082: Let a re-run repair a release left without its assets
davidschachterADFA Nov 12, 2026
ac748be
ADFA-7082: Vendor sqlite-js main with our changes merged, one patch left
davidschachterADFA Nov 12, 2026
8086fd1
ADFA-7082: Vendor the sqlite-js 1.4.1 release
davidschachterADFA Nov 12, 2026
6957c71
ADFA-7082: Let a connection open, and its stored functions load, duri…
davidschachterADFA Nov 12, 2026
763bb47
ADFA-7082: Patch two stack-bound crashes and two garbage cases
davidschachterADFA Nov 12, 2026
c084450
ADFA-7082: Let a re-run replace a release left as a draft
davidschachterADFA Nov 12, 2026
7f8e40c
style: spotless reformat, no functional change
davidschachterADFA Nov 12, 2026
a113c80
ADFA-7082: End the result sets an interrupted call leaves open
davidschachterADFA Nov 13, 2026
64269ea
ADFA-7082: Make ending result sets safe when it runs JavaScript, and …
davidschachterADFA Nov 13, 2026
851ee17
ADFA-7082: Stop what ending result sets runs; count the interrupts db…
davidschachterADFA Nov 13, 2026
8973b29
ADFA-7082: Answer the independent review of patches 0004 to 0007
davidschachterADFA Nov 13, 2026
db04941
ADFA-7082: Test a direct interrupt during db.exec with a result set kept
davidschachterADFA Nov 13, 2026
e538658
Merge branch 'stage' into feat/ADFA-7082-sqlite-js-aar
davidschachterADFA Nov 13, 2026
b8f7aa6
ADFA-7135: Define the interface between the SQLite debugger extension…
claude Nov 13, 2026
c603f89
ADFA-7136: Copy the MCP server from ShareYourApps, renamed
claude Nov 13, 2026
fab6cff
ADFA-7135 Add the sqlite-debugger module skeleton
claude Nov 13, 2026
1b53c59
ADFA-7136: MCP server with the eight read-only database tools
claude Nov 13, 2026
acddbd2
ADFA-7135 Implement the SQLite debugger extension and its host tests
claude Nov 13, 2026
ff0312f
ADFA-7135 Add the JNI layer and NativeDebugEngine
claude Nov 13, 2026
31dc721
style: spotless reformat of the SQLite debugger module, no functional…
claude Nov 13, 2026
16a006f
ADFA-7135 Fix three review findings in the extension
claude Nov 13, 2026
f03521d
ADFA-7136: Document the SQLite debugger module
claude Nov 13, 2026
e21aae3
ADFA-7136: List sqlite-debugger among the modules without ABI flavors
claude Nov 13, 2026
8dd5efb
ADFA-7136 Never let the debugger crash or miss the host app's early c…
claude Nov 13, 2026
c862c5c
ADFA-7135 Keep read-only server connections from holding locks
claude Nov 13, 2026
05c2a2b
ADFA-7136 Bound query results and report truncation per cell
claude Nov 13, 2026
d309d28
ADFA-7136 Drop stale server connections and stop expanding SQL when idle
claude Nov 13, 2026
d1f0feb
ADFA-7136 Test the JNI query path
claude Nov 13, 2026
7684331
ADFA-7136 Document the JNI test and the requery trace limit
claude Nov 13, 2026
3a5cb53
ADFA-7082: Vendor the sqlite-js 1.4.2 release
davidschachterADFA Nov 13, 2026
464e6e7
ADFA-7082: Test sqlite-js 1.4.2's result-set rule and patch 0002
davidschachterADFA Nov 13, 2026
5b9b062
ADFA-7082: Keep a call's cancel for the finals its result sets run
davidschachterADFA Nov 14, 2026
5b5cd20
ADFA-7082: Say what a late cancel does to a call's finals
davidschachterADFA Nov 16, 2026
9d87b3e
ADFA-7135 Set the Kotlin JVM target on the compile tasks
davidschachterADFA Nov 13, 2026
0ec489a
ADFA-7082: Read result sets as interrupted when the cancel lands whil…
davidschachterADFA Nov 16, 2026
5fc4976
ADFA-7082: Address review of the sqlite-js cancel patches
davidschachterADFA Nov 16, 2026
3e1830f
ADFA-7136 Bound the request head and refuse before reading the body; …
davidschachterADFA Nov 16, 2026
7cf251b
ADFA-7135 Refuse the process-wide heap limit and temp directory PRAGM…
davidschachterADFA Nov 16, 2026
f785f96
ADFA-7135 Give server connections a 3 s busy timeout
davidschachterADFA Nov 16, 2026
dcd342e
ADFA-7135 Fail a query whose argument count differs from its paramete…
davidschachterADFA Nov 16, 2026
d90b7b4
ADFA-7136 List an open database once when the databases folder is rea…
davidschachterADFA Nov 16, 2026
3527173
ADFA-7135 Run the sqlite-debugger host tests in CI
davidschachterADFA Nov 16, 2026
e6b2e26
ADFA-7138 Add sqlite-rewrite-runtime, the helpers the requery rewrite…
davidschachterADFA Nov 16, 2026
e392fe9
ADFA-7138 Rewrite android.database.sqlite to requery in the Gradle pl…
davidschachterADFA Nov 16, 2026
0c28568
ADFA-7138 Code on the Go injects the rewrite runtime AAR and checks t…
davidschachterADFA Nov 16, 2026
b65e593
ADFA-7138 Add the SQLite debugger AAR to debuggable variants when opt…
davidschachterADFA Nov 16, 2026
2a5cb6d
ADFA-7138 Apply the rewrite and the debugger from one opt-in property
davidschachterADFA Nov 16, 2026
9dc56f0
ADFA-7138 Do not apply or provision Quick Build for a project that op…
davidschachterADFA Nov 16, 2026
dd570d4
ADFA-7138 Add a script that checks an APK carries no SQLite debugger
davidschachterADFA Nov 16, 2026
4a9bc95
ADFA-7138 Docs: describe the SQLite rewrite and the Gradle wiring
davidschachterADFA Nov 16, 2026
2c78e0a
ADFA-7138 Quick Build opt-in check reads the sources Gradle's findPro…
davidschachterADFA Nov 16, 2026
4e4718f
ADFA-7138 Fail the build when a variant's runtime classpath cannot be…
davidschachterADFA Nov 16, 2026
b15fa5d
ADFA-7082: Vendor the sqlite-js 1.4.3 release, with no patches
davidschachterADFA Nov 16, 2026
d6e0d1a
style: spotless rewrap of the cancelAll() javadoc, no functional change
davidschachterADFA Nov 16, 2026
0c2e603
ADFA-7082: Answer the independent review of the 1.4.3 move
davidschachterADFA Nov 16, 2026
f46e68e
ADFA-7082: Record the phone run of the 1.4.3 build
davidschachterADFA Nov 16, 2026
e9e3f7d
ADFA-7135: Merge #2244 (sqlite-js 1.4.3) into the debugger stack
davidschachterADFA Nov 16, 2026
3605133
ADFA-7138: Merge ADFA-7135 (with #2244's sqlite-js 1.4.3) up the stack
davidschachterADFA Nov 16, 2026
627aa94
ADFA-7138: Say how to turn the SQLite debugger on in an app
davidschachterADFA Nov 16, 2026
5b54c33
ADFA-7135: Correct two README lines the CI and device work made false
davidschachterADFA Nov 16, 2026
2394a80
ADFA-7138: Say how to build when the rewrite fails on a library class
davidschachterADFA Nov 16, 2026
810fe1c
ADFA-7138: Merge ADFA-7135 (README corrections) up the stack
davidschachterADFA Nov 16, 2026
efc07f7
ADFA-7138: Stub the module directory in the Quick Build provisioner f…
davidschachterADFA Nov 17, 2026
1407eae
ADFA-7138: Check a module's SQLite debugger opt-in after the sync too
davidschachterADFA Nov 17, 2026
7a22763
ADFA-7138: Require androidx.core in the rewrite's classpath check
davidschachterADFA Nov 17, 2026
1573878
ADFA-7138: Make every missing-member entry name its descriptors
davidschachterADFA Nov 17, 2026
49c84c0
ADFA-7135 Refuse SQL that holds more than one statement
davidschachterADFA Nov 17, 2026
ff0bd0c
ADFA-7136 Say when a query ran out of time waiting for another tool call
davidschachterADFA Nov 17, 2026
0da5af2
ADFA-7136 Start a tool call's time limit when the call begins
davidschachterADFA Nov 17, 2026
9eb00a2
ADFA-7138: Merge ADFA-7135 (F18 one-statement check, F19 tool deadlin…
davidschachterADFA Nov 17, 2026
d097e5d
ADFA-7135 Let the query backstop's ROLLBACK past the server's authorizer
davidschachterADFA Nov 17, 2026
0d40222
ADFA-7136 Say when get_schema cut a CREATE statement
davidschachterADFA Nov 17, 2026
bc4889b
ADFA-7138: Merge ADFA-7135 (F37 backstop rollback, F38 get_schema tru…
davidschachterADFA Nov 17, 2026
403746b
ADFA-7136 Say that functions the app adds to its own connections are …
davidschachterADFA Nov 17, 2026
9c916ca
ADFA-7136 Name both limits that can leave get_schema entries out
davidschachterADFA Nov 17, 2026
57f7b08
ADFA-7138: Merge ADFA-7135 (F51 app functions, F52 get_schema limits)…
davidschachterADFA Nov 17, 2026
acab926
ADFA-7138: Quick Build status line says "off", not "setup failed", fo…
davidschachterADFA Nov 17, 2026
6468cff
ADFA-7136 Say that a full integrity_check fails on the app's index fu…
davidschachterADFA Nov 17, 2026
cee95ac
ADFA-7136 Give get_schema's paging advice an ORDER BY and the right unit
davidschachterADFA Nov 17, 2026
19c80cd
ADFA-7138: Merge ADFA-7135 (F108 integrity_check app functions, F109 …
davidschachterADFA Nov 17, 2026
0550b88
ADFA-7138 End a live Quick Build session in the refused state when th…
davidschachterADFA Nov 17, 2026
babc5fe
ADFA-7138 Drop the unused sqliteDebuggerMessage and share the AAR-pro…
davidschachterADFA Nov 17, 2026
b93bf8e
ADFA-7138 Document that the SQLite debugger opt-in is decided from al…
davidschachterADFA Nov 17, 2026
bc76c14
ADFA-7136 Say which app functions make quick_check and integrity_chec…
davidschachterADFA Nov 17, 2026
e1864d2
ADFA-7136 Advise ORDER BY type, name to page through sqlite_master
davidschachterADFA Nov 17, 2026
541a706
ADFA-7138 Watch every gradle.properties the SQLite debugger opt-in reads
davidschachterADFA Nov 17, 2026
5ebd1fc
ADFA-7138 Name the Quick Build refusal that replaced sqliteDebuggerMe…
davidschachterADFA Nov 17, 2026
b843c60
ADFA-7138 Describe the opt-in rule: the first file that defines it de…
davidschachterADFA Nov 17, 2026
875ec57
Merge sqlite-debugger/ADFA-7135 into sqlite-debugger/ADFA-7138
davidschachterADFA Nov 17, 2026
299266e
ADFA-7135 Register consumer-rules.pro so an app's R8 keeps NativeBridge
davidschachterADFA Nov 17, 2026
8acd4bd
ADFA-7135 Refuse a server connection to a path the app no longer has …
davidschachterADFA Nov 17, 2026
e6d9171
ADFA-7135 Bound a JSON-RPC batch by message count and reply size
davidschachterADFA Nov 17, 2026
0e61956
ADFA-7138: Merge ADFA-7135 (F149 consumer rules, F151 recheck path, F…
davidschachterADFA Nov 17, 2026
bc94eaa
ADFA-7135 State the true bound on a batch's replies
davidschachterADFA Nov 17, 2026
0defc3f
ADFA-7135 Document the batch limits in the README
davidschachterADFA Nov 17, 2026
85fbbd9
ADFA-7135 Refuse a server connection when every app connection to the…
davidschachterADFA Nov 17, 2026
90266f2
ADFA-7138 Narrow the watchedFiles KDoc to the modules the scan finds
davidschachterADFA Nov 17, 2026
a569ee8
ADFA-7138: Merge ADFA-7135 (F168 batch bound KDoc, F169 README batch …
davidschachterADFA Nov 17, 2026
9200772
ADFA-7135 Say the first row of a result can pass the 4 MiB cap
davidschachterADFA Nov 17, 2026
98c2eb7
ADFA-7138: Merge ADFA-7135 (F172 first-row exception to the 4 MiB cap…
davidschachterADFA Nov 17, 2026
dcadfe1
ADFA-7135 Say a call that waited half its time limit says so
davidschachterADFA Nov 17, 2026
82ba6e7
ADFA-7135: Merge stage (#2244 squash-merged as 5f3d76aad) into the st…
davidschachterADFA Nov 17, 2026
ebe4eda
ADFA-7138: Merge ADFA-7135 (F181 half-deadline KDoc, and stage with #…
davidschachterADFA Nov 17, 2026
27e004b
ADFA-7138 Run the release-APK guard on every push
davidschachterADFA Nov 18, 2026
298071c
ADFA-7138 Document that COPY_FRAMES cannot weaken another instrumenta…
davidschachterADFA Nov 18, 2026
61104a7
ADFA-7138 Warn about strings that name a class the rewrite moves to r…
davidschachterADFA Nov 18, 2026
9ca47ff
ADFA-7138 Run the release-APK guard without the Maven signing key
davidschachterADFA Nov 18, 2026
22d390f
ADFA-7138 Do not warn about a string that only contains a renamed cla…
davidschachterADFA Nov 18, 2026
6fd1fdc
ADFA-7138 Docs: say SqliteReleaseApkTest skips without its AAR paths …
davidschachterADFA Nov 18, 2026
9fedd91
ADFA-7138 Fail the build for a SQLiteQueryBuilder override of query w…
davidschachterADFA Nov 18, 2026
7e38a3f
ADFA-7138 Fail a call a rule could match when its owner cannot be res…
davidschachterADFA Nov 18, 2026
3bdeb36
ADFA-7138 Fail the build for an SQLite cursor used as an Android curs…
davidschachterADFA Nov 18, 2026
183a69f
ADFA-7138 Check the SQLite debugger opt-in again after the model wait…
davidschachterADFA Nov 18, 2026
1648b5a
ADFA-7138 Do not refuse Quick Build from the root opt-in before the m…
davidschachterADFA Nov 18, 2026
6259246
ADFA-7138 Replace the SQLite AARs in one rename when app init extract…
davidschachterADFA Nov 18, 2026
72e44e8
ADFA-7138 Accept an instanceof guard only when it holds on every path…
davidschachterADFA Nov 18, 2026
abf7002
ADFA-7138 Cancel every query that shares an Android CancellationSignal
davidschachterADFA Nov 18, 2026
68bf024
ADFA-7138 Docs: say a cancelled query throws androidx.core's Operatio…
davidschachterADFA Nov 18, 2026
ade142c
ADFA-7138 Look up the SQLite rewrite tests' jars in the active Gradle…
davidschachterADFA Nov 18, 2026
bf86cdd
ADFA-7138 Do not inherit constructors when the tests resolve a reference
davidschachterADFA Nov 18, 2026
0cab2d4
ADFA-7138 Bound the release-APK check script by its timeout before re…
davidschachterADFA Nov 18, 2026
7572ece
ADFA-7138 Check this run's helper in the transform test, not any cach…
davidschachterADFA Nov 18, 2026
5a2fd6e
ADFA-7138: Tapping the "Quick Build: off" status line shows the refus…
davidschachterADFA Nov 18, 2026
5ad480d
ADFA-7138 Delete a failed SQLite AAR copy's temp file, and sync it be…
davidschachterADFA Nov 18, 2026
586a9b9
ADFA-7138 Fail the build for an SQLite cursor stored into an Android …
davidschachterADFA Nov 18, 2026
db7781c
ADFA-7138 Docs: list getWindow() on an unresolvable SQLiteCursor subc…
davidschachterADFA Nov 18, 2026
229feb0
ADFA-7138 Say to retry when an SQLite AAR is missing right after Code…
davidschachterADFA Nov 18, 2026
f556c0c
ADFA-7138 Test that the SQLite rewrite tests find requery in a non-de…
davidschachterADFA Nov 18, 2026
85c3068
ADFA-7138: Warn, not fail, for an unresolvable owner unless the membe…
claude Nov 19, 2026
d392bf6
ADFA-7138 Fix the rewriter tests' comments about getUniqueId after th…
davidschachterADFA Nov 19, 2026
56e26ff
ADFA-7138 Docs: say which rule-table matches on an unresolvable class…
davidschachterADFA Nov 19, 2026
36bdf96
ADFA-7138 Pin the SQLite descriptor tokens and which unresolved-owner…
davidschachterADFA Nov 19, 2026
fbd4451
ADFA-7138 Check in a real AGP build that the unresolved-owner warning…
davidschachterADFA Nov 19, 2026
6e16bdb
ADFA-7138 Hold CancelForwarders weakly so a dropped signal's forwarde…
davidschachterADFA Nov 19, 2026
b0ceebe
ADFA-7138 Warn, not fail, for an unresolvable owner's setWindow(Curso…
davidschachterADFA Nov 19, 2026
d362637
ADFA-7138 Fail the build for an SQLite cursor stored into an Android …
davidschachterADFA Nov 19, 2026
30e7820
ADFA-7138 Keep an Android cursor array's tag across a merge with null…
davidschachterADFA Nov 19, 2026
9f84175
ADFA-7138 Log any exception from an SQLite AAR extraction, so the res…
davidschachterADFA Nov 19, 2026
f6c8bf0
ADFA-7138 Warn, not fail, for an SQLite cursor stored into an Android…
davidschachterADFA Nov 20, 2026
dbe5411
ADFA-7138 Treat a row loaded from a null array as null, so a merge ke…
davidschachterADFA Nov 20, 2026
95f1c49
ADFA-7138 Say an SQLiteCursor[] stored into an array of Android curso…
davidschachterADFA Nov 20, 2026
632bc27
ADFA-7135 Merge origin/stage into sqlite-debugger/ADFA-7135: stage at…
davidschachterADFA Nov 20, 2026
a91559d
ADFA-7138 Merge sqlite-debugger/ADFA-7135 into sqlite-debugger/ADFA-7…
davidschachterADFA Nov 20, 2026
e723fd8
ADFA-7138 Flash why Quick Build is greyed out when its status line is…
davidschachterADFA Nov 21, 2026
542307f
ADFA-7138 Count a row of an SQLiteCursor[] as an SQLite cursor in the…
davidschachterADFA Nov 21, 2026
e7d0da9
ADFA-7138 Test and document that a row of an SQLiteCursor[] is an SQL…
davidschachterADFA Nov 21, 2026
6858c9f
ADFA-7138 Follow a row of an SQLiteCursor[][] as an SQLiteCursor[] fo…
davidschachterADFA Nov 21, 2026
b68446b
ADFA-7138 Call onQuickBuildStatusLineTapped directly in the greyed-ou…
davidschachterADFA Nov 21, 2026
2ae43d2
ADFA-7138 Keep the cursor-array tag when a merge mixes SQLiteCursor[]…
davidschachterADFA Nov 21, 2026
f77079c
ADFA-7138 Test a 3D SQLite cursor array, and name the 1D merge test a…
davidschachterADFA Nov 21, 2026
b9e037f
ADFA-7138 Test that an SQLiteCursor[] merged with an Object[] or a 2D…
davidschachterADFA Nov 21, 2026
7b270b4
ADFA-7138 Test that merge keeps the cursor-array tag only for the sam…
davidschachterADFA Nov 21, 2026
b2d7bbe
ADFA-7138 Name the opt-out that works with property precedence
davidschachterADFA Nov 21, 2026
ece7a67
ADFA-7138 Find COLLATE UNICODE through comments and quotes, and not i…
davidschachterADFA Nov 21, 2026
6f0ee16
ADFA-7138 Reject a driver that declares both query overloads
davidschachterADFA Nov 21, 2026
cb95693
ADFA-7138 Check the missing-member descriptors by rebuilding them
davidschachterADFA Nov 21, 2026
e2690c8
ADFA-7138 Throw the NullPointerException for a null Context in delete…
davidschachterADFA Nov 21, 2026
d1f8094
ADFA-7138 Keep the status-line tap with the text it was bound for
davidschachterADFA Nov 21, 2026
bd26c30
ADFA-7138 Docs: name four rare false positives of the rewrite checks
davidschachterADFA Nov 21, 2026
918e5f7
ADFA-7138 Test the status-line tap wiring in EditorBottomSheet
davidschachterADFA Nov 22, 2026
5407497
ADFA-7138 README: name the opt-out that works with property precedence
davidschachterADFA Nov 22, 2026
2d7c135
ADFA-7135 Merge origin/stage into sqlite-debugger/ADFA-7135: stage at…
davidschachterADFA Nov 22, 2026
a522456
ADFA-7136 Count user tables whose name only looks like sqlite_ in get…
davidschachterADFA Nov 22, 2026
4ee1506
ADFA-7136 Report a path whose app connections are all closing as not …
davidschachterADFA Nov 22, 2026
f4cf4c3
ADFA-7138 COLLATE rule: a quoted name must end at its closing character
davidschachterADFA Nov 22, 2026
eec3d54
ADFA-7138 Docs: correct the cast and subclass false-positive sentences
davidschachterADFA Nov 22, 2026
c284f2c
ADFA-7138 Status-line tap: bind again when the refusal text is writte…
davidschachterADFA Nov 22, 2026
3a3d57a
ADFA-7135 Drain unread request input before closing after an error reply
davidschachterADFA Nov 22, 2026
df22b7a
ADFA-7136 Stop a server statement after 1.5 s on a database that is n…
davidschachterADFA Nov 22, 2026
f683484
ADFA-7135 Run the SQLite debugger's Kotlin unit tests in CI
davidschachterADFA Nov 22, 2026
4bb66f7
ADFA-7138 Merge sqlite-debugger/ADFA-7135 into sqlite-debugger/ADFA-7…
davidschachterADFA Nov 22, 2026
9ff51c2
ADFA-7138 Docs: a cast to a non-SQLite cursor type can be a false pos…
davidschachterADFA Nov 22, 2026
f532ce6
ADFA-7138 Status-line tap test: place the sheet in a CoordinatorLayou…
davidschachterADFA Nov 22, 2026
3ae862a
ADFA-7135 sqlite-debugger README: say where the rest lands and what r…
davidschachterADFA Nov 22, 2026
52bc0ad
ADFA-7135 sqlite-debugger README: the device runs predate the review …
davidschachterADFA Nov 22, 2026
3dc0d01
ADFA-7138 Merge sqlite-debugger/ADFA-7135 into sqlite-debugger/ADFA-7…
davidschachterADFA Nov 22, 2026
3412fe0
ADFA-7138 Quick Build tap: no "Replace the installed app?" when the S…
davidschachterADFA Nov 23, 2026
6926346
ADFA-7138 Quick Build SQLite debugger opt-in: decide it for the modul…
davidschachterADFA Nov 23, 2026
33c9bac
ADFA-7138 Reject OpenParams in array instructions (MULTIANEWARRAY, ar…
davidschachterADFA Nov 23, 2026
ae88e4f
ADFA-7138 COLLATE rule: a quoted or bracketed collation name needs no…
davidschachterADFA Nov 23, 2026
650d1fc
ADFA-7138 COLLATE rule: a block comment ends at its first star-slash
davidschachterADFA Nov 23, 2026
1651a0c
ADFA-7138 COLLATE LOCALIZED warning: say what happens to existing ind…
davidschachterADFA Nov 23, 2026
0a7a0b2
ADFA-7138 Runtime openOrCreateDatabase: throw for world-access modes …
davidschachterADFA Nov 23, 2026
bb6194e
ADFA-7138 sqlite-rewrite.md: an inherited query(CursorFactory, Object…
davidschachterADFA Nov 23, 2026
87f3017
ADFA-7138 SQLite debugger opt-out wording: name parent projects in th…
davidschachterADFA Nov 23, 2026
4ff13a5
ADFA-7138 COLLATE check: take each comment and whitespace run whole, …
davidschachterADFA Nov 23, 2026
f21b3ac
ADFA-7135 Merge origin/stage into sqlite-debugger/ADFA-7135: stage at…
davidschachterADFA Nov 23, 2026
f6de53d
ADFA-7135 Remove separator comments from the SQLite debugger module
davidschachterADFA Nov 23, 2026
12a3bd6
ADFA-7135 Say in the README that test.sh runs on Linux only
davidschachterADFA Nov 23, 2026
212c143
ADFA-7135 Clear a connection's closing flag when a later statement runs
davidschachterADFA Nov 23, 2026
3db82a5
ADFA-7136 Keep one pending idle check in DatabaseTools
davidschachterADFA Nov 23, 2026
c84d987
ADFA-7136 List the cut cells in truncated_cell_indexes
davidschachterADFA Nov 23, 2026
4911b94
ADFA-7136 Give one deadline to every tool call of a POST
davidschachterADFA Nov 23, 2026
ee7fa6f
ADFA-7136 Tell a get_events client when its cursor is from an earlier…
davidschachterADFA Nov 23, 2026
7570c49
ADFA-7138 Merge sqlite-debugger/ADFA-7135 into sqlite-debugger/ADFA-7…
davidschachterADFA Nov 23, 2026
4fc9885
ADFA-7135 Merge origin/stage at 8ab2028bd into sqlite-debugger/ADFA-7135
davidschachterADFA Nov 24, 2026
5bf99a1
ADFA-7135 Merge origin/stage at b5931b2e6 into sqlite-debugger/ADFA-7135
davidschachterADFA Nov 24, 2026
c78cc27
ADFA-7135 Roll back an open transaction when a query fails before it …
davidschachterADFA Nov 24, 2026
c84ae0c
ADFA-7135 Stop JNI_OnLoad at the first failed lookup or allocation
davidschachterADFA Nov 24, 2026
a645f21
ADFA-7135 Document the setup failures of sqlitedbg_open_server
davidschachterADFA Nov 24, 2026
5540ee5
ADFA-7138 Read the SQLite debugger opt-in in Gradle's order: user hom…
davidschachterADFA Nov 24, 2026
1954dcd
ADFA-7138 Show a Quick Build refusal as off, not as a failure, on the…
davidschachterADFA Nov 24, 2026
7e43c17
ADFA-7138 Fail on an unresolvable Context-method owner only for a vir…
davidschachterADFA Nov 24, 2026
dcb5506
ADFA-7136 Say "at least N tables" when get_stats hit the table list cap
davidschachterADFA Nov 24, 2026
a24a886
ADFA-7136 Answer Expect: 100-continue before reading the request body
davidschachterADFA Nov 24, 2026
afaf027
ADFA-7136 Answer 400 when a chunked body ends inside the trailer section
davidschachterADFA Nov 24, 2026
18304ca
ADFA-7136 Count open attempts in FakeDebugEngine so "never opened" ca…
davidschachterADFA Nov 24, 2026
242f68a
ADFA-7136 Bound the waits in queuedBehindAnotherCall and release in f…
davidschachterADFA Nov 24, 2026
860cac5
ADFA-7136 Wait for the recorded accept retries instead of sleeping in…
davidschachterADFA Nov 24, 2026
29f355d
ADFA-7135 Open the JNI test's app fixture with UTF-8 bytes and check …
davidschachterADFA Nov 24, 2026
f3fce48
ADFA-7135 Fail the parameter diagnostic JNI test when the query succeeds
davidschachterADFA Nov 24, 2026
ba78ebb
ADFA-7136 Say in the README that the time limits and two idle paths a…
davidschachterADFA Nov 24, 2026
38ee669
ADFA-7138 Remove the one-argument isSqliteDebuggerEnabled, which only…
davidschachterADFA Nov 24, 2026
acdca5a
ADFA-7138 Note the window left by skipping the replace question on a …
davidschachterADFA Nov 24, 2026
0b4ebca
ADFA-7138 Document that androidTest classes are not rewritten
davidschachterADFA Nov 24, 2026
662206a
ADFA-7138 Merge sqlite-debugger/ADFA-7135 at ba78ebbb2 into sqlite-de…
davidschachterADFA Nov 24, 2026
6cbe9c2
ADFA-7138 Merge origin/stage at 122cc41cd into sqlite-debugger/ADFA-7138
davidschachterADFA Nov 24, 2026
8bd3e26
ADFA-7138 Merge origin/stage at acca2c3b3 into sqlite-debugger/ADFA-7138
davidschachterADFA Nov 25, 2026
008d135
ADFA-7138 Merge origin/stage at ade5cc2fb into sqlite-debugger/ADFA-7138
davidschachterADFA Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,21 @@ jobs:
exit "$status"
fi

# ADFA-7138: builds the minified release and the debug variant of a sample app that opted into the
# SQLite debugger, with the real debugger, rewrite runtime and requery AARs, and runs
# scripts/check-release-apk-no-sqlite-debugger.sh on both. The release must pass; the debug APK must
# fail, which shows the check still sees the debugger. The AARs it builds are the ones the assemble
# below bundles, so they are not built twice.
- name: Check that an opted-in app's release APK carries no SQLite debugger
run: |
command -v unzip || { sudo apt-get update && sudo apt-get install -y unzip; }
# The test stages :logger, :logsender and :build-info into build-local Maven repositories, which
# needs no signing. With the job's signing key present MavenPublishConf runs the Sign tasks, and
# they fail, so the key is left out of this step.
env -u ORG_GRADLE_PROJECT_signingInMemoryKey -u ORG_GRADLE_PROJECT_signingInMemoryKeyId \
-u ORG_GRADLE_PROJECT_signingInMemoryKeyPassword \
flox activate -d flox/base -- ./gradlew :gradle-plugin:sqliteReleaseApkTest --no-daemon

- name: Install advancecomp (advzip, used by recompressApk)
run: |
command -v advzip || { sudo apt-get update && sudo apt-get install -y advancecomp; }
Expand Down
5 changes: 3 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Strategy: **layer-and-subsystem based**, not feature-by-feature. The Gradle buil

- **`app` depends inward; libraries never depend on `app`.** Subsystems are consumed by `app`, not vice versa.
- **Vendored forks are substituted, not imported ad hoc.** `composite-builds/build-deps` and `build-deps-common` provide forked `javac`/`jdt`/`layoutlib`/etc.; `settings.gradle.kts` substitutes them in for `com.itsaky.androidide.build:*`. Don't add a Maven coordinate for something already substituted. Pebble is likewise built from source, as `subprojects:pebble`, for a lexer fix Android needs (its `NOTICE` says what changed); depend on `projects.subprojects.pebble`, not `io.pebbletemplates:pebble`.
- **All module config flows through `composite-builds/build-logic`.** Every Android module gets the `v7`/`v8` ABI flavors centrally (`AndroidModuleConf.kt`) — there is no flavorless `assembleDebug`. `:plugin-api`, `:subprojects:sqlite-js` and `:subprojects:sqlite-debugger`, libraries for other projects that need one artifact, are intentionally excluded from flavors.
- **All module config flows through `composite-builds/build-logic`.** Every Android module gets the `v7`/`v8` ABI flavors centrally (`AndroidModuleConf.kt`) — there is no flavorless `assembleDebug`. `:plugin-api`, `:subprojects:sqlite-js`, `:subprojects:sqlite-debugger` and `:subprojects:sqlite-rewrite-runtime`, libraries for other projects that need one artifact, are intentionally excluded from flavors.
- **`RepositoriesMode.FAIL_ON_PROJECT_REPOS`** — repositories are declared once in `settings.gradle.kts`; modules must not declare their own.
- **Avoid new dependencies.** Check `gradle/libs.versions.toml` first; the build almost certainly already has it.

Expand All @@ -104,11 +104,12 @@ Strategy: **layer-and-subsystem based**, not feature-by-feature. The Gradle buil
These structural facts shape every module. Day-to-day build *commands* live in `CLAUDE.md`; the rules that produce them live here.

- **Centralized convention logic.** All Android module setup flows through `composite-builds/build-logic` (`conf/AndroidModuleConf.kt`). Modules stay thin and share configuration, so understanding any module's setup starts here.
- **ABI product flavors.** Every Android module *except* `:plugin-api`, `:subprojects:sqlite-js` and `:subprojects:sqlite-debugger` gets two flavors on the `abi` dimension — `v7` (`armeabi-v7a`) and `v8` (`arm64-v8a`) — defined centrally. There is no flavorless variant; tasks are `assembleV8Debug`, `assembleV7Release`, etc.
- **ABI product flavors.** Every Android module *except* `:plugin-api`, `:subprojects:sqlite-js`, `:subprojects:sqlite-debugger` and `:subprojects:sqlite-rewrite-runtime` gets two flavors on the `abi` dimension — `v7` (`armeabi-v7a`) and `v8` (`arm64-v8a`) — defined centrally. There is no flavorless variant; tasks are `assembleV8Debug`, `assembleV7Release`, etc.
- **SDK levels** (`build-logic/.../build/config/BuildConfig.kt`): `COMPILE_SDK=36`, `MIN_SDK=28`, `TARGET_SDK=28`. **`TARGET_SDK` is deliberately pinned at 28:** higher targets enforce W^X (write-xor-execute), which blocks executing code from app-writable files. That is fatal for an on-device IDE that compiles and runs code (Gradle, `javac`, Termux binaries), so it is a hard requirement, not tech debt. `MIN_SDK_FOR_APPS_BUILT_WITH_COGO=16` is the floor for the apps a *user* builds with CoGo — distinct from CoGo's own `MIN_SDK`.
- **Native asset bundling.** The on-device LLM (`llama-impl`) ships as a per-flavor native AAR, wired through the root `build.gradle.kts` (`bundleLlamaV8Assets` / `assembleV8Assets`, …); prebuilt per-flavor assets live under `assets/release/v7/` and `assets/release/v8/`.
- **sqlite-js for apps built with CoGo** (ADFA-7082). `subprojects:sqlite-js` builds the AAR that the JavaScript-in-SQLite project template depends on: the sqlite-js release vendored (see its README), for arm64-v8a and armeabi-v7a, minSdk 26, without core-library desugaring. Nothing in CoGo depends on it. Its default entry point runs no code stored in a database; loading stored functions is a separate entry point, only for databases the app made, since loading runs their code. `test-sqlite-js.yml` runs its host tests on pull requests. The manual `release-sqlite-js.yml` publishes it to the moving `sqlite-js-latest` release, from which dev-assets fetches it into the template, as it fetches `plugin-api-latest` for the plugin template.
- **SQLite debugger for apps built with CoGo** (ADFA-7131). `subprojects:sqlite-debugger` builds an AAR with a debug-only SQLite debugger and MCP server for apps built with CoGo: a native extension on requery's SQLite plus a loopback HTTP server. Like sqlite-js it has no ABI flavors, and nothing in CoGo depends on it; see its README.
- **AARs bundled for apps built with CoGo.** `:logsender`, `:subprojects:sqlite-debugger` and `:subprojects:sqlite-rewrite-runtime` are built as AARs and bundled into the IDE's assets (`AndroidIDEAssetsPlugin`). Code on the Go extracts them and passes their paths to Gradle as properties, and its Gradle plugin injects each into the app: logsender and the debugger into debuggable variants, the rewrite runtime into every variant of a project with `cogo.sqliteDebugger=true`. `:subprojects:sqlite-rewrite-runtime` is Java-only, has no ABI flavors and holds the helpers the build-time rewrite to requery redirects to (ADFA-7138); see `gradle-plugin/docs/sqlite-rewrite.md`.
- **Native lib compression** (ADFA-2306, ADFA-4729). The app manifest hard-codes `android:extractNativeLibs="true"` (required: the installer must materialize libs in `nativeLibraryDir`, e.g. `libshizuku.so` is an executable the adb shell runs from there). That attribute overrides the `jniLibs.useLegacyPackaging` DSL, so AGP packages `lib/<abi>/*.so` deflate-compressed in **every** APK — ~5.9 MB smaller (`libtree-sitter-kotlin.so` alone is 4.18 MB → 339 kB). The trap is the `recompressApk` post-step (release always, debug in CI only): its no-compress lists in `app/build.gradle.kts` must NOT contain `"so"`, or it silently re-stores the libs and undoes the saving — which is what ADFA-2306 fixed for release and ADFA-4729 for CI debug. Locally built debug APKs (including the e2e farm's) never run that step and were always fine.
- **Quick Build shares the Gradle distribution's toolchain** (ADFA-4931). `:app`'s `quickBuildDaemonZip` leaves the Kotlin compiler and eight other jars out of the daemon zip, because the on-device Gradle distribution already carries them; `QuickBuildArtifactStager` links them in at provision time. That makes the daemon's Kotlin version the distribution's, so `:quickbuild:daemon` takes its Kotlin artifacts at `org.adfa.constants.GRADLE_DISTRIBUTION_KOTLIN_VERSION`, and `:app:quickBuildDistJarCheck` fails the build when the distribution it packages lacks a linked jar. See [ADR 0016](docs/adr/0016-quick-build-compiles-outside-gradle.md).
- **`app` package layout is by concern, not feature:** `activities`, `fragments`, `services`, `di`, `agent`, `viewmodel(s)`, `repositories`, `roomData`, `localWebServer`, `preferences`, `ui` (Compose screens live under `ui/compose`), `templates/manager` (the Manager screen's `.cgt`-parsing data layer, with direct filesystem access to `Environment.TEMPLATES_DIR` — distinct from the plugin-facing `IdeTemplateService` in `plugin-api`/`plugin-manager`), `utils`, ….
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ flox activate -d flox/local -- ./gradlew <task>
```

- **Debug APK (arm64, the usual target):** `flox activate -d flox/local -- ./gradlew :app:assembleV8Debug --parallel --max-workers=6`
- **Module unit tests:** `flox activate -d flox/local -- ./gradlew :editor:testV7DebugUnitTest` - unit tests are per-flavor, there is no plain `test` task. `:plugin-api`, `:subprojects:sqlite-js` and `:subprojects:sqlite-debugger` are the modules without flavors: `:plugin-api:testDebugUnitTest`.
- **Module unit tests:** `flox activate -d flox/local -- ./gradlew :editor:testV7DebugUnitTest` - unit tests are per-flavor, there is no plain `test` task. `:plugin-api`, `:subprojects:sqlite-js`, `:subprojects:sqlite-debugger` and `:subprojects:sqlite-rewrite-runtime` are the modules without flavors: `:plugin-api:testDebugUnitTest`.
- **Single unit test:** append `--tests "com.itsaky.androidide.SomeTest"` to the flavored task above.
- **Fast iteration:** during multi-file/multi-module changes, verify with targeted `:module:compileV8DebugKotlin`/`compileV8DebugJavaWithJavac` invocations (batch several modules into one Gradle call) rather than a full assemble. Reserve `:app:assembleV8Debug` for final end-to-end verification — it's slow (multi-minute) in this multi-module project, and running it after every small change adds up.
- **Long-running commands: narrate them, and background only the read-only ones.** Anything that can exceed ~60s — `assembleV8Debug`, a full test sweep, a cold Gradle invocation of any kind (daemon start plus configuring this many modules is ~20s before any task runs, and far worse under memory pressure), and `git push`, which runs Spotless through the hook — gets a line before it starts saying what is running and roughly how long it takes, and a status line every couple of minutes while it runs: elapsed time, the last output line, whether it is still progressing. A silent terminal is indistinguishable from a hang, and saying which it is is your job, not the user's to ask.
Expand All @@ -26,7 +26,7 @@ When the user names a CI/CD job ("the sonar job", "the analyze workflow"), read

### ABI product flavors (v7 / v8)

Every module except `:plugin-api`, `:subprojects:sqlite-js` and `:subprojects:sqlite-debugger` carries `v7` (`armeabi-v7a`) and `v8` (`arm64-v8a`) flavors, so build tasks are `assembleV8Debug`, `assembleV7Release`, etc. — there is **no** flavorless `assembleDebug`. Those three build one artifact for other projects. See [ARCHITECTURE.md](ARCHITECTURE.md) (Build & Module Configuration) for flavors, native asset bundling, and SDK levels.
Every module except `:plugin-api`, `:subprojects:sqlite-js`, `:subprojects:sqlite-debugger` and `:subprojects:sqlite-rewrite-runtime` carries `v7` (`armeabi-v7a`) and `v8` (`arm64-v8a`) flavors, so build tasks are `assembleV8Debug`, `assembleV7Release`, etc. — there is **no** flavorless `assembleDebug`. Those four build one artifact for other projects. See [ARCHITECTURE.md](ARCHITECTURE.md) (Build & Module Configuration) for flavors, native asset bundling, and SDK levels.

### Emulator / device

Expand Down
3 changes: 3 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ dependencies {
// (QuickBuildArtifactStager).
evaluationDependsOn(":quickbuild:runtime")
evaluationDependsOn(":quickbuild:daemon")
// The assets plugin bundles its release AAR (ADFA-7131).
evaluationDependsOn(":subprojects:sqlite-debugger")
evaluationDependsOn(":subprojects:sqlite-rewrite-runtime")

// ADFA-4931: jars the daemon loads from the on-device Gradle distribution instead of shipping its
// own copy, since `gradle-dists/` and `quickbuild/` both sit under <ANDROIDIDE_HOME>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildTone
import org.appdevforall.cotg.quickbuild.domain.session.toTone
import org.appdevforall.cotg.quickbuild.service.session.QuickBuildSessionManager
Expand Down Expand Up @@ -150,10 +151,13 @@ class QuickBuildAction(
private val tapInFlight = AtomicBoolean(false)

/**
* Runs a Quick Build tap: save the open files, confirm replacing an installed app, then
* hand the tap to [sessionManager]. The toolbar button and the plugin API both start
* Quick Build here, so they cannot drift apart.
* Runs a Quick Build tap: save the open files, confirm replacing an installed app unless the
* SQLite debugger will refuse the build, then hand the tap to [sessionManager]. The toolbar
* button, the status line's "tap for details" and the plugin API all start Quick Build here,
* so they cannot drift apart.
*
* @param refusedForSqliteDebugger read off the main thread after the save: true when the
* provisioner will refuse the build because the project turns the SQLite debugger on.
* @param beforeSession asked on the main thread just before the tap reaches the session;
* false drops it, for a caller that cancelled while the tap was saving or asking.
* @param onOutcome told once how the tap ended, unless the activity is destroyed or
Expand All @@ -163,20 +167,22 @@ class QuickBuildAction(
internal fun launchTap(
activity: EditorHandlerActivity,
sessionManager: QuickBuildSessionManager,
refusedForSqliteDebugger: () -> Boolean = { GradleQuickBuildProvisioner.refusesForSqliteDebugger() },
beforeSession: () -> Boolean = { true },
onOutcome: (TapOutcome) -> Unit = {},
): Job? {
if (!tapInFlight.compareAndSet(false, true)) {
log.info("Quick Build: a tap is already in flight; dropping this one")
return null
}
return startTap(activity, sessionManager, beforeSession, onOutcome)
return startTap(activity, sessionManager, refusedForSqliteDebugger, beforeSession, onOutcome)
.also { it.invokeOnCompletion { tapInFlight.set(false) } }
}

private fun startTap(
activity: EditorHandlerActivity,
sessionManager: QuickBuildSessionManager,
refusedForSqliteDebugger: () -> Boolean,
beforeSession: () -> Boolean,
onOutcome: (TapOutcome) -> Unit,
): Job =
Expand Down Expand Up @@ -209,6 +215,19 @@ class QuickBuildAction(
onOutcome(TapOutcome.SAVE_FAILED)
return@launch
}
// Read after the save, which can write a gradle.properties the user just edited, and
// before the activity check, since it leaves the main thread.
val refused =
withContext(Dispatchers.IO) {
try {
refusedForSqliteDebugger()
} catch (e: Exception) {
// Unknown, so ask about the installed app as a tap always did; the provisioner
// still makes its own check.
log.warn("Quick Build: could not read the SQLite debugger opt-in; asking about the installed app", e)
false
}
}
if (activity.isDestroyed || activity.isFinishing) {
log.info("Quick Build: the activity went away during the save; dropping the tap")
onOutcome(TapOutcome.ACTIVITY_GONE)
Expand All @@ -218,7 +237,7 @@ class QuickBuildAction(
// project's real applicationId. If the Standard Run build currently occupies that
// id, a tap replaces it, so the activity confirms the clobber first and the build
// proceeds only on accept.
if (!activity.awaitQuickBuildClobberConfirmed()) {
if (!replaceConfirmedUnlessRefused(refused) { activity.awaitQuickBuildClobberConfirmed() }) {
Comment thread
davidschachterADFA marked this conversation as resolved.
Resolved
onOutcome(TapOutcome.DECLINED)
return@launch
}
Expand All @@ -235,6 +254,25 @@ class QuickBuildAction(
onOutcome(TapOutcome.STARTED)
}

/**
* Whether a tap may go on to the session, as far as replacing the installed app goes. Not
* asked when the SQLite debugger will refuse the build: the provisioner refuses before
* anything is staged or installed, so the question would be about a replacement that cannot
* happen, and its Cancel would hide the refusal that explains why Quick Build is off. The
* session then shows that refusal, as the banner and as the status line's "tap for details".
*
* Skipping the question relies on the provisioner reading the same model and files moments
* later. A change in between (a sync, or an edit to gradle.properties) could install over
* the app without asking.
*
* @param refused whether the SQLite debugger will refuse the build.
* @param confirm asks the user, on the main thread; true to replace the installed app.
*/
internal suspend fun replaceConfirmedUnlessRefused(
refused: Boolean,
confirm: suspend () -> Boolean,
): Boolean = refused || confirm()

/**
* The one bit the tap carries across the save/watch boundary: whether the save-all
* will write anything. SaveResult does not say, but saveAllResult only writes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -799,13 +799,7 @@ open class EditorHandlerActivity :
// path's tint and disabled dim here.
icon = toolbarIcon(action.icon, action.createColorFilter(data), action.enabled),
hint = getToolbarContentDescription(action, data),
onClick = {
if (action.enabled) {
registry.executeAction(action, data)
} else if (action.id == QuickBuildAction.ID) {
QuickBuildAction.disabledReason(this)?.let(::flashInfoLong)
}
},
onClick = { tapToolbarAction(registry, action, data) },
onLongClick = {
// Quick Build is a split button: long-press opens the
// Quick Build / Restart session / Help dropdown instead of the
Expand Down Expand Up @@ -881,9 +875,7 @@ open class EditorHandlerActivity :
popup.setOnMenuItemClickListener { item ->
when (item.itemId) {
R.id.action_quick_build -> {
// Through the registry, same as Standard Run below, so the menu entry
// and the toolbar tap share one code path (incl. the analytics event).
if (quickBuild != null && quickBuild.enabled) registry.executeAction(quickBuild, data)
runQuickBuildAction(data)
true
}

Expand All @@ -909,6 +901,37 @@ open class EditorHandlerActivity :
popup.show()
}

/**
* A tap on a toolbar button: runs its action through the registry, or, while the Quick Build
* button is greyed out, flashes why (ADFA-6574).
*/
private fun tapToolbarAction(
registry: DefaultActionsRegistry,
action: ActionItem,
data: ActionData,
) {
if (action.enabled) {
registry.executeAction(action, data)
} else if (action.id == QuickBuildAction.ID) {
QuickBuildAction.disabledReason(this)?.let(::flashInfoLong)
}
}

/**
* Taps the toolbar's Quick Build button, through the button's own tap, so the dropdown row and a
* status line that asks for a tap do what the button does (including the analytics event): run
* Quick Build, or, while the button is greyed out, flash the reason the button gives.
*/
private fun runQuickBuildAction(data: ActionData) {
val registry = getInstance() as DefaultActionsRegistry
val quickBuild = registry.findAction(EDITOR_TOOLBAR, QuickBuildAction.ID) ?: return
tapToolbarAction(registry, quickBuild, data)
}

override fun onQuickBuildStatusLineTapped() {
runQuickBuildAction(createToolbarActionData())
}

private fun createToolbarActionData(): ActionData {
val data = ActionData.create(this)
val currentEditor = getCurrentEditor()
Expand Down
Loading
Loading