Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 181135db authored by Kean Mariotti's avatar Kean Mariotti Committed by Android (Google) Code Review
Browse files

Merge "IME traces: remove unused fields" into main

parents 53db21ac 796121b6
Loading
Loading
Loading
Loading
+0 −12
Original line number Original line Diff line number Diff line
@@ -17,8 +17,6 @@
package com.android.internal.inputmethod;
package com.android.internal.inputmethod;


import static android.view.inputmethod.InputConnectionProto.CURSOR_CAPS_MODE;
import static android.view.inputmethod.InputConnectionProto.CURSOR_CAPS_MODE;
import static android.view.inputmethod.InputConnectionProto.EDITABLE_TEXT;
import static android.view.inputmethod.InputConnectionProto.SELECTED_TEXT;
import static android.view.inputmethod.InputConnectionProto.SELECTED_TEXT_END;
import static android.view.inputmethod.InputConnectionProto.SELECTED_TEXT_END;
import static android.view.inputmethod.InputConnectionProto.SELECTED_TEXT_START;
import static android.view.inputmethod.InputConnectionProto.SELECTED_TEXT_START;


@@ -335,16 +333,6 @@ public final class EditableInputConnection extends BaseInputConnection
    @Override
    @Override
    public void dumpDebug(ProtoOutputStream proto, long fieldId) {
    public void dumpDebug(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        final long token = proto.start(fieldId);
        CharSequence editableText = mTextView.getText();
        CharSequence selectedText = getSelectedText(0 /* flags */);
        if (InputConnectionProtoDumper.DUMP_TEXT) {
            if (editableText != null) {
                proto.write(EDITABLE_TEXT, editableText.toString());
            }
            if (selectedText != null) {
                proto.write(SELECTED_TEXT, selectedText.toString());
            }
        }
        final Editable content = getEditable();
        final Editable content = getEditable();
        if (content != null) {
        if (content != null) {
            int start = Selection.getSelectionStart(content);
            int start = Selection.getSelectionStart(content);
+2 −30
Original line number Original line Diff line number Diff line
@@ -44,7 +44,6 @@ import android.view.inputmethod.SurroundingText;
 */
 */
public final class InputConnectionProtoDumper {
public final class InputConnectionProtoDumper {
    static final String TAG = "InputConnectionProtoDumper";
    static final String TAG = "InputConnectionProtoDumper";
    public static final boolean DUMP_TEXT = false;


    private InputConnectionProtoDumper() {}
    private InputConnectionProtoDumper() {}


@@ -67,11 +66,6 @@ public final class InputConnectionProtoDumper {
        final long token = proto.start(GET_TEXT_AFTER_CURSOR);
        final long token = proto.start(GET_TEXT_AFTER_CURSOR);
        proto.write(GetTextAfterCursor.LENGTH, length);
        proto.write(GetTextAfterCursor.LENGTH, length);
        proto.write(GetTextAfterCursor.FLAGS, flags);
        proto.write(GetTextAfterCursor.FLAGS, flags);
        if (result == null) {
            proto.write(GetTextAfterCursor.RESULT, "null result");
        } else if (DUMP_TEXT) {
            proto.write(GetTextAfterCursor.RESULT, result.toString());
        }
        proto.end(token);
        proto.end(token);
        return proto.getBytes();
        return proto.getBytes();
    }
    }
@@ -95,11 +89,6 @@ public final class InputConnectionProtoDumper {
        final long token = proto.start(GET_TEXT_BEFORE_CURSOR);
        final long token = proto.start(GET_TEXT_BEFORE_CURSOR);
        proto.write(GetTextBeforeCursor.LENGTH, length);
        proto.write(GetTextBeforeCursor.LENGTH, length);
        proto.write(GetTextBeforeCursor.FLAGS, flags);
        proto.write(GetTextBeforeCursor.FLAGS, flags);
        if (result == null) {
            proto.write(GetTextBeforeCursor.RESULT, "null result");
        } else if (DUMP_TEXT) {
            proto.write(GetTextBeforeCursor.RESULT, result.toString());
        }
        proto.end(token);
        proto.end(token);
        return proto.getBytes();
        return proto.getBytes();
    }
    }
@@ -122,11 +111,6 @@ public final class InputConnectionProtoDumper {
        ProtoOutputStream proto = new ProtoOutputStream();
        ProtoOutputStream proto = new ProtoOutputStream();
        final long token = proto.start(GET_SELECTED_TEXT);
        final long token = proto.start(GET_SELECTED_TEXT);
        proto.write(GetSelectedText.FLAGS, flags);
        proto.write(GetSelectedText.FLAGS, flags);
        if (result == null) {
            proto.write(GetSelectedText.RESULT, "null result");
        } else if (DUMP_TEXT) {
            proto.write(GetSelectedText.RESULT, result.toString());
        }
        proto.end(token);
        proto.end(token);
        return proto.getBytes();
        return proto.getBytes();
    }
    }
@@ -155,13 +139,8 @@ public final class InputConnectionProtoDumper {
        proto.write(GetSurroundingText.BEFORE_LENGTH, beforeLength);
        proto.write(GetSurroundingText.BEFORE_LENGTH, beforeLength);
        proto.write(GetSurroundingText.AFTER_LENGTH, afterLength);
        proto.write(GetSurroundingText.AFTER_LENGTH, afterLength);
        proto.write(GetSurroundingText.FLAGS, flags);
        proto.write(GetSurroundingText.FLAGS, flags);
        if (result == null) {
        if (result != null) {
            final long token_result = proto.start(GetSurroundingText.RESULT);
            final long token_result = proto.start(GetSurroundingText.RESULT);
            proto.write(GetSurroundingText.SurroundingText.TEXT, "null result");
            proto.end(token_result);
        } else if (DUMP_TEXT) {
            final long token_result = proto.start(GetSurroundingText.RESULT);
            proto.write(GetSurroundingText.SurroundingText.TEXT, result.getText().toString());
            proto.write(GetSurroundingText.SurroundingText.SELECTION_START,
            proto.write(GetSurroundingText.SurroundingText.SELECTION_START,
                    result.getSelectionStart());
                    result.getSelectionStart());
            proto.write(GetSurroundingText.SurroundingText.SELECTION_END,
            proto.write(GetSurroundingText.SurroundingText.SELECTION_END,
@@ -188,9 +167,7 @@ public final class InputConnectionProtoDumper {
        ProtoOutputStream proto = new ProtoOutputStream();
        ProtoOutputStream proto = new ProtoOutputStream();
        final long token = proto.start(GET_CURSOR_CAPS_MODE);
        final long token = proto.start(GET_CURSOR_CAPS_MODE);
        proto.write(GetCursorCapsMode.REQ_MODES, reqModes);
        proto.write(GetCursorCapsMode.REQ_MODES, reqModes);
        if (DUMP_TEXT) {
        proto.write(GetCursorCapsMode.RESULT, result);
        proto.write(GetCursorCapsMode.RESULT, result);
        }
        proto.end(token);
        proto.end(token);
        return proto.getBytes();
        return proto.getBytes();
    }
    }
@@ -223,11 +200,6 @@ public final class InputConnectionProtoDumper {
        proto.write(GetExtractedText.ExtractedTextRequest.HINT_MAX_CHARS, request.hintMaxChars);
        proto.write(GetExtractedText.ExtractedTextRequest.HINT_MAX_CHARS, request.hintMaxChars);
        proto.end(token_request);
        proto.end(token_request);
        proto.write(GetExtractedText.FLAGS, flags);
        proto.write(GetExtractedText.FLAGS, flags);
        if (result == null) {
            proto.write(GetExtractedText.RESULT, "null result");
        } else if (DUMP_TEXT) {
            proto.write(GetExtractedText.RESULT, result.text.toString());
        }
        proto.end(token);
        proto.end(token);
        return proto.getBytes();
        return proto.getBytes();
    }
    }
+7 −9
Original line number Original line Diff line number Diff line
@@ -16,8 +16,6 @@


syntax = "proto2";
syntax = "proto2";


import "frameworks/base/core/proto/android/privacy.proto";

package android.view.inputmethod;
package android.view.inputmethod;


option java_multiple_files = true;
option java_multiple_files = true;
@@ -26,8 +24,8 @@ option java_multiple_files = true;
 * Represents a {@link android.view.inputmethod.InputConnection} object.
 * Represents a {@link android.view.inputmethod.InputConnection} object.
 */
 */
message InputConnectionProto {
message InputConnectionProto {
  optional string editable_text = 1 [(.android.privacy).dest = DEST_LOCAL];
  reserved 1; // string editable_text
  optional string selected_text = 2 [(.android.privacy).dest = DEST_LOCAL];
  reserved 2; // string selected_text
  optional int32 selected_text_start = 3;
  optional int32 selected_text_start = 3;
  optional int32 selected_text_end = 4;
  optional int32 selected_text_end = 4;
  optional int32 cursor_caps_mode = 5;
  optional int32 cursor_caps_mode = 5;
@@ -50,18 +48,18 @@ message InputConnectionCallProto {
  message GetTextBeforeCursor {
  message GetTextBeforeCursor {
    optional int32 length = 1;
    optional int32 length = 1;
    optional int32 flags = 2;
    optional int32 flags = 2;
    optional string result = 3 [(.android.privacy).dest = DEST_LOCAL];
    reserved 3; // string result
  }
  }


  message GetTextAfterCursor {
  message GetTextAfterCursor {
    optional int32 length = 1;
    optional int32 length = 1;
    optional int32 flags = 2;
    optional int32 flags = 2;
    optional string result = 3 [(.android.privacy).dest = DEST_LOCAL];
    reserved 3; // string result = 3
  }
  }


  message GetSelectedText {
  message GetSelectedText {
    optional int32 flags = 1;
    optional int32 flags = 1;
    optional string result = 2 [(.android.privacy).dest = DEST_LOCAL];
    reserved 2; // string result = 2
  }
  }


  message GetSurroundingText {
  message GetSurroundingText {
@@ -71,7 +69,7 @@ message InputConnectionCallProto {
    optional SurroundingText result = 4;
    optional SurroundingText result = 4;


    message SurroundingText {
    message SurroundingText {
      optional string text = 1 [(.android.privacy).dest = DEST_LOCAL];
      reserved 1; // string text = 1
      optional int32 selection_start = 2;
      optional int32 selection_start = 2;
      optional int32 selection_end = 3;
      optional int32 selection_end = 3;
      optional int32 offset = 4;
      optional int32 offset = 4;
@@ -86,7 +84,7 @@ message InputConnectionCallProto {
  message GetExtractedText {
  message GetExtractedText {
    optional ExtractedTextRequest request = 1;
    optional ExtractedTextRequest request = 1;
    optional int32 flags = 2;
    optional int32 flags = 2;
    optional string result = 3 [(.android.privacy).dest = DEST_LOCAL];
    reserved 3; // string result = 3


    message ExtractedTextRequest {
    message ExtractedTextRequest {
      optional int32 token = 1;
      optional int32 token = 1;