Merge "ChooserSelector shouldn't crash w/o IntentResolver" into tm-qpr-dev
This commit is contained in:
@@ -3,6 +3,7 @@ package com.android.systemui
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.util.Log
|
||||
import com.android.systemui.dagger.SysUISingleton
|
||||
import com.android.systemui.dagger.qualifiers.Application
|
||||
import com.android.systemui.dagger.qualifiers.Background
|
||||
@@ -55,7 +56,11 @@ class ChooserSelector @Inject constructor(
|
||||
} else {
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
||||
}
|
||||
packageManager.setComponentEnabledSetting(chooserComponent, newState, /* flags = */ 0)
|
||||
try {
|
||||
packageManager.setComponentEnabledSetting(chooserComponent, newState, /* flags = */ 0)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
Log.w("ChooserSelector", "Unable to set IntentResolver enabled=" + enabled, e)
|
||||
}
|
||||
}
|
||||
|
||||
suspend inline fun awaitCancellation(): Nothing = suspendCancellableCoroutine { }
|
||||
|
||||
Reference in New Issue
Block a user