Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
c26c140
add screen for gathering gesture data (WIP)
Helium314 May 29, 2025
497350d
send data via mail (not working yet, nothing attached)
Helium314 May 30, 2025
92b7824
load most of the word list in background
Helium314 Jun 2, 2025
7b901fc
Merge branch 'main' into gesture-data
Helium314 Jun 2, 2025
a404615
add version code
Helium314 Jun 3, 2025
8b3bcea
add gesture library hash to data
Helium314 Jun 3, 2025
7985fec
Merge branch 'main' into gesture-data
Helium314 Aug 16, 2025
e986dad
Merge branch 'main' into gesture-data
Helium314 Aug 26, 2025
e095f56
Merge branch 'main' into gesture-data
Helium314 Oct 19, 2025
0f35638
split & move file(s), more share intents + tests
Helium314 Oct 19, 2025
013a2a8
placeholder text and comments
Helium314 Oct 20, 2025
1c4e81d
add mail info for file share intent
Helium314 Oct 21, 2025
e2ae830
start the review screen
Helium314 Oct 26, 2025
cc7f637
some update
Helium314 Oct 26, 2025
3985ddb
make review screen work, extend
Helium314 Oct 28, 2025
8dddfc9
make selection work
Helium314 Oct 28, 2025
55da84d
more space for the actual data
Helium314 Oct 28, 2025
fafd491
give URI permission in intent instead of manifest
Helium314 Nov 2, 2025
308abce
remove user-id, more ideas
Helium314 Nov 3, 2025
d2fec47
add logging to content provider
Helium314 Nov 6, 2025
bd86330
Merge branch 'main' into gesture-data
Helium314 Nov 6, 2025
d48c806
fix build
Helium314 Nov 6, 2025
a1b72c4
only use the ACTION_SEND intent, but limit it to mail apps
Helium314 Nov 6, 2025
454879c
make export to mail more compatible
Helium314 Nov 9, 2025
30f8a0f
todo
Helium314 Nov 11, 2025
ffa033c
add missing file
Helium314 Nov 11, 2025
f8a59cd
Merge branch 'main' into gesture-data
Helium314 Nov 17, 2025
665d96d
Merge branch 'main' into gesture-data
Helium314 Nov 17, 2025
20c646d
add hash to dictionaries, comments in wordData
Helium314 Nov 17, 2025
3d83cb7
add db and use it
Helium314 Nov 17, 2025
8246879
add missing file
Helium314 Nov 17, 2025
c5a59a6
make it work somewhat
Helium314 Nov 17, 2025
672c031
tune which data is stored
Helium314 Nov 17, 2025
7991c0b
add ignore list dialog
Helium314 Nov 17, 2025
9ecb1e4
make sort and peristing ignore list work
Helium314 Nov 18, 2025
0f06618
improve review screen for landscape mode
Helium314 Nov 18, 2025
6a01f6b
continue work on review screen
Helium314 Nov 18, 2025
f0b561f
share / delete what is selected
Helium314 Nov 18, 2025
76ea5b7
improve ignorelist handling
Helium314 Nov 18, 2025
2199d51
improve display
Helium314 Nov 19, 2025
20924a3
improve sorting
Helium314 Nov 19, 2025
c8a0d16
better text for share / delete buttons
Helium314 Nov 19, 2025
46a15c5
adjust filter
Helium314 Nov 19, 2025
f98fb21
Merge branch 'main' into gesture-data
Helium314 Nov 19, 2025
5c4aa99
rename and comments
Helium314 Nov 19, 2025
50ff030
make review filter a bit nicer
Helium314 Nov 19, 2025
7079eae
hide the text input field
Helium314 Nov 19, 2025
529dfa5
autosave words
Helium314 Nov 19, 2025
8d9f510
add active / passive column
Helium314 Nov 19, 2025
868e351
Merge branch 'main' into gesture-data
Helium314 Nov 19, 2025
b97efb3
update checksum stuff
Helium314 Nov 19, 2025
04823c7
change text if other keyboards are used
Helium314 Nov 19, 2025
6401f99
go from entering gesture data to review screen instead of showing sha…
Helium314 Nov 19, 2025
04ebc54
adjust ignore list case treatment
Helium314 Nov 19, 2025
544c706
move stuff around in GestureDataScreen
Helium314 Nov 19, 2025
bf88a1c
comments
Helium314 Nov 19, 2025
d31afa1
disable floating preview for active gathering
Helium314 Nov 20, 2025
8d11243
update filtering and when to save gesture data
Helium314 Nov 20, 2025
a6039be
move data around to more suitable places
Helium314 Nov 20, 2025
13d17dd
tweak data sharing
Helium314 Nov 20, 2025
1c82418
revert change to donottranslate.xml
Helium314 Nov 20, 2025
b2a60f7
save gesture data in coroutine
Helium314 Nov 20, 2025
f285f82
comments
Helium314 Nov 20, 2025
eb5dd32
write json lines instead of a long single lines
Helium314 Nov 20, 2025
51f4f85
don't show irrevelant dictionaries
Helium314 Nov 20, 2025
f8558b6
show word count
Helium314 Nov 20, 2025
4679150
minor improvements to data screen
Helium314 Nov 20, 2025
335c51a
more info about words
Helium314 Nov 20, 2025
9047887
add license headers
Helium314 Nov 20, 2025
afe9c2e
slightly improve review screen
Helium314 Nov 20, 2025
36c0ec7
move passive gathering exclusions into gesturedatascreen
Helium314 Nov 21, 2025
c6089dc
add app ignore list
Helium314 Nov 21, 2025
fc2d972
add filter for app list
Helium314 Nov 21, 2025
3634c41
improve review screen bottum buttons
Helium314 Nov 21, 2025
a89f3b9
comment
Helium314 Nov 21, 2025
a59990b
Merge branch 'main' into gesture-data
Helium314 Nov 21, 2025
62da1c3
comments
Helium314 Nov 22, 2025
4f50291
update documentation and disable passive data gathering
Helium314 Nov 22, 2025
848a971
reduced UI in active gathering mode
Helium314 Nov 22, 2025
97bf262
comment
Helium314 Nov 22, 2025
8d7703c
Merge branch 'main' into gesture-data
Helium314 Nov 22, 2025
5559948
make active gathering work in wide screen mode
Helium314 Nov 22, 2025
d77711d
Merge branch 'main' into gesture-data
Helium314 Nov 22, 2025
627debd
us isWideScreen
Helium314 Nov 22, 2025
b46d8a6
update hashes
Helium314 Nov 22, 2025
62139c7
store full key size
Helium314 Nov 22, 2025
fe776ed
remove useless json encoding
Helium314 Nov 22, 2025
15a5234
mark data as exported
Helium314 Nov 22, 2025
6b5ce0d
show delete only after export
Helium314 Nov 22, 2025
4f88274
string resources
Helium314 Nov 22, 2025
186e52d
some more string resources, move sort to icons
Helium314 Nov 23, 2025
d3df9d8
add missing icons
Helium314 Nov 23, 2025
e6d2d53
scroll to top on sort
Helium314 Nov 23, 2025
5cde2f7
delete: return count, optionally delete only exported data
Helium314 Nov 23, 2025
45481c7
store deleted exported word count
Helium314 Nov 23, 2025
639caf3
simple bottom bar for active mode
Helium314 Nov 23, 2025
5850725
add weight to the active gathering words (use probability / frequency)
Helium314 Nov 23, 2025
9e9c22e
Merge branch 'main' into gesture-data
Helium314 Nov 24, 2025
75762b4
ask user to upload and clean db if there are more than 10k entries
Helium314 Nov 24, 2025
000a86a
have expiration date
Helium314 Nov 24, 2025
ca2a804
comment code, move some of it
Helium314 Nov 24, 2025
e148533
fix
Helium314 Nov 24, 2025
678d50a
fix wordlist creation
Helium314 Nov 24, 2025
b764bf6
some strings and mark todos
Helium314 Nov 26, 2025
e08e20d
fixes and better json file formatting, by @the-eclectic-dyslexic
Helium314 Nov 30, 2025
fbf8596
Merge branch 'main' into gesture-data
Helium314 Nov 30, 2025
4b97b73
Merge branch 'main' into gesture-data
Helium314 Dec 25, 2025
0d5d567
comments / reminders for removing data gathering when project is done
Helium314 Dec 25, 2025
97e0b7b
more comments / reminders
Helium314 Dec 25, 2025
df1d8b2
string resources
Helium314 Dec 25, 2025
c0c2d15
don't store gesture lib hash
Helium314 Dec 25, 2025
2725ef3
hide data gathering 2 weeks after end
Helium314 Dec 26, 2025
e707e40
Merge branch 'main' into gesture-data
Helium314 Dec 26, 2025
dd27983
update gesture screen and resource strings
Helium314 Dec 30, 2025
d3898bb
Merge branch 'main' into gesture-data
Helium314 Dec 30, 2025
5ef4781
more text updates
Helium314 Dec 30, 2025
5c2d2e6
back to end active gathering
Helium314 Dec 30, 2025
9f4832f
more text and minor adjustments
Helium314 Jan 2, 2026
3675617
update readme
Helium314 Jan 3, 2026
7c49d75
rename gesture data json file
Helium314 Jan 27, 2026
84f08ad
Merge branch 'main' into gesture-data
Helium314 Jan 27, 2026
19c9b05
update string
Helium314 Jan 27, 2026
2945e37
fix issues when quickly switching dictionary
Helium314 Jan 29, 2026
5f45a20
improve dictionary selection
Helium314 Jan 29, 2026
7bb0c7d
rename property
Helium314 Jan 29, 2026
3495ee7
adjust knownLibrary to boolean?
Helium314 Jan 30, 2026
dcdb6b9
add notification in case many words are awaiting export
Helium314 Jan 30, 2026
06ee0d5
limit exports to 10k words at once
Helium314 Jan 30, 2026
c546767
UI adjustments, (dialog arrangements, replace text button)
Helium314 Jan 31, 2026
be0d687
show message when close to the end of that data gathering phase
Helium314 Jan 31, 2026
427de61
move informAboutTooManyPassiveModeWords
Helium314 Jan 31, 2026
3530b82
add share icon
Helium314 Jan 31, 2026
6118b66
store popup keys too, and store text instead of code points
Helium314 Feb 12, 2026
82c82f8
disable share & delete buttons after deleting
Helium314 Feb 14, 2026
a171945
update texts and set mail address
Helium314 Feb 14, 2026
c442c81
remove "export" from gesture export strings, use submit / share
Helium314 Feb 14, 2026
3622000
clarify that new strings section should be separate
Helium314 Feb 15, 2026
50315db
tune active gathering probabilities to favor more common words
Helium314 Feb 16, 2026
0641a7e
update dict hashes
Helium314 Feb 18, 2026
33f951b
add info to the dict hash file
Helium314 Feb 21, 2026
4f429cb
properly upgrade the DB
Helium314 Feb 21, 2026
9e81b9f
fix db creation
Helium314 Feb 21, 2026
a5391d2
remove unfinished parts of passive data gathering (to be added separa…
Helium314 Feb 21, 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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Does not use internet permission, and thus is 100% offline.
* [Code Contribution](CONTRIBUTING.md)
- [License](#license)
- [Credits](#credits)
* [Funding](#funding)

# Features
<ul>
Expand Down Expand Up @@ -108,3 +109,11 @@ The icon is licensed under [Creative Commons BY-SA 4.0](https://creativecommons.
- [Indic Keyboard](https://gitlab.com/indicproject/indic-keyboard)
- [FlorisBoard](https://github.com/florisboard/florisboard/)
- Our [contributors](https://github.com/Helium314/HeliBoard/graphs/contributors)

## Funding

This project is funded through [NGI Mobifree Fund](https://nlnet.nl/mobifree), a fund established by [NLnet](https://nlnet.nl) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu) program. Learn more at the [NLnet project page](https://nlnet.nl/project/GestureTyping).

[<img src="https://nlnet.nl/logo/banner.png" alt="NLnet foundation logo" width="20%" />](https://nlnet.nl)

Further the project benefits from donations provided by many users (thank you all!).
7 changes: 7 additions & 0 deletions app/src/debug/res/values/gesture_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-License-Identifier: GPL-3.0-only
-->
<resources>
<string name="gesture_data_provider_authority" translatable="false">helium314.keyboard.debug.provider</string>
</resources>
7 changes: 7 additions & 0 deletions app/src/debugNoMinify/res/values/gesture_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-License-Identifier: GPL-3.0-only
-->
<resources>
<string name="gesture_data_provider_authority" translatable="false">helium314.keyboard.debug.provider</string>
</resources>
10 changes: 10 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ SPDX-License-Identifier: Apache-2.0 AND GPL-3.0-only
</intent-filter>
</receiver>

<!-- necessary for sending mail attachments, remove when data gathering phase is done (end of 2026 latest) -->
<provider android:name="helium314.keyboard.settings.screens.gesturedata.GestureFileProvider"
android:authorities="@string/gesture_data_provider_authority"
android:enabled="true"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/gesture_data_path"/>
</provider>
</application>

<queries>
Expand Down
126 changes: 126 additions & 0 deletions app/src/main/assets/known_dict_hashes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# SHA256 hashes of dictionaries in https://codeberg.org/Helium314/aosp-dictionaries (relevant because here we also have the word list file)
00c9c095e3e1619369ab62a3b4474ebb6eb78b1350a5366985635c1922aca780
0266a78e525ed7decac2a005593bbe9459094340e9802647376dc8ac6a09203d
027c742c6901d8ebcae667d2791cf9ad4543d0324c539a441a0611287de51af1
08687a0119f7e8e9fb1ab30d8fb757c22cab9606dc38a5392192581bacc3dc53
0c7f58a31f05ca04febc9499ecff692e514928e0c9251aff60a68e38c704b024
0d02046c84e14c1a9fd541c9be869c4e558e40ae706c20b7667c2df36fc72b80
0f4d1d60681a94c3e19c4c694f64d48b08f3904fb6bf724076e21a83ab9f7945
11c43687913663c4f3bb5915085067358a18c9b8f0fd8759a191bd55028983c7
144907462cf2a4c0d3b7c6e2aa67687a448a3f665ca449072ec433e85ff1b745
14e94e229ba51fce0f40cab8a7dcfec4085c183712898f8a14d2016478ff6d1b
166f60a0d3e11055215a5d3ee42ac6ce806d3d1a3fbc3137351c178bb667e58b
17965a492f20ab1ba06f95704f9754a1f82e54be6581c50bb1d11b37e12a85a0
17f8b5ff2227167d3a0a3cb436c8982b8957a94fe0e41bb11561c8cf4b51541f
20ebf36d7297c06a229f6d3a8d18ab2c94cd02653aa23466110f93ac4caaa5ff
211d08ea29ae85e9c449665a78f9fcefb6aac16a8b60d4642029b49b1e271fda
244e81bd6c18841bfcd0d418908554b24cb512eed2c3abb3de6139bdb247b55f
2841857c1bb2c251b0ba4bd452863d21e275edeac32fced8c8ef14ade0839eb3
316e9a7e610b381f271926f3bd38d7bffd640befda99129f5f1092fa6b19a04a
3532cfbee38003621c2d260d64690d8fbfdef419ab3508dcfc617a3b46df8590
37151db7e9df12d7846e8d7ba936ff8aa441d13981c44971b61a4b86d104f422
37d3519d23f19fe8c1ddafa76380af32cb8ab50f08544cbafe2a28255734461a
38f0215d78b749ce8029952001846176a5dbbfe85f723c141e5b60fc1be910b8
3c1bb98883ac5bc96a96e206972b5fc8c4a04ad8992d26c4d365ae0cdcc8f686
410fb85388b646b6694373e83f30052040332acd2baaeb640574d3846c7c5ea4
44a048bdb352b7b3f3d07a86ad1fb1692052b5a7838a57bc39caaae6181fcbad
47155863f9fe3c188c9c5d4f850d02a4b499e9828fecc4bfb8305f65fedfcef2
50d931a2a73acfbd5e2d69d14927981f985aefeda1067a37cf40d9d4d5b330e0
537078e3ba369c87063031f03051d80a0ee121a5459f8192811ca254fc959d19
54298a813d2425dc666882604fbc86f9487819417e25599f9660612be7d32da5
57d1e2e7d0b08beec4d540952d0e538698c5d82f4e6a2cdba938800bfdc4a80d
59e66fa3ac88783a1ad3e7db4b200c6206dfcebd459f4da30fffd895173c220c
5b2d08c14128bcfb9d62db3cd5df8f0af8f7c2e653d9913f72f9f87d64648864
5cc04de56805b03d4e9309e163b5360a2ab0206c962271c146117adb3c0823e2
618dfbfba32bd69a44792ac6aa81c12528762b011e20691662058158c5d2f275
61ce4cd1cd1961ab2ca2796964e4b1468eb48cb7568973c16f850348ebaedcc2
642ff3e5727e81d3a1ebdeddd9226dd7c17166bcd52f8f6e39f34b44be6faabd
6610bafc848961239f59b9f81a6f9b29b58fc31f89d5f4c50b4e7e1a8eb6f21e
6850487b3985ea073f6f570fa5f489261c695e173552ec60bdd9fcedb0cc090f
6aa8233c3c3533968b32d8a16079d73789936f03f663e55561494c3c655dd992
6cc7bc856de7928606ec974a17887f80848c7692560824ab05153a48cb193c94
6d0667373d4b6850690e328ac471a25a82aa838e412b646d97e73cac4d0a4573
6e4c39ba5e471af8be2d8ea4a62d2cf0afded233481a3f7c6486889696014ffe
72c3d30ef37e97eefc5dcec0a2ccd822190fe2e5da0958f6c775a610fb6e339a
73fb7768d9a1eb38b232e296bb0a6e7f438031ba8d76cdeed11cd2b57868e8a0
7bc8ae5c5b565050a478b82372d758c178804fc8c07d47cdb00ec314da2a7093
7cf81b85f8602d970d1b4cd4ca8136e4a65313784fdf9011f17fdfc2e0b8f0c5
7db7af0e5314bde1437ecfa191c992dc7650796759142ddca5041f71d2aee0a1
7dd95ef84493bbb3860baa24f6afe8f83f79da931e4abf5a7ee921b9947a3e4f
7eca55127764b36d7823b7ff86b4e2a0dabbf76bfc0d5659df657c6ea0f24f13
806243bb3b799ef89c3aa1a147b5d12d2ec19271c6b3c0bbff7147af14c14c01
813745bafaf928545cc215bfc96b68ad5c961fb1618ea2fea6ad230a1ddfa091
8208a0d7374415cc610e2b605c44a0d2beed4920e44f63b1a9f5e838b95557a3
8539600880f2586504fdcab610fd7d4966c161a2a235b1c927fe634d34c196fa
861855eee7c7995d65b03746f3cb446b3831b92e8600f5ce221039ff8be05244
87bc832f9b0f191907f1d08a12527a2c0e8854e23db807fa28af1936a4c0a87a
89dbb28105af326a721c6ae7fb45e6a1e8f59c28f8a23f23731ef4d2ad10b90f
8a43d036b300e22197452fcf7ca08af87c561ea5f4be144d861e13215034dac6
8f0aea5aa50019691b0ec709b1874b9c0f2a954547d77d252967864834ccad72
8f826109fd75c81354d950519983ced2205bf9c9844131924590e7ca8cac5746
91710c15f1877f6a9b88b25a27de724b43eeb263b3c606e1512d606149f827b6
91f919e3783787ccf009025d78fefb2233861567a6d41cbb3f6a282fee59558a
92481712900b5f92e0b6621422d329753fe43a749e5bd75113ccbcd4882e003a
94a808c9043d896b59357075c002c138555d66f6ed513a0a7215ce3fad84b028
9937ec9a8929536ba6dea19f92e984b8a4aaea82d385dcbe239f9586bca415d8
997fa17bbf9a077e5777412bcfe70ebf8c4fb09d5c822f09d442608ee9039551
9a64cdf81cc873885df78c14a061eff8ab1bd8b8795f5e595a9e2030f83d2c58
9bf6d8d2e076249d516ed18c7522d133d9ac8f4ce8061231fa82ede68f240e45
9bfe41428b84b81c21405f53d3719aa8c5d2c96f41d74606e575d9b2a75d2757
a06ae29a41d0a21b68aa295f4d9a05b62a0f8644d18c27ef5b27cb87bb06d833
a1eaa344209680bb042d7ee0c66db1796101c43bf4942d4f496ee11ab63c5e49
acf2164c98d715501cdcd34a8021791af3f08f6845bd245b740ba7a3e452d36b
ade68d50d4a5a92eb1e3ad2d88a6a0f729d33a8d7ca420da9c7b405916b1dab7
af4616eb74a7e1d61b74171ba0f22da424b31075b3c07652642e5c92adacabf5
b090d0ebaf877d292d58aeb0b3eed4fbde8c63d0ec6ef7cd9977ba2fa0212f98
09c576971a0a8131dc285e3a4ccb8aea039285d0951614e15e2fbf50d6693def
b1e4ead01631d578bcae538d40cdb7a17fb4ee2721814e363dfeaf404765ae69
b321f8c09afb8b3e3ce69d1b151bd8173cef1cb76f7a5993fbd4b3edea141b7f
b6d905cdfdf18ee4743a561c7bf3ad33a9fd0266ea49e2d85e016fc08d2d3735
bb2b5373748e3eb1daebfbdf66141102c5ffb63e3bba03326c8b00bfc7b7bb18
bd950ef4b57655120eee65cee62a5d216a63f721d9a8bb759ce2022437840443
bdd66c0873e65fb71e20f7c8dee85dd7ab9be59f627fff7521790ff8326c9f18
beb2fda8a3bbaeeec95c301c5cce3e40474e01677a4412fb070eee2040c391d3
c0794d9e5f85fbe623b7b3e617f2a9d7f45011648b289a0b263dfdafddac9332
c8b106372ad532ce708fcf6e8b723cf89549c06273f77ba964f7eb5d56be176a
c9e5607bd63143930b41ca91919bce23e8abca8172ad24a0fdede029398c95d7
cb8d9163245752f96be76326e6fcedbe73ba6fde7373db4511157944d0970582
cefbefc25ea656b4b8da5189366b1d1d608c205fcb1f83ec7e9ef4b76447937f
d2317360a5af36b9db484892cbb2975d53cd40c01b9e8a2a1f23251be80cfa86
d247e66bdc29a80b65a71df4a94b37e119a8c3ba8ca5956295028dfb285aa55f
d45c1dc02a76e527bef7d330f8d1f15a4c4dffef8f58215f4bd5ea91e5f28ce6
d4d88d10eb0d7023525f8bc7c24d5562ded72d0e75d4e3f8e8f0219f5dfc3a5f
d5c863d7f424642d5317616d89135b9f1d6eb66cdb62652271d930a428f588b0
d779d40bee274be2a5596e6df7882ac4685327c360810000ab5b900c6a79fe32
d7b78b2eb4ee6a103acbd96b1cd1f20a87bd20f7c021ca2b069ca32d424282b2
d7d80eaafe52dcdba057cdd7bed279f966c6e16ba501d46bb343ffa67732d62f
d9ecea24f9b769462834c8760661678f62f33267bec0cc9b069e8fc2ae986e32
dace1f700bb5335ed5c9e627a32dd02642c37f6f7fa524867786ca0496b20500
df331ac2278a8c83507457eb71ef4e71c9c3ed0b9540f9786425401a38f739f1
df554eb58ba6cfdc8017ea1cf71e61a65bdd36be6ad58ffb1a2c7cf02126e108
e3c97d35a1b27c343abfd6d1c255289f776576201c2e061a7e7827723205a11d
e5d70df2a2b1cde9ffce60d7cad28316864c01dd9123606c4ec79e5ae9a5123e
e7b8bdb40871257c24e4741ade0ebfbc940a5e5264a8adb5682ad6c8d2e78249
e89f2927c84d0d12d6b6509cd532a86ff2721747b0f4536c8c4f6e3995dd2b2e
eb86c6ab70cb1486c759a159b4ca39cd19bf9ec099ea92afb24a76effa71fd11
ed4d0a44db2fc11c53d2986b279520faa01ee4602af6a564023ea4565d41bf42
ed8917d4039ba966c7f0647f0c3337c5cd715ef5e16fa73a8d28d982ea3469a5
ede31f35db403ea05ebb722f5e445e1bf4c9f25833619e20558e1c3e7db11554
ee5de04b6a93af67d2095a68ac1a8709ecdbf838cc5c98795f0b4ad2d192c2c7
f10eef860d5cb06cd772360fe19dfe256799c52a78fdc31a0cd55634c909d3a2
f19489ee41838c899dd44c3cb62b27a30f848d4f4f8af09e807b50542289a534
f392e78a9719dd818acd75b7cd9ac5d49db8190fad394beb35dcae84fac20803
f58d0bdadeba0f08330c1233448f47b18cb459eddd9f24bfcf56cf638d8c9013
f7037e4714242fda95a3b4254d47228b9be537c35a125115b138d70318c30e70
f7ab933be79d3994e8bda46ea39fcb569aeb0f5eea49043f0dce1888caee4d51
fa9841c4a10fad7a422a61c84fb1c8bd7618b5b9d2debddaa84e1e95f841c1e8
fd4ff64e40d0c7cd34914f473090b21c266e0ab9631b04a96e799fbe4879a5e4
b9db272876025f0ae9878427a3f75aa3f2a108f1aa95e049043a4d93f83faf5c
5b036c1fbac15712d81cc9144301332c357c1a64f1b9dc1dac0b6d06c42978fd
1e147d575efda14bf17659f255395780a766fde14aca316b8a06065d04fcbdd9
a179a6cc357e6bdefe1051d34df0e8513117678e7c4422a10f36bda005d29841
1612f0c86aecc47c7f48a4c36f5169fb9240e5c22417b1cf8516d9497220c532
1c0d451dfcc82172cd053c2da183ebc4c79a3b88ab06ad1e856396e00fe6b57d
d37ed94c37d5638dfcd847ee288fc0db7281f7ae5a7cf448751ad333faffbf30
150a376283d4b84f568c3ff2ce2d2619e540c4ecf098c39b39e2c0b9b2a9f697
bc93c0b59c4059442c9b451f213aec5d83e8c389736cf325de387bdd4770e1ae
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package com.android.inputmethod.latin;

import android.text.TextUtils;
import helium314.keyboard.latin.utils.ChecksumCalculator;
import helium314.keyboard.latin.utils.Log;
import android.util.SparseArray;

Expand Down Expand Up @@ -643,6 +644,20 @@ private synchronized void closeInternalLocked() {
}
}

private String mDictFileHash;
public String getHash() {
if (mDictFileHash != null) return mDictFileHash;
final File dict = new File(mDictFilePath);
if (!dict.isFile()) {
mDictFileHash = "";
return mDictFileHash;
}
mDictFileHash = ChecksumCalculator.INSTANCE.checksum(dict);
if (mDictFileHash == null)
mDictFileHash = "";
return mDictFileHash;
}

// TODO: Manage BinaryDictionary instances without using WeakReference or something.
@Override
protected void finalize() throws Throwable {
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/helium314/keyboard/latin/AppsManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@ class AppsManager(val context: Context) : BroadcastReceiver() {
interface AppsChangedListener {
fun onAppsChanged()
}

fun getPackagesAndNames(): Collection<Pair<String, String>> {
val filter = Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER)
return mPackageManager.queryIntentActivities(filter, 0).distinctBy { it.activityInfo.packageName }.map {
it.activityInfo.packageName to it.activityInfo.loadLabel(mPackageManager).toString()
}
}
}
13 changes: 12 additions & 1 deletion app/src/main/java/helium314/keyboard/latin/LatinIME.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import helium314.keyboard.latin.suggestions.SuggestionStripViewAccessor;
import helium314.keyboard.latin.touchinputconsumer.GestureConsumer;
import helium314.keyboard.latin.utils.ColorUtilKt;
import helium314.keyboard.latin.utils.GestureDataGatheringKt;
import helium314.keyboard.latin.utils.InlineAutofillUtils;
import helium314.keyboard.latin.utils.InputMethodPickerKt;
import helium314.keyboard.latin.utils.JniUtils;
Expand Down Expand Up @@ -124,8 +125,9 @@ public class LatinIME extends InputMethodService implements

// UIHandler is needed when creating InputLogic
public final UIHandler mHandler = new UIHandler(this);
private final DictionaryFacilitator mDictionaryFacilitator =
private DictionaryFacilitator mDictionaryFacilitator = // non-final for active gesture data gathering, revert when data gathering phase is done (end of 2026 latest)
DictionaryFacilitatorProvider.getDictionaryFacilitator(false);
private final DictionaryFacilitator mOriginalDictionaryFacilitator = mDictionaryFacilitator;
final InputLogic mInputLogic = new InputLogic(this, this, mDictionaryFacilitator);

// TODO: Move these {@link View}s to {@link KeyboardSwitcher}.
Expand Down Expand Up @@ -831,6 +833,15 @@ private void onStartInputInternal(final EditorInfo editorInfo, final boolean res
void onStartInputViewInternal(final EditorInfo editorInfo, final boolean restarting) {
super.onStartInputView(editorInfo, restarting);

// only for active gesture data gathering, remove when data gathering phase is done (end of 2026 latest)
if (GestureDataGatheringKt.isInActiveGatheringMode(editorInfo)) {
mDictionaryFacilitator = GestureDataGatheringKt.getGestureDataActiveFacilitator();
} else {
mDictionaryFacilitator = mOriginalDictionaryFacilitator;
}
GestureDataGatheringKt.showEndNotificationIfNecessary(this); // will do nothing for a long time
mInputLogic.setFacilitator(mDictionaryFacilitator);

mDictionaryFacilitator.onStartInput();
// Switch to the null consumer to handle cases leading to early exit below, for which we
// also wouldn't be consuming gesture data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@ package helium314.keyboard.latin.database
import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import helium314.keyboard.latin.utils.GestureDataDao
import helium314.keyboard.latin.utils.Log
import java.io.File

class Database private constructor(context: Context, name: String = NAME) : SQLiteOpenHelper(context, name, null, VERSION) {
override fun onCreate(db: SQLiteDatabase) {
db.execSQL(ClipboardDao.CREATE_TABLE)
onUpgrade(db, 0, VERSION)
}

override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
// nothing yet
if (oldVersion <= 1) {
db.execSQL(GestureDataDao.CREATE_TABLE)
}
}

companion object {
private val TAG = Database::class.java.simpleName
private const val VERSION = 1
private const val VERSION = 2
const val NAME = "heliboard.db"
private var instance: Database? = null
fun getInstance(context: Context): Database {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,8 @@ public void close() {
mLock.writeLock().unlock();
}
}

public String getHash() {
return mBinaryDictionary.getHash();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,14 @@ public final class InputLogic {
private int mSpaceState;
// Never null
public SuggestedWords mSuggestedWords = SuggestedWords.getEmptyInstance();
public final Suggest mSuggest;
private final DictionaryFacilitator mDictionaryFacilitator;
public Suggest mSuggest; // non-final for active gesture data gathering, revert when data gathering phase is done (end of 2026 latest)
public DictionaryFacilitator mDictionaryFacilitator; // non-final for active gesture data gathering, revert when data gathering phase is done (end of 2026 latest)
private SingleDictionaryFacilitator mEmojiDictionaryFacilitator;
public void setFacilitator(DictionaryFacilitator facilitator) { // only for active gesture data gathering, remove when data gathering phase is done (end of 2026 latest)
if (mDictionaryFacilitator == facilitator) return;
mDictionaryFacilitator = facilitator;
mSuggest = new Suggest(mDictionaryFacilitator);
}

public LastComposedWord mLastComposedWord = LastComposedWord.NOT_A_COMPOSED_WORD;
// This has package visibility so it can be accessed from InputLogicHandler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ object ChecksumCalculator {
return s.toString()
}

fun checksum(file: File) = file.inputStream().use { checksum(it) }
fun checksum(file: File) = runCatching {
file.inputStream().use { checksum(it) }
}.getOrNull()
}
Loading