Merge "ChooserSelector shouldn't crash w/o IntentResolver" into stage-aosp-master
This commit is contained in:
committed by
Android (Google) Code Review
commit
41e436ff44
@@ -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
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
packageManager.setComponentEnabledSetting(chooserComponent, newState, /* flags = */ 0)
|
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 { }
|
||||||
|
|||||||
Reference in New Issue
Block a user