Loading core/java/android/companion/CompanionDeviceManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -1086,7 +1086,7 @@ public final class CompanionDeviceManager { } Objects.requireNonNull(deviceAddress, "address cannot be null"); try { mService.registerDevicePresenceListenerService(deviceAddress, mService.legacyStartObservingDevicePresence(deviceAddress, mContext.getOpPackageName(), mContext.getUserId()); } catch (RemoteException e) { ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class); Loading Loading @@ -1128,7 +1128,7 @@ public final class CompanionDeviceManager { } Objects.requireNonNull(deviceAddress, "address cannot be null"); try { mService.unregisterDevicePresenceListenerService(deviceAddress, mService.legacyStopObservingDevicePresence(deviceAddress, mContext.getPackageName(), mContext.getUserId()); } catch (RemoteException e) { ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class); Loading Loading @@ -1328,7 +1328,7 @@ public final class CompanionDeviceManager { @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public void notifyDeviceAppeared(int associationId) { try { mService.notifyDeviceAppeared(associationId); mService.notifySelfManagedDeviceAppeared(associationId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1350,7 +1350,7 @@ public final class CompanionDeviceManager { @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public void notifyDeviceDisappeared(int associationId) { try { mService.notifyDeviceDisappeared(associationId); mService.notifySelfManagedDeviceDisappeared(associationId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/android/companion/ICompanionDeviceManager.aidl +12 −12 Original line number Diff line number Diff line Loading @@ -59,12 +59,16 @@ interface ICompanionDeviceManager { int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void registerDevicePresenceListenerService(in String deviceAddress, in String callingPackage, int userId); void legacyStartObservingDevicePresence(in String deviceAddress, in String callingPackage, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void unregisterDevicePresenceListenerService(in String deviceAddress, in String callingPackage, int userId); void legacyStopObservingDevicePresence(in String deviceAddress, in String callingPackage, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void startObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void stopObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId); boolean canPairWithoutPrompt(in String packageName, in String deviceMacAddress, int userId); Loading Loading @@ -93,9 +97,11 @@ interface ICompanionDeviceManager { @EnforcePermission("USE_COMPANION_TRANSPORTS") void removeOnMessageReceivedListener(int messageType, IOnMessageReceivedListener listener); void notifyDeviceAppeared(int associationId); @EnforcePermission("REQUEST_COMPANION_SELF_MANAGED") void notifySelfManagedDeviceAppeared(int associationId); void notifyDeviceDisappeared(int associationId); @EnforcePermission("REQUEST_COMPANION_SELF_MANAGED") void notifySelfManagedDeviceDisappeared(int associationId); PendingIntent buildPermissionTransferUserConsentIntent(String callingPackage, int userId, int associationId); Loading Loading @@ -135,10 +141,4 @@ interface ICompanionDeviceManager { byte[] getBackupPayload(int userId); void applyRestoredPayload(in byte[] payload, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void startObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void stopObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId); } Loading
core/java/android/companion/CompanionDeviceManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -1086,7 +1086,7 @@ public final class CompanionDeviceManager { } Objects.requireNonNull(deviceAddress, "address cannot be null"); try { mService.registerDevicePresenceListenerService(deviceAddress, mService.legacyStartObservingDevicePresence(deviceAddress, mContext.getOpPackageName(), mContext.getUserId()); } catch (RemoteException e) { ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class); Loading Loading @@ -1128,7 +1128,7 @@ public final class CompanionDeviceManager { } Objects.requireNonNull(deviceAddress, "address cannot be null"); try { mService.unregisterDevicePresenceListenerService(deviceAddress, mService.legacyStopObservingDevicePresence(deviceAddress, mContext.getPackageName(), mContext.getUserId()); } catch (RemoteException e) { ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class); Loading Loading @@ -1328,7 +1328,7 @@ public final class CompanionDeviceManager { @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public void notifyDeviceAppeared(int associationId) { try { mService.notifyDeviceAppeared(associationId); mService.notifySelfManagedDeviceAppeared(associationId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1350,7 +1350,7 @@ public final class CompanionDeviceManager { @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public void notifyDeviceDisappeared(int associationId) { try { mService.notifyDeviceDisappeared(associationId); mService.notifySelfManagedDeviceDisappeared(associationId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/android/companion/ICompanionDeviceManager.aidl +12 −12 Original line number Diff line number Diff line Loading @@ -59,12 +59,16 @@ interface ICompanionDeviceManager { int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void registerDevicePresenceListenerService(in String deviceAddress, in String callingPackage, int userId); void legacyStartObservingDevicePresence(in String deviceAddress, in String callingPackage, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void unregisterDevicePresenceListenerService(in String deviceAddress, in String callingPackage, int userId); void legacyStopObservingDevicePresence(in String deviceAddress, in String callingPackage, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void startObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void stopObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId); boolean canPairWithoutPrompt(in String packageName, in String deviceMacAddress, int userId); Loading Loading @@ -93,9 +97,11 @@ interface ICompanionDeviceManager { @EnforcePermission("USE_COMPANION_TRANSPORTS") void removeOnMessageReceivedListener(int messageType, IOnMessageReceivedListener listener); void notifyDeviceAppeared(int associationId); @EnforcePermission("REQUEST_COMPANION_SELF_MANAGED") void notifySelfManagedDeviceAppeared(int associationId); void notifyDeviceDisappeared(int associationId); @EnforcePermission("REQUEST_COMPANION_SELF_MANAGED") void notifySelfManagedDeviceDisappeared(int associationId); PendingIntent buildPermissionTransferUserConsentIntent(String callingPackage, int userId, int associationId); Loading Loading @@ -135,10 +141,4 @@ interface ICompanionDeviceManager { byte[] getBackupPayload(int userId); void applyRestoredPayload(in byte[] payload, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void startObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId); @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE") void stopObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId); }