Add Platform VPNs to VPN list

This change allows the Settings VPN pages to pull the apps providing a
new Platform VPN.

Bug: 144246835
Test: Compiles, manual testing
Change-Id: Ibb7e79ccde754724c9fc00c88da98e975f325ba7
This commit is contained in:
Benedict Wong
2020-01-17 18:53:46 -08:00
parent 5c8b22657c
commit bcd6b8cbca
2 changed files with 7 additions and 4 deletions

View File

@@ -15,6 +15,7 @@
*/
package com.android.settings.vpn2;
import static android.app.AppOpsManager.OP_ACTIVATE_PLATFORM_VPN;
import static android.app.AppOpsManager.OP_ACTIVATE_VPN;
import android.annotation.NonNull;
@@ -312,7 +313,7 @@ public class AppManagementFragment extends SettingsPreferenceFragment
final AppOpsManager service =
(AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
final List<AppOpsManager.PackageOps> ops = service.getOpsForPackage(application.uid,
application.packageName, new int[]{OP_ACTIVATE_VPN});
application.packageName, new int[]{OP_ACTIVATE_VPN, OP_ACTIVATE_PLATFORM_VPN});
return !ArrayUtils.isEmpty(ops);
}