commit | 35abddd0936cdf02e79a42bb5ad634f026ad4be9 | [log] [tgz] |
---|---|---|
author | Alexander Martinz <amartinz@shiftphones.com> | Fri Apr 03 16:22:11 2020 +0200 |
committer | Alexander Martinz <amartinz@shiftphones.com> | Fri Apr 03 16:41:16 2020 +0200 |
tree | f3bef0ac70af5fdffc70c928a6d1f7291cef2f41 | |
parent | 9cdc2f497b882f4add7bc6e119b586d5718f8556 [diff] |
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>
Simple application to download and apply OTA packages.
The app sends GET
requests to the URL defined by the updater_server_url
resource (or the lineage.updater.uri
system property) and expects as response a JSON with the following structure:
{ "response": [ { "datetime": 1230764400, "filename": "ota-package.zip", "id": "5eb63bbbe01eeed093cb22bb8f5acdc3", "romtype": "nightly", "size": 314572800, "url": "https://example.com/ota-package.zip", "version": "15.1" } ] }
The datetime
attribute is the build date expressed as UNIX timestamp.
The filename
attribute is the name of the file to be downloaded.
The id
attribute is a string that uniquely identifies the update.
The romtype
attribute is the string to be compared with the ro.lineage.releasetype
property.
The size
attribute is the size of the update expressed in bytes.
The url
attribute is the URL of the file to be downloaded.
The version
attribute is the string to be compared with the ro.lineage.build.version
property.
Additional attributes are ignored.
Updater needs access to the system API, therefore it can't be built only using the public SDK. You first need to generate the libraries with all the needed classes. The application also needs elevated privileges, so you need to sign it with the right key to update the one in the system partition. To do this:
gen-keystore.sh
make UpdaterStudio
from the root of the Android source tree. This command will add the needed libraries in system_libraries/
.You need to do the above once, unless Android Studio can't find some symbol. In this case, rebuild the system libraries with make UpdaterStudio
.