Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08af136e authored by Guojing Yuan's avatar Guojing Yuan Committed by Android (Google) Code Review
Browse files

Merge "[CDM perm sync] Hide data transfer APIs"

parents ff73f8ec cad88126
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -8961,13 +8961,11 @@ package android.companion {
  public abstract class CompanionDeviceService extends android.app.Service {
    ctor public CompanionDeviceService();
    method @RequiresPermission(android.Manifest.permission.DELIVER_COMPANION_MESSAGES) public final void dispatchMessage(int, int, @NonNull byte[]);
    method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
    method @Deprecated @MainThread public void onDeviceAppeared(@NonNull String);
    method @MainThread public void onDeviceAppeared(@NonNull android.companion.AssociationInfo);
    method @Deprecated @MainThread public void onDeviceDisappeared(@NonNull String);
    method @MainThread public void onDeviceDisappeared(@NonNull android.companion.AssociationInfo);
    method @MainThread public void onDispatchMessage(int, int, @NonNull byte[]);
    field public static final String SERVICE_INTERFACE = "android.companion.CompanionDeviceService";
  }
+6 −7
Original line number Diff line number Diff line
@@ -36,11 +36,6 @@ import java.util.Objects;
 * See {@link #onDeviceAppeared(AssociationInfo)}/{@link #onDeviceDisappeared(AssociationInfo)}.
 *
 * <p>
 * Additionally, the service will receive a call from the system, if and when the system needs to
 * transfer data to the companion device.
 * See {@link #dispatchMessage(int, int, byte[])}).
 *
 * <p>
 * Companion applications must create a service that {@code extends}
 * {@link CompanionDeviceService}, and declare it in their AndroidManifest.xml with the
 * "android.permission.BIND_COMPANION_DEVICE_SERVICE" permission
@@ -79,8 +74,8 @@ import java.util.Objects;
 * <p>
 * It is possible for an application to declare multiple {@link CompanionDeviceService}-s.
 * In such case, the system will bind all declared services, but will deliver
 * {@link #onDeviceAppeared(AssociationInfo)}, {@link #onDeviceDisappeared(AssociationInfo)} and
 * {@link #dispatchMessage(int, int, byte[])} only to one "primary" services.
 * {@link #onDeviceAppeared(AssociationInfo)} and {@link #onDeviceDisappeared(AssociationInfo)}
 * only to one "primary" services.
 * Applications that declare multiple {@link CompanionDeviceService}-s should indicate the "primary"
 * service using "android.companion.primary" tag.
 * <pre>{@code
@@ -156,6 +151,8 @@ public abstract class CompanionDeviceService extends Service {
     * @param messageId system assigned id of the message to be sent
     * @param associationId association id of the associated device
     * @param message message to be sent
     *
     * @hide
     */
    @MainThread
    public void onDispatchMessage(int messageId, int associationId, @NonNull byte[] message) {
@@ -172,6 +169,8 @@ public abstract class CompanionDeviceService extends Service {
     * @param messageId id of the message
     * @param associationId id of the associated device
     * @param message messaged received from the associated device
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.DELIVER_COMPANION_MESSAGES)
    public final void dispatchMessage(int messageId, int associationId, @NonNull byte[] message) {