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

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

Merge "incidentd: Adding proto dump for AlarmManager."

parents 4b3a7f29 61e03292
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.os.WorkSource;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.Log;
import android.util.proto.ProtoOutputStream;

import libcore.util.ZoneInfoDB;

@@ -1121,5 +1122,13 @@ public class AlarmManager {
                return new AlarmClockInfo[size];
            }
        };

        /** @hide */
        public void writeToProto(ProtoOutputStream proto, long fieldId) {
            final long token = proto.start(fieldId);
            proto.write(AlarmClockInfoProto.TRIGGER_TIME_MS, mTriggerTime);
            mShowIntent.writeToProto(proto, AlarmClockInfoProto.SHOW_INTENT);
            proto.end(token);
        }
    }
}
+11 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.os.Parcelable;
import android.os.RemoteException;
import android.os.UserHandle;
import android.util.AndroidException;
import android.util.proto.ProtoOutputStream;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1082,6 +1083,15 @@ public final class PendingIntent implements Parcelable {
        return sb.toString();
    }

    /** @hide */
    public void writeToProto(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        if (mTarget != null) {
            proto.write(PendingIntentProto.TARGET, mTarget.asBinder().toString());
        }
        proto.end(token);
    }

    public int describeContents() {
        return 0;
    }
+13 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import java.io.PrintWriter;
import java.util.ArrayList;

import android.util.Slog;
import android.util.proto.ProtoOutputStream;

/**
 * Helper class for logging serious issues, which also keeps a small
@@ -63,4 +64,16 @@ public class LocalLog {
            return true;
        }
    }

    public void writeToProto(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);

        synchronized (mLines) {
            for (int i = 0; i < mLines.size(); ++i) {
                proto.write(LocalLogProto.LINES, mLines.get(i));
            }
        }

        proto.end(token);
    }
}
+54 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";

import "frameworks/base/core/proto/android/app/pendingintent.proto";

option java_multiple_files = true;

package android.app;

/**
 * An android.app.AlarmManager object.
 */
message AlarmManagerProto {
  enum AlarmType {
    // Alarm time in System.currentTimeMillis() (wall clock time in UTC), which
    // will wake up the device when it goes off.
    RTC_WAKEUP = 0;
    // Alarm time in System.currentTimeMillis() (wall clock time in UTC).  This
    // alarm does not wake the device up; if it goes off while the device is
    // asleep, it will not be delivered until the next time the device wakes up.
    RTC = 1;
    // Alarm time in SystemClock.elapsedRealtime() (time since boot, including
    // sleep), which will wake up the device when it goes off.
    ELAPSED_REALTIME_WAKEUP = 2;
    // Alarm time in SystemClock.elapsedRealtime() (time since boot, including
    // sleep). This alarm does not wake the device up; if it goes off while the
    // device is asleep, it will not be delivered until the next time the device
    // wakes up.
    ELAPSED_REALTIME = 3;
  }
}

// An android.app.AlarmManager.AlarmClockInfo object.
message AlarmClockInfoProto {
  // This value is UTC wall clock time in milliseconds, as returned by
  // System#currentTimeMillis() for example.
  optional int64 trigger_time_ms = 1;
  optional android.app.PendingIntentProto show_intent = 2;
}
+28 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";

option java_multiple_files = true;

package android.app;

/**
 * An android.app.PendingIntent object.
 */
message PendingIntentProto {
  optional string target = 1;
}
Loading