Part3 - Don't add padlock if the restriction is not set by admin.

Bug: 26687435
Change-Id: Ibfea6d7d5bd32e7a05dcc2cc32b121c9e50b6a34
This commit is contained in:
Sudheer Shanka
2016-02-11 18:48:14 +00:00
parent 7f2a013619
commit 9e9e63b7b3
21 changed files with 207 additions and 84 deletions

View File

@@ -194,7 +194,7 @@ public class AppStorageSettings extends AppInfoWithHeader
@Override
public void onClick(View v) {
if (v == mClearCacheButton) {
if (mAppsControlDisallowedAdmin != null) {
if (mAppsControlDisallowedAdmin != null && !mAppsControlDisallowedBySystem) {
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
getActivity(), mAppsControlDisallowedAdmin);
return;
@@ -203,7 +203,7 @@ public class AppStorageSettings extends AppInfoWithHeader
}
mPm.deleteApplicationCacheFiles(mPackageName, mClearCacheObserver);
} else if (v == mClearDataButton) {
if (mAppsControlDisallowedAdmin != null) {
if (mAppsControlDisallowedAdmin != null && !mAppsControlDisallowedBySystem) {
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
getActivity(), mAppsControlDisallowedAdmin);
} else if (mAppEntry.info.manageSpaceActivityName != null) {
@@ -219,7 +219,7 @@ public class AppStorageSettings extends AppInfoWithHeader
} else if (v == mChangeStorageButton && mDialogBuilder != null && !isMoveInProgress()) {
mDialogBuilder.show();
} else if (v == mClearUriButton) {
if (mAppsControlDisallowedAdmin != null) {
if (mAppsControlDisallowedAdmin != null && !mAppsControlDisallowedBySystem) {
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
getActivity(), mAppsControlDisallowedAdmin);
} else {
@@ -323,6 +323,10 @@ public class AppStorageSettings extends AppInfoWithHeader
mClearCacheButton.setOnClickListener(this);
}
}
if (mAppsControlDisallowedBySystem) {
mClearCacheButton.setEnabled(false);
mClearDataButton.setEnabled(false);
}
}
@Override
@@ -369,6 +373,10 @@ public class AppStorageSettings extends AppInfoWithHeader
}
mClearDataButton.setOnClickListener(this);
}
if (mAppsControlDisallowedBySystem) {
mClearDataButton.setEnabled(false);
}
}
private void initMoveDialog() {
@@ -488,6 +496,10 @@ public class AppStorageSettings extends AppInfoWithHeader
mUri.addPreference(pref);
}
if (mAppsControlDisallowedBySystem) {
mClearUriButton.setEnabled(false);
}
mClearUri.setOrder(order);
mClearUriButton.setVisibility(View.VISIBLE);