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

Commit c8ce4d5c authored by Matthew Sedam's avatar Matthew Sedam
Browse files

Add setTestMode to Context Hub AIDL definition

Bug: 258074235
Test: make android.hardware.contexthub-update-api
Test: atest VtsAidlHalContextHubTargetTest
Test: m
Change-Id: I276857a2a2254cdf41bc8767ab972436a9015418
parent 1cb36a53
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -47,5 +47,6 @@ interface IContextHub {
  void onHostEndpointDisconnected(char hostEndpointId);
  long[] getPreloadedNanoappIds();
  void onNanSessionStateChanged(in boolean state);
  const int EX_CONTEXT_HUB_UNSPECIFIED = -1;
  void setTestMode(in boolean enable);
  const int EX_CONTEXT_HUB_UNSPECIFIED = (-1);
}
+3 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ parcelable NanoappBinary {
  byte targetChreApiMajorVersion;
  byte targetChreApiMinorVersion;
  byte[] customBinary;
  const int FLAG_SIGNED = 1;
  const int FLAG_ENCRYPTED = 2;
  const int FLAG_TCM_CAPABLE = 4;
  const int FLAG_SIGNED = (1 << 0);
  const int FLAG_ENCRYPTED = (1 << 1);
  const int FLAG_TCM_CAPABLE = (1 << 2);
}
+6 −6
Original line number Diff line number Diff line
@@ -35,10 +35,10 @@ package android.hardware.contexthub;
@Backing(type="byte") @VintfStability
enum Setting {
  LOCATION = 1,
  WIFI_MAIN = 2,
  WIFI_SCANNING = 3,
  AIRPLANE_MODE = 4,
  MICROPHONE = 5,
  BT_MAIN = 6,
  BT_SCANNING = 7,
  WIFI_MAIN,
  WIFI_SCANNING,
  AIRPLANE_MODE,
  MICROPHONE,
  BT_MAIN,
  BT_SCANNING,
}
+16 −0
Original line number Diff line number Diff line
@@ -216,6 +216,22 @@ interface IContextHub {
     */
    void onNanSessionStateChanged(in boolean state);

    /**
     * Puts the context hub in and out of test mode. Test mode is a clean state
     * where tests can be executed in the same environment. If enable is true,
     * this will enable test mode by unloading all nanoapps. If enable is false,
     * this will disable test mode and reverse the actions of enabling test mode
     * by loading all preloaded nanoapps. This puts CHRE in a normal state.
     *
     * This should only be used for a test environment, either through a
     * @TestApi or development tools. This should not be used in a production
     * environment.
     *
     * @param enable If true, put the context hub in test mode. If false, disable
     *               test mode.
     */
    void setTestMode(in boolean enable);

    /**
     * Error codes that are used as service specific errors with the AIDL return
     * value EX_SERVICE_SPECIFIC.
+4 −0
Original line number Diff line number Diff line
@@ -113,6 +113,10 @@ ScopedAStatus ContextHub::sendMessageToHub(int32_t in_contextHubId,
    }
}

ScopedAStatus ContextHub::setTestMode(bool /* enable */) {
    return ndk::ScopedAStatus::ok();
}

ScopedAStatus ContextHub::onHostEndpointConnected(const HostEndpointInfo& in_info) {
    mConnectedHostEndpoints.insert(in_info.hostEndpointId);

Loading