Only allow admin users to adopt sd card as internal storage.
Bug: 21883016 Change-Id: I11ca324ab74ce2a8bf13064b4c7735aea132c562
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings.deviceinfo;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserManager;
|
||||
import android.os.storage.DiskInfo;
|
||||
import android.os.storage.VolumeInfo;
|
||||
import android.widget.CompoundButton;
|
||||
@@ -30,6 +31,8 @@ public class StorageWizardInit extends StorageWizardBase {
|
||||
private RadioButton mRadioExternal;
|
||||
private RadioButton mRadioInternal;
|
||||
|
||||
private boolean mIsPermittedToAdopt;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -39,6 +42,8 @@ public class StorageWizardInit extends StorageWizardBase {
|
||||
}
|
||||
setContentView(R.layout.storage_wizard_init);
|
||||
|
||||
mIsPermittedToAdopt = UserManager.get(this).isAdminUser();
|
||||
|
||||
setIllustrationInternal(true);
|
||||
setHeaderText(R.string.storage_wizard_init_title, mDisk.getDescription());
|
||||
|
||||
@@ -63,6 +68,12 @@ public class StorageWizardInit extends StorageWizardBase {
|
||||
onNavigateNext();
|
||||
finish();
|
||||
}
|
||||
|
||||
// TODO: Show a message about why this is disabled for guest and that only an admin user
|
||||
// can adopt an sd card.
|
||||
if (!mIsPermittedToAdopt) {
|
||||
mRadioInternal.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
private final OnCheckedChangeListener mRadioListener = new OnCheckedChangeListener() {
|
||||
|
Reference in New Issue
Block a user