Loading services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java +37 −14 Original line number Diff line number Diff line Loading @@ -453,8 +453,13 @@ public abstract class IContextHubWrapper { public int sendMessageToContextHub( short hostEndpointId, int contextHubId, NanoAppMessage message) throws RemoteException { return toTransactionResult(mHub.sendMessageToHub(contextHubId, ContextHubServiceUtil.createAidlContextHubMessage(hostEndpointId, message))); try { mHub.sendMessageToHub(contextHubId, ContextHubServiceUtil.createAidlContextHubMessage(hostEndpointId, message)); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result Loading @@ -462,31 +467,55 @@ public abstract class IContextHubWrapper { int transactionId) throws RemoteException { android.hardware.contexthub.NanoappBinary aidlNanoAppBinary = ContextHubServiceUtil.createAidlNanoAppBinary(binary); return toTransactionResult( mHub.loadNanoapp(contextHubId, aidlNanoAppBinary, transactionId)); try { mHub.loadNanoapp(contextHubId, aidlNanoAppBinary, transactionId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result public int unloadNanoapp(int contextHubId, long nanoappId, int transactionId) throws RemoteException { return toTransactionResult(mHub.unloadNanoapp(contextHubId, nanoappId, transactionId)); try { mHub.unloadNanoapp(contextHubId, nanoappId, transactionId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result public int enableNanoapp(int contextHubId, long nanoappId, int transactionId) throws RemoteException { return toTransactionResult(mHub.enableNanoapp(contextHubId, nanoappId, transactionId)); try { mHub.enableNanoapp(contextHubId, nanoappId, transactionId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result public int disableNanoapp(int contextHubId, long nanoappId, int transactionId) throws RemoteException { return toTransactionResult(mHub.disableNanoapp(contextHubId, nanoappId, transactionId)); try { mHub.disableNanoapp(contextHubId, nanoappId, transactionId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result public int queryNanoapps(int contextHubId) throws RemoteException { return toTransactionResult(mHub.queryNanoapps(contextHubId)); try { mHub.queryNanoapps(contextHubId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } public void registerCallback(int contextHubId, ICallback callback) throws RemoteException { Loading @@ -494,12 +523,6 @@ public abstract class IContextHubWrapper { mHub.registerCallback(contextHubId, mAidlCallbackMap.get(contextHubId)); } @ContextHubTransaction.Result private int toTransactionResult(boolean success) { return success ? ContextHubTransaction.RESULT_SUCCESS : ContextHubTransaction.RESULT_FAILED_UNKNOWN; } private void onSettingChanged(byte setting, boolean enabled) { try { mHub.onSettingChanged(setting, enabled); Loading Loading
services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java +37 −14 Original line number Diff line number Diff line Loading @@ -453,8 +453,13 @@ public abstract class IContextHubWrapper { public int sendMessageToContextHub( short hostEndpointId, int contextHubId, NanoAppMessage message) throws RemoteException { return toTransactionResult(mHub.sendMessageToHub(contextHubId, ContextHubServiceUtil.createAidlContextHubMessage(hostEndpointId, message))); try { mHub.sendMessageToHub(contextHubId, ContextHubServiceUtil.createAidlContextHubMessage(hostEndpointId, message)); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result Loading @@ -462,31 +467,55 @@ public abstract class IContextHubWrapper { int transactionId) throws RemoteException { android.hardware.contexthub.NanoappBinary aidlNanoAppBinary = ContextHubServiceUtil.createAidlNanoAppBinary(binary); return toTransactionResult( mHub.loadNanoapp(contextHubId, aidlNanoAppBinary, transactionId)); try { mHub.loadNanoapp(contextHubId, aidlNanoAppBinary, transactionId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result public int unloadNanoapp(int contextHubId, long nanoappId, int transactionId) throws RemoteException { return toTransactionResult(mHub.unloadNanoapp(contextHubId, nanoappId, transactionId)); try { mHub.unloadNanoapp(contextHubId, nanoappId, transactionId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result public int enableNanoapp(int contextHubId, long nanoappId, int transactionId) throws RemoteException { return toTransactionResult(mHub.enableNanoapp(contextHubId, nanoappId, transactionId)); try { mHub.enableNanoapp(contextHubId, nanoappId, transactionId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result public int disableNanoapp(int contextHubId, long nanoappId, int transactionId) throws RemoteException { return toTransactionResult(mHub.disableNanoapp(contextHubId, nanoappId, transactionId)); try { mHub.disableNanoapp(contextHubId, nanoappId, transactionId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } @ContextHubTransaction.Result public int queryNanoapps(int contextHubId) throws RemoteException { return toTransactionResult(mHub.queryNanoapps(contextHubId)); try { mHub.queryNanoapps(contextHubId); return ContextHubTransaction.RESULT_SUCCESS; } catch (RemoteException e) { return ContextHubTransaction.RESULT_FAILED_UNKNOWN; } } public void registerCallback(int contextHubId, ICallback callback) throws RemoteException { Loading @@ -494,12 +523,6 @@ public abstract class IContextHubWrapper { mHub.registerCallback(contextHubId, mAidlCallbackMap.get(contextHubId)); } @ContextHubTransaction.Result private int toTransactionResult(boolean success) { return success ? ContextHubTransaction.RESULT_SUCCESS : ContextHubTransaction.RESULT_FAILED_UNKNOWN; } private void onSettingChanged(byte setting, boolean enabled) { try { mHub.onSettingChanged(setting, enabled); Loading