summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/InputMethodManagerService.java1
-rw-r--r--services/core/java/com/android/server/LockSettingsService.java39
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java13
-rw-r--r--services/core/java/com/android/server/display/VirtualDisplayAdapter.java16
-rw-r--r--services/core/java/com/android/server/notification/ManagedServices.java4
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java133
-rw-r--r--services/core/java/com/android/server/notification/ZenModeHelper.java38
-rw-r--r--services/core/java/com/android/server/pm/UserManagerService.java12
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java2
9 files changed, 135 insertions, 123 deletions
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index 9511f54..e856a93 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -1695,6 +1695,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
vis = 0;
}
mImeWindowVis = vis;
+ mInputShown = ((mImeWindowVis & InputMethodService.IME_VISIBLE) != 0);
mBackDisposition = backDisposition;
final boolean iconVisibility = ((vis & (InputMethodService.IME_ACTIVE)) != 0)
&& (mWindowManagerService.isHardKeyboardAvailable()
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index 5df74c5..ed2de4a 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -356,28 +356,23 @@ public class LockSettingsService extends ILockSettings.Stub {
return mStorage.hasPattern(userId);
}
- private void maybeUpdateKeystore(String password, int userHandle) {
+ private void setKeystorePassword(String password, int userHandle) {
final UserManager um = (UserManager) mContext.getSystemService(USER_SERVICE);
final KeyStore ks = KeyStore.getInstance();
final List<UserInfo> profiles = um.getProfiles(userHandle);
- boolean shouldReset = TextUtils.isEmpty(password);
-
- // For historical reasons, don't wipe a non-empty keystore if we have a single user with a
- // single profile.
- if (userHandle == UserHandle.USER_OWNER && profiles.size() == 1) {
- if (!ks.isEmpty()) {
- shouldReset = false;
- }
+ for (UserInfo pi : profiles) {
+ ks.onUserPasswordChanged(pi.id, password);
}
+ }
+
+ private void unlockKeystore(String password, int userHandle) {
+ final UserManager um = (UserManager) mContext.getSystemService(USER_SERVICE);
+ final KeyStore ks = KeyStore.getInstance();
+ final List<UserInfo> profiles = um.getProfiles(userHandle);
for (UserInfo pi : profiles) {
- final int profileUid = UserHandle.getUid(pi.id, Process.SYSTEM_UID);
- if (shouldReset) {
- ks.resetUid(profileUid);
- } else {
- ks.passwordUid(password, profileUid);
- }
+ ks.unlock(pi.id, password);
}
}
@@ -423,7 +418,7 @@ public class LockSettingsService extends ILockSettings.Stub {
if (pattern == null) {
getGateKeeperService().clearSecureUserId(userId);
mStorage.writePatternHash(null, userId);
- maybeUpdateKeystore(null, userId);
+ setKeystorePassword(null, userId);
return;
}
@@ -451,7 +446,7 @@ public class LockSettingsService extends ILockSettings.Stub {
if (password == null) {
getGateKeeperService().clearSecureUserId(userId);
mStorage.writePasswordHash(null, userId);
- maybeUpdateKeystore(null, userId);
+ setKeystorePassword(null, userId);
return;
}
@@ -484,7 +479,7 @@ public class LockSettingsService extends ILockSettings.Stub {
toEnrollBytes);
if (hash != null) {
- maybeUpdateKeystore(toEnroll, userId);
+ setKeystorePassword(toEnroll, userId);
}
return hash;
@@ -530,7 +525,7 @@ public class LockSettingsService extends ILockSettings.Stub {
byte[] hash = mLockPatternUtils.patternToHash(
mLockPatternUtils.stringToPattern(pattern));
if (Arrays.equals(hash, storedHash.hash)) {
- maybeUpdateKeystore(pattern, userId);
+ unlockKeystore(pattern, userId);
// migrate password to GateKeeper
setLockPattern(pattern, null, userId);
if (!hasChallenge) {
@@ -556,7 +551,7 @@ public class LockSettingsService extends ILockSettings.Stub {
}
// pattern has matched
- maybeUpdateKeystore(pattern, userId);
+ unlockKeystore(pattern, userId);
return token;
}
@@ -599,7 +594,7 @@ public class LockSettingsService extends ILockSettings.Stub {
if (storedHash.version == CredentialHash.VERSION_LEGACY) {
byte[] hash = mLockPatternUtils.passwordToHash(password, userId);
if (Arrays.equals(hash, storedHash.hash)) {
- maybeUpdateKeystore(password, userId);
+ unlockKeystore(password, userId);
// migrate password to GateKeeper
setLockPassword(password, null, userId);
if (!hasChallenge) {
@@ -625,7 +620,7 @@ public class LockSettingsService extends ILockSettings.Stub {
}
// password has matched
- maybeUpdateKeystore(password, userId);
+ unlockKeystore(password, userId);
return token;
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 82dbfee..d1df7e2 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -14121,6 +14121,7 @@ public final class ActivityManagerService extends ActivityManagerNative
boolean dumpDetails = false;
boolean dumpFullDetails = false;
boolean dumpDalvik = false;
+ boolean dumpSummaryOnly = false;
boolean oomOnly = false;
boolean isCompact = false;
boolean localOnly = false;
@@ -14141,6 +14142,9 @@ public final class ActivityManagerService extends ActivityManagerNative
dumpDalvik = true;
} else if ("-c".equals(opt)) {
isCompact = true;
+ } else if ("-s".equals(opt)) {
+ dumpDetails = true;
+ dumpSummaryOnly = true;
} else if ("--oom".equals(opt)) {
oomOnly = true;
} else if ("--local".equals(opt)) {
@@ -14148,10 +14152,11 @@ public final class ActivityManagerService extends ActivityManagerNative
} else if ("--package".equals(opt)) {
packages = true;
} else if ("-h".equals(opt)) {
- pw.println("meminfo dump options: [-a] [-d] [-c] [--oom] [process]");
+ pw.println("meminfo dump options: [-a] [-d] [-c] [-s] [--oom] [process]");
pw.println(" -a: include all available information for each process.");
pw.println(" -d: include dalvik details.");
pw.println(" -c: dump in a compact machine-parseable representation.");
+ pw.println(" -s: dump only summary of application memory usage.");
pw.println(" --oom: only show processes organized by oom adj.");
pw.println(" --local: only collect details locally, don't call process.");
pw.println(" --package: interpret process arg as package, dumping all");
@@ -14212,7 +14217,7 @@ public final class ActivityManagerService extends ActivityManagerNative
mi.dalvikPrivateDirty = (int)tmpLong[0];
}
ActivityThread.dumpMemInfoTable(pw, mi, isCheckinRequest, dumpFullDetails,
- dumpDalvik, pid, r.baseName, 0, 0, 0, 0, 0, 0);
+ dumpDalvik, dumpSummaryOnly, pid, r.baseName, 0, 0, 0, 0, 0, 0);
if (isCheckinRequest) {
pw.println();
}
@@ -14278,7 +14283,7 @@ public final class ActivityManagerService extends ActivityManagerNative
if (dumpDetails) {
if (localOnly) {
ActivityThread.dumpMemInfoTable(pw, mi, isCheckinRequest, dumpFullDetails,
- dumpDalvik, pid, r.processName, 0, 0, 0, 0, 0, 0);
+ dumpDalvik, dumpSummaryOnly, pid, r.processName, 0, 0, 0, 0, 0, 0);
if (isCheckinRequest) {
pw.println();
}
@@ -14286,7 +14291,7 @@ public final class ActivityManagerService extends ActivityManagerNative
try {
pw.flush();
thread.dumpMemInfo(fd, mi, isCheckinRequest, dumpFullDetails,
- dumpDalvik, innerArgs);
+ dumpDalvik, dumpSummaryOnly, innerArgs);
} catch (RemoteException e) {
if (!isCheckinRequest) {
pw.println("Got RemoteException!");
diff --git a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
index 6f59b54..7f961ae 100644
--- a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
@@ -82,7 +82,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
appToken.linkToDeath(device, 0);
} catch (RemoteException ex) {
mVirtualDisplayDevices.remove(appToken);
- device.destroyLocked();
+ device.destroyLocked(false);
return null;
}
@@ -110,7 +110,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
public DisplayDevice releaseVirtualDisplayLocked(IBinder appToken) {
VirtualDisplayDevice device = mVirtualDisplayDevices.remove(appToken);
if (device != null) {
- device.destroyLocked();
+ device.destroyLocked(true);
appToken.unlinkToDeath(device, 0);
}
@@ -147,7 +147,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
if (device != null) {
Slog.i(TAG, "Virtual display device released because application token died: "
+ device.mOwnerPackageName);
- device.destroyLocked();
+ device.destroyLocked(false);
sendDisplayDeviceEventLocked(device, DISPLAY_DEVICE_EVENT_REMOVED);
}
}
@@ -205,19 +205,19 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
@Override
public void binderDied() {
synchronized (getSyncRoot()) {
- if (mSurface != null) {
- handleBinderDiedLocked(mAppToken);
- }
+ handleBinderDiedLocked(mAppToken);
}
}
- public void destroyLocked() {
+ public void destroyLocked(boolean binderAlive) {
if (mSurface != null) {
mSurface.release();
mSurface = null;
}
SurfaceControl.destroyDisplay(getDisplayTokenLocked());
- mCallback.dispatchDisplayStopped();
+ if (binderAlive) {
+ mCallback.dispatchDisplayStopped();
+ }
}
@Override
diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java
index b92c734..6f8e3ca 100644
--- a/services/core/java/com/android/server/notification/ManagedServices.java
+++ b/services/core/java/com/android/server/notification/ManagedServices.java
@@ -189,6 +189,10 @@ abstract public class ManagedServices {
}
}
+ public boolean isComponentEnabledForPackage(String pkg) {
+ return mEnabledServicesPackageNames.contains(pkg);
+ }
+
public void onPackagesChanged(boolean queryReplace, String[] pkgList) {
if (DEBUG) Slog.d(TAG, "onPackagesChanged queryReplace=" + queryReplace
+ " pkgList=" + (pkgList == null ? null : Arrays.asList(pkgList))
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 25998da..791c1de 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -37,7 +37,6 @@ import android.app.NotificationManager.Policy;
import android.app.PendingIntent;
import android.app.StatusBarManager;
import android.app.usage.UsageEvents;
-import android.app.usage.UsageStats;
import android.app.usage.UsageStatsManagerInternal;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -233,7 +232,7 @@ public class NotificationManagerService extends SystemService {
new ArrayMap<String, NotificationRecord>();
final ArrayList<ToastRecord> mToastQueue = new ArrayList<ToastRecord>();
final ArrayMap<String, NotificationRecord> mSummaryByGroupKey = new ArrayMap<>();
- private final ArrayMap<String, Policy.Token> mPolicyTokens = new ArrayMap<>();
+ private final ArrayMap<String, Boolean> mPolicyAccess = new ArrayMap<>();
// The last key in this list owns the hardware.
@@ -899,6 +898,7 @@ public class NotificationManagerService extends SystemService {
@Override
void onZenModeChanged() {
+ sendRegisteredOnlyBroadcast(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED);
synchronized(mNotificationList) {
updateInterruptionFilterLocked();
}
@@ -906,9 +906,12 @@ public class NotificationManagerService extends SystemService {
@Override
void onPolicyChanged() {
- getContext().sendBroadcast(
- new Intent(NotificationManager.ACTION_NOTIFICATION_POLICY_CHANGED)
- .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY));
+ sendRegisteredOnlyBroadcast(NotificationManager.ACTION_NOTIFICATION_POLICY_CHANGED);
+ }
+
+ private void sendRegisteredOnlyBroadcast(String action) {
+ getContext().sendBroadcast(new Intent(action)
+ .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY));
}
});
final File systemDir = new File(Environment.getDataDirectory(), "system");
@@ -1607,6 +1610,19 @@ public class NotificationManagerService extends SystemService {
}
@Override
+ public void setInterruptionFilter(String pkg, int filter) throws RemoteException {
+ enforcePolicyAccess(pkg, "setInterruptionFilter");
+ final int zen = NotificationManager.zenModeFromInterruptionFilter(filter, -1);
+ if (zen == -1) throw new IllegalArgumentException("Invalid filter: " + filter);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ mZenModeHelper.setManualZenMode(zen, null, "setInterruptionFilter");
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ @Override
public void notifyConditions(String pkg, IConditionProvider provider,
Condition[] conditions) {
final ManagedServiceInfo info = mConditionProviders.checkServiceToken(provider);
@@ -1641,16 +1657,19 @@ public class NotificationManagerService extends SystemService {
message);
}
- private void enforcePolicyToken(Policy.Token token, String method) {
- if (!checkPolicyToken(token)) {
- Slog.w(TAG, "Invalid notification policy token calling " + method);
- throw new SecurityException("Invalid notification policy token");
+ private void enforcePolicyAccess(String pkg, String method) {
+ if (!checkPolicyAccess(pkg)) {
+ Slog.w(TAG, "Notification policy access denied calling " + method);
+ throw new SecurityException("Notification policy access denied");
}
}
- private boolean checkPolicyToken(Policy.Token token) {
- return mPolicyTokens.containsValue(token)
- || mListeners.mPolicyTokens.containsValue(token);
+ private boolean checkPackagePolicyAccess(String pkg) {
+ return Boolean.TRUE.equals(mPolicyAccess.get(pkg));
+ }
+
+ private boolean checkPolicyAccess(String pkg) {
+ return checkPackagePolicyAccess(pkg) || mListeners.isComponentEnabledForPackage(pkg);
}
@Override
@@ -1702,52 +1721,76 @@ public class NotificationManagerService extends SystemService {
}
@Override
- public Policy.Token getPolicyTokenFromListener(INotificationListener listener) {
+ public void requestNotificationPolicyAccess(String pkg,
+ INotificationManagerCallback callback) throws RemoteException {
+ if (callback == null) {
+ Slog.w(TAG, "requestNotificationPolicyAccess: no callback specified");
+ return;
+ }
+ if (pkg == null) {
+ Slog.w(TAG, "requestNotificationPolicyAccess denied: no package specified");
+ callback.onPolicyRequestResult(false);
+ return;
+ }
final long identity = Binder.clearCallingIdentity();
try {
- return mListeners.getPolicyToken(listener);
+ synchronized (mNotificationList) {
+ // immediately grant for now
+ mPolicyAccess.put(pkg, true);
+ if (DBG) Slog.w(TAG, "requestNotificationPolicyAccess granted for " + pkg);
+ }
} finally {
Binder.restoreCallingIdentity(identity);
}
+ callback.onPolicyRequestResult(true);
}
@Override
- public void requestNotificationPolicyToken(String pkg,
- INotificationManagerCallback callback) throws RemoteException {
- if (callback == null) {
- Slog.w(TAG, "requestNotificationPolicyToken: no callback specified");
- return;
- }
- if (pkg == null) {
- Slog.w(TAG, "requestNotificationPolicyToken denied: no package specified");
- callback.onPolicyToken(null);
- return;
- }
- Policy.Token token = null;
+ public boolean isNotificationPolicyAccessGranted(String pkg) {
+ return checkPolicyAccess(pkg);
+ }
+
+ @Override
+ public boolean isNotificationPolicyAccessGrantedForPackage(String pkg) {
+ enforceSystemOrSystemUI("request policy access status for another package");
+ return checkPackagePolicyAccess(pkg);
+ }
+
+ @Override
+ public String[] getPackagesRequestingNotificationPolicyAccess()
+ throws RemoteException {
+ enforceSystemOrSystemUI("request policy access packages");
final long identity = Binder.clearCallingIdentity();
try {
synchronized (mNotificationList) {
- token = mPolicyTokens.get(pkg);
- if (token == null) {
- token = new Policy.Token(new Binder());
- mPolicyTokens.put(pkg, token);
+ final String[] rt = new String[mPolicyAccess.size()];
+ for (int i = 0; i < mPolicyAccess.size(); i++) {
+ rt[i] = mPolicyAccess.keyAt(i);
}
- if (DBG) Slog.w(TAG, "requestNotificationPolicyToken granted for " + pkg);
+ return rt;
}
} finally {
Binder.restoreCallingIdentity(identity);
}
- callback.onPolicyToken(token);
}
@Override
- public boolean isNotificationPolicyTokenValid(String pkg, Policy.Token token) {
- return checkPolicyToken(token);
+ public void setNotificationPolicyAccessGranted(String pkg, boolean granted)
+ throws RemoteException {
+ enforceSystemOrSystemUI("grant notification policy access");
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ synchronized (mNotificationList) {
+ mPolicyAccess.put(pkg, granted);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
@Override
- public Policy getNotificationPolicy(Policy.Token token) {
- enforcePolicyToken(token, "getNotificationPolicy");
+ public Policy getNotificationPolicy(String pkg) {
+ enforcePolicyAccess(pkg, "getNotificationPolicy");
final long identity = Binder.clearCallingIdentity();
try {
return mZenModeHelper.getNotificationPolicy();
@@ -1757,8 +1800,8 @@ public class NotificationManagerService extends SystemService {
}
@Override
- public void setNotificationPolicy(Policy.Token token, Policy policy) {
- enforcePolicyToken(token, "setNotificationPolicy");
+ public void setNotificationPolicy(String pkg, Policy policy) {
+ enforcePolicyAccess(pkg, "setNotificationPolicy");
final long identity = Binder.clearCallingIdentity();
try {
mZenModeHelper.setNotificationPolicy(policy);
@@ -1881,11 +1924,9 @@ public class NotificationManagerService extends SystemService {
pw.print(listener.component);
}
pw.println(')');
- pw.print(" mPolicyTokens.keys: ");
- pw.println(TextUtils.join(",", mPolicyTokens.keySet()));
- pw.print(" mListeners.mPolicyTokens.keys: ");
- pw.println(TextUtils.join(",", mListeners.mPolicyTokens.keySet()));
}
+ pw.println("\n Policy access:");
+ pw.print(" mPolicyAccess: "); pw.println(mPolicyAccess);
pw.println("\n Condition providers:");
mConditionProviders.dump(pw, filter);
@@ -3138,18 +3179,12 @@ public class NotificationManagerService extends SystemService {
public class NotificationListeners extends ManagedServices {
private final ArraySet<ManagedServiceInfo> mLightTrimListeners = new ArraySet<>();
- private final ArrayMap<ComponentName, Policy.Token> mPolicyTokens = new ArrayMap<>();
private boolean mNotificationGroupsDesired;
public NotificationListeners() {
super(getContext(), mHandler, mNotificationList, mUserProfiles);
}
- public Policy.Token getPolicyToken(INotificationListener listener) {
- final ManagedServiceInfo info = checkServiceTokenLocked(listener);
- return info == null ? null : mPolicyTokens.get(info.component);
- }
-
@Override
protected Config getConfig() {
Config c = new Config();
@@ -3174,7 +3209,6 @@ public class NotificationManagerService extends SystemService {
synchronized (mNotificationList) {
updateNotificationGroupsDesiredLocked();
update = makeRankingUpdateLocked(info);
- mPolicyTokens.put(info.component, new Policy.Token(new Binder()));
}
try {
listener.onListenerConnected(update);
@@ -3191,7 +3225,6 @@ public class NotificationManagerService extends SystemService {
}
mLightTrimListeners.remove(removed);
updateNotificationGroupsDesiredLocked();
- mPolicyTokens.remove(removed.component);
}
public void setOnNotificationPostedTrimLocked(ManagedServiceInfo info, int trim) {
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index db0c076..aeb6b78 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -22,6 +22,7 @@ import static android.media.AudioAttributes.USAGE_NOTIFICATION;
import static android.media.AudioAttributes.USAGE_NOTIFICATION_RINGTONE;
import android.app.AppOpsManager;
+import android.app.NotificationManager;
import android.app.NotificationManager.Policy;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -144,11 +145,11 @@ public class ZenModeHelper {
}
public int getZenModeListenerInterruptionFilter() {
- return getZenModeListenerInterruptionFilter(mZenMode);
+ return NotificationManager.zenModeToInterruptionFilter(mZenMode);
}
- public void requestFromListener(ComponentName name, int interruptionFilter) {
- final int newZen = zenModeFromListenerInterruptionFilter(interruptionFilter, -1);
+ public void requestFromListener(ComponentName name, int filter) {
+ final int newZen = NotificationManager.zenModeFromInterruptionFilter(filter, -1);
if (newZen != -1) {
setManualZenMode(newZen, null,
"listener:" + (name != null ? name.flattenToShortString() : null));
@@ -395,37 +396,6 @@ public class ZenModeHelper {
}
}
- private static int getZenModeListenerInterruptionFilter(int zen) {
- switch (zen) {
- case Global.ZEN_MODE_OFF:
- return NotificationListenerService.INTERRUPTION_FILTER_ALL;
- case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
- return NotificationListenerService.INTERRUPTION_FILTER_PRIORITY;
- case Global.ZEN_MODE_ALARMS:
- return NotificationListenerService.INTERRUPTION_FILTER_ALARMS;
- case Global.ZEN_MODE_NO_INTERRUPTIONS:
- return NotificationListenerService.INTERRUPTION_FILTER_NONE;
- default:
- return 0;
- }
- }
-
- private static int zenModeFromListenerInterruptionFilter(int listenerInterruptionFilter,
- int defValue) {
- switch (listenerInterruptionFilter) {
- case NotificationListenerService.INTERRUPTION_FILTER_ALL:
- return Global.ZEN_MODE_OFF;
- case NotificationListenerService.INTERRUPTION_FILTER_PRIORITY:
- return Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS;
- case NotificationListenerService.INTERRUPTION_FILTER_ALARMS:
- return Global.ZEN_MODE_ALARMS;
- case NotificationListenerService.INTERRUPTION_FILTER_NONE:
- return Global.ZEN_MODE_NO_INTERRUPTIONS;
- default:
- return defValue;
- }
- }
-
private ZenModeConfig readDefaultConfig(Resources resources) {
XmlResourceParser parser = null;
try {
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index e79a206..e6f5e3d 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -234,6 +234,14 @@ public class UserManagerService extends IUserManager.Stub {
mUserListFile = new File(mUsersDir, USER_LIST_FILENAME);
initDefaultGuestRestrictions();
readUserListLocked();
+ sInstance = this;
+ }
+ }
+ }
+
+ void systemReady() {
+ synchronized (mInstallLock) {
+ synchronized (mPackagesLock) {
// Prune out any partially created/partially removed users.
ArrayList<UserInfo> partials = new ArrayList<UserInfo>();
for (int i = 0; i < mUsers.size(); i++) {
@@ -248,12 +256,8 @@ public class UserManagerService extends IUserManager.Stub {
+ " (name=" + ui.name + ")");
removeUserStateLocked(ui.id);
}
- sInstance = this;
}
}
- }
-
- void systemReady() {
userForeground(UserHandle.USER_OWNER);
mAppOpsService = IAppOpsService.Stub.asInterface(
ServiceManager.getService(Context.APP_OPS_SERVICE));
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 6f01ca0..67c198f 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -2897,7 +2897,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
boolean callerIsDeviceOwnerAdmin = isCallerDeviceOwnerOrInitializer(callingUid);
boolean doNotAskCredentialsOnBoot =
- (flags & DevicePolicyManager.DO_NOT_ASK_CREDENTIALS_ON_BOOT) != 0;
+ (flags & DevicePolicyManager.RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT) != 0;
if (callerIsDeviceOwnerAdmin && doNotAskCredentialsOnBoot) {
setDoNotAskCredentialsOnBoot();
}