From 5fe07aa7a81c840eaf52bf95d4d5bacd914a8106 Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Wed, 16 Oct 2013 11:15:41 -0700 Subject: Clear the caller identity when dumping print system state. bug:11251806 Change-Id: I295db22f327bc81f911cf638295415689d54fe56 --- .../com/android/server/print/PrintManagerService.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'services/java/com') diff --git a/services/java/com/android/server/print/PrintManagerService.java b/services/java/com/android/server/print/PrintManagerService.java index edd6b25..8a3997a 100644 --- a/services/java/com/android/server/print/PrintManagerService.java +++ b/services/java/com/android/server/print/PrintManagerService.java @@ -361,12 +361,17 @@ public final class PrintManagerService extends IPrintManager.Stub { } synchronized (mLock) { - pw.println("PRINT MANAGER STATE (dumpsys print)"); - final int userStateCount = mUserStates.size(); - for (int i = 0; i < userStateCount; i++) { - UserState userState = mUserStates.get(i); - userState.dump(fd, pw, ""); - pw.println(); + final long identity = Binder.clearCallingIdentity(); + try { + pw.println("PRINT MANAGER STATE (dumpsys print)"); + final int userStateCount = mUserStates.size(); + for (int i = 0; i < userStateCount; i++) { + UserState userState = mUserStates.get(i); + userState.dump(fd, pw, ""); + pw.println(); + } + } finally { + Binder.restoreCallingIdentity(identity); } } } -- cgit v1.1 From 5aca2b8dc4f4ff2d466a64587d06666c7bbd9749 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Wed, 16 Oct 2013 16:21:54 -0700 Subject: Plumb through physical device UUID and label. vold now parse out UUID and label for inserted physical devices, and reports them to framework. Add these to hidden StorageVolume class for use by DocumentsUI and MediaProvider. Remove last JNI method in FileUtils! Bug: 11175082 Change-Id: I1cfcd1ade61767b103f693319ea2600008ee2e3c --- services/java/com/android/server/MountService.java | 84 +++++++++++++++------- 1 file changed, 57 insertions(+), 27 deletions(-) (limited to 'services/java/com') diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java index c7ca1ea..7308b7d 100644 --- a/services/java/com/android/server/MountService.java +++ b/services/java/com/android/server/MountService.java @@ -56,12 +56,14 @@ import android.os.storage.StorageResultCode; import android.os.storage.StorageVolume; import android.text.TextUtils; import android.util.AttributeSet; +import android.util.Log; import android.util.Slog; import android.util.Xml; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.app.IMediaContainerService; +import com.android.internal.util.IndentingPrintWriter; import com.android.internal.util.Preconditions; import com.android.internal.util.XmlUtils; import com.android.server.NativeDaemonConnector.Command; @@ -83,6 +85,7 @@ import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; import java.security.spec.KeySpec; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -173,6 +176,8 @@ class MountService extends IMountService.Stub * 600 series - Unsolicited broadcasts. */ public static final int VolumeStateChange = 605; + public static final int VolumeUuidChange = 613; + public static final int VolumeUserLabelChange = 614; public static final int VolumeDiskInserted = 630; public static final int VolumeDiskRemoved = 631; public static final int VolumeBadRemoval = 632; @@ -801,6 +806,26 @@ class MountService extends IMountService.Stub notifyVolumeStateChange( cooked[2], cooked[3], Integer.parseInt(cooked[7]), Integer.parseInt(cooked[10])); + } else if (code == VoldResponseCode.VolumeUuidChange) { + // Format: nnn