Loading core/java/android/app/admin/DevicePolicyManager.java +26 −4 Original line number Diff line number Diff line Loading @@ -11585,12 +11585,14 @@ public class DevicePolicyManager { * #setCrossProfilePackages(ComponentName, Set)}.</li> * <li>The default package names set by the OEM that are allowed to request user consent for * cross-profile communication without being explicitly enabled by the admin, via * {@link com.android.internal.R.array#cross_profile_apps}</li> * {@link com.android.internal.R.array#cross_profile_apps} and * {@link com.android.internal.R.array#vendor_cross_profile_apps}.</li> * </ul> * * @return the combined set of whitelisted package names set via * {@link #setCrossProfilePackages(ComponentName, Set)} and * {@link com.android.internal.R.array#cross_profile_apps} * {@link #setCrossProfilePackages(ComponentName, Set)}, * {@link com.android.internal.R.array#cross_profile_apps}, * and {@link com.android.internal.R.array#vendor_cross_profile_apps}. * * @hide */ Loading @@ -11600,7 +11602,7 @@ public class DevicePolicyManager { permission.INTERACT_ACROSS_PROFILES }) public @NonNull Set<String> getAllCrossProfilePackages() { throwIfParentInstance("getDefaultCrossProfilePackages"); throwIfParentInstance("getAllCrossProfilePackages"); if (mService != null) { try { return new ArraySet<>(mService.getAllCrossProfilePackages()); Loading @@ -11611,6 +11613,26 @@ public class DevicePolicyManager { return Collections.emptySet(); } /** * Returns the default package names set by the OEM that are allowed to request user consent for * cross-profile communication without being explicitly enabled by the admin, via * {@link com.android.internal.R.array#cross_profile_apps} and * {@link com.android.internal.R.array#vendor_cross_profile_apps}. * * @hide */ public @NonNull Set<String> getDefaultCrossProfilePackages() { throwIfParentInstance("getDefaultCrossProfilePackages"); if (mService != null) { try { return new ArraySet<>(mService.getDefaultCrossProfilePackages()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return Collections.emptySet(); } /** * Returns whether the device is being used as a managed kiosk. These requirements are as * follows: core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -457,6 +457,7 @@ interface IDevicePolicyManager { List<String> getCrossProfilePackages(in ComponentName admin); List<String> getAllCrossProfilePackages(); List<String> getDefaultCrossProfilePackages(); boolean isManagedKiosk(); boolean isUnattendedManagedKiosk(); Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1266,6 +1266,7 @@ <java-symbol type="array" name="vendor_disallowed_apps_managed_profile" /> <java-symbol type="array" name="vendor_disallowed_apps_managed_device" /> <java-symbol type="array" name="cross_profile_apps" /> <java-symbol type="array" name="vendor_cross_profile_apps" /> <java-symbol type="drawable" name="default_wallpaper" /> <java-symbol type="drawable" name="default_lock_wallpaper" /> Loading core/res/res/values/vendor_cross_profile_apps.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <resources> <!-- A collection of apps that have been pre-approved for cross-profile communication. These will not require admin consent, but will still require user consent during provisioning. --> <string-array translatable="false" name="vendor_cross_profile_apps"> </string-array> </resources> services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +9 −2 Original line number Diff line number Diff line Loading @@ -15077,9 +15077,16 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { return packages; } private List<String> getDefaultCrossProfilePackages() { return Arrays.asList(mContext.getResources() @Override public List<String> getDefaultCrossProfilePackages() { Set<String> crossProfilePackages = new HashSet<>(); Collections.addAll(crossProfilePackages, mContext.getResources() .getStringArray(R.array.cross_profile_apps)); Collections.addAll(crossProfilePackages, mContext.getResources() .getStringArray(R.array.vendor_cross_profile_apps)); return new ArrayList<>(crossProfilePackages); } private List<ActiveAdmin> getProfileOwnerAdminsForCurrentProfileGroup() { Loading
core/java/android/app/admin/DevicePolicyManager.java +26 −4 Original line number Diff line number Diff line Loading @@ -11585,12 +11585,14 @@ public class DevicePolicyManager { * #setCrossProfilePackages(ComponentName, Set)}.</li> * <li>The default package names set by the OEM that are allowed to request user consent for * cross-profile communication without being explicitly enabled by the admin, via * {@link com.android.internal.R.array#cross_profile_apps}</li> * {@link com.android.internal.R.array#cross_profile_apps} and * {@link com.android.internal.R.array#vendor_cross_profile_apps}.</li> * </ul> * * @return the combined set of whitelisted package names set via * {@link #setCrossProfilePackages(ComponentName, Set)} and * {@link com.android.internal.R.array#cross_profile_apps} * {@link #setCrossProfilePackages(ComponentName, Set)}, * {@link com.android.internal.R.array#cross_profile_apps}, * and {@link com.android.internal.R.array#vendor_cross_profile_apps}. * * @hide */ Loading @@ -11600,7 +11602,7 @@ public class DevicePolicyManager { permission.INTERACT_ACROSS_PROFILES }) public @NonNull Set<String> getAllCrossProfilePackages() { throwIfParentInstance("getDefaultCrossProfilePackages"); throwIfParentInstance("getAllCrossProfilePackages"); if (mService != null) { try { return new ArraySet<>(mService.getAllCrossProfilePackages()); Loading @@ -11611,6 +11613,26 @@ public class DevicePolicyManager { return Collections.emptySet(); } /** * Returns the default package names set by the OEM that are allowed to request user consent for * cross-profile communication without being explicitly enabled by the admin, via * {@link com.android.internal.R.array#cross_profile_apps} and * {@link com.android.internal.R.array#vendor_cross_profile_apps}. * * @hide */ public @NonNull Set<String> getDefaultCrossProfilePackages() { throwIfParentInstance("getDefaultCrossProfilePackages"); if (mService != null) { try { return new ArraySet<>(mService.getDefaultCrossProfilePackages()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return Collections.emptySet(); } /** * Returns whether the device is being used as a managed kiosk. These requirements are as * follows:
core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -457,6 +457,7 @@ interface IDevicePolicyManager { List<String> getCrossProfilePackages(in ComponentName admin); List<String> getAllCrossProfilePackages(); List<String> getDefaultCrossProfilePackages(); boolean isManagedKiosk(); boolean isUnattendedManagedKiosk(); Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1266,6 +1266,7 @@ <java-symbol type="array" name="vendor_disallowed_apps_managed_profile" /> <java-symbol type="array" name="vendor_disallowed_apps_managed_device" /> <java-symbol type="array" name="cross_profile_apps" /> <java-symbol type="array" name="vendor_cross_profile_apps" /> <java-symbol type="drawable" name="default_wallpaper" /> <java-symbol type="drawable" name="default_lock_wallpaper" /> Loading
core/res/res/values/vendor_cross_profile_apps.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <resources> <!-- A collection of apps that have been pre-approved for cross-profile communication. These will not require admin consent, but will still require user consent during provisioning. --> <string-array translatable="false" name="vendor_cross_profile_apps"> </string-array> </resources>
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +9 −2 Original line number Diff line number Diff line Loading @@ -15077,9 +15077,16 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { return packages; } private List<String> getDefaultCrossProfilePackages() { return Arrays.asList(mContext.getResources() @Override public List<String> getDefaultCrossProfilePackages() { Set<String> crossProfilePackages = new HashSet<>(); Collections.addAll(crossProfilePackages, mContext.getResources() .getStringArray(R.array.cross_profile_apps)); Collections.addAll(crossProfilePackages, mContext.getResources() .getStringArray(R.array.vendor_cross_profile_apps)); return new ArrayList<>(crossProfilePackages); } private List<ActiveAdmin> getProfileOwnerAdminsForCurrentProfileGroup() {