summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Raphael Kim <raphk@google.com> 2024-04-23 02:51:48 -0700
committer Raphael Kim <raphk@google.com> 2024-04-23 02:51:48 -0700
commit5cb53006bbc434aa4fe672018668e78d86fe586c (patch)
tree9f6b2e62dd4e64555a254745ec8cb3be3885f657
parentf7f5f52bf3334e5202a2ef5fb9b704c7ea42fa50 (diff)
[CDM] Use proper package name when calling attach/detachSystemDataTransport APIs.
Bug: 332909678 Test: atest CtsCompanionDeviceManagerMultiDeviceTestCases Change-Id: If6d4f42e6461e2b59efcfe48fa2b5451212091d2
-rw-r--r--core/java/android/companion/CompanionDeviceManager.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/companion/CompanionDeviceManager.java b/core/java/android/companion/CompanionDeviceManager.java
index a08d659ab4aa..e812d81c0053 100644
--- a/core/java/android/companion/CompanionDeviceManager.java
+++ b/core/java/android/companion/CompanionDeviceManager.java
@@ -1884,7 +1884,7 @@ public final class CompanionDeviceManager {
mLocalOut = new ParcelFileDescriptor.AutoCloseOutputStream(localFd);
try {
- mService.attachSystemDataTransport(mContext.getPackageName(),
+ mService.attachSystemDataTransport(mContext.getOpPackageName(),
mContext.getUserId(), mAssociationId, remoteFd);
} catch (RemoteException e) {
throw new IOException("Failed to configure transport", e);
@@ -1921,9 +1921,9 @@ public final class CompanionDeviceManager {
mStopped = true;
try {
- mService.detachSystemDataTransport(mContext.getPackageName(),
+ mService.detachSystemDataTransport(mContext.getOpPackageName(),
mContext.getUserId(), mAssociationId);
- } catch (RemoteException e) {
+ } catch (RemoteException | IllegalArgumentException e) {
Log.w(TAG, "Failed to detach transport", e);
}