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

Commit 9cc9ad63 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Enable Window Dumpsys Section"

parents 0d16870b be6de301
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -87,12 +87,12 @@ PrivacyBuffer::stripField(const Privacy* parentPolicy, const PrivacySpec& spec)
    // current field is message type and its sub-fields have extra privacy policies
    uint32_t msgSize = mData.readRawVarint();
    EncodedBuffer::Pointer start = mData.rp()->copy();
    while (mData.rp()->pos() - start.pos() != msgSize) {
    long long token = mProto.start(policy->EncodedFieldId());
    while (mData.rp()->pos() - start.pos() != msgSize) {
        status_t err = stripField(policy, spec);
        if (err != NO_ERROR) return err;
        mProto.end(token);
    }
    mProto.end(token);
    return NO_ERROR;
}

+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ extern const Section* SECTION_LIST[];
 * This is the mapping of section IDs to each section's privacy policy.
 * The section IDs are guaranteed in ascending order, not NULL-terminated since size is provided.
 */
extern const Privacy* PRIVACY_POLICY_LIST[];
extern const Privacy** PRIVACY_POLICY_LIST;

extern const int PRIVACY_POLICY_COUNT;

+10 −0
Original line number Diff line number Diff line
@@ -260,3 +260,13 @@ TEST_F(PrivacyBufferTest, BadDataInNestedMessage) {
    PrivacySpec spec;
    ASSERT_EQ(privacyBuf.strip(spec), BAD_VALUE);
}

TEST_F(PrivacyBufferTest, SelfRecursionMessage) {
    string input = "\x2a\"" + VARINT_FIELD_1 + STRING_FIELD_2 + MESSAGE_FIELD_5;
    writeToFdBuffer(input);
    Privacy* field5 = create_message_privacy(5, NULL);
    Privacy* list[] = { create_privacy(1, OTHER_TYPE, LOCAL), field5, NULL };
    field5->children = list;
    string expected = "\x2a\x1c" + STRING_FIELD_2 + "\x2a\xd" + STRING_FIELD_2;
    assertStrip(EXPLICIT, expected, field5);
}
+4 −2
Original line number Diff line number Diff line
@@ -20,9 +20,11 @@ Privacy* list[] = {
Privacy field_0 { 0, 11, list, EXPLICIT, NULL };
Privacy field_1 { 1, 9, NULL, AUTOMATIC, NULL };

const Privacy* PRIVACY_POLICY_LIST[] = {
Privacy* final_list[] = {
    &field_0,
    &field_1
};

const Privacy** PRIVACY_POLICY_LIST = const_cast<const Privacy**>(final_list);

const int PRIVACY_POLICY_COUNT = 2;
+6 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import "frameworks/base/core/proto/android/os/pagetypeinfo.proto";
import "frameworks/base/core/proto/android/os/procrank.proto";
import "frameworks/base/core/proto/android/server/activitymanagerservice.proto";
import "frameworks/base/core/proto/android/server/alarmmanagerservice.proto";
import "frameworks/base/core/proto/android/server/windowmanagerservice.proto";
import "frameworks/base/core/proto/android/server/fingerprint.proto";
import "frameworks/base/core/proto/android/server/powermanagerservice.proto";
import "frameworks/base/core/proto/android/service/appwidget.proto";
@@ -135,4 +136,9 @@ message IncidentProto {
        (section).type = SECTION_DUMPSYS,
        (section).args = "alarm --proto"
    ];

    optional com.android.server.wm.proto.WindowManagerServiceProto window = 3017 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "window --proto"
    ];
}
Loading