OSDN Git Service

Improve dump format
authorLucas Dupin <dupin@google.com>
Wed, 10 Apr 2019 23:07:50 +0000 (16:07 -0700)
committerLucas Dupin <dupin@google.com>
Wed, 10 Apr 2019 23:09:23 +0000 (16:09 -0700)
Test: adb shell dumpsys activity service com.android.systemui
Bug: 130204212
Change-Id: I75a74a46a2bd5e63a0f13a877741cc1ab806d6d0

packages/SystemUI/plugin/src/com/android/systemui/plugins/SensorManagerPlugin.java
packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java

index fbd863d..bc6547f 100644 (file)
@@ -59,14 +59,16 @@ public interface SensorManagerPlugin extends Plugin {
         public static final int TYPE_WAKE_DISPLAY = 2;
         public static final int TYPE_SWIPE = 3;
 
-        int mType;
+        private int mType;
 
+        public Sensor(int type) {
+            mType = type;
+        }
         public int getType() {
             return mType;
         }
-
-        public Sensor(int type) {
-            mType = type;
+        public String toString() {
+            return "{PluginSensor type=\"" + mType + "\"}";
         }
     }
 
index 77180f8..831d074 100644 (file)
@@ -228,9 +228,9 @@ public class DozeSensors {
     /** Dump current state */
     public void dump(PrintWriter pw) {
         for (TriggerSensor s : mSensors) {
-            pw.print("Sensor: "); pw.println(s.toString());
+            pw.print("  Sensor: "); pw.println(s.toString());
         }
-        pw.print("ProxSensor: "); pw.println(mProxSensor.toString());
+        pw.print("  ProxSensor: "); pw.println(mProxSensor.toString());
     }
 
     /**