Fix usage of the updated CDM APIs

Bug: 194301022
Test: make
Change-Id: I70633f43d37fdeec8329e0c58f7cffa402dba689
This commit is contained in:
Sergey Nikolaienkov
2021-10-27 15:41:25 +02:00
parent 74a797efd8
commit 7fea5bd54f
4 changed files with 37 additions and 17 deletions

View File

@@ -24,9 +24,9 @@ import static org.mockito.Mockito.when;
import android.companion.AssociationInfo;
import android.companion.CompanionDeviceManager;
import android.companion.DeviceId;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.MacAddress;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
@@ -100,15 +100,14 @@ public class BluetoothDetailsCompanionAppsControllerTest extends
setupFakeLabelAndInfo(packageName, appName);
final int associationId = mAssociations.size() + 1;
final DeviceId deviceId =
new DeviceId(DeviceId.TYPE_MAC_ADDRESS, mCachedDevice.getAddress());
final AssociationInfo association = new AssociationInfo(
associationId,
/* userId */ 0,
packageName,
Arrays.asList(deviceId),
MacAddress.fromString(mCachedDevice.getAddress()),
/* displayName */ null,
/* deviceProfile */ "",
/* managedByCompanionApp */ false,
/* selfManaged */ false,
/* notifyOnDeviceNearby */ true,
/* timeApprovedMs */ System.currentTimeMillis());