Rename setApplicationBlocked to setApplicationHidden
This corrects the expected behavior of the app state. Hidden apps
can be installed by the store to be brought out of hidden state.
Bug: 16191518
Change-Id: Id128ce971ceee99ba1dea14ba07ce03bd8d77335
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 5f2262b..efeded5 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -2523,20 +2523,20 @@
}
/**
- * Called by device or profile owner to block or unblock packages. When a package is blocked it
+ * Called by device or profile owner to hide or unhide packages. When a package is hidden it
* is unavailable for use, but the data and actual package file remain.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
- * @param packageName The name of the package to block or unblock.
- * @param blocked {@code true} if the package should be blocked, {@code false} if it should be
- * unblocked.
- * @return boolean Whether the blocked setting of the package was successfully updated.
+ * @param packageName The name of the package to hide or unhide.
+ * @param hidden {@code true} if the package should be hidden, {@code false} if it should be
+ * unhidden.
+ * @return boolean Whether the hidden setting of the package was successfully updated.
*/
- public boolean setApplicationBlocked(ComponentName admin, String packageName,
- boolean blocked) {
+ public boolean setApplicationHidden(ComponentName admin, String packageName,
+ boolean hidden) {
if (mService != null) {
try {
- return mService.setApplicationBlocked(admin, packageName, blocked);
+ return mService.setApplicationHidden(admin, packageName, hidden);
} catch (RemoteException e) {
Log.w(TAG, "Failed talking with device policy service", e);
}
@@ -2545,20 +2545,20 @@
}
/**
- * Called by profile or device owner to block or unblock currently installed packages. This
+ * Called by profile or device owner to hide or unhide currently installed packages. This
* should only be called by a profile or device owner running within a managed profile.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param intent An intent matching the app(s) to be updated. All apps that resolve for this
* intent will be updated in the current profile.
- * @param blocked {@code true} if the packages should be blocked, {@code false} if they should
- * be unblocked.
+ * @param hidden {@code true} if the packages should be hidden, {@code false} if they should
+ * be unhidden.
* @return int The number of activities that matched the intent and were updated.
*/
- public int setApplicationsBlocked(ComponentName admin, Intent intent, boolean blocked) {
+ public int setApplicationsHidden(ComponentName admin, Intent intent, boolean hidden) {
if (mService != null) {
try {
- return mService.setApplicationsBlocked(admin, intent, blocked);
+ return mService.setApplicationsHidden(admin, intent, hidden);
} catch (RemoteException e) {
Log.w(TAG, "Failed talking with device policy service", e);
}
@@ -2567,16 +2567,16 @@
}
/**
- * Called by device or profile owner to determine if a package is blocked.
+ * Called by device or profile owner to determine if a package is hidden.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
- * @param packageName The name of the package to retrieve the blocked status of.
- * @return boolean {@code true} if the package is blocked, {@code false} otherwise.
+ * @param packageName The name of the package to retrieve the hidden status of.
+ * @return boolean {@code true} if the package is hidden, {@code false} otherwise.
*/
- public boolean isApplicationBlocked(ComponentName admin, String packageName) {
+ public boolean isApplicationHidden(ComponentName admin, String packageName) {
if (mService != null) {
try {
- return mService.isApplicationBlocked(admin, packageName);
+ return mService.isApplicationHidden(admin, packageName);
} catch (RemoteException e) {
Log.w(TAG, "Failed talking with device policy service", e);
}