Loading core/api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -1414,6 +1414,8 @@ package android.hardware.lights { package android.hardware.location { public final class ContextHubManager { method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public boolean disableTestMode(); method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public boolean enableTestMode(); method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public long[] getPreloadedNanoAppIds(@NonNull android.hardware.location.ContextHubInfo); } Loading core/java/android/hardware/location/ContextHubManager.java +45 −0 Original line number Diff line number Diff line Loading @@ -994,6 +994,51 @@ public final class ContextHubManager { return nanoappIds; } /** * Puts the Context Hub in test mode. * * The purpose of this API is to make testing CHRE/Context Hub more * predictable and robust. This temporarily unloads all * nanoapps. * * Note that this API must not cause CHRE/Context Hub to behave differently * in test compared to production. * * @return true if the enable test mode operation succeeded. * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) @NonNull public boolean enableTestMode() { try { return mService.setTestMode(true); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Puts the Context Hub out of test mode. * * This API will undo any previously made enableTestMode() calls. * After this API is called, it should restore the state of the system * to the normal/production mode before any enableTestMode() call was * made. If the enableTestMode() call unloaded any nanoapps * to enter test mode, it should reload those nanoapps in this API call. * * @return true if the disable operation succeeded. * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) @NonNull public boolean disableTestMode() { try { return mService.setTestMode(false); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Unregister a callback for receive messages from the context hub. * Loading Loading
core/api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -1414,6 +1414,8 @@ package android.hardware.lights { package android.hardware.location { public final class ContextHubManager { method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public boolean disableTestMode(); method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public boolean enableTestMode(); method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public long[] getPreloadedNanoAppIds(@NonNull android.hardware.location.ContextHubInfo); } Loading
core/java/android/hardware/location/ContextHubManager.java +45 −0 Original line number Diff line number Diff line Loading @@ -994,6 +994,51 @@ public final class ContextHubManager { return nanoappIds; } /** * Puts the Context Hub in test mode. * * The purpose of this API is to make testing CHRE/Context Hub more * predictable and robust. This temporarily unloads all * nanoapps. * * Note that this API must not cause CHRE/Context Hub to behave differently * in test compared to production. * * @return true if the enable test mode operation succeeded. * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) @NonNull public boolean enableTestMode() { try { return mService.setTestMode(true); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Puts the Context Hub out of test mode. * * This API will undo any previously made enableTestMode() calls. * After this API is called, it should restore the state of the system * to the normal/production mode before any enableTestMode() call was * made. If the enableTestMode() call unloaded any nanoapps * to enter test mode, it should reload those nanoapps in this API call. * * @return true if the disable operation succeeded. * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) @NonNull public boolean disableTestMode() { try { return mService.setTestMode(false); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Unregister a callback for receive messages from the context hub. * Loading