Fix broadcast on SDK 32 (#2065)
This commit is contained in:
parent
5b00618822
commit
1b3b838760
|
|
@ -79,6 +79,14 @@ public class ActivityManagerService {
|
||||||
int appOp, Bundle options, boolean serialized, boolean sticky, int userId) throws RemoteException {
|
int appOp, Bundle options, boolean serialized, boolean sticky, int userId) throws RemoteException {
|
||||||
IActivityManager am = getActivityManager();
|
IActivityManager am = getActivityManager();
|
||||||
if (am == null || thread == null) return -1;
|
if (am == null || thread == null) return -1;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S_V2) {
|
||||||
|
try {
|
||||||
|
return am.broadcastIntentWithFeature(thread, callingFeatureId, intent, resolvedType, resultTo,
|
||||||
|
resultCode, resultData, null, requiredPermissions, null, null, appOp, null,
|
||||||
|
serialized, sticky, userId);
|
||||||
|
} catch (NoSuchMethodError ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
return am.broadcastIntentWithFeature(thread, callingFeatureId, intent, resolvedType, resultTo,
|
return am.broadcastIntentWithFeature(thread, callingFeatureId, intent, resolvedType, resultTo,
|
||||||
resultCode, resultData, null, requiredPermissions, null, appOp, null,
|
resultCode, resultData, null, requiredPermissions, null, appOp, null,
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,13 @@ import android.os.RemoteException;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
public interface IActivityManager extends IInterface {
|
public interface IActivityManager extends IInterface {
|
||||||
|
@RequiresApi(32)
|
||||||
|
int broadcastIntentWithFeature(IApplicationThread caller, String callingFeatureId,
|
||||||
|
Intent intent, String resolvedType, IIntentReceiver resultTo,
|
||||||
|
int resultCode, String resultData, Bundle resultExtras,
|
||||||
|
String[] requiredPermissions, String[] excludedPermissions,
|
||||||
|
String[] excludePackages, int appOp, Bundle bOptions,
|
||||||
|
boolean serialized, boolean sticky, int userId) throws RemoteException;
|
||||||
@RequiresApi(31)
|
@RequiresApi(31)
|
||||||
int broadcastIntentWithFeature(IApplicationThread caller, String callingFeatureId,
|
int broadcastIntentWithFeature(IApplicationThread caller, String callingFeatureId,
|
||||||
Intent intent, String resolvedType, IIntentReceiver resultTo,
|
Intent intent, String resolvedType, IIntentReceiver resultTo,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue