Loading core/java/android/os/BasicShellCommandHandler.java +12 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,18 @@ public abstract class BasicShellCommandHandler { } } /** * @return all the remaining arguments in the command without moving the current position. */ public String[] peekRemainingArgs() { int remaining = getRemainingArgsCount(); String[] args = new String[remaining]; for (int pos = mArgPos; pos < mArgs.length; pos++) { args[pos - mArgPos] = mArgs[pos]; } return args; } /** * Returns number of arguments that haven't been processed yet. */ Loading core/java/com/android/internal/protolog/BaseProtoLogImpl.java +0 −1 Original line number Diff line number Diff line Loading @@ -277,7 +277,6 @@ public class BaseProtoLogImpl { String group = groups[i]; IProtoLogGroup g = LOG_GROUPS.get(group); if (g != null) { System.out.println("G: "+ g); if (setTextLogging) { g.setLogToLogcat(value); } else { Loading core/java/com/android/internal/statusbar/IStatusBar.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.graphics.Rect; import android.hardware.biometrics.IBiometricSysuiReceiver; import android.hardware.biometrics.PromptInfo; import android.os.Bundle; import android.os.ParcelFileDescriptor; import android.service.notification.StatusBarNotification; import com.android.internal.statusbar.StatusBarIcon; Loading Loading @@ -223,6 +224,11 @@ oneway interface IStatusBar */ void stopTracing(); /** * Handles a logging command from the WM shell command. */ void handleWindowManagerLoggingCommand(in String[] args, in ParcelFileDescriptor outFd); /** * If true, suppresses the ambient display from showing. If false, re-enables the ambient * display. Loading libs/WindowManager/Shell/src/com/android/wm/shell/protolog/ShellProtoLogGroup.java +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import com.android.internal.protolog.common.IProtoLogGroup; * This file is used by the ProtoLogTool to generate optimized logging code. */ public enum ShellProtoLogGroup implements IProtoLogGroup { // NOTE: Since we enable these from the same WM ShellCommand, these names should not conflict // with those in the framework ProtoLogGroup WM_SHELL_TASK_ORG(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, Consts.TAG_WM_SHELL), TEST_GROUP(true, true, false, "WindowManagerShellProtoLogTest"); Loading libs/WindowManager/Shell/src/com/android/wm/shell/protolog/ShellProtoLogImpl.java +6 −9 Original line number Diff line number Diff line Loading @@ -44,8 +44,6 @@ public class ShellProtoLogImpl extends BaseProtoLogImpl { private static ShellProtoLogImpl sServiceInstance = null; private final PrintWriter mSystemOutWriter; static { addLogGroupEnum(ShellProtoLogGroup.values()); } Loading Loading @@ -111,11 +109,11 @@ public class ShellProtoLogImpl extends BaseProtoLogImpl { return sServiceInstance; } public void startTextLogging(Context context, String... groups) { public int startTextLogging(Context context, String[] groups, PrintWriter pw) { try { mViewerConfig.loadViewerConfig( context.getResources().openRawResource(R.raw.wm_shell_protolog)); setLogging(true /* setTextLogging */, true, mSystemOutWriter, groups); return setLogging(true /* setTextLogging */, true, pw, groups); } catch (IOException e) { Log.i(TAG, "Unable to load log definitions: IOException while reading " + "wm_shell_protolog. " + e); Loading @@ -123,16 +121,15 @@ public class ShellProtoLogImpl extends BaseProtoLogImpl { Log.i(TAG, "Unable to load log definitions: JSON parsing exception while reading " + "wm_shell_protolog. " + e); } return -1; } public void stopTextLogging(String... groups) { setLogging(true /* setTextLogging */, false, mSystemOutWriter, groups); public int stopTextLogging(String[] groups, PrintWriter pw) { return setLogging(true /* setTextLogging */, false, pw, groups); } private ShellProtoLogImpl() { super(new File(LOG_FILENAME), null, BUFFER_CAPACITY, new ProtoLogViewerConfigReader()); mSystemOutWriter = new PrintWriter(System.out, true); super(new File(LOG_FILENAME), null, BUFFER_CAPACITY, new ProtoLogViewerConfigReader()); } } Loading
core/java/android/os/BasicShellCommandHandler.java +12 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,18 @@ public abstract class BasicShellCommandHandler { } } /** * @return all the remaining arguments in the command without moving the current position. */ public String[] peekRemainingArgs() { int remaining = getRemainingArgsCount(); String[] args = new String[remaining]; for (int pos = mArgPos; pos < mArgs.length; pos++) { args[pos - mArgPos] = mArgs[pos]; } return args; } /** * Returns number of arguments that haven't been processed yet. */ Loading
core/java/com/android/internal/protolog/BaseProtoLogImpl.java +0 −1 Original line number Diff line number Diff line Loading @@ -277,7 +277,6 @@ public class BaseProtoLogImpl { String group = groups[i]; IProtoLogGroup g = LOG_GROUPS.get(group); if (g != null) { System.out.println("G: "+ g); if (setTextLogging) { g.setLogToLogcat(value); } else { Loading
core/java/com/android/internal/statusbar/IStatusBar.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.graphics.Rect; import android.hardware.biometrics.IBiometricSysuiReceiver; import android.hardware.biometrics.PromptInfo; import android.os.Bundle; import android.os.ParcelFileDescriptor; import android.service.notification.StatusBarNotification; import com.android.internal.statusbar.StatusBarIcon; Loading Loading @@ -223,6 +224,11 @@ oneway interface IStatusBar */ void stopTracing(); /** * Handles a logging command from the WM shell command. */ void handleWindowManagerLoggingCommand(in String[] args, in ParcelFileDescriptor outFd); /** * If true, suppresses the ambient display from showing. If false, re-enables the ambient * display. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/protolog/ShellProtoLogGroup.java +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import com.android.internal.protolog.common.IProtoLogGroup; * This file is used by the ProtoLogTool to generate optimized logging code. */ public enum ShellProtoLogGroup implements IProtoLogGroup { // NOTE: Since we enable these from the same WM ShellCommand, these names should not conflict // with those in the framework ProtoLogGroup WM_SHELL_TASK_ORG(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, Consts.TAG_WM_SHELL), TEST_GROUP(true, true, false, "WindowManagerShellProtoLogTest"); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/protolog/ShellProtoLogImpl.java +6 −9 Original line number Diff line number Diff line Loading @@ -44,8 +44,6 @@ public class ShellProtoLogImpl extends BaseProtoLogImpl { private static ShellProtoLogImpl sServiceInstance = null; private final PrintWriter mSystemOutWriter; static { addLogGroupEnum(ShellProtoLogGroup.values()); } Loading Loading @@ -111,11 +109,11 @@ public class ShellProtoLogImpl extends BaseProtoLogImpl { return sServiceInstance; } public void startTextLogging(Context context, String... groups) { public int startTextLogging(Context context, String[] groups, PrintWriter pw) { try { mViewerConfig.loadViewerConfig( context.getResources().openRawResource(R.raw.wm_shell_protolog)); setLogging(true /* setTextLogging */, true, mSystemOutWriter, groups); return setLogging(true /* setTextLogging */, true, pw, groups); } catch (IOException e) { Log.i(TAG, "Unable to load log definitions: IOException while reading " + "wm_shell_protolog. " + e); Loading @@ -123,16 +121,15 @@ public class ShellProtoLogImpl extends BaseProtoLogImpl { Log.i(TAG, "Unable to load log definitions: JSON parsing exception while reading " + "wm_shell_protolog. " + e); } return -1; } public void stopTextLogging(String... groups) { setLogging(true /* setTextLogging */, false, mSystemOutWriter, groups); public int stopTextLogging(String[] groups, PrintWriter pw) { return setLogging(true /* setTextLogging */, false, pw, groups); } private ShellProtoLogImpl() { super(new File(LOG_FILENAME), null, BUFFER_CAPACITY, new ProtoLogViewerConfigReader()); mSystemOutWriter = new PrintWriter(System.out, true); super(new File(LOG_FILENAME), null, BUFFER_CAPACITY, new ProtoLogViewerConfigReader()); } }