diff --git a/Android.mk b/Android.mk index aaa05af45d0d3..b7f6ebf7b249b 100644 --- a/Android.mk +++ b/Android.mk @@ -694,6 +694,7 @@ aidl_files := \ frameworks/base/core/java/android/service/quicksettings/Tile.aidl \ frameworks/native/aidl/binder/android/os/PersistableBundle.aidl \ system/netd/server/binder/android/net/UidRange.aidl \ + frameworks/base/telephony/java/android/telephony/PcoData.aidl \ gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl $(gen): PRIVATE_SRC_FILES := $(aidl_files) diff --git a/telephony/java/android/telephony/PcoData.aidl b/telephony/java/android/telephony/PcoData.aidl new file mode 100644 index 0000000000000..a93b8d318c335 --- /dev/null +++ b/telephony/java/android/telephony/PcoData.aidl @@ -0,0 +1,21 @@ +/* +** +** Copyright (C) 2016 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. +*/ + +package android.telephony; + +parcelable PcoData; + diff --git a/telephony/java/android/telephony/PcoData.java b/telephony/java/android/telephony/PcoData.java new file mode 100644 index 0000000000000..3e735e74bc225 --- /dev/null +++ b/telephony/java/android/telephony/PcoData.java @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2016 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. + */ + +package android.telephony; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Contains Carrier-specific (and opaque) Protocol configuration Option + * Data. In general this is only passed on to carrier-specific applications + * for interpretation. + * + * @hide + */ +public class PcoData implements Parcelable { + + public final int cid; + public final String bearerProto; + public final int pcoId; + public final byte[] contents; + + public PcoData(int cid, String bearerProto, int pcoId, byte[]contents) { + this.cid = cid; + this.bearerProto = bearerProto; + this.pcoId = pcoId; + this.contents = contents; + } + + public PcoData(Parcel in) { + cid = in.readInt(); + bearerProto = in.readString(); + pcoId = in.readInt(); + contents = in.createByteArray(); + } + + /** + * {@link Parcelable#writeToParcel} + */ + public void writeToParcel(Parcel out, int flags) { + out.writeInt(cid); + out.writeString(bearerProto); + out.writeInt(pcoId); + out.writeByteArray(contents); + } + + /** + * {@link Parcelable#describeContents} + */ + public int describeContents() { + return 0; + } + + /** + * {@link Parcelable.Creator} + * + * @hide + */ + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public PcoData createFromParcel(Parcel in) { + return new PcoData(in); + } + + public PcoData[] newArray(int size) { + return new PcoData[size]; + } + }; + + @Override + public String toString() { + return "PcoData(" + cid + ", " + bearerProto + ", " + pcoId + ", contents[" + + contents.length + "])"; + } +} diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index 64626541a2d3c..a91e9beb3143a 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -461,4 +461,5 @@ cat include/telephony/ril.h | \ int RIL_UNSOL_ON_SS = 1043; int RIL_UNSOL_STK_CC_ALPHA_NOTIFY = 1044; int RIL_UNSOL_LCEDATA_RECV = 1045; + int RIL_UNSOL_PCO_DATA = 1046; }