Merge "Rename get/setBlockUninstall() to get/setUninstallBlocked()" into lmp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
20303426ac
@@ -5412,7 +5412,6 @@ package android.app.admin {
|
||||
method public java.lang.String[] getAccountTypesWithManagementDisabled();
|
||||
method public java.util.List<android.content.ComponentName> getActiveAdmins();
|
||||
method public android.os.Bundle getApplicationRestrictions(android.content.ComponentName, java.lang.String);
|
||||
method public boolean getBlockUninstall(android.content.ComponentName, java.lang.String);
|
||||
method public boolean getCameraDisabled(android.content.ComponentName);
|
||||
method public boolean getCrossProfileCallerIdDisabled(android.content.ComponentName);
|
||||
method public java.util.List<java.lang.String> getCrossProfileWidgetProviders(android.content.ComponentName);
|
||||
@@ -5439,6 +5438,7 @@ package android.app.admin {
|
||||
method public boolean getStorageEncryption(android.content.ComponentName);
|
||||
method public int getStorageEncryptionStatus();
|
||||
method public java.util.List<java.lang.String> getTrustAgentFeaturesEnabled(android.content.ComponentName, android.content.ComponentName);
|
||||
method public boolean getUninstallBlocked(android.content.ComponentName, java.lang.String);
|
||||
method public boolean hasCaCertInstalled(byte[]);
|
||||
method public boolean hasGrantedPolicy(android.content.ComponentName, int);
|
||||
method public boolean installCaCert(android.content.ComponentName, byte[]);
|
||||
@@ -5457,7 +5457,6 @@ package android.app.admin {
|
||||
method public void setAccountManagementDisabled(android.content.ComponentName, java.lang.String, boolean);
|
||||
method public boolean setApplicationHidden(android.content.ComponentName, java.lang.String, boolean);
|
||||
method public void setApplicationRestrictions(android.content.ComponentName, java.lang.String, android.os.Bundle);
|
||||
method public void setBlockUninstall(android.content.ComponentName, java.lang.String, boolean);
|
||||
method public void setCameraDisabled(android.content.ComponentName, boolean);
|
||||
method public void setCrossProfileCallerIdDisabled(android.content.ComponentName, boolean);
|
||||
method public void setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String);
|
||||
@@ -5486,6 +5485,7 @@ package android.app.admin {
|
||||
method public void setSecureSetting(android.content.ComponentName, java.lang.String, java.lang.String);
|
||||
method public int setStorageEncryption(android.content.ComponentName, boolean);
|
||||
method public void setTrustAgentFeaturesEnabled(android.content.ComponentName, android.content.ComponentName, java.util.List<java.lang.String>);
|
||||
method public void setUninstallBlocked(android.content.ComponentName, java.lang.String, boolean);
|
||||
method public boolean switchUser(android.content.ComponentName, android.os.UserHandle);
|
||||
method public void uninstallAllUserCaCerts(android.content.ComponentName);
|
||||
method public void uninstallCaCert(android.content.ComponentName, byte[]);
|
||||
|
||||
@@ -3243,12 +3243,13 @@ public class DevicePolicyManager {
|
||||
*
|
||||
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
|
||||
* @param packageName package to change.
|
||||
* @param blockUninstall true if the user shouldn't be able to uninstall the package.
|
||||
* @param uninstallBlocked true if the user shouldn't be able to uninstall the package.
|
||||
*/
|
||||
public void setBlockUninstall(ComponentName admin, String packageName, boolean blockUninstall) {
|
||||
public void setUninstallBlocked(ComponentName admin, String packageName,
|
||||
boolean uninstallBlocked) {
|
||||
if (mService != null) {
|
||||
try {
|
||||
mService.setBlockUninstall(admin, packageName, blockUninstall);
|
||||
mService.setUninstallBlocked(admin, packageName, uninstallBlocked);
|
||||
} catch (RemoteException re) {
|
||||
Log.w(TAG, "Failed to call block uninstall on device policy service");
|
||||
}
|
||||
@@ -3263,10 +3264,10 @@ public class DevicePolicyManager {
|
||||
* @param packageName package to check.
|
||||
* @return true if the user shouldn't be able to uninstall the package.
|
||||
*/
|
||||
public boolean getBlockUninstall(ComponentName admin, String packageName) {
|
||||
public boolean getUninstallBlocked(ComponentName admin, String packageName) {
|
||||
if (mService != null) {
|
||||
try {
|
||||
return mService.getBlockUninstall(admin, packageName);
|
||||
return mService.getUninstallBlocked(admin, packageName);
|
||||
} catch (RemoteException re) {
|
||||
Log.w(TAG, "Failed to call block uninstall on device policy service");
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ interface IDevicePolicyManager {
|
||||
|
||||
void notifyLockTaskModeChanged(boolean isEnabled, String pkg, int userId);
|
||||
|
||||
void setBlockUninstall(in ComponentName admin, in String packageName, boolean blockUninstall);
|
||||
boolean getBlockUninstall(in ComponentName admin, in String packageName);
|
||||
void setUninstallBlocked(in ComponentName admin, in String packageName, boolean uninstallBlocked);
|
||||
boolean getUninstallBlocked(in ComponentName admin, in String packageName);
|
||||
|
||||
void setCrossProfileCallerIdDisabled(in ComponentName who, boolean disabled);
|
||||
boolean getCrossProfileCallerIdDisabled(in ComponentName who);
|
||||
|
||||
@@ -4769,7 +4769,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockUninstall(ComponentName who, String packageName, boolean blockUninstall) {
|
||||
public void setUninstallBlocked(ComponentName who, String packageName,
|
||||
boolean uninstallBlocked) {
|
||||
final int userId = UserHandle.getCallingUserId();
|
||||
|
||||
synchronized (this) {
|
||||
@@ -4781,7 +4782,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
long id = Binder.clearCallingIdentity();
|
||||
try {
|
||||
IPackageManager pm = AppGlobals.getPackageManager();
|
||||
pm.setBlockUninstallForUser(packageName, blockUninstall, userId);
|
||||
pm.setBlockUninstallForUser(packageName, uninstallBlocked, userId);
|
||||
} catch (RemoteException re) {
|
||||
// Shouldn't happen.
|
||||
Slog.e(LOG_TAG, "Failed to setBlockUninstallForUser", re);
|
||||
@@ -4792,7 +4793,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBlockUninstall(ComponentName who, String packageName) {
|
||||
public boolean getUninstallBlocked(ComponentName who, String packageName) {
|
||||
final int userId = UserHandle.getCallingUserId();
|
||||
|
||||
synchronized (this) {
|
||||
|
||||
Reference in New Issue
Block a user