Commit Graph

380 Commits

Author SHA1 Message Date
Michael W
613fbacdbf Updater: Fix header margin
* Instead of hardcoding it to 86dp (which was probably fine
  when we didn't have cutouts, calculate the required top margin
  by adding top inset and status bar height and applying it dynamically
* Increase compile and min sdk versions to avoid warnings - we compile
  using the build sdk (33) when building inline anyway

Change-Id: I80444e5a2247730f06af461a1cce7ac36c6c9631
2023-07-08 15:23:11 -04:00
Michael W
c3093cb4cc Updater: Align with Settings / Materialize
* Better integrate with Settings by changing the background
  so it matches the Toolbar - one solid background
* Make updates distinct cards with rounded border and
  add spacing between them

Change-Id: If9c649f63e9bb3762f2ae272c96f5e62e0821e46
2023-07-08 15:23:03 -04:00
Michael W
bf1646fa93 Updater: Handle NumberFormatException
* For cases like local Updates (not yet merged) and probably
  others, the parsing might fail and take down the Updater
* Handle NFE properly

Change-Id: If9609c59d1048c9d37aa6de90855e02f28d96ce2
2023-07-08 15:22:56 -04:00
Sebastiano Barezzi
755560bbcd Updater: Redo project structure
* Let's be more Android Studio friendly
* While at it match AOSP deps with Gradle ones and update them

Change-Id: Ib8829e3d954ce43fbf19280d1db2bc43c6fc89e0
2023-07-08 15:22:49 -04:00
LineageOS Infra
ae11300ff0 Automatic translation import
Change-Id: I3609a2dc8eb68bb479f2f101231de03e2b0de9e0
2023-07-01 16:12:33 +00:00
LineageOS Infra
3852db1751 Automatic translation import
Change-Id: Ide309b43c89b7efc78579ccc303b539a90662749
2023-06-20 16:28:32 +00:00
Michael W
1ec0b8d1de Updater: 20 and up are integers!
Not 20.0 but 20!

Change-Id: Iccbcd765ce2be60cef413a73461563569bc7cdc6
2023-06-05 19:19:52 +02:00
LineageOS Infra
0b5e925013 Automatic translation import
Change-Id: Ia202063d4d134323f36a5b494b0019d9f97cffff
2023-06-01 12:49:42 +00:00
althafvly
cdcb51197b Updater: Drop usage of NetworkInfo
- NetworkInfo is deprecated

Change-Id: I433bd5e89080931e9a2fdf1253d8e5f493ea2cbe
2023-05-22 15:05:02 +02:00
Bruno Martins
e32b81fb3a Updater: Check if network is really metered
Instead of assuming so, based on whether user is connected over
a WiFi or Ethernet connection, simply use the proper API.

Use default value of PREF_MOBILE_DATA_WARNING, if it had been
already set.

Change-Id: Ie4fa0301df7f2cebf94c967fc188acc54b2ce71e
Signed-off-by: althafvly <althafvly@gmail.com>
2023-05-22 15:04:54 +02:00
LineageOS Infra
9ddb4f10e0 Automatic translation import
Change-Id: I929cbcac278eca6c2aefc04f3d6e08b75d797f72
2023-05-15 09:16:34 +00:00
LineageOS Infra
85347e77d1 Automatic translation import
Change-Id: Ieaa98bc4483ecafe190dc992667132a2b309ba6d
2023-04-24 08:41:49 +00:00
Tommaso Fonda
bfbc440118 Updater: Show the correct percentage during package installation
Fixes the mismatch between the progress bar's status and the percentage
displayed next to it.

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/4830
Change-Id: I5c243acda4f06561cbd5b3a73060205b32d8d41d
2023-04-13 17:31:46 +02:00
Michael Bestas
e83f74ace7 Automatic translation import
Change-Id: Id98f9cc0e305b0425364dbb62639b483ad221bf7
2023-03-23 16:39:02 +02:00
Michael Bestas
304b45b3eb Automatic translation import
Change-Id: Ie2fa01b2491be5bed23c1280ed24725fd4f4b4b5
2023-02-13 16:05:54 +02:00
Michael Bestas
468ff36885 Automatic translation import
Change-Id: I08d6cc588245610a901d55d38488b542722ea20a
2023-01-10 04:42:11 +02:00
Michael Bestas
dfe9efc180 Automatic translation import
Change-Id: I56665d5c1bb65b94ef79be87b891b218dffcbbdf
2022-12-16 20:58:10 +02:00
althafvly
79845a7f0b Updater: Move PreferenceManager to AndroidX
Change-Id: I18c1c64652036359adcb47a34a2e565223f59e53
2022-11-28 20:35:23 +05:30
Michael Bestas
baf2238f5b Automatic translation import
Change-Id: Icb46946c7cec9f77b372627a7e2e6d5ca1e1dfad
2022-11-25 15:04:01 +02:00
Dil3mm4
59c5c5ff21 Updater: Add POST_NOTIFICATIONS permission & pre-grant it
Without the permission, Updater can't spawn notifications on
downloads/install

Reference: https://developer.android.com/develop/ui/views/notifications/notification-permission
Test: boot, download an update via updater, check notification drawer
Co-authored-by: Michael Bestas <mkbestas@lineageos.org>
Change-Id: I131c62ae5033f56f8915426f68f7aea76dba78dd
2022-11-15 00:07:09 +01:00
Michael Bestas
cb6281e7f0 Automatic translation import
Change-Id: I9d30d9157184ddde3f1145cac0e4108cebd42008
2022-11-03 20:11:06 +01:00
Michael Bestas
9ff0a26243 Automatic translation import
Change-Id: Icb95ebb843b9f212877e277463ed6ed02e02b2b8
2022-10-05 20:08:46 +03:00
Michael Bestas
8c2d4337b8 Automatic translation import
Change-Id: I88933a49fd3bbfffc6c9c1c45ccaca2779bb75e2
2022-09-22 15:30:24 +03:00
Aaron Kling
257a80e351 Use -television instead of -large-notouch for atv resources
Mobile builds on devices with no touch panel are also getting these
settings applied, which is not intended.

Change-Id: I02fac65dc7042c04259d6f65a957185aac32a252
2022-09-14 05:45:15 +02:00
Michael W
c25d43a9ca Automatic translation import
Change-Id: Ia33b8622d3f16e6d139e6ca63e9f4cc305e427cc
2022-08-15 15:50:00 +02:00
Michael Bestas
580c7ec218 Automatic translation import
Change-Id: I317e8fbd026393a3808915ee5e8beaf81afaee4c
2022-08-04 20:42:39 +03:00
Michael Bestas
b5dca5271f Automatic translation import
Change-Id: I359623d2a73f6f310f277551dfd7716ddd464291
2022-06-20 23:59:13 +03:00
LuK1337
c6d2a1694a Updater: Unbreak "Export update" feature
Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/4736
Change-Id: I186a27d2e99098cf8ebb3dd5c7348cdb528baa78
2022-05-26 00:12:28 +02:00
Aayush Gupta
418d464d14 Updater: Show update's version on AlertDialog and Notification
Currently at most of the places, build version is obtained from BuildInfoUtils.getBuildVersion()
method. This method obtains build version from the current running system's property.

However, in case there is a version bump on OTA, this logic results in wrong version
being shown to the user while updating/upgrading the system.

Get the version from the update itself to show the proper version in update notification
and pre-install warning.

Signed-off-by: Aayush Gupta <theimpulson@e.email>
Change-Id: Ia74085d8d7c067c408e7cfce1de90d49dcc68307
2022-05-23 11:20:45 +05:30
Michael Bestas
55a4e6eb97 Automatic translation import
Change-Id: I44333045e0168a795a1a1a0440c3df71f44c7c7c
2022-05-10 21:58:51 +03:00
Arian
16cb5c2f25 UpdateInstaller: Set file permissions on uncrypt ota package
-----

E RecoverySystemService: Failed to reserve space for compressed apex:
E RecoverySystemService: java.io.FileNotFoundException: /data/lineageos_updates/lineage-19.1-20220422-UNOFFICIAL-GMS-sagit.zip.uncrypt (Permission denied)
E RecoverySystemService: 	at java.util.zip.ZipFile.open(Native Method)
E RecoverySystemService: 	at java.util.zip.ZipFile.<init>(ZipFile.java:265)
E RecoverySystemService: 	at java.util.zip.ZipFile.<init>(ZipFile.java:187)
E RecoverySystemService: 	at java.util.zip.ZipFile.<init>(ZipFile.java:158)
E RecoverySystemService: 	at com.android.server.recoverysystem.RecoverySystemService.getCompressedApexInfoList(RecoverySystemService.java:921)
E RecoverySystemService: 	at com.android.server.recoverysystem.RecoverySystemService.allocateSpaceForUpdate(RecoverySystemService.java:972)
E RecoverySystemService: 	at android.os.IRecoverySystem$Stub.onTransact(IRecoverySystem.java:156)
E RecoverySystemService: 	at android.os.Binder.execTransactInternal(Binder.java:1179)
E RecoverySystemService: 	at android.os.Binder.execTransact(Binder.java:1143)
E UpdateInstaller: Could not install update
E UpdateInstaller: java.io.IOException: Failed to allocate space for update /data/lineageos_updates/lineage-19.1-20220422-UNOFFICIAL-GMS-sagit.zip.uncrypt
E UpdateInstaller: 	at android.os.RecoverySystem.installPackage(RecoverySystem.java:678)
E UpdateInstaller: 	at android.os.RecoverySystem.installPackage(RecoverySystem.java:596)
E UpdateInstaller: 	at org.lineageos.updater.controller.UpdateInstaller.installPackage(UpdateInstaller.java:100)
E UpdateInstaller: 	at org.lineageos.updater.controller.UpdateInstaller.access$400(UpdateInstaller.java:35)
E UpdateInstaller: 	at org.lineageos.updater.controller.UpdateInstaller$1.run(UpdateInstaller.java:144)
E UpdateInstaller: 	at java.lang.Thread.run(Thread.java:920)

Change-Id: I8250bf58709b92572cdffc8e5faca4bf243935aa
2022-04-23 14:46:28 +02:00
Asher Simonds
bbf2442ad4 Updater: Bring in the new icon
* Part of the new iconset made by Asher Simonds

Co-authored-by: Michael W <baddaemon87@gmail.com>
Change-Id: Iead4aaf8fce32418ad86ca58c03c7e86f1067d78
2022-04-06 23:14:45 +02:00
Michael Bestas
6fe0ac8682 Automatic translation import
Change-Id: I4c859e7e41fcbe1cc51fbb3b541e2f092a3d808b
2022-04-03 20:09:01 +03:00
Michael W
1ffe1a80ae Updater: Don't show thousands of days
* When pausing and resuming, the ETA calculation is off by a lot
  due to the time diff since the last calculation resulting in a
  big delta and therefore a very low speed
* By fixing this, we also need to set the last byte count to the total
  byte count there, otherwise the downloaded bytes since last calculation
  will be larger than in reality, resulting in too fast speeds calculated

Change-Id: Ica1053cc297ff59221ea2bc0014f20973a080c88
2022-03-07 14:08:16 +00:00
Michael W
9ad96eca85 Updater: Move progress next to progressbar
Author: Michael W <baddaemon87@gmail.com>
Date:   Fri Feb 11 18:16:02 2022 +0100

    Updater: Move progress next to progressbar

    * The progress text can get very long, resulting in jumping marquee text
    * In order to reduce the length, move the percentage out of the text
      and next to the progressbar
    * The behavior can be observed e.g. on pro1 in german, where the button
      is also wider due to the german text

    Change-Id: I0276182efed757c0929b31434edad9be548b841c

Author: Timi Rautamäki <timi.rautamaki@gmail.com>
Date:   Thu Mar 3 16:12:16 2022 +0000

    fixup! Updater: Move progress next to progressbar

    Fix crash on ATV devices by applying same layout changes to
    layout-large-notouch.

    Change-Id: Id6eabcf8b1960106eb63bd15bcf97f9b4cf0bbc8

Change-Id: I8aed4c35c6ac4261c0536a6b263d63f5b1fd11ba
2022-03-07 14:08:01 +00:00
Alexander Martinz
27f04e5b78 Updater: layout: activity_updates: add spacing between build info and last checked entry
Change-Id: Ie85fecb30ba12b056569049aac674dc1b8653942
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2022-02-10 20:53:39 +00:00
Alexander Martinz
75497ee48b Updater: Allow starting activities from background
-----

05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: FATAL EXCEPTION: main
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: Process: com.shiftos.updater, PID: 19707
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.shiftos.updater/org.lineageos.updater.controller.UpdaterService }: app is in background uid UidRecord{1463ce2 u0a63 TPSL bg:+47m50s26ms idle change:idle procs:1 seq(0,0,0)}
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1616)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.ContextImpl.startService(ContextImpl.java:1571)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.content.ContextWrapper.startService(ContextWrapper.java:669)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at org.lineageos.updater.UpdatesActivity.onStart(UpdatesActivity.java:181)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1433)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.Activity.performStart(Activity.java:7847)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3295)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:107)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:214)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7397)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
05-06 17:21:58.988 10063 19707 19707 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)

-----

Change-Id: Ibc2d471b028c1d4e824b3ede4bbc336d76801f88
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2022-02-10 20:53:39 +00:00
Joey
9edea6468c Updater: use consistent format for file sizes
Change-Id: I9a17cf2df69e2e39e90de169ca108511c71d4e31
Signed-off-by: Joey <joey@lineageos.org>
2022-02-10 20:53:39 +00:00
Michael W
d54176ccf7 Updater: Show toast when starting export
* It's not immediately clear that an export is started since the
  notification isn't intrusive
* Show a toast - that will be clear enough

Change-Id: I78d78b23884df3ddb37bc486c1d6012f899c888d
2022-02-10 20:53:39 +00:00
Michael W
f27d50d640 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 20:53:39 +00:00
Michael W
811d050272 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 20:53:39 +00:00
Michael W
d2557b8c6c 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 20:53:39 +00:00
Michael W
964eb5a68e 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 20:53:39 +00:00
Michael W
297668b3ef Updater: update dependencies
Change-Id: I0686b28e7f6754c1b11b219b9036ea372032070b
2022-02-10 20:53:39 +00:00
Michael W
9f814a9a32 Updater: Replace lintOptions with lint
* As per AS recommendation

Change-Id: Id3668f21f356f13dcce4576c528b8af06d77a95f
2022-02-10 20:53:39 +00:00
Michael W
755254e1e5 Updater: Compile with and target Sdk version 31
Change-Id: I976d7af04d2d8f75ae0353341fe61a3a0510d840
2022-02-10 20:53:36 +00:00
Michael W
7843198d27 Updater: Change gradle from 3.5 to 7.1
Change-Id: Ia70512a77cdb30c6315863dcb65233d38cb5c9b9
2022-02-10 15:49:45 +01:00
Michael W
1f4d0571db Updater: Replace jcenter with mavenCentral
Change-Id: I0b6ae6553f106eef4cb7d331e3b089b74a66abcb
2022-02-10 09:37:49 +00:00
SahilSonar
4626490513 Updater: Convert to blueprint
Drop "UpdaterStudio" module while at it, considering that aidegen
can be used to compile Lineage Updater with Android Studio.

Change-Id: I828338461d0277992bfb301c2f785116c12dfc8a
2022-02-08 19:36:47 +01:00
Michael Bestas
7f584e9c08 Automatic translation import
Change-Id: I9aab887dd19308e821c5ba034563d0279abebb96
2022-01-12 15:46:57 +02:00