Methods Summary |
---|
void | addDisabledComponent(java.lang.String componentClassName, int userId)
modifyUserStateComponents(userId, true, false).disabledComponents.add(componentClassName);
|
void | addEnabledComponent(java.lang.String componentClassName, int userId)
modifyUserStateComponents(userId, false, true).enabledComponents.add(componentClassName);
|
public void | copyFrom(com.android.server.pm.PackageSettingBase base)Make a shallow copy of this package settings.
grantedPermissions = base.grantedPermissions;
gids = base.gids;
primaryCpuAbiString = base.primaryCpuAbiString;
secondaryCpuAbiString = base.secondaryCpuAbiString;
cpuAbiOverrideString = base.cpuAbiOverrideString;
timeStamp = base.timeStamp;
firstInstallTime = base.firstInstallTime;
lastUpdateTime = base.lastUpdateTime;
signatures = base.signatures;
permissionsFixed = base.permissionsFixed;
haveGids = base.haveGids;
userState.clear();
for (int i=0; i<base.userState.size(); i++) {
userState.put(base.userState.keyAt(i), base.userState.valueAt(i));
}
installStatus = base.installStatus;
keySetData = base.keySetData;
|
boolean | disableComponentLPw(java.lang.String componentClassName, int userId)
PackageUserState state = modifyUserStateComponents(userId, true, false);
boolean changed = state.enabledComponents != null
? state.enabledComponents.remove(componentClassName) : false;
changed |= state.disabledComponents.add(componentClassName);
return changed;
|
boolean | enableComponentLPw(java.lang.String componentClassName, int userId)
PackageUserState state = modifyUserStateComponents(userId, false, true);
boolean changed = state.disabledComponents != null
? state.disabledComponents.remove(componentClassName) : false;
changed |= state.enabledComponents.add(componentClassName);
return changed;
|
boolean | getBlockUninstall(int userId)
return readUserState(userId).blockUninstall;
|
int | getCurrentEnabledStateLPr(java.lang.String componentName, int userId)
PackageUserState state = readUserState(userId);
if (state.enabledComponents != null && state.enabledComponents.contains(componentName)) {
return COMPONENT_ENABLED_STATE_ENABLED;
} else if (state.disabledComponents != null
&& state.disabledComponents.contains(componentName)) {
return COMPONENT_ENABLED_STATE_DISABLED;
} else {
return COMPONENT_ENABLED_STATE_DEFAULT;
}
|
android.util.ArraySet | getDisabledComponents(int userId)
return readUserState(userId).disabledComponents;
|
int | getEnabled(int userId)
return readUserState(userId).enabled;
|
android.util.ArraySet | getEnabledComponents(int userId)
return readUserState(userId).enabledComponents;
|
boolean | getHidden(int userId)
return readUserState(userId).hidden;
|
public int | getInstallStatus()
return installStatus;
|
boolean | getInstalled(int userId)
return readUserState(userId).installed;
|
java.lang.String | getInstallerPackageName()
return installerPackageName;
|
java.lang.String | getLastDisabledAppCaller(int userId)
return readUserState(userId).lastDisableAppCaller;
|
boolean | getNotLaunched(int userId)
return readUserState(userId).notLaunched;
|
boolean | getStopped(int userId)
return readUserState(userId).stopped;
|
void | init(java.io.File codePath, java.io.File resourcePath, java.lang.String legacyNativeLibraryPathString, java.lang.String primaryCpuAbiString, java.lang.String secondaryCpuAbiString, java.lang.String cpuAbiOverrideString, int pVersionCode)
this.codePath = codePath;
this.codePathString = codePath.toString();
this.resourcePath = resourcePath;
this.resourcePathString = resourcePath.toString();
this.legacyNativeLibraryPathString = legacyNativeLibraryPathString;
this.primaryCpuAbiString = primaryCpuAbiString;
this.secondaryCpuAbiString = secondaryCpuAbiString;
this.cpuAbiOverrideString = cpuAbiOverrideString;
this.versionCode = pVersionCode;
|
boolean | isAnyInstalled(int[] users)
for (int user: users) {
if (readUserState(user).installed) {
return true;
}
}
return false;
|
private android.content.pm.PackageUserState | modifyUserState(int userId)
PackageUserState state = userState.get(userId);
if (state == null) {
state = new PackageUserState();
userState.put(userId, state);
}
return state;
|
android.content.pm.PackageUserState | modifyUserStateComponents(int userId, boolean disabled, boolean enabled)
PackageUserState state = modifyUserState(userId);
if (disabled && state.disabledComponents == null) {
state.disabledComponents = new ArraySet<String>(1);
}
if (enabled && state.enabledComponents == null) {
state.enabledComponents = new ArraySet<String>(1);
}
return state;
|
int[] | queryInstalledUsers(int[] users, boolean installed)
int num = 0;
for (int user : users) {
if (getInstalled(user) == installed) {
num++;
}
}
int[] res = new int[num];
num = 0;
for (int user : users) {
if (getInstalled(user) == installed) {
res[num] = user;
num++;
}
}
return res;
|
public android.content.pm.PackageUserState | readUserState(int userId)
PackageUserState state = userState.get(userId);
if (state != null) {
return state;
}
return DEFAULT_USER_STATE;
|
void | removeUser(int userId)
userState.delete(userId);
|
boolean | restoreComponentLPw(java.lang.String componentClassName, int userId)
PackageUserState state = modifyUserStateComponents(userId, true, true);
boolean changed = state.disabledComponents != null
? state.disabledComponents.remove(componentClassName) : false;
changed |= state.enabledComponents != null
? state.enabledComponents.remove(componentClassName) : false;
return changed;
|
void | setBlockUninstall(boolean blockUninstall, int userId)
modifyUserState(userId).blockUninstall = blockUninstall;
|
void | setDisabledComponents(android.util.ArraySet components, int userId)
modifyUserState(userId).disabledComponents = components;
|
void | setDisabledComponentsCopy(android.util.ArraySet components, int userId)
modifyUserState(userId).disabledComponents = components != null
? new ArraySet<String>(components) : null;
|
void | setEnabled(int state, int userId, java.lang.String callingPackage)
PackageUserState st = modifyUserState(userId);
st.enabled = state;
st.lastDisableAppCaller = callingPackage;
|
void | setEnabledComponents(android.util.ArraySet components, int userId)
modifyUserState(userId).enabledComponents = components;
|
void | setEnabledComponentsCopy(android.util.ArraySet components, int userId)
modifyUserState(userId).enabledComponents = components != null
? new ArraySet<String>(components) : null;
|
void | setHidden(boolean hidden, int userId)
modifyUserState(userId).hidden = hidden;
|
public void | setInstallStatus(int newStatus)
installStatus = newStatus;
|
void | setInstalled(boolean inst, int userId)
modifyUserState(userId).installed = inst;
|
public void | setInstallerPackageName(java.lang.String packageName)
installerPackageName = packageName;
|
void | setNotLaunched(boolean stop, int userId)
modifyUserState(userId).notLaunched = stop;
|
void | setStopped(boolean stop, int userId)
modifyUserState(userId).stopped = stop;
|
public void | setTimeStamp(long newStamp)
timeStamp = newStamp;
|
void | setUserState(int userId, int enabled, boolean installed, boolean stopped, boolean notLaunched, boolean hidden, java.lang.String lastDisableAppCaller, android.util.ArraySet enabledComponents, android.util.ArraySet disabledComponents, boolean blockUninstall)
PackageUserState state = modifyUserState(userId);
state.enabled = enabled;
state.installed = installed;
state.stopped = stopped;
state.notLaunched = notLaunched;
state.hidden = hidden;
state.lastDisableAppCaller = lastDisableAppCaller;
state.enabledComponents = enabledComponents;
state.disabledComponents = disabledComponents;
state.blockUninstall = blockUninstall;
|