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

Commit bdfcbbb3 authored by Sarah Chin's avatar Sarah Chin
Browse files

Update satellite APIs from feedback

Test: atest SatelliteManagerTest
Bug: 261053569
Change-Id: Id1eb6580ea365fbba188c44237e06e6e7ca7ba9d
Merged-In: Id1eb6580ea365fbba188c44237e06e6e7ca7ba9d
parent 1bee42eb
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -21,13 +21,6 @@ package android.telephony.satellite;
 * @hide
 * @hide
 */
 */
oneway interface ISatelliteStateCallback {
oneway interface ISatelliteStateCallback {
    /**
     * Indicates that the satellite has pending datagrams for the device to be pulled.
     *
     * @param count Number of pending datagrams.
     */
    void onPendingDatagramCount(in int count);

    /**
    /**
     * Indicates that the satellite modem state has changed.
     * Indicates that the satellite modem state has changed.
     *
     *
+1 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@ import android.telephony.satellite.PointingInfo;
 * Interface for position update and datagram transfer state change callback.
 * Interface for position update and datagram transfer state change callback.
 * @hide
 * @hide
 */
 */
oneway interface ISatellitePositionUpdateCallback {
oneway interface ISatelliteTransmissionUpdateCallback {
    /**
    /**
     * Called when satellite datagram transfer state changed.
     * Called when satellite datagram transfer state changed.
     *
     *
+1 −50
Original line number Original line Diff line number Diff line
@@ -30,31 +30,12 @@ public final class PointingInfo implements Parcelable {
    /** Satellite elevation in degrees */
    /** Satellite elevation in degrees */
    private float mSatelliteElevationDegrees;
    private float mSatelliteElevationDegrees;


    /** Antenna azimuth in degrees */
    private float mAntennaAzimuthDegrees;

    /**
     * Angle of rotation about the x axis. This value represents the angle between a plane
     * parallel to the device's screen and a plane parallel to the ground.
     */
    private float mAntennaPitchDegrees;

    /**
     * Angle of rotation about the y axis. This value represents the angle between a plane
     * perpendicular to the device's screen and a plane parallel to the ground.
     */
    private float mAntennaRollDegrees;

    /**
    /**
     * @hide
     * @hide
     */
     */
    public PointingInfo(float satelliteAzimuthDegrees, float satelliteElevationDegrees,
    public PointingInfo(float satelliteAzimuthDegrees, float satelliteElevationDegrees) {
            float antennaAzimuthDegrees, float antennaPitchDegrees, float antennaRollDegrees) {
        mSatelliteAzimuthDegrees = satelliteAzimuthDegrees;
        mSatelliteAzimuthDegrees = satelliteAzimuthDegrees;
        mSatelliteElevationDegrees = satelliteElevationDegrees;
        mSatelliteElevationDegrees = satelliteElevationDegrees;
        mAntennaAzimuthDegrees = antennaAzimuthDegrees;
        mAntennaPitchDegrees = antennaPitchDegrees;
        mAntennaRollDegrees = antennaRollDegrees;
    }
    }


    private PointingInfo(Parcel in) {
    private PointingInfo(Parcel in) {
@@ -70,9 +51,6 @@ public final class PointingInfo implements Parcelable {
    public void writeToParcel(@NonNull Parcel out, int flags) {
    public void writeToParcel(@NonNull Parcel out, int flags) {
        out.writeFloat(mSatelliteAzimuthDegrees);
        out.writeFloat(mSatelliteAzimuthDegrees);
        out.writeFloat(mSatelliteElevationDegrees);
        out.writeFloat(mSatelliteElevationDegrees);
        out.writeFloat(mAntennaAzimuthDegrees);
        out.writeFloat(mAntennaPitchDegrees);
        out.writeFloat(mAntennaRollDegrees);
    }
    }


    public static final @android.annotation.NonNull Creator<PointingInfo> CREATOR =
    public static final @android.annotation.NonNull Creator<PointingInfo> CREATOR =
@@ -99,18 +77,6 @@ public final class PointingInfo implements Parcelable {


        sb.append("SatelliteElevationDegrees:");
        sb.append("SatelliteElevationDegrees:");
        sb.append(mSatelliteElevationDegrees);
        sb.append(mSatelliteElevationDegrees);
        sb.append(",");

        sb.append("AntennaAzimuthDegrees:");
        sb.append(mAntennaAzimuthDegrees);
        sb.append(",");

        sb.append("AntennaPitchDegrees:");
        sb.append(mAntennaPitchDegrees);
        sb.append(",");

        sb.append("AntennaRollDegrees:");
        sb.append(mAntennaRollDegrees);
        return sb.toString();
        return sb.toString();
    }
    }


@@ -122,23 +88,8 @@ public final class PointingInfo implements Parcelable {
        return mSatelliteElevationDegrees;
        return mSatelliteElevationDegrees;
    }
    }


    public float getAntennaAzimuthDegrees() {
        return mAntennaAzimuthDegrees;
    }

    public float getAntennaPitchDegrees() {
        return mAntennaPitchDegrees;
    }

    public float getAntennaRollDegrees() {
        return mAntennaRollDegrees;
    }

    private void readFromParcel(Parcel in) {
    private void readFromParcel(Parcel in) {
        mSatelliteAzimuthDegrees = in.readFloat();
        mSatelliteAzimuthDegrees = in.readFloat();
        mSatelliteElevationDegrees = in.readFloat();
        mSatelliteElevationDegrees = in.readFloat();
        mAntennaAzimuthDegrees = in.readFloat();
        mAntennaPitchDegrees = in.readFloat();
        mAntennaRollDegrees = in.readFloat();
    }
    }
}
}
+22 −46
Original line number Original line Diff line number Diff line
@@ -32,32 +32,25 @@ public final class SatelliteCapabilities implements Parcelable {
     */
     */
    @NonNull @SatelliteManager.NTRadioTechnology private Set<Integer> mSupportedRadioTechnologies;
    @NonNull @SatelliteManager.NTRadioTechnology private Set<Integer> mSupportedRadioTechnologies;


    /**
     * Whether satellite modem is always on.
     * This indicates the power impact of keeping it on is very minimal.
     */
    private boolean mIsAlwaysOn;

    /**
    /**
     * Whether UE needs to point to a satellite to send and receive data.
     * Whether UE needs to point to a satellite to send and receive data.
     */
     */
    private boolean mNeedsPointingToSatellite;
    private boolean mIsPointingRequired;


    /**
    /**
     * Whether UE needs a separate SIM profile to communicate with the satellite network.
     * The maximum number of bytes per datagram that can be sent over satellite.
     */
     */
    private boolean mNeedsSeparateSimProfile;
    private int mMaxBytesPerOutgoingDatagram;


    /**
    /**
     * @hide
     * @hide
     */
     */
    public SatelliteCapabilities(Set<Integer> supportedRadioTechnologies, boolean isAlwaysOn,
    public SatelliteCapabilities(Set<Integer> supportedRadioTechnologies,
            boolean needsPointingToSatellite, boolean needsSeparateSimProfile) {
            boolean isPointingRequired, int maxBytesPerOutgoingDatagram) {
        mSupportedRadioTechnologies = supportedRadioTechnologies == null
        mSupportedRadioTechnologies = supportedRadioTechnologies == null
                ? new HashSet<>() : supportedRadioTechnologies;
                ? new HashSet<>() : supportedRadioTechnologies;
        mIsAlwaysOn = isAlwaysOn;
        mIsPointingRequired = isPointingRequired;
        mNeedsPointingToSatellite = needsPointingToSatellite;
        mMaxBytesPerOutgoingDatagram = maxBytesPerOutgoingDatagram;
        mNeedsSeparateSimProfile = needsSeparateSimProfile;
    }
    }


    private SatelliteCapabilities(Parcel in) {
    private SatelliteCapabilities(Parcel in) {
@@ -80,9 +73,8 @@ public final class SatelliteCapabilities implements Parcelable {
            out.writeInt(0);
            out.writeInt(0);
        }
        }


        out.writeBoolean(mIsAlwaysOn);
        out.writeBoolean(mIsPointingRequired);
        out.writeBoolean(mNeedsPointingToSatellite);
        out.writeInt(mMaxBytesPerOutgoingDatagram);
        out.writeBoolean(mNeedsSeparateSimProfile);
    }
    }


    @NonNull public static final Creator<SatelliteCapabilities> CREATOR = new Creator<>() {
    @NonNull public static final Creator<SatelliteCapabilities> CREATOR = new Creator<>() {
@@ -111,16 +103,12 @@ public final class SatelliteCapabilities implements Parcelable {
            sb.append("none,");
            sb.append("none,");
        }
        }


        sb.append("isAlwaysOn:");
        sb.append("isPointingRequired:");
        sb.append(mIsAlwaysOn);
        sb.append(mIsPointingRequired);
        sb.append(",");

        sb.append("needsPointingToSatellite:");
        sb.append(mNeedsPointingToSatellite);
        sb.append(",");
        sb.append(",");


        sb.append("needsSeparateSimProfile:");
        sb.append("maxBytesPerOutgoingDatagram");
        sb.append(mNeedsSeparateSimProfile);
        sb.append(mMaxBytesPerOutgoingDatagram);
        return sb.toString();
        return sb.toString();
    }
    }


@@ -132,34 +120,23 @@ public final class SatelliteCapabilities implements Parcelable {
        return mSupportedRadioTechnologies;
        return mSupportedRadioTechnologies;
    }
    }


    /**
     * Get whether the satellite modem is always on.
     * This indicates the power impact of keeping it on is very minimal.
     *
     * @return {@code true} if the satellite modem is always on and {@code false} otherwise.
     */
    public boolean isAlwaysOn() {
        return mIsAlwaysOn;
    }

    /**
    /**
     * Get whether UE needs to point to a satellite to send and receive data.
     * Get whether UE needs to point to a satellite to send and receive data.
     *
     *
     * @return {@code true} if UE needs to pointing to a satellite to send and receive data and
     * @return {@code true} if UE needs to point to a satellite to send and receive data and
     *         {@code false} otherwise.
     *         {@code false} otherwise.
     */
     */
    public boolean needsPointingToSatellite() {
    public boolean isPointingRequired() {
        return mNeedsPointingToSatellite;
        return mIsPointingRequired;
    }
    }


    /**
    /**
     * Get whether UE needs a separate SIM profile to communicate with the satellite network.
     * The maximum number of bytes per datagram that can be sent over satellite.
     *
     *
     * @return {@code true} if UE needs a separate SIM profile to comunicate with the satellite
     * @return The maximum number of bytes per datagram that can be sent over satellite.
     *         network and {@code false} otherwise.
     */
     */
    public boolean needsSeparateSimProfile() {
    public int getMaxBytesPerOutgoingDatagram() {
        return mNeedsSeparateSimProfile;
        return mMaxBytesPerOutgoingDatagram;
    }
    }


    private void readFromParcel(Parcel in) {
    private void readFromParcel(Parcel in) {
@@ -171,8 +148,7 @@ public final class SatelliteCapabilities implements Parcelable {
            }
            }
        }
        }


        mIsAlwaysOn = in.readBoolean();
        mIsPointingRequired = in.readBoolean();
        mNeedsPointingToSatellite = in.readBoolean();
        mMaxBytesPerOutgoingDatagram = in.readInt();
        mNeedsSeparateSimProfile = in.readBoolean();
    }
    }
}
}
+4 −6
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@
package android.telephony.satellite;
package android.telephony.satellite;


import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable;


@@ -28,7 +27,7 @@ public final class SatelliteDatagram implements Parcelable {
    /**
    /**
     * Datagram to be sent or received over satellite.
     * Datagram to be sent or received over satellite.
     */
     */
    private byte[] mData;
    @NonNull private byte[] mData;


    /**
    /**
     * @hide
     * @hide
@@ -51,8 +50,8 @@ public final class SatelliteDatagram implements Parcelable {
        out.writeByteArray(mData);
        out.writeByteArray(mData);
    }
    }


    public static final @android.annotation.NonNull Creator<SatelliteDatagram> CREATOR =
    @NonNull public static final Creator<SatelliteDatagram> CREATOR =
            new Creator<SatelliteDatagram>() {
            new Creator<>() {
                @Override
                @Override
                public SatelliteDatagram createFromParcel(Parcel in) {
                public SatelliteDatagram createFromParcel(Parcel in) {
                    return new SatelliteDatagram(in);
                    return new SatelliteDatagram(in);
@@ -64,8 +63,7 @@ public final class SatelliteDatagram implements Parcelable {
                }
                }
            };
            };


    @Nullable
    @NonNull public byte[] getSatelliteDatagram() {
    public byte[] getSatelliteDatagram() {
        return mData;
        return mData;
    }
    }


Loading