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

Commit c2ae6fb9 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Merge commit '605eb79c' into manualmerge

Change-Id: Id6db8cce3a477572478a1d50f624823200848896
parents 6ba9c529 605eb79c
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -2371,6 +2371,15 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            reply.writeNoException();
            return true;
        }

        case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            final int uid = data.readInt();
            final byte[] firstPacket = data.createByteArray();
            notifyCleartextNetwork(uid, firstPacket);
            reply.writeNoException();
            return true;
        }
        }

        return super.onTransact(code, data, reply, flags);
@@ -5479,5 +5488,18 @@ class ActivityManagerProxy implements IActivityManager
        reply.recycle();
    }

    @Override
    public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeInt(uid);
        data.writeByteArray(firstPacket);
        mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
        reply.recycle();
    }

    private IBinder mRemote;
}
+8 −0
Original line number Diff line number Diff line
@@ -1186,9 +1186,17 @@ public final class ActivityThread {
            sendMessage(H.BACKGROUND_VISIBLE_BEHIND_CHANGED, token, visible ? 1 : 0);
        }

        @Override
        public void scheduleEnterAnimationComplete(IBinder token) {
            sendMessage(H.ENTER_ANIMATION_COMPLETE, token);
        }

        @Override
        public void notifyCleartextNetwork(byte[] firstPacket) {
            if (StrictMode.vmCleartextNetworkEnabled()) {
                StrictMode.onCleartextNetworkDetected(firstPacket);
            }
        }
    }

    private class H extends Handler {
+18 −0
Original line number Diff line number Diff line
@@ -670,6 +670,15 @@ public abstract class ApplicationThreadNative extends Binder
            reply.writeNoException();
            return true;
        }

        case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION:
        {
            data.enforceInterface(IApplicationThread.descriptor);
            final byte[] firstPacket = data.createByteArray();
            notifyCleartextNetwork(firstPacket);
            reply.writeNoException();
            return true;
        }
        }

        return super.onTransact(code, data, reply, flags);
@@ -1350,4 +1359,13 @@ class ApplicationThreadProxy implements IApplicationThread {
        mRemote.transact(ENTER_ANIMATION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
        data.recycle();
    }

    @Override
    public void notifyCleartextNetwork(byte[] firstPacket) throws RemoteException {
        Parcel data = Parcel.obtain();
        data.writeInterfaceToken(IApplicationThread.descriptor);
        data.writeByteArray(firstPacket);
        mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
        data.recycle();
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -471,6 +471,7 @@ public interface IActivityManager extends IInterface {
    public void notifyEnterAnimationComplete(IBinder token) throws RemoteException;

    public void systemBackupRestored() throws RemoteException;
    public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException;

    /*
     * Private non-Binder interfaces
@@ -794,4 +795,7 @@ public interface IActivityManager extends IInterface {
    int CHECK_PERMISSION_WITH_TOKEN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+241;
    int REGISTER_TASK_STACK_LISTENER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+242;
    int SYSTEM_BACKUP_RESTORED = IBinder.FIRST_CALL_TRANSACTION+243;

    // Start of M transactions
    int NOTIFY_CLEARTEXT_NETWORK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+280;
}
+2 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ public interface IApplicationThread extends IInterface {
    void scheduleCancelVisibleBehind(IBinder token) throws RemoteException;
    void scheduleBackgroundVisibleBehindChanged(IBinder token, boolean enabled) throws RemoteException;
    void scheduleEnterAnimationComplete(IBinder token) throws RemoteException;
    void notifyCleartextNetwork(byte[] firstPacket) throws RemoteException;

    String descriptor = "android.app.IApplicationThread";

@@ -204,4 +205,5 @@ public interface IApplicationThread extends IInterface {
    int CANCEL_VISIBLE_BEHIND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+52;
    int BACKGROUND_VISIBLE_BEHIND_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+53;
    int ENTER_ANIMATION_COMPLETE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+54;
    int NOTIFY_CLEARTEXT_NETWORK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+55;
}
Loading