Commit Graph

288 Commits

Author SHA1 Message Date
Michael W
12a22e43e2 Updater: Switch to destination selector
* Let the user decide where to store the file
* That way it's not located in /storage/emulated/0/Android/data/...
  ...org.lineageos.updater/files/LineageOS updates/*.zip
  -> The user knows where the file is stored
  -> We don't have to care about WRITE_EXTERNAL_STORAGE etc
* Remove the cancel button - after closing the file stream we loose
  permission to access it, therefore can't delete it anymore
  -> Let the user handle deletion manually
* Since we don't use WRITE_EXTERNAL_STORAGE anymore, remove it from
  Manifest and also remove PermissionUtils (+calls) - we can now export
  immediately.
  -> This also solves the
  "TODO: start exporting once the permission has been granted"

Change-Id: I50afa403f2803569aa9def807ea20ee72c582284
2022-02-10 15:45:29 +01:00
Michael W
2623730bef Updater: No need to install every update
* Apparently users are not aware that they don't have to install every
  update we ever released (weeklies) after they have skipped some due
  to various reasons
* Since we are providing full installation packages, remind the user that
  it's ok to only ever choose the newest one

Change-Id: I70f9acd70344f36aaae7e45b848f6bcb7a8b3c0f
2022-02-10 15:45:29 +01:00
Michael W
f2ac903e3e Updater: We don't do upgrades
* We are actually updating, but especially between translations and
  non native speakers, drawing a semantical difference is more harmful
  than helpful
* Use "install" instead

Change-Id: Icdf1ce45d6cd35334b5c8ac13af3ec6741d837b6
2022-02-10 15:45:29 +01:00
Michael Bestas
8f332103fe Updater: Add exported flags in manifest
Targeting S+ (version 31 and above) requires that an explicit value
for android:exported be defined when intent filters are present

Change-Id: I2ce2b2cd1dcd69e343ae8577587483b19d825fdc
2022-02-10 15:45:28 +01:00
Michael Bestas
e0bcaec5b6 Updater: Add FLAG_IMMUTABLE flag to PendingIntent
Fixes:
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE
or FLAG_MUTABLE be specified when creating a PendingIntent.

Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some
functionality depends on the PendingIntent being mutable,
e.g. if it needs to be used with inline replies or bubbles.

Change-Id: I63b25512d3bf6e0d3b0cc95d91295f4065175848
2022-02-10 15:45:17 +01:00
Michael W
46c06ad958 Updater: The great cleanup
* Make final where possible
* Remove unused casts, imports, methods, enums and constructors
* Add null checks

Change-Id: Idd1a16426dd1928e2ed9922f5a35ba32ce4f808b
2022-02-10 15:44:46 +01:00
Michael W
bdb6a3ff66 Updater: update dependencies
Change-Id: I0686b28e7f6754c1b11b219b9036ea372032070b
2022-02-10 15:40:01 +01:00
Michael W
16cc9dd259 Updater: Replace lintOptions with lint
* As per AS recommendation

Change-Id: Id3668f21f356f13dcce4576c528b8af06d77a95f
2022-02-10 15:40:01 +01:00
Michael W
541e70f789 Updater: Compile with and target Sdk version 30
Change-Id: Ie479a27173e9941ab3152eb3ce6078c794b5aa7f
2022-02-10 15:40:01 +01:00
Michael W
45bb652a10 Updater: Change gradle from 3.5 to 7.1
Change-Id: Ia70512a77cdb30c6315863dcb65233d38cb5c9b9
2022-02-10 15:39:58 +01:00
Michael W
69b461369c Updater: Replace jcenter with mavenCentral
Change-Id: I0b6ae6553f106eef4cb7d331e3b089b74a66abcb
2022-01-31 16:05:42 +01:00
Luca Stefani
28dd829142 fixup! Updater: add a 3-dot menu for update item
Change-Id: I10fe453c5f14d1a0ca49b734df517047cb7ee802
2021-11-01 22:02:08 +02:00
Michael W
1500f2f68e Automatic translation import
Change-Id: Ibbfc884c22676ca287f8bda05e35b2b5b28d980c
2021-10-26 20:49:28 +02:00
Timi Rautamäki
affcb29065 Updater: add a 3-dot menu for update item
A menu opening with only a long press is not intuitive and often not
found by user.

Change-Id: I7f819b77e2cbc534cafe488edadc4d3dd9b87d01
2021-10-13 18:09:21 +02:00
Timi Rautamäki
81dc120f09 Updater: follow TwoPanelSettings styling
Change-Id: I8d0957288fca25f1584f5ddb35c994c7ac2575f7
2021-09-14 17:51:38 +00:00
Timi Rautamäki
a96d54f236 Updater: initial layout for TV
Change-Id: Ia4704f7a15d9c1179ec93c1cab28707ba8115e70
2021-09-14 17:51:36 +00:00
Michael Bestas
6e5bbdaae1 Automatic translation import
Change-Id: I2d7ce9569a264be7d739f96328948c45516ffa5c
2021-08-21 04:07:41 +03:00
LineageOS Builder
a5492459f9 Automatic translation import
Change-Id: Icf76cbc53dd4b000862d76f470f6ad737b96c829
2021-05-01 15:56:43 +00:00
Dhina17
a36be60f98 Updater: appbar: Set the collapsing animation duration to 0ms
- Fixes lately fading out title of the expanded bar when collapsing (parallax)

Change-Id: I86062153b84ca4f82649862e15baa30aba2e6995
2021-04-28 11:58:07 +05:30
Michael W
7cfeb81a45 Updater: Fix exporting updates
* getExternalStorageDirectory was deprecated in API level 29
* Use the proposed Context#getExternalFilesDirs(String) instead

The following message can be found in the logs, followed by a crash:
MediaProvider: Creating a non-default top level directory or
deleting an existing one is not allowed!

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/3358
Change-Id: I81412985abc0f64d0fccb0d3069ac57ef6b4ffef
2021-04-19 13:42:15 +02:00
Michael Bestas
5a9c7479e7 Automatic translation import
Change-Id: I13c96b381b0fcc17c127fe64c6fc7e3997b8f248
2021-02-28 02:41:28 +02:00
chrmhoffmann
29ca6e5f3f update push script: remove bashisms
* [[ and == are bash-only. /bin/sh does not necessarily default to bash

Change-Id: I2e47f514568fc8cc94f387c82a86bea141345ba5
2020-12-28 11:10:55 +01:00
Pavel Salomatov
ffe5b527f6 UpdatesDbHelper: Move identical code into helper method
Change-Id: I2e19d9756fab94d9fcd3352b0baef45300044d3a
2020-12-17 13:11:05 +01:00
Alessandro Astone
9689a6b8bb Updater: Retrieve recovery update setting using the prop itself
This makes it easier to share the setting with SetupWizard.

Change-Id: I9a69df99c1b9a198ef9d5a039a090721b0195064
2020-11-23 17:14:24 +01:00
Nolen Johnson
a3c6c19a5f Updater: Clarify explanation for why A/B can't disable recovery update
Change-Id: Ia8cd1ec8c1ed5b5c8c2b9761da6782d66d1f67cd
2020-11-14 07:28:51 +01:00
Bruno Martins
96626c2fde Updater: Add setting for updating recovery
When enabled, the recovery of the device will be updated with the
version of the installed system. This is only applicable to devices
with a dedicated recovery partition and not A/B.

Change-Id: I4c1701b09c000b4cdb044069fa9ba857500f9cb1
2020-11-12 16:47:30 +00:00
LuK1337
1f8b7d56b0 Updater: Sign with platform key
Change-Id: Ia54f30e697d82d522a8dbe8e157b8f9f9e15daa8
2020-09-29 12:28:27 +02:00
LineageOS Builder
e3b26100c5 Automatic translation import
Change-Id: I84df5f5257fc5ee97ad307d289f3f503100c4e70
2020-09-20 10:11:28 +00:00
LineageOS Builder
1de5ff5239 Automatic translation import
Change-Id: Ifdc568ca60c3c2892993296017cfbbe1341989ce
2020-09-11 11:11:55 +00:00
Michael Bestas
4f8f00148a Automatic translation import
Change-Id: If04e431e80d0d9cd7ca4753be5f9aeb454e1fd66
2020-05-23 18:21:58 +03:00
LuK1337
bb09c53d83 Updater: Use accent_device_default_{dark,light} for colorAccent values
* That way the accent color is synced with Settings.

Change-Id: I86473166c46f0c71ec6ae69decccb981f01c6a1d
2020-05-18 11:20:51 +02:00
Michael Bestas
618ecad81a Updater: Add privapp permissions xml
Change-Id: If1953e76859850359a63dc4a4ab50940d76fd59f
2020-05-06 20:48:18 +03:00
Michael Bestas
e944ca0661 Automatic translation import
Change-Id: I36e2f6bdc74c81f26c2fd281544a4f2b576bfb44
2020-04-23 16:50:00 +03:00
Luca Stefani
d1273f214e Only cancel notification if update isn't installed
* Even if the package is removed on A/B devices
  we still want to show the reboot notification

Change-Id: I980d36766a1427874b65b11674a8f0ae4ce1db88
2020-04-11 12:19:52 +02:00
Alexander Martinz
759d5510c8 UpdatesActivity: only set performance mode on A/B devices
If the preference dialog gets dismissed on a non-ab-device it still
tries to set performance mode.

Add a check to prevent that and only set performance mode on A/B devices.

Change-Id: I6290eb80550b4cfc8a012f94bdf228af7d4fc416
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2020-04-03 17:00:31 +02:00
Alexander Martinz
35abddd093 Updater: remove dialog before showing a new one and when detaching
2020-04-03 16:18:18.286 28742-28742/org.lineageos.updater E/WindowManager: android.view.WindowLeaked: Activity org.lineageos.updater.UpdatesActivity has leaked window DecorView@5dd12b3[UpdatesActivity] that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:621)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:377)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:96)
        at android.app.Dialog.show(Dialog.java:342)
        at androidx.appcompat.app.AlertDialog$Builder.show(AlertDialog.java:1009)
        at org.lineageos.updater.UpdatesListAdapter.showInfoDialog(UpdatesListAdapter.java:552)
        at org.lineageos.updater.UpdatesListAdapter.lambda$setButtonAction$5$UpdatesListAdapter(UpdatesListAdapter.java:375)
        at org.lineageos.updater.-$$Lambda$UpdatesListAdapter$xtQzmsol8pO3BlYZkbKcb5gVAq4.onClick(Unknown Source:2)
        at org.lineageos.updater.UpdatesListAdapter.lambda$setButtonAction$9(UpdatesListAdapter.java:408)
        at org.lineageos.updater.-$$Lambda$UpdatesListAdapter$M4hRQyNgJseuHrw6EfkhK_yrGK8.onClick(Unknown Source:2)
        at android.view.View.performClick(View.java:7259)
        at android.view.View.performClickInternal(View.java:7236)
        at android.view.View.access$3600(View.java:801)
        at android.view.View$PerformClick.run(View.java:27896)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7397)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)

Change-Id: I7877b02b8526c7c12331a660a7ac934d02656e6f
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2020-04-03 16:41:16 +02:00
Alexander Martinz
9cdc2f497b AndroidManifest: explicitly disable cleartext traffic
Change-Id: Ib7528a58f423f40af1bafa16acdc9a4538207433
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2020-04-03 16:41:16 +02:00
Alexander Martinz
d94231abea Updater: do not use hidden field
BatteryManager#BATTERY_PLUGGED_ANY is hidden and actually just
a combination of all public available plugged values.
Recreate the hidden field instead of using it directly.

This unbreaks Android Studio builds.

Change-Id: I4754ce7544dab22306eeac03c3e9f26b650094d2
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2020-04-03 16:38:39 +02:00
Michael Bestas
9290c48307 Automatic translation import
Change-Id: Ic3bd376cfd0870ca579c12fb5b0457f2d690cdc8
2020-04-03 07:45:00 +02:00
Michael W
e4822ff569 Updater: Delete updates only after refreshing the notification
* Looks like we first need to process the notification before we can delete
  an update

Change-Id: I49f6c03a109f908e8a7b01f02b821a68ab273af3
2020-04-02 13:44:32 +02:00
Mickey Knox
416401aa2c Updater: push-update.sh: Make it work on macOS
Change-Id: I2bb51e349961efb1738d1abac2eaad9d3b4b9ad0
2020-03-31 18:47:18 +02:00
jhenrique09
eabab0e94e Fix export of zip
Add requestLegacyExternalStorage permission to allow usage of legacy storage

Change-Id: Iae3f61c4b714c168feba7de665a46ebe4ac1ee77
2020-02-05 01:48:06 +01:00
Michael Bestas
1fa036ce68 Automatic translation import
Change-Id: Ief254bec7ea4d6334643e1d1093a09cbf0e75fb9
2020-01-27 16:44:03 +02:00
Luca Stefani
91f33aa03e Updater: Move to AndroidX
Change-Id: I7bd67915638db5330b854f66f9fc1adb864b64be
2019-09-07 19:11:27 +02:00
Michael Bestas
56349fabc5 Automatic translation import
Change-Id: Ibbab351981135e7f0c213a97f169d98b737aff27
2019-08-25 19:28:18 +03:00
Michael Bestas
a3332eca1f Automatic translation import
Change-Id: Ic00c496504fe3e3083dff55b70b660d8fa11f5e4
2019-08-04 16:24:50 +03:00
Michael Bestas
d9fe6ee908 Automatic translation import
Change-Id: I90864874a46a7e651ded45605cf3d99d7b37f400
2019-07-06 11:59:32 +03:00
Michael Bestas
44a35fca4d Automatic translation import
Change-Id: I406b8de8d199e2c230254787aa0a29924952e8de
2019-06-19 21:21:33 +03:00
Michael Bestas
22a41280f0 Automatic translation import
Change-Id: I5c475240409637bee28aafba6b752e96509a97d7
2019-06-08 18:59:02 +03:00
Michael W
5763bc9d38 Updater: Make upgrade-url device specific
* After moving from the generic /upgrade.html url to a device specific
  one, updater needs to display that instead

Change-Id: If9fc6bddfab206a97283f2080ea4df0cbb742a7d
2019-04-28 11:33:32 +02:00