Handle uninstall action for active device admin app

  • Device OS and version: Oreo
  • F-Droid version (in the About screen): 1.4

What did you do? (clear steps if possible)

  • install WaveUp
  • enable it
  • enable Lock screen in app
  • go back to F-Droid
  • press Uninstall

What did you expect to see?

It should pop-up a dialogue telling the user this app has Device Admin permissions and offering a button to that specific entry in Android Settings to first remove Admin rights

What did you see instead?

Unknown error dialogue

Logcat says: PackageManager: Not removing package com.jarsilio.android.waveup: has active device admin

BTW, trying to uninstall from the launcher, PackageInstaller pops a notification that links to DeviceAdmin as expected.