Loading core/java/android/hardware/location/ContextHubManager.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -764,7 +764,7 @@ public final class ContextHubManager { IContextHubClient clientProxy; IContextHubClient clientProxy; try { try { clientProxy = mService.createClient(clientInterface, hubInfo.getId()); clientProxy = mService.createClient(hubInfo.getId(), clientInterface); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading core/java/android/hardware/location/IContextHubService.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -59,7 +59,7 @@ interface IContextHubService { int sendMessage(int contextHubHandle, int nanoAppHandle, in ContextHubMessage msg); int sendMessage(int contextHubHandle, int nanoAppHandle, in ContextHubMessage msg); // Creates a client to send and receive messages // Creates a client to send and receive messages IContextHubClient createClient(in IContextHubClientCallback client, int contextHubId); IContextHubClient createClient(int contextHubId, in IContextHubClientCallback client); // Creates a PendingIntent-based client to send and receive messages // Creates a PendingIntent-based client to send and receive messages IContextHubClient createPendingIntentClient( IContextHubClient createPendingIntentClient( Loading services/core/java/com/android/server/location/ContextHubClientManager.java +2 −4 Original line number Original line Diff line number Diff line Loading @@ -80,15 +80,15 @@ import java.util.function.Consumer; /** /** * Registers a new client with the service. * Registers a new client with the service. * * * @param clientCallback the callback interface of the client to register * @param contextHubInfo the object describing the hub this client is attached to * @param contextHubInfo the object describing the hub this client is attached to * @param clientCallback the callback interface of the client to register * * * @return the client interface * @return the client interface * * * @throws IllegalStateException if max number of clients have already registered * @throws IllegalStateException if max number of clients have already registered */ */ /* package */ IContextHubClient registerClient( /* package */ IContextHubClient registerClient( IContextHubClientCallback clientCallback, ContextHubInfo contextHubInfo) { ContextHubInfo contextHubInfo, IContextHubClientCallback clientCallback) { ContextHubClientBroker broker; ContextHubClientBroker broker; synchronized (this) { synchronized (this) { short hostEndPointId = getHostEndPointId(); short hostEndPointId = getHostEndPointId(); Loading Loading @@ -120,8 +120,6 @@ import java.util.function.Consumer; * * * @return the client interface * @return the client interface * * * @throws IllegalArgumentException the PendingIntent was already registered for a different * ContextHubClient * @throws IllegalStateException if there were too many registered clients at the service * @throws IllegalStateException if there were too many registered clients at the service */ */ /* package */ IContextHubClient registerClient( /* package */ IContextHubClient registerClient( Loading services/core/java/com/android/server/location/ContextHubService.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -173,7 +173,7 @@ public class ContextHubService extends IContextHubService.Stub { for (int contextHubId : mContextHubIdToInfoMap.keySet()) { for (int contextHubId : mContextHubIdToInfoMap.keySet()) { ContextHubInfo contextHubInfo = mContextHubIdToInfoMap.get(contextHubId); ContextHubInfo contextHubInfo = mContextHubIdToInfoMap.get(contextHubId); IContextHubClient client = mClientManager.registerClient( IContextHubClient client = mClientManager.registerClient( createDefaultClientCallback(contextHubId), contextHubInfo); contextHubInfo, createDefaultClientCallback(contextHubId)); defaultClientMap.put(contextHubId, client); defaultClientMap.put(contextHubId, client); try { try { Loading Loading @@ -608,8 +608,8 @@ public class ContextHubService extends IContextHubService.Stub { /** /** * Creates and registers a client at the service for the specified Context Hub. * Creates and registers a client at the service for the specified Context Hub. * * * @param clientCallback the client interface to register with the service * @param contextHubId the ID of the hub this client is attached to * @param contextHubId the ID of the hub this client is attached to * @param clientCallback the client interface to register with the service * @return the generated client interface, null if registration was unsuccessful * @return the generated client interface, null if registration was unsuccessful * * * @throws IllegalArgumentException if contextHubId is not a valid ID * @throws IllegalArgumentException if contextHubId is not a valid ID Loading @@ -618,7 +618,7 @@ public class ContextHubService extends IContextHubService.Stub { */ */ @Override @Override public IContextHubClient createClient( public IContextHubClient createClient( IContextHubClientCallback clientCallback, int contextHubId) throws RemoteException { int contextHubId, IContextHubClientCallback clientCallback) throws RemoteException { checkPermissions(); checkPermissions(); if (!isValidContextHubId(contextHubId)) { if (!isValidContextHubId(contextHubId)) { throw new IllegalArgumentException("Invalid context hub ID " + contextHubId); throw new IllegalArgumentException("Invalid context hub ID " + contextHubId); Loading @@ -628,7 +628,7 @@ public class ContextHubService extends IContextHubService.Stub { } } ContextHubInfo contextHubInfo = mContextHubIdToInfoMap.get(contextHubId); ContextHubInfo contextHubInfo = mContextHubIdToInfoMap.get(contextHubId); return mClientManager.registerClient(clientCallback, contextHubInfo); return mClientManager.registerClient(contextHubInfo, clientCallback); } } /** /** Loading Loading
core/java/android/hardware/location/ContextHubManager.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -764,7 +764,7 @@ public final class ContextHubManager { IContextHubClient clientProxy; IContextHubClient clientProxy; try { try { clientProxy = mService.createClient(clientInterface, hubInfo.getId()); clientProxy = mService.createClient(hubInfo.getId(), clientInterface); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading
core/java/android/hardware/location/IContextHubService.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -59,7 +59,7 @@ interface IContextHubService { int sendMessage(int contextHubHandle, int nanoAppHandle, in ContextHubMessage msg); int sendMessage(int contextHubHandle, int nanoAppHandle, in ContextHubMessage msg); // Creates a client to send and receive messages // Creates a client to send and receive messages IContextHubClient createClient(in IContextHubClientCallback client, int contextHubId); IContextHubClient createClient(int contextHubId, in IContextHubClientCallback client); // Creates a PendingIntent-based client to send and receive messages // Creates a PendingIntent-based client to send and receive messages IContextHubClient createPendingIntentClient( IContextHubClient createPendingIntentClient( Loading
services/core/java/com/android/server/location/ContextHubClientManager.java +2 −4 Original line number Original line Diff line number Diff line Loading @@ -80,15 +80,15 @@ import java.util.function.Consumer; /** /** * Registers a new client with the service. * Registers a new client with the service. * * * @param clientCallback the callback interface of the client to register * @param contextHubInfo the object describing the hub this client is attached to * @param contextHubInfo the object describing the hub this client is attached to * @param clientCallback the callback interface of the client to register * * * @return the client interface * @return the client interface * * * @throws IllegalStateException if max number of clients have already registered * @throws IllegalStateException if max number of clients have already registered */ */ /* package */ IContextHubClient registerClient( /* package */ IContextHubClient registerClient( IContextHubClientCallback clientCallback, ContextHubInfo contextHubInfo) { ContextHubInfo contextHubInfo, IContextHubClientCallback clientCallback) { ContextHubClientBroker broker; ContextHubClientBroker broker; synchronized (this) { synchronized (this) { short hostEndPointId = getHostEndPointId(); short hostEndPointId = getHostEndPointId(); Loading Loading @@ -120,8 +120,6 @@ import java.util.function.Consumer; * * * @return the client interface * @return the client interface * * * @throws IllegalArgumentException the PendingIntent was already registered for a different * ContextHubClient * @throws IllegalStateException if there were too many registered clients at the service * @throws IllegalStateException if there were too many registered clients at the service */ */ /* package */ IContextHubClient registerClient( /* package */ IContextHubClient registerClient( Loading
services/core/java/com/android/server/location/ContextHubService.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -173,7 +173,7 @@ public class ContextHubService extends IContextHubService.Stub { for (int contextHubId : mContextHubIdToInfoMap.keySet()) { for (int contextHubId : mContextHubIdToInfoMap.keySet()) { ContextHubInfo contextHubInfo = mContextHubIdToInfoMap.get(contextHubId); ContextHubInfo contextHubInfo = mContextHubIdToInfoMap.get(contextHubId); IContextHubClient client = mClientManager.registerClient( IContextHubClient client = mClientManager.registerClient( createDefaultClientCallback(contextHubId), contextHubInfo); contextHubInfo, createDefaultClientCallback(contextHubId)); defaultClientMap.put(contextHubId, client); defaultClientMap.put(contextHubId, client); try { try { Loading Loading @@ -608,8 +608,8 @@ public class ContextHubService extends IContextHubService.Stub { /** /** * Creates and registers a client at the service for the specified Context Hub. * Creates and registers a client at the service for the specified Context Hub. * * * @param clientCallback the client interface to register with the service * @param contextHubId the ID of the hub this client is attached to * @param contextHubId the ID of the hub this client is attached to * @param clientCallback the client interface to register with the service * @return the generated client interface, null if registration was unsuccessful * @return the generated client interface, null if registration was unsuccessful * * * @throws IllegalArgumentException if contextHubId is not a valid ID * @throws IllegalArgumentException if contextHubId is not a valid ID Loading @@ -618,7 +618,7 @@ public class ContextHubService extends IContextHubService.Stub { */ */ @Override @Override public IContextHubClient createClient( public IContextHubClient createClient( IContextHubClientCallback clientCallback, int contextHubId) throws RemoteException { int contextHubId, IContextHubClientCallback clientCallback) throws RemoteException { checkPermissions(); checkPermissions(); if (!isValidContextHubId(contextHubId)) { if (!isValidContextHubId(contextHubId)) { throw new IllegalArgumentException("Invalid context hub ID " + contextHubId); throw new IllegalArgumentException("Invalid context hub ID " + contextHubId); Loading @@ -628,7 +628,7 @@ public class ContextHubService extends IContextHubService.Stub { } } ContextHubInfo contextHubInfo = mContextHubIdToInfoMap.get(contextHubId); ContextHubInfo contextHubInfo = mContextHubIdToInfoMap.get(contextHubId); return mClientManager.registerClient(clientCallback, contextHubInfo); return mClientManager.registerClient(contextHubInfo, clientCallback); } } /** /** Loading