Fix broadcastIntentWithFeature on Android S with newer patch (#2111)

This commit is contained in:
LoveSy 2022-09-14 10:52:52 +08:00 committed by GitHub
parent 4ffcb36a95
commit 8f8eb73a69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -79,15 +79,13 @@ public class ActivityManagerService {
int appOp, Bundle options, boolean serialized, boolean sticky, int userId) throws RemoteException {
IActivityManager am = getActivityManager();
if (am == null || thread == null) return -1;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S_V2) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
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) {
return am.broadcastIntentWithFeature(thread, callingFeatureId, intent, resolvedType, resultTo,
resultCode, resultData, null, requiredPermissions, null, appOp, null,
serialized, sticky, userId);

View File

@ -33,7 +33,7 @@ import android.os.RemoteException;
import androidx.annotation.RequiresApi;
public interface IActivityManager extends IInterface {
@RequiresApi(32)
@RequiresApi(31)
int broadcastIntentWithFeature(IApplicationThread caller, String callingFeatureId,
Intent intent, String resolvedType, IIntentReceiver resultTo,
int resultCode, String resultData, Bundle resultExtras,