summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-06-29Updater: Unbreak "Export update" featureHEADsugisawa-mr1LuK1337
Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/4736 Change-Id: I186a27d2e99098cf8ebb3dd5c7348cdb528baa78
2022-06-29Updater: Show update's version on AlertDialog and NotificationAayush Gupta
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-01Updater: Enable A/B perf mode by defaultjhenrique09
Change-Id: I586b5505d902bb315075f35bfbb84a799363ddbd Signed-off-by: alk3pInjection <webmaster@raspii.tech>
2022-05-01Updater: Initial adaptation for Project ICEalk3pInjection
Change-Id: I81df1b1b426c22fde6ced1a8167019b9fd35a00d
2022-04-23UpdateInstaller: Set file permissions on uncrypt ota packageArian
----- 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-03-07Updater: Don't show thousands of daysMichael W
* 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-07Updater: Move progress next to progressbarMichael W
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-02-10Updater: use consistent format for file sizesJoey
Change-Id: I9a17cf2df69e2e39e90de169ca108511c71d4e31 Signed-off-by: Joey <joey@lineageos.org>
2022-02-10Updater: Show toast when starting exportMichael W
* 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-10Updater: Switch to destination selectorMichael W
* 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-10Updater: No need to install every updateMichael W
* 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-10Updater: The great cleanupMichael W
* Make final where possible * Remove unused casts, imports, methods, enums and constructors * Add null checks Change-Id: Idd1a16426dd1928e2ed9922f5a35ba32ce4f808b
2021-11-08Updater: update layout and colors for 12Timi Rautamäki
* Updated toolbar layout and behaviour * Changed colors to match AOSP settings Change-Id: Ic8efa69f9ba06055bac1772e1d9f3eb5ada67d8d
2021-11-04Updater: Add a 3-dot menu for update itemTimi Rautamäki
Author: Timi Rautamaki <timi.rautamaki@gmail.com> Date: Wed Oct 13 16:06:51 2021 +0000 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 Author: Luca Stefani <luca.stefani.ge1@gmail.com> Date: Mon Nov 1 21:01:11 2021 +0100 fixup! Updater: add a 3-dot menu for update item Change-Id: I10fe453c5f14d1a0ca49b734df517047cb7ee802 Change-Id: I8abf95327906bd6d3fb98978b931418f15d3dd00
2021-10-11Updater: Add FLAG_IMMUTABLE flag to PendingIntentMichael Bestas
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
2021-09-14Updater: initial layout for TVTimi Rautamäki
Change-Id: Ia4704f7a15d9c1179ec93c1cab28707ba8115e70
2021-04-19Updater: Fix exporting updatesMichael W
* 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
2020-12-17UpdatesDbHelper: Move identical code into helper methodPavel Salomatov
Change-Id: I2e19d9756fab94d9fcd3352b0baef45300044d3a
2020-11-23Updater: Retrieve recovery update setting using the prop itselfAlessandro Astone
This makes it easier to share the setting with SetupWizard. Change-Id: I9a69df99c1b9a198ef9d5a039a090721b0195064
2020-11-12Updater: Add setting for updating recoveryBruno Martins
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-04-11Only cancel notification if update isn't installedLuca Stefani
* Even if the package is removed on A/B devices we still want to show the reboot notification Change-Id: I980d36766a1427874b65b11674a8f0ae4ce1db88
2020-04-03UpdatesActivity: only set performance mode on A/B devicesAlexander Martinz
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-03Updater: remove dialog before showing a new one and when detachingAlexander Martinz
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-03Updater: do not use hidden fieldAlexander Martinz
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-02Updater: Delete updates only after refreshing the notificationMichael W
* Looks like we first need to process the notification before we can delete an update Change-Id: I49f6c03a109f908e8a7b01f02b821a68ab273af3
2019-09-07Updater: Move to AndroidXLuca Stefani
Change-Id: I7bd67915638db5330b854f66f9fc1adb864b64be
2019-04-28Updater: Make upgrade-url device specificMichael W
* After moving from the generic /upgrade.html url to a device specific one, updater needs to display that instead Change-Id: If9fc6bddfab206a97283f2080ea4df0cbb742a7d
2019-04-10Updater: Allow to suspend A/B updatesLuca Stefani
Change-Id: I0387fd491a07a2214e4331a2cfe25988e0016a61
2019-03-05Updater: Assume older Android version to be incompatibleHan Wang
* Issue happens when both 15.1 and 16.0 are built. Change-Id: I0cb7c834824056f450129524a7aec8091c9d3dc7
2019-02-10Updater: Implement auto update check interval preferenceLuK1337
* This replaces auto update check switch with a dropdown with 4 options: * Never * Once a day * Once a week (default) * Once a month Change-Id: I4bcae4c013a5d44958f9c54d641e64aac3062a8b
2018-08-08Updater: Fix EXTRA_PLUGGED check in isBatteryLevelOkLuK1337
* EXTRA_PLUGGED is not a boolean. Change-Id: I3c2869cc4e08b48e396e5bae5ef22383fcbf7260
2018-07-24Updater: Use PowerManager instead of Intent.ACTION_REBOOT broadcastLuK1337
* We are getting permission denial when sending Intent.ACTION_REBOOT broadcast, using pm.reboot() instead works just fine. Change-Id: I38d0ad8cc5f4c9362fd5baf7476e14bff56616dd
2018-07-24Updater: Fix 'REBOOT' button not showing up after A/B updateLuK1337
* After update is complete button is being handled in handleNotActiveStatus instead of handleActiveStatus. Change-Id: I6a4df580f93b71fd12e902801125acae668ec991
2018-07-14Don't use one shot PendingIntents for the notification actionsGabriele M
FLAG_ONE_SHOT doesn't make so much sense here, the intents are generic and can be repeated. Change-Id: Ib457d975387dfd838372639e2aaa40a3df6f4d15
2018-07-14Updater: Improve battery checkLuca Stefani
* Lower default value by 10% * Decrease the level by another 10% if charging * Always allow installation in case device doesn't have a battery * Show the requirements in the alert dialog Change-Id: Iebb10220612006fbd096eb474cf3034ef52144b3
2018-07-14Don't treat the current build as compatibleGabriele M
Even if technically it is compatible. Change-Id: I72d39c761ad02b851c5ec7cfae664e886931f852
2018-07-14Updater: Add property that allows us to downgradeLuK1337
Change-Id: I6916639f05c52ae198f0d1656deb23ee5186907f
2018-07-11Updater: Allow toggling A/B perf modeTheScarastic
Change-Id: I380a39bf6008b341c8005ac548d42d2413d0d643
2018-06-15Updater: Move battery level check to UpdatesListAdapterLuK1337
* We cannot create dialog from service level without hardcoding theme resource and granting SYSTEM_ALERT_WINDOW permission therefore we got to move it here. Change-Id: I70ee5d6c8ef4af4f5c6f29e593b1c20797781017
2018-06-13Requre a minimum remaining battery capacity to install updatesGabriele M
The recovery doesn't install the update if the remaining battery capacity isn't at least 20% (or 15% if charging). Require at least 40%, just to be safe. Change-Id: I5cd7c40f029141cde2b0922b25fece2b55989710
2018-06-13Minor app notification improvementsGabriele M
- Don't use BigTextStyle if we only need to show a single line of text, but keep using it if the progressbar is visible. - Change the icon to reflect the currrent state. - Use android.R.drawable instead of com.android.internal.R.drawable Change-Id: I0f69fe5f4fa63cdec180e89afa098d27819f33fd
2018-06-13Show in app reboot buttonGabriele M
Change-Id: I8d65746b58c16a7cf4a430ea29bb7b0fba1802d5
2018-06-13Turn UpdateInstaller into a singletonGabriele M
For symmetry with ABUpdateInstaller. Change-Id: I9b61ed286c91f10140705e7b3e24b0eab0c75f49
2018-06-13Remove Controller interfaceGabriele M
This is just useless as is. Change-Id: I957ea3bda4097ccb8d730943639cd5e74b1b2440
2018-06-13Remove LegacySupport classGabriele M
This was meant to provide an upgrade path from the old app. It's been almost a year now, this class is no longer needed. Change-Id: I17c82e5877b275c5ceb3caefa28066abc170f095
2018-05-16Prevent null pointer exceptionsGabriele M
The main activity connects to the service after setting up the local broadcast. This allows the service to send notification before the activity is ready, causing null pointer exceptions. This happens for example rotating the screen while an update is being installed. Also, replace the existing check on mUpdaterController with a check on mDownloadsId since the latter depends on the former and both are required. Change-Id: I620fd7aa1e90468ab40dfedaa06c23f96f3e6807
2018-05-16Use Content-Length if greater than current sizeGabriele M
The server may temporarily report an incorrect size that is smaller than the actual size. Content-Length is expected to always be accurate, but its value does not correspond to the full file size when resuming downloads. Use Content-Length only if it's bigger than the currently known size. Change-Id: I2cc06bfbd2349f21528047b4840f549fbe84964e
2018-04-21Allow to properly translate the download ETA stringGabriele M
Change-Id: Ie6bbbddbbd9fd7adbc16472ad9c42c1d257413a1
2018-04-20Append random ID to temporary json file namesGabriele M
Multiple update list downloads can happen simultaneously. Use unique file names for the temporary jsons to avoid conflicts. Change-Id: I751c9838394e1f5aebbe359f61532947b429f39b
2018-04-20Use a determinate progressbar while installing A/B updatesGabriele M
This needs to be done explicitly after the recent UI changes. Change-Id: Ie333a51d7c679c17998872071b2bd84c1f47ca48