@@ -289,6 +289,10 @@ public boolean isEnable() {
289289
290290 static class GetIntentSender extends MethodProxy {
291291
292+ protected int mIntentIndex = 5 ;
293+ protected int mResolvedTypesIndex = 6 ;
294+ protected int mFlagsIndex = 7 ;
295+
292296 @ Override
293297 public String getMethodName () {
294298 return "getIntentSender" ;
@@ -297,11 +301,11 @@ public String getMethodName() {
297301 @ Override
298302 public Object call (Object who , Method method , Object ... args ) throws Throwable {
299303 String creator = (String ) args [1 ];
300- String [] resolvedTypes = (String []) args [6 ];
304+ String [] resolvedTypes = (String []) args [mResolvedTypesIndex ];
301305 int type = (int ) args [0 ];
302- int flags = (int ) args [7 ];
306+ int flags = (int ) args [mFlagsIndex ];
303307 if (args [5 ] instanceof Intent []) {
304- Intent [] intents = (Intent []) args [5 ];
308+ Intent [] intents = (Intent []) args [mIntentIndex ];
305309 for (int i = 0 ; i < intents .length ; i ++) {
306310 Intent intent = intents [i ];
307311 if (resolvedTypes != null && i < resolvedTypes .length ) {
@@ -313,7 +317,7 @@ public Object call(Object who, Method method, Object... args) throws Throwable {
313317 }
314318 }
315319 }
316- args [7 ] = flags ;
320+ args [mFlagsIndex ] = flags ;
317321 args [1 ] = getHostPkg ();
318322 // Force userId to 0
319323 if (args [args .length - 1 ] instanceof Integer ) {
@@ -1777,4 +1781,19 @@ public String getMethodName() {
17771781 return "registerReceiverWithFeature" ;
17781782 }
17791783 }
1784+
1785+ static class GetIntentSenderWithFeature extends GetIntentSender {
1786+
1787+ public GetIntentSenderWithFeature () {
1788+ // http://aospxref.com/android-11.0.0_r21/xref/frameworks/base/core/java/android/app/IActivityManager.aidl?fi=IActivityManager#245
1789+ mIntentIndex = 6 ;
1790+ mResolvedTypesIndex = 7 ;
1791+ mFlagsIndex = 8 ;
1792+ }
1793+
1794+ @ Override
1795+ public String getMethodName () {
1796+ return "getIntentSenderWithFeature" ;
1797+ }
1798+ }
17801799}
0 commit comments