Revert "Ensure receiver unregistered synchronously in onDestroy"

This reverts commit e55aa17399.
This commit is contained in:
Mygod
2019-08-19 23:49:09 +08:00
parent 5e87244041
commit 4aece2204a
3 changed files with 37 additions and 31 deletions

View File

@@ -35,12 +35,6 @@ fun Long.toPluralInt(): Int {
return (this % 1000000000).toInt() + 1000000000
}
fun Context.ensureReceiverUnregistered(receiver: BroadcastReceiver) {
try {
unregisterReceiver(receiver)
} catch (_: IllegalArgumentException) { }
}
@SuppressLint("Recycle")
fun <T> useParcel(block: (Parcel) -> T) = Parcel.obtain().run {
try {