Advertisement
Guest User

Untitled

a guest
Oct 27th, 2017
623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/am/ActivityManagerService.java#18624
  2. https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
  3.  
  4. -> com.android.server.am.ActivityManagerShellCommand.runSendBroadcast()
  5.  
  6. calls
  7.  
  8. -> com.android.server.am.ActivityManagerService.broadcastIntent()
  9.  
  10. with IApplicationThread caller = null, this means
  11.  
  12. final ProcessRecord callerApp = getRecordForAppLocked(caller);
  13.  
  14. fails and
  15.  
  16. -> com.android.server.am.ActivityManagerService.broadcastIntentLocked()
  17.  
  18. is being called with ProcessRecord callerApp = null, String callerPackage = null
  19.  
  20. These are passed as parameters to
  21.  
  22. -> com.android.server.am.ActivityManagerService.isInstantApp(),
  23.  
  24. where
  25.  
  26. if (callerPackage == null) {
  27. Slog.e(TAG, "isInstantApp with an application's uid, no record, and no package name");
  28. throw new IllegalArgumentException("Calling application did not provide package name");
  29. }
  30.  
  31. finally causes an exception.
  32.  
  33. This is bypassed when running the /system/bin/cmd through `su` on a rooted phone.
  34. In that case isInstantApp will return false before throwing the exception:
  35.  
  36. if (UserHandle.getAppId(uid) < FIRST_APPLICATION_UID) {
  37. return false;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement