Loading compatibility_matrices/compatibility_matrix.current.xml +1 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ </hal> <hal format="aidl" optional="true"> <name>android.hardware.contexthub</name> <version>2</version> <interface> <name>IContextHub</name> <instance>default</instance> Loading contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -45,5 +45,6 @@ interface IContextHub { void sendMessageToHub(in int contextHubId, in android.hardware.contexthub.ContextHubMessage message); void onHostEndpointConnected(in android.hardware.contexthub.HostEndpointInfo hostEndpointInfo); void onHostEndpointDisconnected(char hostEndpointId); long[] getPreloadedNanoappIds(); const int EX_CONTEXT_HUB_UNSPECIFIED = -1; } contexthub/aidl/android/hardware/contexthub/IContextHub.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.hardware.contexthub.ContextHubMessage; import android.hardware.contexthub.HostEndpointInfo; import android.hardware.contexthub.IContextHubCallback; import android.hardware.contexthub.NanoappBinary; import android.hardware.contexthub.NanoappInfo; import android.hardware.contexthub.Setting; @VintfStability Loading Loading @@ -194,6 +195,14 @@ interface IContextHub { */ void onHostEndpointDisconnected(char hostEndpointId); /** * Provides the list of preloaded nanoapp IDs on the system. The output of this API must * not change. * * @return The list of preloaded nanoapp IDs */ long[] getPreloadedNanoappIds(); /** * Error codes that are used as service specific errors with the AIDL return * value EX_SERVICE_SPECIFIC. Loading contexthub/aidl/default/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ cc_library_static { shared_libs: [ "libbase", "libbinder_ndk", "android.hardware.contexthub-V1-ndk", "android.hardware.contexthub-V2-ndk", ], export_include_dirs: ["include"], srcs: [ Loading @@ -50,7 +50,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", "android.hardware.contexthub-V1-ndk", "android.hardware.contexthub-V2-ndk", ], static_libs: [ "libcontexthubexampleimpl", Loading contexthub/aidl/default/ContextHub.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,17 @@ ScopedAStatus ContextHub::queryNanoapps(int32_t in_contextHubId) { } } ScopedAStatus ContextHub::getPreloadedNanoappIds(std::vector<int64_t>* out_preloadedNanoappIds) { if (out_preloadedNanoappIds == nullptr) { return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } for (uint64_t i = 0; i < 10; ++i) { out_preloadedNanoappIds->push_back(i); } return ndk::ScopedAStatus::ok(); } ScopedAStatus ContextHub::registerCallback(int32_t in_contextHubId, const std::shared_ptr<IContextHubCallback>& in_cb) { if (in_contextHubId == kMockHubId) { Loading Loading
compatibility_matrices/compatibility_matrix.current.xml +1 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ </hal> <hal format="aidl" optional="true"> <name>android.hardware.contexthub</name> <version>2</version> <interface> <name>IContextHub</name> <instance>default</instance> Loading
contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -45,5 +45,6 @@ interface IContextHub { void sendMessageToHub(in int contextHubId, in android.hardware.contexthub.ContextHubMessage message); void onHostEndpointConnected(in android.hardware.contexthub.HostEndpointInfo hostEndpointInfo); void onHostEndpointDisconnected(char hostEndpointId); long[] getPreloadedNanoappIds(); const int EX_CONTEXT_HUB_UNSPECIFIED = -1; }
contexthub/aidl/android/hardware/contexthub/IContextHub.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.hardware.contexthub.ContextHubMessage; import android.hardware.contexthub.HostEndpointInfo; import android.hardware.contexthub.IContextHubCallback; import android.hardware.contexthub.NanoappBinary; import android.hardware.contexthub.NanoappInfo; import android.hardware.contexthub.Setting; @VintfStability Loading Loading @@ -194,6 +195,14 @@ interface IContextHub { */ void onHostEndpointDisconnected(char hostEndpointId); /** * Provides the list of preloaded nanoapp IDs on the system. The output of this API must * not change. * * @return The list of preloaded nanoapp IDs */ long[] getPreloadedNanoappIds(); /** * Error codes that are used as service specific errors with the AIDL return * value EX_SERVICE_SPECIFIC. Loading
contexthub/aidl/default/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ cc_library_static { shared_libs: [ "libbase", "libbinder_ndk", "android.hardware.contexthub-V1-ndk", "android.hardware.contexthub-V2-ndk", ], export_include_dirs: ["include"], srcs: [ Loading @@ -50,7 +50,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", "android.hardware.contexthub-V1-ndk", "android.hardware.contexthub-V2-ndk", ], static_libs: [ "libcontexthubexampleimpl", Loading
contexthub/aidl/default/ContextHub.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,17 @@ ScopedAStatus ContextHub::queryNanoapps(int32_t in_contextHubId) { } } ScopedAStatus ContextHub::getPreloadedNanoappIds(std::vector<int64_t>* out_preloadedNanoappIds) { if (out_preloadedNanoappIds == nullptr) { return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } for (uint64_t i = 0; i < 10; ++i) { out_preloadedNanoappIds->push_back(i); } return ndk::ScopedAStatus::ok(); } ScopedAStatus ContextHub::registerCallback(int32_t in_contextHubId, const std::shared_ptr<IContextHubCallback>& in_cb) { if (in_contextHubId == kMockHubId) { Loading