Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d293911 authored by Olawale Ogunwale's avatar Olawale Ogunwale Committed by Android Git Automerger
Browse files

am ebdfb6e8: Merge "[ActivityManager] Distinguish FG or BG receiver finished"

* commit 'ebdfb6e8':
  [ActivityManager] Distinguish FG or BG receiver finished
parents cacf5564 ebdfb6e8
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -466,8 +466,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            String resultData = data.readString();
            Bundle resultExtras = data.readBundle();
            boolean resultAbort = data.readInt() != 0;
            int intentFlags = data.readInt();
            if (who != null) {
                finishReceiver(who, resultCode, resultData, resultExtras, resultAbort);
                finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
            }
            reply.writeNoException();
            return true;
@@ -2807,7 +2808,8 @@ class ActivityManagerProxy implements IActivityManager
        data.recycle();
        reply.recycle();
    }
    public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException
    public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
            boolean abortBroadcast, int flags) throws RemoteException
    {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
@@ -2817,6 +2819,7 @@ class ActivityManagerProxy implements IActivityManager
        data.writeString(resultData);
        data.writeBundle(map);
        data.writeInt(abortBroadcast ? 1 : 0);
        data.writeInt(flags);
        mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
        reply.readException();
        data.recycle();
+1 −1
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@ public final class ActivityThread {
        public ReceiverData(Intent intent, int resultCode, String resultData, Bundle resultExtras,
                boolean ordered, boolean sticky, IBinder token, int sendingUser) {
            super(resultCode, resultData, resultExtras, TYPE_COMPONENT, ordered, sticky,
                    token, sendingUser);
                    token, sendingUser, intent.getFlags());
            this.intent = intent;
        }

+2 −1
Original line number Diff line number Diff line
@@ -106,7 +106,8 @@ public interface IActivityManager extends IInterface {
            String resultData, Bundle map, String requiredPermission,
            int appOp, boolean serialized, boolean sticky, int userId) throws RemoteException;
    public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) throws RemoteException;
    public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException;
    public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
            boolean abortBroadcast, int flags) throws RemoteException;
    public void attachApplication(IApplicationThread app) throws RemoteException;
    public void activityResumed(IBinder token) throws RemoteException;
    public void activityIdle(IBinder token, Configuration config,
+3 −3
Original line number Diff line number Diff line
@@ -796,7 +796,7 @@ public final class LoadedApk {
                        if (extras != null) {
                            extras.setAllowFds(false);
                        }
                        mgr.finishReceiver(this, resultCode, data, extras, false);
                        mgr.finishReceiver(this, resultCode, data, extras, false, intent.getFlags());
                    } catch (RemoteException e) {
                        Slog.w(ActivityThread.TAG, "Couldn't finish broadcast to unregistered receiver");
                    }
@@ -821,8 +821,8 @@ public final class LoadedApk {
            public Args(Intent intent, int resultCode, String resultData, Bundle resultExtras,
                    boolean ordered, boolean sticky, int sendingUser) {
                super(resultCode, resultData, resultExtras,
                        mRegistered ? TYPE_REGISTERED : TYPE_UNREGISTERED,
                        ordered, sticky, mIIntentReceiver.asBinder(), sendingUser);
                        mRegistered ? TYPE_REGISTERED : TYPE_UNREGISTERED, ordered,
                        sticky, mIIntentReceiver.asBinder(), sendingUser, intent.getFlags());
                mCurIntent = intent;
                mOrdered = ordered;
            }
+6 −4
Original line number Diff line number Diff line
@@ -238,6 +238,7 @@ public abstract class BroadcastReceiver {
        final boolean mInitialStickyHint;
        final IBinder mToken;
        final int mSendingUser;
        final int mFlags;
        
        int mResultCode;
        String mResultData;
@@ -246,8 +247,8 @@ public abstract class BroadcastReceiver {
        boolean mFinished;

        /** @hide */
        public PendingResult(int resultCode, String resultData, Bundle resultExtras,
                int type, boolean ordered, boolean sticky, IBinder token, int userId) {
        public PendingResult(int resultCode, String resultData, Bundle resultExtras, int type,
                boolean ordered, boolean sticky, IBinder token, int userId, int flags) {
            mResultCode = resultCode;
            mResultData = resultData;
            mResultExtras = resultExtras;
@@ -256,6 +257,7 @@ public abstract class BroadcastReceiver {
            mInitialStickyHint = sticky;
            mToken = token;
            mSendingUser = userId;
            mFlags = flags;
        }
        
        /**
@@ -417,11 +419,11 @@ public abstract class BroadcastReceiver {
                    }
                    if (mOrderedHint) {
                        am.finishReceiver(mToken, mResultCode, mResultData, mResultExtras,
                                mAbortBroadcast);
                                mAbortBroadcast, mFlags);
                    } else {
                        // This broadcast was sent to a component; it is not ordered,
                        // but we still need to tell the activity manager we are done.
                        am.finishReceiver(mToken, 0, null, null, false);
                        am.finishReceiver(mToken, 0, null, null, false, mFlags);
                    }
                } catch (RemoteException ex) {
                }
Loading