Fix android:allowClearUserData.
Now respect this flag for system apps. Change-Id: I496b0051a4998cb41b8c07fd0eb85e253de1eb97
This commit is contained in:
@@ -71,6 +71,7 @@ public class InstalledAppDetails extends Activity
|
|||||||
implements View.OnClickListener, ApplicationsState.Callbacks {
|
implements View.OnClickListener, ApplicationsState.Callbacks {
|
||||||
private static final String TAG="InstalledAppDetails";
|
private static final String TAG="InstalledAppDetails";
|
||||||
static final boolean SUPPORT_DISABLE_APPS = false;
|
static final boolean SUPPORT_DISABLE_APPS = false;
|
||||||
|
private static final boolean localLOGV = false;
|
||||||
|
|
||||||
private PackageManager mPm;
|
private PackageManager mPm;
|
||||||
private ApplicationsState mState;
|
private ApplicationsState mState;
|
||||||
@@ -80,7 +81,7 @@ public class InstalledAppDetails extends Activity
|
|||||||
private boolean mMoveInProgress = false;
|
private boolean mMoveInProgress = false;
|
||||||
private boolean mUpdatedSysApp = false;
|
private boolean mUpdatedSysApp = false;
|
||||||
private Button mActivitiesButton;
|
private Button mActivitiesButton;
|
||||||
private boolean localLOGV = false;
|
private boolean mCanClearData = true;
|
||||||
private TextView mAppVersion;
|
private TextView mAppVersion;
|
||||||
private TextView mTotalSize;
|
private TextView mTotalSize;
|
||||||
private TextView mAppSize;
|
private TextView mAppSize;
|
||||||
@@ -182,6 +183,13 @@ public class InstalledAppDetails extends Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initDataButtons() {
|
private void initDataButtons() {
|
||||||
|
if ((mAppEntry.info.flags&(ApplicationInfo.FLAG_SYSTEM
|
||||||
|
| ApplicationInfo.FLAG_ALLOW_CLEAR_USER_DATA))
|
||||||
|
== ApplicationInfo.FLAG_SYSTEM) {
|
||||||
|
mClearDataButton.setText(R.string.clear_user_data_text);
|
||||||
|
mClearDataButton.setEnabled(false);
|
||||||
|
mCanClearData = false;
|
||||||
|
} else {
|
||||||
if (mAppEntry.info.manageSpaceActivityName != null) {
|
if (mAppEntry.info.manageSpaceActivityName != null) {
|
||||||
mClearDataButton.setText(R.string.manage_space_text);
|
mClearDataButton.setText(R.string.manage_space_text);
|
||||||
} else {
|
} else {
|
||||||
@@ -189,6 +197,7 @@ public class InstalledAppDetails extends Activity
|
|||||||
}
|
}
|
||||||
mClearDataButton.setOnClickListener(this);
|
mClearDataButton.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private CharSequence getMoveErrMsg(int errCode) {
|
private CharSequence getMoveErrMsg(int errCode) {
|
||||||
switch (errCode) {
|
switch (errCode) {
|
||||||
@@ -505,7 +514,7 @@ public class InstalledAppDetails extends Activity
|
|||||||
mTotalSize.setText(getSizeStr(mAppEntry.size));
|
mTotalSize.setText(getSizeStr(mAppEntry.size));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAppEntry.dataSize <= 0) {
|
if (mAppEntry.dataSize <= 0 || !mCanClearData) {
|
||||||
mClearDataButton.setEnabled(false);
|
mClearDataButton.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
mClearDataButton.setEnabled(true);
|
mClearDataButton.setEnabled(true);
|
||||||
|
Reference in New Issue
Block a user