@@ -218,7 +218,7 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
218218 reply .writeInt (result ? 1 : 0 );
219219 return true ;
220220 }
221-
221+
222222 case FINISH_ACTIVITY_TRANSACTION : {
223223 data .enforceInterface (IActivityManager .descriptor );
224224 IBinder token = data .readStrongBinder ();
@@ -243,6 +243,15 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
243243 return true ;
244244 }
245245
246+ case FINISH_ACTIVITY_AFFINITY_TRANSACTION : {
247+ data .enforceInterface (IActivityManager .descriptor );
248+ IBinder token = data .readStrongBinder ();
249+ boolean res = finishActivityAffinity (token );
250+ reply .writeNoException ();
251+ reply .writeInt (res ? 1 : 0 );
252+ return true ;
253+ }
254+
246255 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION : {
247256 data .enforceInterface (IActivityManager .descriptor );
248257 IBinder token = data .readStrongBinder ();
@@ -1866,6 +1875,18 @@ public void finishSubActivity(IBinder token, String resultWho, int requestCode)
18661875 data .recycle ();
18671876 reply .recycle ();
18681877 }
1878+ public boolean finishActivityAffinity (IBinder token ) throws RemoteException {
1879+ Parcel data = Parcel .obtain ();
1880+ Parcel reply = Parcel .obtain ();
1881+ data .writeInterfaceToken (IActivityManager .descriptor );
1882+ data .writeStrongBinder (token );
1883+ mRemote .transact (FINISH_ACTIVITY_AFFINITY_TRANSACTION , data , reply , 0 );
1884+ reply .readException ();
1885+ boolean res = reply .readInt () != 0 ;
1886+ data .recycle ();
1887+ reply .recycle ();
1888+ return res ;
1889+ }
18691890 public boolean willActivityBeVisible (IBinder token ) throws RemoteException {
18701891 Parcel data = Parcel .obtain ();
18711892 Parcel reply = Parcel .obtain ();
0 commit comments