Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 635ea803 authored by Vladislav Kuzkokov's avatar Vladislav Kuzkokov
Browse files

Unhide printing policy API.

Bug: 64140119
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPrintingPolicy
Change-Id: Ic3fc78bda168217788111860ce40ad7ba2256d7d
parent 6f7734a6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -6470,6 +6470,7 @@ package android.app.admin {
    method public boolean isMasterVolumeMuted(android.content.ComponentName);
    method public boolean isNetworkLoggingEnabled(android.content.ComponentName);
    method public boolean isPackageSuspended(android.content.ComponentName, java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean isPrintingEnabled();
    method public boolean isProfileOwnerApp(java.lang.String);
    method public boolean isProvisioningAllowed(java.lang.String);
    method public boolean isResetPasswordTokenActive(android.content.ComponentName);
@@ -6539,6 +6540,7 @@ package android.app.admin {
    method public boolean setPermittedAccessibilityServices(android.content.ComponentName, java.util.List<java.lang.String>);
    method public boolean setPermittedCrossProfileNotificationListeners(android.content.ComponentName, java.util.List<java.lang.String>);
    method public boolean setPermittedInputMethods(android.content.ComponentName, java.util.List<java.lang.String>);
    method public void setPrintingEnabled(android.content.ComponentName, boolean);
    method public void setProfileEnabled(android.content.ComponentName);
    method public void setProfileName(android.content.ComponentName, java.lang.String);
    method public void setRecommendedGlobalProxy(android.content.ComponentName, android.net.ProxyInfo);
+1 −0
Original line number Diff line number Diff line
@@ -380,6 +380,7 @@ package android.app.admin {
    method public java.lang.CharSequence getDeviceOwnerOrganizationName();
    method public java.util.List<java.lang.String> getPermittedAccessibilityServices(int);
    method public java.util.List<java.lang.String> getPermittedInputMethodsForCurrentUser();
    method public java.lang.CharSequence getPrintingDisabledReason();
    method public android.content.ComponentName getProfileOwner() throws java.lang.IllegalArgumentException;
    method public java.lang.String getProfileOwnerNameAsUser(int) throws java.lang.IllegalArgumentException;
    method public int getUserProvisioningState();
+9 −4
Original line number Diff line number Diff line
@@ -9201,10 +9201,13 @@ public class DevicePolicyManager {
    /**
     * Allows/disallows printing.
     *
     * Called by a device owner or a profile owner.
     * Device owner changes policy for all users. Profile owner can override it if present.
     * Printing is enabled by default. If {@code FEATURE_PRINTING} is absent, the call is ignored.
     *
     * @param admin which {@link DeviceAdminReceiver} this request is associated with.
     * @param enabled whether printing should be allowed or not.
     * @throws SecurityException if {@code admin} is neither device, nor profile owner.
     * @hide
     */
    public void setPrintingEnabled(@NonNull ComponentName admin, boolean enabled) {
        try {
@@ -9215,10 +9218,12 @@ public class DevicePolicyManager {
    }

    /**
     * Returns whether printing is enabled for current user.
     * Returns whether printing is enabled for this user.
     *
     * Always {@code false} if {@code FEATURE_PRINTING} is absent.
     * Otherwise, {@code true} by default.
     *
     * @return {@code true} iff printing is enabled.
     * @hide
     */
    public boolean isPrintingEnabled() {
        try {
@@ -9233,9 +9238,9 @@ public class DevicePolicyManager {
     *
     * Used only by PrintService.
     * @return Localized error message.
     * @throws SecurityException if caller is not system.
     * @hide
     */
    @SystemApi
    public CharSequence getPrintingDisabledReason() {
        try {
            return mService.getPrintingDisabledReason();