@@ -199,8 +199,9 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
199199 Configuration config = Configuration .CREATOR .createFromParcel (data );
200200 Bundle options = data .readInt () != 0
201201 ? Bundle .CREATOR .createFromParcel (data ) : null ;
202+ int userId = data .readInt ();
202203 int result = startActivityWithConfig (app , intent , resolvedType ,
203- resultTo , resultWho , requestCode , startFlags , config , options );
204+ resultTo , resultWho , requestCode , startFlags , config , options , userId );
204205 reply .writeNoException ();
205206 reply .writeInt (result );
206207 return true ;
@@ -897,9 +898,10 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
897898 int fl = data .readInt ();
898899 Bundle options = data .readInt () != 0
899900 ? Bundle .CREATOR .createFromParcel (data ) : null ;
901+ int userId = data .readInt ();
900902 IIntentSender res = getIntentSender (type , packageName , token ,
901903 resultWho , requestCode , requestIntents ,
902- requestResolvedTypes , fl , options );
904+ requestResolvedTypes , fl , options , userId );
903905 reply .writeNoException ();
904906 reply .writeStrongBinder (res != null ? res .asBinder () : null );
905907 return true ;
@@ -934,6 +936,22 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
934936 return true ;
935937 }
936938
939+ case HANDLE_INCOMING_USER_TRANSACTION : {
940+ data .enforceInterface (IActivityManager .descriptor );
941+ int callingPid = data .readInt ();
942+ int callingUid = data .readInt ();
943+ int userId = data .readInt ();
944+ boolean allowAll = data .readInt () != 0 ;
945+ boolean requireFull = data .readInt () != 0 ;
946+ String name = data .readString ();
947+ String callerPackage = data .readString ();
948+ int res = handleIncomingUser (callingPid , callingUid , userId , allowAll ,
949+ requireFull , name , callerPackage );
950+ reply .writeNoException ();
951+ reply .writeInt (res );
952+ return true ;
953+ }
954+
937955 case SET_PROCESS_LIMIT_TRANSACTION : {
938956 data .enforceInterface (IActivityManager .descriptor );
939957 int max = data .readInt ();
@@ -1304,25 +1322,6 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
13041322 return true ;
13051323 }
13061324
1307- case START_ACTIVITY_IN_PACKAGE_TRANSACTION :
1308- {
1309- data .enforceInterface (IActivityManager .descriptor );
1310- int uid = data .readInt ();
1311- Intent intent = Intent .CREATOR .createFromParcel (data );
1312- String resolvedType = data .readString ();
1313- IBinder resultTo = data .readStrongBinder ();
1314- String resultWho = data .readString ();
1315- int requestCode = data .readInt ();
1316- int startFlags = data .readInt ();
1317- Bundle options = data .readInt () != 0
1318- ? Bundle .CREATOR .createFromParcel (data ) : null ;
1319- int result = startActivityInPackage (uid , intent , resolvedType ,
1320- resultTo , resultWho , requestCode , startFlags , options );
1321- reply .writeNoException ();
1322- reply .writeInt (result );
1323- return true ;
1324- }
1325-
13261325 case KILL_APPLICATION_WITH_UID_TRANSACTION : {
13271326 data .enforceInterface (IActivityManager .descriptor );
13281327 String pkg = data .readString ();
@@ -1489,22 +1488,6 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
14891488 return true ;
14901489 }
14911490
1492- case START_ACTIVITIES_IN_PACKAGE_TRANSACTION :
1493- {
1494- data .enforceInterface (IActivityManager .descriptor );
1495- int uid = data .readInt ();
1496- Intent [] intents = data .createTypedArray (Intent .CREATOR );
1497- String [] resolvedTypes = data .createStringArray ();
1498- IBinder resultTo = data .readStrongBinder ();
1499- Bundle options = data .readInt () != 0
1500- ? Bundle .CREATOR .createFromParcel (data ) : null ;
1501- int result = startActivitiesInPackage (uid , intents , resolvedTypes ,
1502- resultTo , options );
1503- reply .writeNoException ();
1504- reply .writeInt (result );
1505- return true ;
1506- }
1507-
15081491 case START_ACTIVITIES_TRANSACTION :
15091492 {
15101493 data .enforceInterface (IActivityManager .descriptor );
@@ -1877,7 +1860,7 @@ public WaitResult startActivityAndWait(IApplicationThread caller, Intent intent,
18771860 public int startActivityWithConfig (IApplicationThread caller , Intent intent ,
18781861 String resolvedType , IBinder resultTo , String resultWho ,
18791862 int requestCode , int startFlags , Configuration config ,
1880- Bundle options ) throws RemoteException {
1863+ Bundle options , int userId ) throws RemoteException {
18811864 Parcel data = Parcel .obtain ();
18821865 Parcel reply = Parcel .obtain ();
18831866 data .writeInterfaceToken (IActivityManager .descriptor );
@@ -1895,6 +1878,7 @@ public int startActivityWithConfig(IApplicationThread caller, Intent intent,
18951878 } else {
18961879 data .writeInt (0 );
18971880 }
1881+ data .writeInt (userId );
18981882 mRemote .transact (START_ACTIVITY_TRANSACTION , data , reply , 0 );
18991883 reply .readException ();
19001884 int result = reply .readInt ();
@@ -2840,7 +2824,7 @@ public String getPackageForToken(IBinder token) throws RemoteException
28402824 public IIntentSender getIntentSender (int type ,
28412825 String packageName , IBinder token , String resultWho ,
28422826 int requestCode , Intent [] intents , String [] resolvedTypes , int flags ,
2843- Bundle options ) throws RemoteException {
2827+ Bundle options , int userId ) throws RemoteException {
28442828 Parcel data = Parcel .obtain ();
28452829 Parcel reply = Parcel .obtain ();
28462830 data .writeInterfaceToken (IActivityManager .descriptor );
@@ -2863,6 +2847,7 @@ public IIntentSender getIntentSender(int type,
28632847 } else {
28642848 data .writeInt (0 );
28652849 }
2850+ data .writeInt (userId );
28662851 mRemote .transact (GET_INTENT_SENDER_TRANSACTION , data , reply , 0 );
28672852 reply .readException ();
28682853 IIntentSender res = IIntentSender .Stub .asInterface (
@@ -2905,6 +2890,25 @@ public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
29052890 reply .recycle ();
29062891 return res ;
29072892 }
2893+ public int handleIncomingUser (int callingPid , int callingUid , int userId , boolean allowAll ,
2894+ boolean requireFull , String name , String callerPackage ) throws RemoteException {
2895+ Parcel data = Parcel .obtain ();
2896+ Parcel reply = Parcel .obtain ();
2897+ data .writeInterfaceToken (IActivityManager .descriptor );
2898+ data .writeInt (callingPid );
2899+ data .writeInt (callingUid );
2900+ data .writeInt (userId );
2901+ data .writeInt (allowAll ? 1 : 0 );
2902+ data .writeInt (requireFull ? 1 : 0 );
2903+ data .writeString (name );
2904+ data .writeString (callerPackage );
2905+ mRemote .transact (HANDLE_INCOMING_USER_TRANSACTION , data , reply , 0 );
2906+ reply .readException ();
2907+ int res = reply .readInt ();
2908+ data .recycle ();
2909+ reply .recycle ();
2910+ return res ;
2911+ }
29082912 public void setProcessLimit (int max ) throws RemoteException
29092913 {
29102914 Parcel data = Parcel .obtain ();
@@ -3360,34 +3364,6 @@ public void resumeAppSwitches() throws RemoteException {
33603364 data .recycle ();
33613365 }
33623366
3363- public int startActivityInPackage (int uid ,
3364- Intent intent , String resolvedType , IBinder resultTo ,
3365- String resultWho , int requestCode , int startFlags , Bundle options )
3366- throws RemoteException {
3367- Parcel data = Parcel .obtain ();
3368- Parcel reply = Parcel .obtain ();
3369- data .writeInterfaceToken (IActivityManager .descriptor );
3370- data .writeInt (uid );
3371- intent .writeToParcel (data , 0 );
3372- data .writeString (resolvedType );
3373- data .writeStrongBinder (resultTo );
3374- data .writeString (resultWho );
3375- data .writeInt (requestCode );
3376- data .writeInt (startFlags );
3377- if (options != null ) {
3378- data .writeInt (1 );
3379- options .writeToParcel (data , 0 );
3380- } else {
3381- data .writeInt (0 );
3382- }
3383- mRemote .transact (START_ACTIVITY_IN_PACKAGE_TRANSACTION , data , reply , 0 );
3384- reply .readException ();
3385- int result = reply .readInt ();
3386- reply .recycle ();
3387- data .recycle ();
3388- return result ;
3389- }
3390-
33913367 public void killApplicationWithUid (String pkg , int uid ) throws RemoteException {
33923368 Parcel data = Parcel .obtain ();
33933369 Parcel reply = Parcel .obtain ();
@@ -3655,30 +3631,6 @@ public int startActivities(IApplicationThread caller,
36553631 return result ;
36563632 }
36573633
3658- public int startActivitiesInPackage (int uid ,
3659- Intent [] intents , String [] resolvedTypes , IBinder resultTo ,
3660- Bundle options ) throws RemoteException {
3661- Parcel data = Parcel .obtain ();
3662- Parcel reply = Parcel .obtain ();
3663- data .writeInterfaceToken (IActivityManager .descriptor );
3664- data .writeInt (uid );
3665- data .writeTypedArray (intents , 0 );
3666- data .writeStringArray (resolvedTypes );
3667- data .writeStrongBinder (resultTo );
3668- if (options != null ) {
3669- data .writeInt (1 );
3670- options .writeToParcel (data , 0 );
3671- } else {
3672- data .writeInt (0 );
3673- }
3674- mRemote .transact (START_ACTIVITIES_IN_PACKAGE_TRANSACTION , data , reply , 0 );
3675- reply .readException ();
3676- int result = reply .readInt ();
3677- reply .recycle ();
3678- data .recycle ();
3679- return result ;
3680- }
3681-
36823634 public int getFrontActivityScreenCompatMode () throws RemoteException {
36833635 Parcel data = Parcel .obtain ();
36843636 Parcel reply = Parcel .obtain ();
0 commit comments