* 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
* 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
-----
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>
* 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
* 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
* 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
* 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
Targeting S+ (version 31 and above) requires that an explicit value
for android:exported be defined when intent filters are present
Change-Id: I2ce2b2cd1dcd69e343ae8577587483b19d825fdc
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
* Make final where possible
* Remove unused casts, imports, methods, enums and constructors
* Add null checks
Change-Id: Idd1a16426dd1928e2ed9922f5a35ba32ce4f808b
* 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
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
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 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>
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>