Merge "Make printing policy a restriction."
This commit is contained in:
committed by
Android (Google) Code Review
commit
999ea9fb7e
@@ -9403,41 +9403,6 @@ 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.
|
||||
*/
|
||||
public void setPrintingEnabled(@NonNull ComponentName admin, boolean enabled) {
|
||||
try {
|
||||
mService.setPrintingEnabled(admin, enabled);
|
||||
} catch (RemoteException re) {
|
||||
throw re.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public boolean isPrintingEnabled() {
|
||||
try {
|
||||
return mService.isPrintingEnabled();
|
||||
} catch (RemoteException re) {
|
||||
throw re.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by device owner to add an override APN.
|
||||
*
|
||||
|
||||
@@ -402,9 +402,6 @@ interface IDevicePolicyManager {
|
||||
CharSequence getStartUserSessionMessage(in ComponentName admin);
|
||||
CharSequence getEndUserSessionMessage(in ComponentName admin);
|
||||
|
||||
void setPrintingEnabled(in ComponentName admin, boolean enabled);
|
||||
boolean isPrintingEnabled();
|
||||
|
||||
List<String> setMeteredDataDisabled(in ComponentName admin, in List<String> packageNames);
|
||||
List<String> getMeteredDataDisabled(in ComponentName admin);
|
||||
|
||||
|
||||
@@ -943,6 +943,20 @@ public class UserManager {
|
||||
* @see #getUserRestrictions()
|
||||
*/
|
||||
public static final String DISALLOW_SHARE_INTO_MANAGED_PROFILE = "no_sharing_into_profile";
|
||||
|
||||
/**
|
||||
* Specifies whether the user is allowed to print.
|
||||
*
|
||||
* This restriction can be set by device or profile owner.
|
||||
*
|
||||
* The default value is {@code false}.
|
||||
*
|
||||
* @see DevicePolicyManager#addUserRestriction(ComponentName, String)
|
||||
* @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
|
||||
* @see #getUserRestrictions()
|
||||
*/
|
||||
public static final String DISALLOW_PRINTING = "no_printing";
|
||||
|
||||
/**
|
||||
* Application restriction key that is used to indicate the pending arrival
|
||||
* of real restrictions for the app.
|
||||
|
||||
Reference in New Issue
Block a user