Marcus Hoffmann 3a2ab0baa6 fixes a crash that can be triggered when uninstalling with privext
Fixes the following crash:

05-19 22:39:55.535  1037 24513 W WindowManager: Attempted to add application window with unknown token Token{2f841 null}.  Aborting.
05-19 22:39:55.536 10844 10844 D AndroidRuntime: Shutting down VM
05-19 22:39:55.540 10844 10844 E AndroidRuntime: FATAL EXCEPTION: main
05-19 22:39:55.540 10844 10844 E AndroidRuntime: Process: org.fdroid.fdroid.debug, PID: 10844
05-19 22:39:55.540 10844 10844 E AndroidRuntime: android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@d8ae31 is not valid; is your activity running?
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.view.ViewRootImpl.setView(ViewRootImpl.java:891)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:372)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:128)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.app.Dialog.show(Dialog.java:454)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at org.fdroid.fdroid.views.AppDetailsActivity$7.onReceive(AppDetailsActivity.java:607)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:311)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:47)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:120)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:108)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:166)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7529)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

The !isFinishing check was already in the installReceiver part, but
somehow missing in uninstallReceiver. There's also a reference to this
here: http://blackriver.to/2012/08/android-annoying-exception-unable-to-add-window-is-your-activity-running/

I don't understand this crash, especially as the dialouge still gets
shown after adding this check (possibly the parent activity is finishing
and then immediately restarting?). But this sems to realibly fix it.

This was happening when I installed an app, used a new settings entry to
unregister privext as a device owner (by calling it via binder/aidl) and
then trying to uninstall the app I just installed again, whithout
closing f-droid inbetween.
2020-05-19 23:43:25 +02:00
2020-01-10 16:27:58 +01:00
2018-11-19 11:35:04 +03:30
2020-02-04 17:15:07 +01:00
2016-09-28 22:15:00 +01:00
2015-08-24 10:35:55 -07:00

F-Droid Client

build status Translation status

Client for F-Droid, the Free Software repository system for Android.

Building with Gradle

./gradlew assembleRelease

Direct download

You can download the application directly from our site or browse it in the repo.

Contributing

See our Contributing doc for information on how to report issues, translate the app into your language or help with development.

IRC

We are on #fdroid and #fdroid-dev on Freenode. We hold weekly dev meetings on #fdroid-dev on Thursdays at 11:30h UTC, which usually last half an hour.

FAQ

  • Why does F-Droid require "Unknown Sources" to install apps by default?

Because a regular Android app cannot act as a package manager on its own. To do so, it would require system privileges (see below), similar to what Google Play does.

  • Can I avoid enabling "Unknown Sources" by installing F-Droid as a privileged system app?

This used to be the case, but no longer is. Now the Privileged Extension is the one that should be placed in the system. It can be bundled with a ROM or installed via a zip.

License

This program is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Some icons are made by Picol, Icomoon or Dave Gandy from Flaticon or by Google and are licensed by Creative Commons BY 3.0.

Other icons are from the Material Design Icon set released under an Attribution 4.0 International license.

Translation

Everything can be translated. See Translation and Localization for more info. translation status

Description
No description provided
Readme GPL-3.0 46 MiB
Languages
Java 98.5%
Shell 0.6%
Python 0.6%
AIDL 0.2%
HTML 0.1%