OSDN Git Service

Clear the caller identity when dumping print system state.
authorSvetoslav <svetoslavganov@google.com>
Wed, 16 Oct 2013 18:15:41 +0000 (11:15 -0700)
committerSvetoslav <svetoslavganov@google.com>
Wed, 16 Oct 2013 18:15:45 +0000 (11:15 -0700)
bug:11251806

Change-Id: I295db22f327bc81f911cf638295415689d54fe56

services/java/com/android/server/print/PrintManagerService.java

index edd6b25..8a3997a 100644 (file)
@@ -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);
             }
         }
     }