Loading core/java/android/companion/CompanionDeviceManager.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -118,6 +118,9 @@ public final class CompanionDeviceManager { * association is no longer relevant to avoid unnecessary battery and/or data drain resulting * association is no longer relevant to avoid unnecessary battery and/or data drain resulting * from special privileges that the association provides</p> * from special privileges that the association provides</p> * * * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> * * @param request specific details about this request * @param request specific details about this request * @param callback will be called once there's at least one device found for user to choose from * @param callback will be called once there's at least one device found for user to choose from * @param handler A handler to control which thread the callback will be delivered on, or null, * @param handler A handler to control which thread the callback will be delivered on, or null, Loading Loading @@ -160,6 +163,9 @@ public final class CompanionDeviceManager { } } /** /** * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> * * @return a list of MAC addresses of devices that have been previously associated with the * @return a list of MAC addresses of devices that have been previously associated with the * current app. You can use these with {@link #disassociate} * current app. You can use these with {@link #disassociate} */ */ Loading @@ -184,6 +190,9 @@ public final class CompanionDeviceManager { * association is no longer relevant to avoid unnecessary battery and/or data drain resulting * association is no longer relevant to avoid unnecessary battery and/or data drain resulting * from special privileges that the association provides</p> * from special privileges that the association provides</p> * * * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> * * @param deviceMacAddress the MAC address of device to disassociate from this app * @param deviceMacAddress the MAC address of device to disassociate from this app */ */ public void disassociate(@NonNull String deviceMacAddress) { public void disassociate(@NonNull String deviceMacAddress) { Loading @@ -206,6 +215,9 @@ public final class CompanionDeviceManager { * are allowed. * are allowed. * * * Your app must have an association with a device before calling this API * Your app must have an association with a device before calling this API * * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> */ */ public void requestNotificationAccess(ComponentName component) { public void requestNotificationAccess(ComponentName component) { if (!checkFeaturePresent()) { if (!checkFeaturePresent()) { Loading @@ -226,6 +238,9 @@ public final class CompanionDeviceManager { * * * Your app must have an association with a device before calling this API * Your app must have an association with a device before calling this API * * * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> * * @param component the name of the component * @param component the name of the component * @return whether the given component has the notification listener permission * @return whether the given component has the notification listener permission */ */ Loading Loading
core/java/android/companion/CompanionDeviceManager.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -118,6 +118,9 @@ public final class CompanionDeviceManager { * association is no longer relevant to avoid unnecessary battery and/or data drain resulting * association is no longer relevant to avoid unnecessary battery and/or data drain resulting * from special privileges that the association provides</p> * from special privileges that the association provides</p> * * * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> * * @param request specific details about this request * @param request specific details about this request * @param callback will be called once there's at least one device found for user to choose from * @param callback will be called once there's at least one device found for user to choose from * @param handler A handler to control which thread the callback will be delivered on, or null, * @param handler A handler to control which thread the callback will be delivered on, or null, Loading Loading @@ -160,6 +163,9 @@ public final class CompanionDeviceManager { } } /** /** * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> * * @return a list of MAC addresses of devices that have been previously associated with the * @return a list of MAC addresses of devices that have been previously associated with the * current app. You can use these with {@link #disassociate} * current app. You can use these with {@link #disassociate} */ */ Loading @@ -184,6 +190,9 @@ public final class CompanionDeviceManager { * association is no longer relevant to avoid unnecessary battery and/or data drain resulting * association is no longer relevant to avoid unnecessary battery and/or data drain resulting * from special privileges that the association provides</p> * from special privileges that the association provides</p> * * * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> * * @param deviceMacAddress the MAC address of device to disassociate from this app * @param deviceMacAddress the MAC address of device to disassociate from this app */ */ public void disassociate(@NonNull String deviceMacAddress) { public void disassociate(@NonNull String deviceMacAddress) { Loading @@ -206,6 +215,9 @@ public final class CompanionDeviceManager { * are allowed. * are allowed. * * * Your app must have an association with a device before calling this API * Your app must have an association with a device before calling this API * * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> */ */ public void requestNotificationAccess(ComponentName component) { public void requestNotificationAccess(ComponentName component) { if (!checkFeaturePresent()) { if (!checkFeaturePresent()) { Loading @@ -226,6 +238,9 @@ public final class CompanionDeviceManager { * * * Your app must have an association with a device before calling this API * Your app must have an association with a device before calling this API * * * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> * * @param component the name of the component * @param component the name of the component * @return whether the given component has the notification listener permission * @return whether the given component has the notification listener permission */ */ Loading