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

Commit 18a29022 authored by Garfield Tan's avatar Garfield Tan
Browse files

Pass exclusive flag into serial service

Also add/change TEST_MAPPING files to run presubmit tests for serial
services.

Bug: 415125368
Test: atest SerialTests
Flag: android.hardware.serial.flags.enable_serial_api
Change-Id: I5b310dbe20c41c9730178f14005585cb373b06b3
parent 1a5abff5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -8,6 +8,12 @@
        "core/tests/coretests/src/android/view/inputmethod/.*",
        "core/tests/coretests/src/com/android/internal/inputmethod/.*"
      ]
    },
    {
      "name": "SerialTests",
      "file_patterns": [
        "core/java/android/hardware/serial/.*"
      ]
    }
  ],
  "wear-robolectric-postsubmit": [
+5 −5
Original line number Diff line number Diff line
@@ -32,5 +32,5 @@ interface ISerialManager {
    void unregisterSerialPortListener(in ISerialPortListener listener);

    /** Requests opening a file descriptor for the serial port. */
    void requestOpen(in String portName, in int flags, in ISerialPortResponseCallback callback);
    void requestOpen(in String portName, in int flags, in boolean exclusive, in ISerialPortResponseCallback callback);
}
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public final class SerialPort {
        Objects.requireNonNull(executor, "Executor must not be null");
        Objects.requireNonNull(receiver, "Receiver must not be null");
        try {
            mService.requestOpen(mInfo.getName(), flags,
            mService.requestOpen(mInfo.getName(), flags, exclusive,
                    new SerialPortResponseCallback(executor, receiver));
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
+7 −0
Original line number Diff line number Diff line
{
  "presubmit": [
    {
      "name": "SerialTests"
    }
  ]
}
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public class SerialManagerService extends ISerialManager.Stub {
    }

    @Override
    public void requestOpen(@NonNull String portName, int flags,
    public void requestOpen(@NonNull String portName, int flags, boolean exclusive,
            @NonNull ISerialPortResponseCallback callback) throws RemoteException {
        synchronized (mLock) {
            try {
Loading