Merge "ChooserSelector shouldn't crash w/o IntentResolver" into stage-aosp-master

This commit is contained in:
TreeHugger Robot
2022-10-12 22:14:42 +00:00
committed by Android (Google) Code Review

View File

@@ -3,6 +3,7 @@ package com.android.systemui
import android.content.ComponentName import android.content.ComponentName
import android.content.Context import android.content.Context
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.util.Log
import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dagger.qualifiers.Background
@@ -55,7 +56,11 @@ class ChooserSelector @Inject constructor(
} else { } else {
PackageManager.COMPONENT_ENABLED_STATE_DISABLED 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 { } suspend inline fun awaitCancellation(): Nothing = suspendCancellableCoroutine { }