Loading services/core/java/com/android/server/location/ContextHubClientBroker.java +20 −3 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } /** * Handles a nanoapp load event. * Notifies the client of a nanoapp load event if the connection is open. * * @param nanoAppId the ID of the nanoapp that was loaded. */ Loading @@ -195,7 +195,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } /** * Handles a nanoapp unload event. * Notifies the client of a nanoapp unload event if the connection is open. * * @param nanoAppId the ID of the nanoapp that was unloaded. */ Loading @@ -211,7 +211,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } /** * Handles a hub reset for this client. * Notifies the client of a hub reset event if the connection is open. */ /* package */ void onHubReset() { if (mConnectionOpen.get()) { Loading @@ -223,4 +223,21 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } } } /** * Notifies the client of a nanoapp abort event if the connection is open. * * @param nanoAppId the ID of the nanoapp that aborted * @param abortCode the nanoapp specific abort code */ /* package */ void onNanoAppAborted(long nanoAppId, int abortCode) { if (mConnectionOpen.get()) { try { mCallbackInterface.onNanoAppAborted(nanoAppId, abortCode); } catch (RemoteException e) { Log.e(TAG, "RemoteException while calling onNanoAppAborted on client" + " (host endpoint ID = " + mHostEndPointId + ")", e); } } } } services/core/java/com/android/server/location/ContextHubClientManager.java +14 −11 Original line number Diff line number Diff line Loading @@ -149,34 +149,37 @@ import java.util.function.Consumer; } /** * Handles a nanoapp load event. * * @param contextHubId the ID of the hub where the nanoapp was loaded. * @param nanoAppId the ID of the nanoapp that was loaded. * @param contextHubId the ID of the hub where the nanoapp was loaded * @param nanoAppId the ID of the nanoapp that was loaded */ /* package */ void onNanoAppLoaded(int contextHubId, long nanoAppId) { forEachClientOfHub(contextHubId, client -> client.onNanoAppLoaded(nanoAppId)); } /** * Handles a nanoapp unload event. * * @param contextHubId the ID of the hub where the nanoapp was unloaded. * @param nanoAppId the ID of the nanoapp that was unloaded. * @param contextHubId the ID of the hub where the nanoapp was unloaded * @param nanoAppId the ID of the nanoapp that was unloaded */ /* package */ void onNanoAppUnloaded(int contextHubId, long nanoAppId) { forEachClientOfHub(contextHubId, client -> client.onNanoAppUnloaded(nanoAppId)); } /** * Handles a hub reset. * * @param contextHubId the ID of the hub that has reset. * @param contextHubId the ID of the hub that has reset */ /* package */ void onHubReset(int contextHubId) { forEachClientOfHub(contextHubId, client -> client.onHubReset()); } /** * @param contextHubId the ID of the hub that contained the nanoapp that aborted * @param nanoAppId the ID of the nanoapp that aborted * @param abortCode the nanoapp specific abort code */ /* package */ void onNanoAppAborted(int contextHubId, long nanoAppId, int abortCode) { forEachClientOfHub(contextHubId, client -> client.onNanoAppAborted(nanoAppId, abortCode)); } /** * Creates a new ContextHubClientBroker object for a client and registers it with the client * manager. Loading services/core/java/com/android/server/location/ContextHubService.java +1 −1 Original line number Diff line number Diff line Loading @@ -573,7 +573,7 @@ public class ContextHubService extends IContextHubService.Stub { * @param abortCode the nanoapp-specific abort code */ private void handleAppAbortCallback(int contextHubId, long nanoAppId, int abortCode) { // TODO(b/31049861): Implement this mClientManager.onNanoAppAborted(contextHubId, nanoAppId, abortCode); } /** Loading Loading
services/core/java/com/android/server/location/ContextHubClientBroker.java +20 −3 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } /** * Handles a nanoapp load event. * Notifies the client of a nanoapp load event if the connection is open. * * @param nanoAppId the ID of the nanoapp that was loaded. */ Loading @@ -195,7 +195,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } /** * Handles a nanoapp unload event. * Notifies the client of a nanoapp unload event if the connection is open. * * @param nanoAppId the ID of the nanoapp that was unloaded. */ Loading @@ -211,7 +211,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } /** * Handles a hub reset for this client. * Notifies the client of a hub reset event if the connection is open. */ /* package */ void onHubReset() { if (mConnectionOpen.get()) { Loading @@ -223,4 +223,21 @@ public class ContextHubClientBroker extends IContextHubClient.Stub } } } /** * Notifies the client of a nanoapp abort event if the connection is open. * * @param nanoAppId the ID of the nanoapp that aborted * @param abortCode the nanoapp specific abort code */ /* package */ void onNanoAppAborted(long nanoAppId, int abortCode) { if (mConnectionOpen.get()) { try { mCallbackInterface.onNanoAppAborted(nanoAppId, abortCode); } catch (RemoteException e) { Log.e(TAG, "RemoteException while calling onNanoAppAborted on client" + " (host endpoint ID = " + mHostEndPointId + ")", e); } } } }
services/core/java/com/android/server/location/ContextHubClientManager.java +14 −11 Original line number Diff line number Diff line Loading @@ -149,34 +149,37 @@ import java.util.function.Consumer; } /** * Handles a nanoapp load event. * * @param contextHubId the ID of the hub where the nanoapp was loaded. * @param nanoAppId the ID of the nanoapp that was loaded. * @param contextHubId the ID of the hub where the nanoapp was loaded * @param nanoAppId the ID of the nanoapp that was loaded */ /* package */ void onNanoAppLoaded(int contextHubId, long nanoAppId) { forEachClientOfHub(contextHubId, client -> client.onNanoAppLoaded(nanoAppId)); } /** * Handles a nanoapp unload event. * * @param contextHubId the ID of the hub where the nanoapp was unloaded. * @param nanoAppId the ID of the nanoapp that was unloaded. * @param contextHubId the ID of the hub where the nanoapp was unloaded * @param nanoAppId the ID of the nanoapp that was unloaded */ /* package */ void onNanoAppUnloaded(int contextHubId, long nanoAppId) { forEachClientOfHub(contextHubId, client -> client.onNanoAppUnloaded(nanoAppId)); } /** * Handles a hub reset. * * @param contextHubId the ID of the hub that has reset. * @param contextHubId the ID of the hub that has reset */ /* package */ void onHubReset(int contextHubId) { forEachClientOfHub(contextHubId, client -> client.onHubReset()); } /** * @param contextHubId the ID of the hub that contained the nanoapp that aborted * @param nanoAppId the ID of the nanoapp that aborted * @param abortCode the nanoapp specific abort code */ /* package */ void onNanoAppAborted(int contextHubId, long nanoAppId, int abortCode) { forEachClientOfHub(contextHubId, client -> client.onNanoAppAborted(nanoAppId, abortCode)); } /** * Creates a new ContextHubClientBroker object for a client and registers it with the client * manager. Loading
services/core/java/com/android/server/location/ContextHubService.java +1 −1 Original line number Diff line number Diff line Loading @@ -573,7 +573,7 @@ public class ContextHubService extends IContextHubService.Stub { * @param abortCode the nanoapp-specific abort code */ private void handleAppAbortCallback(int contextHubId, long nanoAppId, int abortCode) { // TODO(b/31049861): Implement this mClientManager.onNanoAppAborted(contextHubId, nanoAppId, abortCode); } /** Loading