diff --git a/core/java/android/companion/CompanionDeviceManager.java b/core/java/android/companion/CompanionDeviceManager.java index 36802eabee159..15685000d6baf 100644 --- a/core/java/android/companion/CompanionDeviceManager.java +++ b/core/java/android/companion/CompanionDeviceManager.java @@ -780,9 +780,9 @@ public final class CompanionDeviceManager { } /** - * Notify the system that the given self-managed association has just 'appeared'. + * Notify the system that the given self-managed association has just appeared. * This causes the system to bind to the companion app to keep it running until the association - * is reported as 'disappeared' + * is reported as disappeared * *
This API is only available for the companion apps that manage the connectivity by * themselves.
@@ -803,7 +803,7 @@ public final class CompanionDeviceManager { } /** - * Notify the system that the given self-managed association has just 'disappeared'. + * Notify the system that the given self-managed association has just disappeared. * This causes the system to unbind to the companion app. * *This API is only available for the companion apps that manage the connectivity by diff --git a/core/java/android/companion/CompanionDeviceService.java b/core/java/android/companion/CompanionDeviceService.java index cb96ebe8bca9d..9e1bf4bb9484c 100644 --- a/core/java/android/companion/CompanionDeviceService.java +++ b/core/java/android/companion/CompanionDeviceService.java @@ -77,10 +77,11 @@ import java.util.Objects; * {@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. + * service using "android.companion.PROPERTY_PRIMARY_COMPANION_DEVICE_SERVICE" service level + * property. *
{@code
- *
* }
*
diff --git a/services/companion/java/com/android/server/companion/PackageUtils.java b/services/companion/java/com/android/server/companion/PackageUtils.java
index 818f0cf8dd420..a2b20593a9cbe 100644
--- a/services/companion/java/com/android/server/companion/PackageUtils.java
+++ b/services/companion/java/com/android/server/companion/PackageUtils.java
@@ -18,7 +18,6 @@ package com.android.server.companion;
import static android.content.pm.PackageManager.FEATURE_COMPANION_DEVICE_SETUP;
import static android.content.pm.PackageManager.GET_CONFIGURATIONS;
-import static android.content.pm.PackageManager.GET_META_DATA;
import static android.content.pm.PackageManager.GET_PERMISSIONS;
import static com.android.server.companion.CompanionDeviceManagerService.TAG;
@@ -53,7 +52,8 @@ import java.util.Map;
final class PackageUtils {
private static final Intent COMPANION_SERVICE_INTENT =
new Intent(CompanionDeviceService.SERVICE_INTERFACE);
- private static final String META_DATA_PRIMARY_TAG = "android.companion.primary";
+ private static final String PROPERTY_PRIMARY_TAG =
+ "android.companion.PROPERTY_PRIMARY_COMPANION_DEVICE_SERVICE";
static @Nullable PackageInfo getPackageInfo(@NonNull Context context,
@UserIdInt int userId, @NonNull String packageName) {
@@ -84,9 +84,8 @@ final class PackageUtils {
static @NonNull Map