2 * Copyright (C) 2016 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.android.internal.telephony;
19 import android.os.Bundle;
20 import android.os.Parcel;
21 import android.os.Parcelable;
24 * A parcelable used in ITelephonyDebugSubscriber.aidl
26 public class TelephonyEvent implements Parcelable {
28 final public long timestamp;
29 final public int phoneId;
31 final public int param1;
32 final public int param2;
33 final public Bundle data;
35 public TelephonyEvent(long timestamp, int phoneId, int tag,
36 int param1, int param2, Bundle data) {
37 this.timestamp = timestamp;
38 this.phoneId = phoneId;
45 /** Implement the Parcelable interface */
46 public static final Parcelable.Creator<TelephonyEvent> CREATOR
47 = new Parcelable.Creator<TelephonyEvent> (){
48 public TelephonyEvent createFromParcel(Parcel source) {
49 final long timestamp = source.readLong();
50 final int phoneId = source.readInt();
51 final int tag = source.readInt();
52 final int param1 = source.readInt();
53 final int param2 = source.readInt();
54 final Bundle data = source.readBundle();
55 return new TelephonyEvent(timestamp, phoneId, tag, param1, param2, data);
58 public TelephonyEvent[] newArray(int size) {
59 return new TelephonyEvent[size];
63 /** Implement the Parcelable interface */
65 public int describeContents() {
69 /** Implement the Parcelable interface */
71 public void writeToParcel(Parcel dest, int flags) {
72 dest.writeLong(timestamp);
73 dest.writeInt(phoneId);
75 dest.writeInt(param1);
76 dest.writeInt(param2);
77 dest.writeBundle(data);
80 public String toString() {
81 return String.format("%d,%d,%d,%d,%d,%s",
82 timestamp, phoneId, tag, param1, param2, data);