@@ -177,9 +177,10 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
177177 ? data .readFileDescriptor () : null ;
178178 Bundle options = data .readInt () != 0
179179 ? Bundle .CREATOR .createFromParcel (data ) : null ;
180+ int userId = data .readInt ();
180181 WaitResult result = startActivityAndWait (app , intent , resolvedType ,
181182 resultTo , resultWho , requestCode , startFlags ,
182- profileFile , profileFd , options );
183+ profileFile , profileFd , options , userId );
183184 reply .writeNoException ();
184185 result .writeToParcel (reply , 0 );
185186 return true ;
@@ -811,7 +812,8 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
811812 Bundle arguments = data .readBundle ();
812813 IBinder b = data .readStrongBinder ();
813814 IInstrumentationWatcher w = IInstrumentationWatcher .Stub .asInterface (b );
814- boolean res = startInstrumentation (className , profileFile , fl , arguments , w );
815+ int userId = data .readInt ();
816+ boolean res = startInstrumentation (className , profileFile , fl , arguments , w , userId );
815817 reply .writeNoException ();
816818 reply .writeInt (res ? 1 : 0 );
817819 return true ;
@@ -1323,11 +1325,11 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
13231325 return true ;
13241326 }
13251327
1326- case KILL_APPLICATION_WITH_UID_TRANSACTION : {
1328+ case KILL_APPLICATION_WITH_APPID_TRANSACTION : {
13271329 data .enforceInterface (IActivityManager .descriptor );
13281330 String pkg = data .readString ();
1329- int uid = data .readInt ();
1330- killApplicationWithUid (pkg , uid );
1331+ int appid = data .readInt ();
1332+ killApplicationWithAppId (pkg , appid );
13311333 reply .writeNoException ();
13321334 return true ;
13331335 }
@@ -1424,7 +1426,8 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
14241426 case GET_PROVIDER_MIME_TYPE_TRANSACTION : {
14251427 data .enforceInterface (IActivityManager .descriptor );
14261428 Uri uri = Uri .CREATOR .createFromParcel (data );
1427- String type = getProviderMimeType (uri );
1429+ int userId = data .readInt ();
1430+ String type = getProviderMimeType (uri , userId );
14281431 reply .writeNoException ();
14291432 reply .writeString (type );
14301433 return true ;
@@ -1573,6 +1576,15 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
15731576 return true ;
15741577 }
15751578
1579+ case IS_USER_RUNNING_TRANSACTION : {
1580+ data .enforceInterface (IActivityManager .descriptor );
1581+ int userid = data .readInt ();
1582+ boolean result = isUserRunning (userid );
1583+ reply .writeNoException ();
1584+ reply .writeInt (result ? 1 : 0 );
1585+ return true ;
1586+ }
1587+
15761588 case REMOVE_SUB_TASK_TRANSACTION :
15771589 {
15781590 data .enforceInterface (IActivityManager .descriptor );
@@ -1827,7 +1839,7 @@ public int startActivityAsUser(IApplicationThread caller, Intent intent,
18271839 public WaitResult startActivityAndWait (IApplicationThread caller , Intent intent ,
18281840 String resolvedType , IBinder resultTo , String resultWho ,
18291841 int requestCode , int startFlags , String profileFile ,
1830- ParcelFileDescriptor profileFd , Bundle options ) throws RemoteException {
1842+ ParcelFileDescriptor profileFd , Bundle options , int userId ) throws RemoteException {
18311843 Parcel data = Parcel .obtain ();
18321844 Parcel reply = Parcel .obtain ();
18331845 data .writeInterfaceToken (IActivityManager .descriptor );
@@ -1851,6 +1863,7 @@ public WaitResult startActivityAndWait(IApplicationThread caller, Intent intent,
18511863 } else {
18521864 data .writeInt (0 );
18531865 }
1866+ data .writeInt (userId );
18541867 mRemote .transact (START_ACTIVITY_AND_WAIT_TRANSACTION , data , reply , 0 );
18551868 reply .readException ();
18561869 WaitResult result = WaitResult .CREATOR .createFromParcel (reply );
@@ -2719,7 +2732,7 @@ public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
27192732 }
27202733
27212734 public boolean startInstrumentation (ComponentName className , String profileFile ,
2722- int flags , Bundle arguments , IInstrumentationWatcher watcher )
2735+ int flags , Bundle arguments , IInstrumentationWatcher watcher , int userId )
27232736 throws RemoteException {
27242737 Parcel data = Parcel .obtain ();
27252738 Parcel reply = Parcel .obtain ();
@@ -2729,6 +2742,7 @@ public boolean startInstrumentation(ComponentName className, String profileFile,
27292742 data .writeInt (flags );
27302743 data .writeBundle (arguments );
27312744 data .writeStrongBinder (watcher != null ? watcher .asBinder () : null );
2745+ data .writeInt (userId );
27322746 mRemote .transact (START_INSTRUMENTATION_TRANSACTION , data , reply , 0 );
27332747 reply .readException ();
27342748 boolean res = reply .readInt () != 0 ;
@@ -3366,13 +3380,13 @@ public void resumeAppSwitches() throws RemoteException {
33663380 data .recycle ();
33673381 }
33683382
3369- public void killApplicationWithUid (String pkg , int uid ) throws RemoteException {
3383+ public void killApplicationWithAppId (String pkg , int appid ) throws RemoteException {
33703384 Parcel data = Parcel .obtain ();
33713385 Parcel reply = Parcel .obtain ();
33723386 data .writeInterfaceToken (IActivityManager .descriptor );
33733387 data .writeString (pkg );
3374- data .writeInt (uid );
3375- mRemote .transact (KILL_APPLICATION_WITH_UID_TRANSACTION , data , reply , 0 );
3388+ data .writeInt (appid );
3389+ mRemote .transact (KILL_APPLICATION_WITH_APPID_TRANSACTION , data , reply , 0 );
33763390 reply .readException ();
33773391 data .recycle ();
33783392 reply .recycle ();
@@ -3507,12 +3521,12 @@ public void crashApplication(int uid, int initialPid, String packageName,
35073521 reply .recycle ();
35083522 }
35093523
3510- public String getProviderMimeType (Uri uri )
3511- throws RemoteException {
3524+ public String getProviderMimeType (Uri uri , int userId ) throws RemoteException {
35123525 Parcel data = Parcel .obtain ();
35133526 Parcel reply = Parcel .obtain ();
35143527 data .writeInterfaceToken (IActivityManager .descriptor );
35153528 uri .writeToParcel (data , 0 );
3529+ data .writeInt (userId );
35163530 mRemote .transact (GET_PROVIDER_MIME_TYPE_TRANSACTION , data , reply , 0 );
35173531 reply .readException ();
35183532 String res = reply .readString ();
@@ -3747,6 +3761,19 @@ public UserInfo getCurrentUser() throws RemoteException {
37473761 return userInfo ;
37483762 }
37493763
3764+ public boolean isUserRunning (int userid ) throws RemoteException {
3765+ Parcel data = Parcel .obtain ();
3766+ Parcel reply = Parcel .obtain ();
3767+ data .writeInterfaceToken (IActivityManager .descriptor );
3768+ data .writeInt (userid );
3769+ mRemote .transact (IS_USER_RUNNING_TRANSACTION , data , reply , 0 );
3770+ reply .readException ();
3771+ boolean result = reply .readInt () != 0 ;
3772+ reply .recycle ();
3773+ data .recycle ();
3774+ return result ;
3775+ }
3776+
37503777 public boolean removeSubTask (int taskId , int subTaskIndex ) throws RemoteException {
37513778 Parcel data = Parcel .obtain ();
37523779 Parcel reply = Parcel .obtain ();
0 commit comments