Commit Graph

380 Commits

Author SHA1 Message Date
LineageOS Infra
f32205c417 Automatic translation import
Change-Id: I8595564c923636bcc682918835167bf3655e5602
2025-04-01 15:14:04 +00:00
Michael W
0342bb3121 Updater: Fix warnings
* Unused imports
* Unused code
* Unused resources
* Set.isEmpty() instead of .size() == 0
* try-with-resources

Change-Id: Ia9351986c62e8e5f8d4615f6146827b891f55f9e
2025-03-07 19:13:04 +00:00
Michael W
33d63d627d Updater: Use Java 11
This is what AOSP uses since SDK 32

Change-Id: I6401a14cd2a00f8e3b8d0fe8ec3ff9ec215bd9c7
2025-03-07 19:13:04 +00:00
Michael W
9918f7ef91 Updater: Bump minSdk to 32
* We use features that are only available on 31 and up (system colors)
  anyway
* We can use Java 11 instead of 1.8 (which we already can use when not
  using gradle, but that way AS also recognizes it)

Change-Id: Ie2ea1e77b1954bde44f06b63e6c09979d0e91c17
2025-03-07 19:13:04 +00:00
Michael W
fbdb5570a5 Updater: Update gradle plugin to 8.7.3
Following AS recommendations

Change-Id: Ib3ad9be87b21e4b8a98ad3e07d3f0af2aa42cabe
2025-03-07 19:13:04 +00:00
Michael W
e28d157a8c Updater: Update gradle wrapper to 8.9
7.5 is not supported by AS anymore

Change-Id: I961776da6c387a16c092e88fdc4423d97cb4b7c7
2025-03-07 19:13:04 +00:00
Michael W
a9d7673d1d Updater: Add welcome message with instructions
Make it clear for everyone before even clicking anything that updates
are not incremental and old ones can be deleted

Change-Id: Ifcc31958d9324899a267741141ff66b10f62edc1
2025-03-07 19:13:04 +00:00
LineageOS Infra
ec85854518 Automatic translation import
Change-Id: I0c36cb9569beebd8d242e8e57865c9d23df9496c
2025-03-01 17:50:28 +00:00
Nolen Johnson
e92031f1ec !fixup Updater: Allow Updater to handle major upgrades via property
* Missing semicolon in the final PS, but more importantly,
  unreachable statement.

Change-Id: Ie064e750e6c91e2689eb8d3faca459b4c30c1ab3
2025-02-18 05:26:08 +00:00
Nolen Johnson
c9159bf47b Updater: Allow Updater to handle major upgrades via property
* If the user has GMS installed, they'll need to install an updated
  copy, as addon.d won't restore it, and if it did it likely wouldn't
  work. So we can't support this unconditionally.
* If the user has no-GMS, this should be totally fine to do, so the
  user could set the property, upgrade, and go on their merry way.
  This use-case is why I didn't make this an `ro.` property.
* If someone building LineageOS builds GMS into the images, upgrade
  via this method would also be feasible.

Change-Id: If2a6e6767dcb182d3dbd2a95c81a940fdb53547e
2025-02-18 03:18:07 +00:00
Michael W
5ab3076f91 Updater: Show "no items" view after deleting last update
Currently after removing the last update from the list, you end up
with a completely empty list. It should look like when you open the app
again with no updates

Change-Id: I77f025baf2e20385d31b5e897b92ddf24680be99
2025-02-17 01:24:58 +00:00
LineageOS Infra
6fafcc4e7f Automatic translation import
Change-Id: Ib2bf80cfe87b70971a3d678c2e15c3cf330e8b7f
2025-02-15 15:47:30 +00:00
LineageOS Infra
e670f6e8cd Automatic translation import
Change-Id: I8a7d494342485ed3e4ca588dc04388814166eba8
2025-02-01 14:28:44 +00:00
LineageOS Infra
d044ba1dee Automatic translation import
Change-Id: I7bdad186119308897dc891a5b83c8e704e5e3621
2025-01-15 20:54:57 +00:00
Hridaya Prajapati
b551ebc472 Updater: Migrate away from deprecated ProgressDialog
Follow usage of AlertDialog with ProgressBar as documented in AOSP.
https://developer.android.com/reference/android/app/ProgressDialog

Change-Id: Ie410f839cb5495a4b37ce926d991d662861ef398
2025-01-04 12:26:03 +00:00
LineageOS Infra
d8e73e380c Automatic translation import
Change-Id: I65d59303983836bf6832aadbbb5c675f92d90745
2025-01-02 08:11:22 +00:00
Michael Bestas
a2e31f1f2d Revert "Updater: 20 and up are integers!"
This reverts commit 1ec0b8d1de.

Change-Id: I5b5c5bf825405d7a0b3720521cea343a0674fd40
2024-12-26 09:35:38 +00:00
Michael Bestas
b31dd16806 Revert "Updater: Handle NumberFormatException"
This reverts commit bf1646fa93.

Change-Id: I90e2bcbecbf04641e97957d0ad3f8964d9403d2f
2024-12-26 09:35:28 +00:00
LuK1337
a07c2fc48e Updater: Allow 22.X to 22.X+N OTAs
Change-Id: Ic4f5d94d4040bd744a372d3bb5090aba70e0688f
2024-12-24 11:06:17 +01:00
Timi
1d33cc3135 Updater: push-update: unroot on exit if zip exists
Change-Id: I10ccb345d02830337bc8aefa4f3d41e80e42d064
2024-12-17 18:19:02 +00:00
Giovanni Ricca
ed36157049 Updater: Set SYSTEM_UPDATE_SETTINGS priority higher than GMS
For whatever reason, when both SYSTEM_UPDATE_SETTINGS components have
the same priority and the first one is disabled (in this case, the GMS
one), it doesn't seem to fallback to the next enabled one and instead
shows a "No apps can perform this action" message. To avoid that, let's
just set higher priority.

9a6853 com.google.android.gms/.update.SystemUpdateActivity filter b9e590
  Action: "android.settings.SYSTEM_UPDATE_SETTINGS"
  Category: "android.intent.category.DEFAULT"
  mPriority=1, mOrder=0, mHasStaticPartialTypes=false, mHasDynamicPartialTypes=false

Change-Id: I886a714304fe6d1906af7e1702ecaf2238bd8cb0
2024-11-11 10:55:02 +01:00
LineageOS Infra
a72dadf7e3 Automatic translation import
Change-Id: I5740bd6f9c095b3e7d0a8207e7541f7506480931
2024-10-31 17:49:49 +00:00
Salvo Giangreco
3cb130d40a Updater: Fix broken download ETA/progress
Change-Id: I1d7b5ecf7779d08c5d617d8c0950b24fbe7d0733
2024-10-02 16:42:50 +00:00
LineageOS Infra
e6edfaab94 Automatic translation import
Change-Id: I82c651eefb62882cec8bb4ee914ee5d9b56264c9
2024-10-01 20:14:22 +00:00
LineageOS Infra
34535a83fb Automatic translation import
Change-Id: Ia65d6e242fa1cbcbec79755974bc5afd8c4afd0d
2024-09-15 16:02:37 +00:00
LineageOS Infra
8d0b616fec Automatic translation import
Change-Id: I7c5a0601e46bfe371c38b07cb2f432fede1d2647
2024-09-02 23:16:27 +00:00
LineageOS Infra
6ef2ee7a34 Automatic translation import
Change-Id: Ieec62f872ff664b0411247876cdb1fa858f7ccab
2024-08-15 20:24:22 +00:00
Michael W
7c5230326f Updater: Append trailing slash to upgrade url
* It gets appended after calling anyway
* Having the url at the end of a linkified message with a dot after it
  (end of sentence, e.g. russian), the dot is also linkified resulting
  in
  https://wiki.lineageos.org/devices/<device>/upgrade.
  which won't work, while the slash makes it work
  (with the linkified dot)

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/7248
Change-Id: Iaacd61267ad886c23393e34071a191a2e08d4009
2024-07-19 17:29:23 +00:00
Michael W
0d1c94fe5a Updater: Round dialogs
Change-Id: Icc5ea5a27e48ec74158588ba11a0277b6f0404cf
2024-06-28 20:18:38 +00:00
LineageOS Infra
8b6c6728ac Automatic translation import
Change-Id: Ib7cf69f228616a1e1d5fb4c9d17de6c233bc861a
2024-06-15 18:21:16 +00:00
LuK1337
4a536da4be Updater: Use https:// for wiki URL
Change-Id: I9b18ce7ea75d7248dd04a5603e80139afc8e6e09
2024-06-06 10:33:42 +02:00
LineageOS Infra
a6ce04aefc Automatic translation import
Change-Id: I4f9f0369ecff6df84e4f824f5e016663fcfe0a28
2024-06-01 22:14:29 +00:00
LuK1337
36c5333f2d Updater: Handle ErrorCode::kUpdateAlreadyInstalled more gracefully
If applyPayload() fails with kUpdateAlreadyInstalled, mark update as
already installed. While this is not ideal since this might not be the
update we actually installed, it's still better than outright dying.

Test: install update, unset needs_reboot_id, kill updater, install
      update again.
Change-Id: Iac264896cffd1db522d81fc2050eb71d62ca91bf
2024-05-17 14:33:12 +00:00
LineageOS Infra
93adf96d12 Automatic translation import
Change-Id: If6cce2f888b32a71567597822a39c2638d65cfca
2024-05-15 15:50:39 +00:00
LuK1337
ddbb843309 Updater: Add /mnt/scratch detection
Change-Id: Ie4d408791c24ce0b592882a0e6c5af12bd16addb
2024-05-02 18:58:57 +00:00
LineageOS Infra
d1d28de8e7 Automatic translation import
Change-Id: I52e976d00a3cf32fa248331d3026d844f03d84df
2024-05-01 16:33:52 +00:00
LineageOS Infra
c9eada5848 Automatic translation import
Change-Id: If4758d368b57157a6c5ec1de7a9dad0c9ae05113
2024-02-18 19:38:55 +00:00
LineageOS Infra
76c126c8af Automatic translation import
Change-Id: I855069d4b214900b32f88a6ec73cb7b2abb07b99
2024-02-10 19:04:56 +00:00
Bruno Martins
27af047c21 Updater: Override SystemUpdater
It is the "Local System Updates" seen in Automotive builds.

Change-Id: If81451e65f55445db000a3a92f3badce8f9ed8e2
2024-01-20 02:26:23 +00:00
Bartłomiej Rudecki
7d9b6c0c64 Updater: Define foregroundServiceType
Required since Android 14 [1].

11-16 14:05:45.363 20623 20623 E AndroidRuntime: FATAL EXCEPTION: main
11-16 14:05:45.363 20623 20623 E AndroidRuntime: Process: org.lineageos.updater, PID: 20623
11-16 14:05:45.363 20623 20623 E AndroidRuntime: android.app.MissingForegroundServiceTypeException: Starting FGS without a type  callerApp=ProcessRecord{6d14558 20623:org.lineageos.updater/u0a149} targetSDK=34

[1] https://developer.android.com/about/versions/14/changes/fgs-types-required

Change-Id: Id6217424177b94d37621062fb1a55778f1dabbab
2023-11-16 22:11:39 +01:00
LineageOS Infra
0b1821c9dc Automatic translation import
Change-Id: I8615afa7afd004f98d18b482f4fa2e946476bf99
2023-11-15 18:52:18 +00:00
LineageOS Infra
a804504378 Automatic translation import
Change-Id: I02c7f9741ab977fb62b0f652fa84e6011feb7dee
2023-11-01 17:29:18 +00:00
LineageOS Infra
7f43b5b628 Automatic translation import
Change-Id: I9f3ad5b2c365df52d808116fe30ee94ab19686f9
2023-10-15 20:43:22 +00:00
LineageOS Infra
3f365d5feb Automatic translation import
Change-Id: I881449a5def2e3e649cda736c10bd6bf119b84d9
2023-10-01 16:33:00 +00:00
LuK1337
64261f1321 Updater: Use generateBp plugin
Change-Id: Ic5431575b684ee2d416d5707e499f0cf538ce4c4
2023-09-18 13:12:06 +02:00
LineageOS Infra
5c17826dcd Automatic translation import
Change-Id: Icff4f920131242cf530f31231cd3ed9916159d11
2023-09-15 17:53:31 +00:00
LineageOS Infra
919a15e270 Automatic translation import
Change-Id: Idd77531a68e9f28c96dd08bf7beceefbb94d7b0a
2023-09-01 14:42:24 +00:00
Joey
5a212ca159 Updater: add support for local updates
Allow importing and installation of OTA files already
downloaded instead of requiring to reboot to recovery
to install them.

Squash of:
- Add support for importing local updates
  Signed-off-by: Joey <jbevilacqua@shiftphones.com>
  Change-Id: I64ca3a6af29bdf8b2c6023a502f23080a27fd79e
- OTA: read timestamp from imported zip metadata
  Signed-off-by: Joey <jbevilacqua@shiftphones.com>
  Change-Id: I93a5c0be81adab9ba8e50afde0e09839f059c9e0
- OTA: fix UI issues with local update
  Signed-off-by: Joey <jbevilacqua@shiftphones.com>
  Change-Id: I07c8f5507bc52c254c3dc1468fea495a073ae96c
- OTA: fix local updates not being shown in UI (pt.2)
  Signed-off-by: Joey <jbevilacqua@shiftphones.com>
  Change-Id: Ife40eea05099eca9e1ee84c6f87d2715e5981cab
- OTA: ignore download status changes for local updates
  Signed-off-by: Joey <jbevilacqua@shiftphones.com>
  Change-Id: I198f9b5462718f8a6e5687c891f3bfc6b1c645bd
- UpdaterService: fix crash with local install
  Change-Id: I27b187cf4adec986d516e3017d1b3877691029b2
  Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
- Local updates: do not remove local update from ui after installation
  Change-Id: I869e090f26273006f933ad99c42b7c6a2e963797
  Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
- Local updates: modify display version
  Change-Id: I8a39e0936040bb9546499754ab4a9ef60c56aca0
  Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
- Local updates: show build date in import dialog
  Change-Id: I9014358ea1cf941e76fdd80a5147e9d924fc1a8f
  Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

Change-Id: I64ca3a6af29bdf8b2c6023a502f23080a27fd79e
Signed-off-by: Joey <joey@lineageos.org>
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2023-08-24 17:57:21 +02:00
LineageOS Infra
5ff552fa43 Automatic translation import
Change-Id: Id05d7c44e5cb5d560ff621ba9a91482925b568e2
2023-07-15 18:08:10 +00:00
Michael W
185b5de51d Updater: Don't show delete twice
* If an update exists and can be deleted, the action button AND the
  popup menu both show the delete action
* By checking wether the action already shows "Delete" we can hide
  that action from the submenu
* Additionally check for online availability to only hide it when it's
  not the last item - otherwise a click on the menu icon wouldn't do
  anything

Change-Id: Idc5da3962be4e0a69847f47b3c5f014b251bd438
2023-07-08 15:23:17 -04:00