summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/audio/AudioService.java13
-rw-r--r--services/core/java/com/android/server/pm/KeySetManagerService.java24
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java17
3 files changed, 44 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 4b7f698..5d386bd 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -3616,6 +3616,19 @@ public class AudioService extends IAudioService.Stub {
final int index = (mIndexMap.valueAt(i) + 5) / 10;
pw.print(index);
}
+ pw.println();
+ pw.print(" Devices: ");
+ final int devices = AudioSystem.getDevicesForStream(mStreamType);
+ int device, i = 0, n = 0;
+ while ((device = 1 << i) <= AudioSystem.DEVICE_OUT_DEFAULT) {
+ if ((devices & device) != 0) {
+ if (n++ > 0) {
+ pw.print(", ");
+ }
+ pw.print(AudioSystem.getOutputDeviceName(device));
+ }
+ i++;
+ }
}
}
diff --git a/services/core/java/com/android/server/pm/KeySetManagerService.java b/services/core/java/com/android/server/pm/KeySetManagerService.java
index 773b164..aa63932 100644
--- a/services/core/java/com/android/server/pm/KeySetManagerService.java
+++ b/services/core/java/com/android/server/pm/KeySetManagerService.java
@@ -414,9 +414,9 @@ public class KeySetManagerService {
// Get the package's known keys and KeySets
ArraySet<Long> deletableKeySets = getOriginalKeySetsByPackageNameLPr(packageName);
ArraySet<Long> deletableKeys = new ArraySet<Long>();
- ArraySet<Long> knownKeys = null;
- for (Long ks : deletableKeySets) {
- knownKeys = mKeySetMapping.get(ks);
+ final int origDksSize = deletableKeySets.size();
+ for (int i = 0; i < origDksSize; i++) {
+ ArraySet<Long> knownKeys = mKeySetMapping.get(deletableKeySets.valueAt(i));
if (knownKeys != null) {
deletableKeys.addAll(knownKeys);
}
@@ -429,9 +429,9 @@ public class KeySetManagerService {
}
ArraySet<Long> knownKeySets = getOriginalKeySetsByPackageNameLPr(pkgName);
deletableKeySets.removeAll(knownKeySets);
- knownKeys = new ArraySet<Long>();
- for (Long ks : knownKeySets) {
- knownKeys = mKeySetMapping.get(ks);
+ final int kksSize = knownKeySets.size();
+ for (int i = 0; i < kksSize; i++) {
+ ArraySet<Long> knownKeys = mKeySetMapping.get(knownKeySets.valueAt(i));
if (knownKeys != null) {
deletableKeys.removeAll(knownKeys);
}
@@ -440,18 +440,22 @@ public class KeySetManagerService {
// The remaining keys and KeySets are not relied on by any other
// application and so can be safely deleted.
- for (Long ks : deletableKeySets) {
+ final int dksSize = deletableKeySets.size();
+ for (int i = 0; i < dksSize; i++) {
+ Long ks = deletableKeySets.valueAt(i);
mKeySets.delete(ks);
mKeySetMapping.delete(ks);
}
- for (Long keyId : deletableKeys) {
- mPublicKeys.delete(keyId);
+ final int dkSize = deletableKeys.size();
+ for (int i = 0; i < dkSize; i++) {
+ mPublicKeys.delete(deletableKeys.valueAt(i));
}
// Now remove the deleted KeySets from each package's signingKeySets
for (String pkgName : mPackages.keySet()) {
PackageSetting p = mPackages.get(pkgName);
- for (Long ks : deletableKeySets) {
+ for (int i = 0; i < dksSize; i++) {
+ Long ks = deletableKeySets.valueAt(i);
p.keySetData.removeSigningKeySet(ks);
}
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index fc9ff76..b90666f 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -51,6 +51,7 @@ import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.pm.UserInfo;
import android.database.ContentObserver;
+import android.graphics.Bitmap;
import android.hardware.usb.UsbManager;
import android.media.AudioManager;
import android.media.IAudioService;
@@ -5491,6 +5492,22 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
}
}
+ @Override
+ public void setUserIcon(ComponentName who, Bitmap icon) {
+ synchronized (this) {
+ Preconditions.checkNotNull(who, "ComponentName is null");
+ getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
+
+ int userId = UserHandle.getCallingUserId();
+ long id = Binder.clearCallingIdentity();
+ try {
+ mUserManager.setUserIcon(userId, icon);
+ } finally {
+ restoreCallingIdentity(id);
+ }
+ }
+ }
+
/**
* We need to update the internal state of whether a user has completed setup once. After
* that, we ignore any changes that reset the Settings.Secure.USER_SETUP_COMPLETE changes