Skip to content

Commit 29edaf5

Browse files
committed
Fix TestDPC build breakage due to API changes
Change-Id: I2518a27611b7e518edd6e52648d4fc187581f8b5
1 parent b74bb67 commit 29edaf5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/src/main/java/com/afwsamples/testdpc/policy/MeteredDataRestrictionInfoAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void onClick(DialogInterface dialog, int which) {
9898

9999
@TargetApi(28)
100100
private void setMeteredDataRestrictedPkgs(List<String> pkgNames) {
101-
final List<String> excludedPkgs = mDevicePolicyManager.setMeteredDataDisabled(
101+
final List<String> excludedPkgs = mDevicePolicyManager.setMeteredDataDisabledPackages(
102102
DeviceAdminReceiver.getComponentName(mContext), pkgNames);
103103

104104
if (!excludedPkgs.isEmpty()) {

app/src/main/java/com/afwsamples/testdpc/policy/PolicyManagementFragment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,8 +1274,8 @@ private boolean installKeyPair(final PrivateKey key, final Certificate cert, fin
12741274
boolean isUserSelectable) {
12751275
if (BuildCompat.isAtLeastP()) {
12761276
return mDevicePolicyManager.installKeyPair(
1277-
mAdminComponentName, key, new Certificate[]{cert}, alias, false,
1278-
isUserSelectable);
1277+
mAdminComponentName, key, new Certificate[]{cert}, alias,
1278+
isUserSelectable ? DevicePolicyManager.INSTALLKEY_SET_USER_SELECTABLE : 0);
12791279
} else {
12801280
if (!isUserSelectable) {
12811281
throw new IllegalArgumentException(
@@ -2783,7 +2783,7 @@ private void showSetMeteredDataPrompt() {
27832783

27842784
@TargetApi(28)
27852785
private List<String> getMeteredDataRestrictedPkgs() {
2786-
return mDevicePolicyManager.getMeteredDataDisabled(mAdminComponentName);
2786+
return mDevicePolicyManager.getMeteredDataDisabledPackages(mAdminComponentName);
27872787
}
27882788

27892789
/**

0 commit comments

Comments
 (0)