Skip to content

Commit 76bc24f

Browse files
committed
Update API usage for setAlwaysOnPackage
Fix: 28614160 Change-Id: Id49432d1f3acac9199007f990886ddcbb04adc5e
1 parent ef6982a commit 76bc24f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/com/afwsamples/testdpc/policy/networking/AlwaysOnVpnFragment.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import android.annotation.TargetApi;
2020
import android.app.admin.DevicePolicyManager;
21+
import android.content.ComponentName;
2122
import android.content.Context;
2223
import android.content.pm.PackageManager;
2324
import android.os.Build;
@@ -56,7 +57,8 @@ public void onResume() {
5657
@Override
5758
protected void setSelectedPackage(String pkg) {
5859
try {
59-
mDpm.setAlwaysOnVpnPackage(DeviceAdminReceiver.getComponentName(getActivity()), pkg);
60+
final ComponentName who = DeviceAdminReceiver.getComponentName(getActivity());
61+
mDpm.setAlwaysOnVpnPackage(who, pkg, /* lockdownEnabled */ true);
6062
} catch (PackageManager.NameNotFoundException | UnsupportedOperationException e) {
6163
if (pkg != null) {
6264
clearSelectedPackage();

0 commit comments

Comments
 (0)