diff options
4 files changed, 310 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/satellite/SatelliteModemEnableRequestAttributes.java b/telephony/java/android/telephony/satellite/SatelliteModemEnableRequestAttributes.java new file mode 100644 index 000000000000..5e56f84ab1a2 --- /dev/null +++ b/telephony/java/android/telephony/satellite/SatelliteModemEnableRequestAttributes.java @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 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.satellite; + +import android.annotation.NonNull; +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.Objects; + +/** + * SatelliteModemEnableRequestAttributes is used to pack info needed by modem to allow carrier to + * roam to satellite. + * + * @hide + */ +public final class SatelliteModemEnableRequestAttributes implements Parcelable { + + /** {@code true} to enable satellite and {@code false} to disable satellite */ + private final boolean mIsEnabled; + /** + * {@code true} to enable demo mode and {@code false} to disable. When disabling satellite, + * {@code mIsDemoMode} is always considered as {@code false} by Telephony. + */ + private final boolean mIsDemoMode; + /** + * {@code true} means satellite is enabled for emergency mode, {@code false} otherwise. When + * disabling satellite, {@code isEmergencyMode} is always considered as {@code false} by + * Telephony. + */ + private final boolean mIsEmergencyMode; + + /** The subscription related info */ + @NonNull private final SatelliteSubscriptionInfo mSatelliteSubscriptionInfo; + + public SatelliteModemEnableRequestAttributes(boolean isEnabled, boolean isDemoMode, + boolean isEmergencyMode, @NonNull SatelliteSubscriptionInfo satelliteSubscriptionInfo) { + mIsEnabled = isEnabled; + mIsDemoMode = isDemoMode; + mIsEmergencyMode = isEmergencyMode; + mSatelliteSubscriptionInfo = satelliteSubscriptionInfo; + } + + private SatelliteModemEnableRequestAttributes(Parcel in) { + mIsEnabled = in.readBoolean(); + mIsDemoMode = in.readBoolean(); + mIsEmergencyMode = in.readBoolean(); + mSatelliteSubscriptionInfo = in.readParcelable( + SatelliteSubscriptionInfo.class.getClassLoader(), SatelliteSubscriptionInfo.class); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + dest.writeBoolean(mIsEnabled); + dest.writeBoolean(mIsDemoMode); + dest.writeBoolean(mIsEmergencyMode); + mSatelliteSubscriptionInfo.writeToParcel(dest, flags); + } + + public static final Creator<SatelliteModemEnableRequestAttributes> CREATOR = new Creator<>() { + @Override + public SatelliteModemEnableRequestAttributes createFromParcel(Parcel in) { + return new SatelliteModemEnableRequestAttributes(in); + } + + @Override + public SatelliteModemEnableRequestAttributes[] newArray(int size) { + return new SatelliteModemEnableRequestAttributes[size]; + } + }; + + @Override + public String toString() { + return (new StringBuilder()).append("SatelliteModemEnableRequestAttributes{") + .append(", mIsEnabled=").append(mIsEnabled) + .append(", mIsDemoMode=").append(mIsDemoMode) + .append(", mIsDemoMode=").append(mIsDemoMode) + .append("mSatelliteSubscriptionInfo=").append(mSatelliteSubscriptionInfo) + .append("}") + .toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SatelliteModemEnableRequestAttributes that = (SatelliteModemEnableRequestAttributes) o; + return mIsEnabled == that.mIsEnabled && mIsDemoMode == that.mIsDemoMode + && mIsEmergencyMode == that.mIsEmergencyMode && mSatelliteSubscriptionInfo.equals( + that.mSatelliteSubscriptionInfo); + } + + @Override + public int hashCode() { + return Objects.hash(mIsEnabled, mIsDemoMode, mIsEmergencyMode, mSatelliteSubscriptionInfo); + } + + public boolean isEnabled() { + return mIsEnabled; + } + + public boolean isDemoMode() { + return mIsDemoMode; + } + + public boolean isEmergencyMode() { + return mIsEmergencyMode; + } + + @NonNull public SatelliteSubscriptionInfo getSatelliteSubscriptionInfo() { + return mSatelliteSubscriptionInfo; + } +} diff --git a/telephony/java/android/telephony/satellite/SatelliteSubscriptionInfo.java b/telephony/java/android/telephony/satellite/SatelliteSubscriptionInfo.java new file mode 100644 index 000000000000..2ef19f8dd69e --- /dev/null +++ b/telephony/java/android/telephony/satellite/SatelliteSubscriptionInfo.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 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.satellite; + +import android.annotation.NonNull; +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.Objects; + +/** + * SatelliteSubscriptionInfo is used to pack subscription related info needed by modem to allow + * carrier to roam to satellite. + * + * @hide + */ +public final class SatelliteSubscriptionInfo implements Parcelable { + /** + * The ICC ID used for satellite attachment. + */ + @NonNull private final String mIccId; + + /** + * The NIDD(Non IP Data) APN to be used for carrier roaming to satellite attachment. + */ + @NonNull private final String mNiddApn; + + public SatelliteSubscriptionInfo(@NonNull String iccId, @NonNull String niddApn) { + mIccId = iccId; + mNiddApn = niddApn; + } + + private SatelliteSubscriptionInfo(Parcel in) { + mIccId = in.readString8(); + mNiddApn = in.readString8(); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + dest.writeString8(mIccId); + dest.writeString8(mNiddApn); + } + + @NonNull public static final Creator<SatelliteSubscriptionInfo> CREATOR = new Creator<>() { + @Override + public SatelliteSubscriptionInfo createFromParcel(Parcel in) { + return new SatelliteSubscriptionInfo(in); + } + + @Override + public SatelliteSubscriptionInfo[] newArray(int size) { + return new SatelliteSubscriptionInfo[size]; + } + }; + + @Override + @NonNull public String toString() { + return (new StringBuilder()).append("SatelliteSubscriptionInfo{") + .append("IccId=").append(mIccId) + .append(", NiddApn=").append(mNiddApn) + .append("}") + .toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SatelliteSubscriptionInfo that = (SatelliteSubscriptionInfo) o; + return mIccId.equals(that.getIccId()) && mNiddApn.equals(that.getNiddApn()); + } + + @Override + public int hashCode() { + return Objects.hash(getIccId(), getNiddApn()); + } + + @NonNull + public String getIccId() { + return mIccId; + } + + @NonNull + public String getNiddApn() { + return mNiddApn; + } +} diff --git a/telephony/java/android/telephony/satellite/stub/SatelliteModemEnableRequestAttributes.aidl b/telephony/java/android/telephony/satellite/stub/SatelliteModemEnableRequestAttributes.aidl new file mode 100644 index 000000000000..0a40e15098c9 --- /dev/null +++ b/telephony/java/android/telephony/satellite/stub/SatelliteModemEnableRequestAttributes.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 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.satellite.stub; + +import android.telephony.satellite.stub.SatelliteSubscriptionInfo; + +/** + * {@hide} + */ + parcelable SatelliteModemEnableRequestAttributes { + /** + * {@code true} to enable satellite and {@code false} to disable. + */ + boolean isEnabled; + /** + * {@code true} to enable demo mode and {@code false} to disable. + */ + boolean isDemoMode; + /** + * {@code true} to enable emergency modeand {@code false} to disable. + */ + boolean isEmergencyMode; + /** + * The subscription related info. + */ + SatelliteSubscriptionInfo satelliteSubscriptionInfo; + }
\ No newline at end of file diff --git a/telephony/java/android/telephony/satellite/stub/SatelliteSubscriptionInfo.aidl b/telephony/java/android/telephony/satellite/stub/SatelliteSubscriptionInfo.aidl new file mode 100644 index 000000000000..f664ddac8d1b --- /dev/null +++ b/telephony/java/android/telephony/satellite/stub/SatelliteSubscriptionInfo.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2023 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.satellite.stub; + +/** + * {@hide} + */ + parcelable SatelliteSubscriptionInfo { + /** + * The ICC ID used for satellite attachment. + */ + String iccId; + /** + * The NIDD(Non IP Data) APN to be used for carrier roaming to satellite attachment. + */ + String niddApn; + }
\ No newline at end of file |