Catch Exception when releasing storage URIs
My phone was in a weird state where a storage URI was configured, but the system didn't know about it (Appinfo didn't show it). Removing it resulted in an Exception
java.lang.SecurityException: No permission grants found for UID 10136 and Uri content://com.android.externalstorage.documents/tree/primary: at android.os.Parcel.createException(Parcel.java:1950) at android.os.Parcel.readException(Parcel.java:1918) at android.os.Parcel.readException(Parcel.java:1868) at android.app.IActivityManager$Stub$Proxy.releasePersistableUriPermission(IActivityManager.java:7486) at android.content.ContentResolver.releasePersistableUriPermission(ContentResolver.java:2173) at org.kde.kdeconnect.Plugins.SftpPlugin.SftpSettingsFragment.onActionItemClicked(SftpSettingsFragment.java:477) at androidx.appcompat.app.AppCompatDelegateImpl$ActionModeCallbackWrapperV9.onActionItemClicked(AppCompatDelegateImpl.java:2171) at androidx.appcompat.app.WindowDecorActionBar$ActionModeImpl.onMenuItemSelected(WindowDecorActionBar.java:1123) at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:840) at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158) at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:991) at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:981) at androidx.appcompat.widget.ActionMenuView.invokeItem(ActionMenuView.java:625) at androidx.appcompat.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:151) at android.view.View.performClick(View.java:6597) at android.view.View.performClickInternal(View.java:6574) at android.view.View.access$3100(View.java:778) at android.view.View$PerformClick.run(View.java:25885) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6718) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.am.ActivityManagerService.releasePersistableUriPermission(ActivityManagerService.java:10580) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2175) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3377) at android.os.Binder.execTransact(Binder.java:731)
Catch it to not choke on it.