use of com.android.server.pm.UserManagerService in project platform_frameworks_base by android.
the class UserController method getUserManager.
private UserManagerService getUserManager() {
UserManagerService userManager = mUserManager;
if (userManager == null) {
IBinder b = ServiceManager.getService(Context.USER_SERVICE);
userManager = mUserManager = (UserManagerService) IUserManager.Stub.asInterface(b);
}
return userManager;
}
use of com.android.server.pm.UserManagerService in project android_frameworks_base by ParanoidAndroid.
the class MountService method readStorageListLocked.
private void readStorageListLocked() {
mVolumes.clear();
mVolumeStates.clear();
Resources resources = mContext.getResources();
int id = com.android.internal.R.xml.storage_list;
XmlResourceParser parser = resources.getXml(id);
AttributeSet attrs = Xml.asAttributeSet(parser);
try {
XmlUtils.beginDocument(parser, TAG_STORAGE_LIST);
while (true) {
XmlUtils.nextElement(parser);
String element = parser.getName();
if (element == null)
break;
if (TAG_STORAGE.equals(element)) {
TypedArray a = resources.obtainAttributes(attrs, com.android.internal.R.styleable.Storage);
String path = a.getString(com.android.internal.R.styleable.Storage_mountPoint);
int descriptionId = a.getResourceId(com.android.internal.R.styleable.Storage_storageDescription, -1);
CharSequence description = a.getText(com.android.internal.R.styleable.Storage_storageDescription);
boolean primary = a.getBoolean(com.android.internal.R.styleable.Storage_primary, false);
boolean removable = a.getBoolean(com.android.internal.R.styleable.Storage_removable, false);
boolean emulated = a.getBoolean(com.android.internal.R.styleable.Storage_emulated, false);
int mtpReserve = a.getInt(com.android.internal.R.styleable.Storage_mtpReserve, 0);
boolean allowMassStorage = a.getBoolean(com.android.internal.R.styleable.Storage_allowMassStorage, false);
// resource parser does not support longs, so XML value is in megabytes
long maxFileSize = a.getInt(com.android.internal.R.styleable.Storage_maxFileSize, 0) * 1024L * 1024L;
Slog.d(TAG, "got storage path: " + path + " description: " + description + " primary: " + primary + " removable: " + removable + " emulated: " + emulated + " mtpReserve: " + mtpReserve + " allowMassStorage: " + allowMassStorage + " maxFileSize: " + maxFileSize);
if (emulated) {
// For devices with emulated storage, we create separate
// volumes for each known user.
mEmulatedTemplate = new StorageVolume(null, descriptionId, true, false, true, mtpReserve, false, maxFileSize, null);
final UserManagerService userManager = UserManagerService.getInstance();
for (UserInfo user : userManager.getUsers(false)) {
createEmulatedVolumeForUserLocked(user.getUserHandle());
}
} else {
if (path == null || description == null) {
Slog.e(TAG, "Missing storage path or description in readStorageList");
} else {
final StorageVolume volume = new StorageVolume(new File(path), descriptionId, primary, removable, emulated, mtpReserve, allowMassStorage, maxFileSize, null);
addVolumeLocked(volume);
}
}
a.recycle();
}
}
} catch (XmlPullParserException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
// Compute storage ID for each physical volume; emulated storage is
// always 0 when defined.
int index = isExternalStorageEmulated() ? 1 : 0;
for (StorageVolume volume : mVolumes) {
if (!volume.isEmulated()) {
volume.setStorageId(index++);
}
}
parser.close();
}
}
use of com.android.server.pm.UserManagerService in project android_frameworks_base by AOSPA.
the class UserController method getUserManager.
private UserManagerService getUserManager() {
UserManagerService userManager = mUserManager;
if (userManager == null) {
IBinder b = ServiceManager.getService(Context.USER_SERVICE);
userManager = mUserManager = (UserManagerService) IUserManager.Stub.asInterface(b);
}
return userManager;
}
use of com.android.server.pm.UserManagerService in project android_frameworks_base by DirtyUnicorns.
the class UserController method getUserManager.
private UserManagerService getUserManager() {
UserManagerService userManager = mUserManager;
if (userManager == null) {
IBinder b = ServiceManager.getService(Context.USER_SERVICE);
userManager = mUserManager = (UserManagerService) IUserManager.Stub.asInterface(b);
}
return userManager;
}
use of com.android.server.pm.UserManagerService in project android_frameworks_base by ResurrectionRemix.
the class UserController method getUserManager.
private UserManagerService getUserManager() {
UserManagerService userManager = mUserManager;
if (userManager == null) {
IBinder b = ServiceManager.getService(Context.USER_SERVICE);
userManager = mUserManager = (UserManagerService) IUserManager.Stub.asInterface(b);
}
return userManager;
}
Aggregations