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

Commit 120480f1 authored by Lifu Tang's avatar Lifu Tang
Browse files

Optimized the memory consumption and renamed PRN

Bug: 27058251
Change-Id: I2309943b1a4e7565868ed0f247b84edc631fbd59
parent d9eec15d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -19184,7 +19184,6 @@ package android.location {
    method public double getElevationUncertaintyInDeg();
    method public byte getLossOfLock();
    method public byte getMultipathIndicator();
    method public byte getPrn();
    method public double getPseudorangeInMeters();
    method public double getPseudorangeRateCarrierInMetersPerSec();
    method public double getPseudorangeRateCarrierUncertaintyInMetersPerSec();
@@ -19195,6 +19194,7 @@ package android.location {
    method public long getReceivedGpsTowUncertaintyInNs();
    method public double getSnrInDb();
    method public short getState();
    method public short getSvid();
    method public short getTimeFromLastBitInMs();
    method public double getTimeOffsetInNs();
    method public boolean hasAzimuthInDeg();
@@ -19254,7 +19254,6 @@ package android.location {
    method public void setElevationUncertaintyInDeg(double);
    method public void setLossOfLock(byte);
    method public void setMultipathIndicator(byte);
    method public void setPrn(byte);
    method public void setPseudorangeInMeters(double);
    method public void setPseudorangeRateCarrierInMetersPerSec(double);
    method public void setPseudorangeRateCarrierUncertaintyInMetersPerSec(double);
@@ -19265,6 +19264,7 @@ package android.location {
    method public void setReceivedGpsTowUncertaintyInNs(long);
    method public void setSnrInDb(double);
    method public void setState(short);
    method public void setSvid(short);
    method public void setTimeFromLastBitInMs(short);
    method public void setTimeOffsetInNs(double);
    method public void setUsedInFix(boolean);
@@ -19319,17 +19319,17 @@ package android.location {
    method public int describeContents();
    method public byte[] getData();
    method public short getMessageId();
    method public byte getPrn();
    method public short getStatus();
    method public short getSubmessageId();
    method public short getSvid();
    method public byte getType();
    method public void reset();
    method public void set(android.location.GnssNavigationMessage);
    method public void setData(byte[]);
    method public void setMessageId(short);
    method public void setPrn(byte);
    method public void setStatus(short);
    method public void setSubmessageId(short);
    method public void setSvid(short);
    method public void setType(byte);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
@@ -19375,8 +19375,8 @@ package android.location {
    method public int getConstellationType(int);
    method public float getElevation(int);
    method public int getNumSatellites();
    method public int getPrn(int);
    method public float getSnr(int);
    method public int getSvid(int);
    method public boolean hasAlmanac(int);
    method public boolean hasEphemeris(int);
    method public boolean usedInFix(int);
+5 −5
Original line number Diff line number Diff line
@@ -20365,7 +20365,6 @@ package android.location {
    method public double getElevationUncertaintyInDeg();
    method public byte getLossOfLock();
    method public byte getMultipathIndicator();
    method public byte getPrn();
    method public double getPseudorangeInMeters();
    method public double getPseudorangeRateCarrierInMetersPerSec();
    method public double getPseudorangeRateCarrierUncertaintyInMetersPerSec();
@@ -20376,6 +20375,7 @@ package android.location {
    method public long getReceivedGpsTowUncertaintyInNs();
    method public double getSnrInDb();
    method public short getState();
    method public short getSvid();
    method public short getTimeFromLastBitInMs();
    method public double getTimeOffsetInNs();
    method public boolean hasAzimuthInDeg();
@@ -20435,7 +20435,6 @@ package android.location {
    method public void setElevationUncertaintyInDeg(double);
    method public void setLossOfLock(byte);
    method public void setMultipathIndicator(byte);
    method public void setPrn(byte);
    method public void setPseudorangeInMeters(double);
    method public void setPseudorangeRateCarrierInMetersPerSec(double);
    method public void setPseudorangeRateCarrierUncertaintyInMetersPerSec(double);
@@ -20446,6 +20445,7 @@ package android.location {
    method public void setReceivedGpsTowUncertaintyInNs(long);
    method public void setSnrInDb(double);
    method public void setState(short);
    method public void setSvid(short);
    method public void setTimeFromLastBitInMs(short);
    method public void setTimeOffsetInNs(double);
    method public void setUsedInFix(boolean);
@@ -20500,17 +20500,17 @@ package android.location {
    method public int describeContents();
    method public byte[] getData();
    method public short getMessageId();
    method public byte getPrn();
    method public short getStatus();
    method public short getSubmessageId();
    method public short getSvid();
    method public byte getType();
    method public void reset();
    method public void set(android.location.GnssNavigationMessage);
    method public void setData(byte[]);
    method public void setMessageId(short);
    method public void setPrn(byte);
    method public void setStatus(short);
    method public void setSubmessageId(short);
    method public void setSvid(short);
    method public void setType(byte);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
@@ -20556,8 +20556,8 @@ package android.location {
    method public int getConstellationType(int);
    method public float getElevation(int);
    method public int getNumSatellites();
    method public int getPrn(int);
    method public float getSnr(int);
    method public int getSvid(int);
    method public boolean hasAlmanac(int);
    method public boolean hasEphemeris(int);
    method public boolean usedInFix(int);
+5 −5
Original line number Diff line number Diff line
@@ -19192,7 +19192,6 @@ package android.location {
    method public double getElevationUncertaintyInDeg();
    method public byte getLossOfLock();
    method public byte getMultipathIndicator();
    method public byte getPrn();
    method public double getPseudorangeInMeters();
    method public double getPseudorangeRateCarrierInMetersPerSec();
    method public double getPseudorangeRateCarrierUncertaintyInMetersPerSec();
@@ -19203,6 +19202,7 @@ package android.location {
    method public long getReceivedGpsTowUncertaintyInNs();
    method public double getSnrInDb();
    method public short getState();
    method public short getSvid();
    method public short getTimeFromLastBitInMs();
    method public double getTimeOffsetInNs();
    method public boolean hasAzimuthInDeg();
@@ -19262,7 +19262,6 @@ package android.location {
    method public void setElevationUncertaintyInDeg(double);
    method public void setLossOfLock(byte);
    method public void setMultipathIndicator(byte);
    method public void setPrn(byte);
    method public void setPseudorangeInMeters(double);
    method public void setPseudorangeRateCarrierInMetersPerSec(double);
    method public void setPseudorangeRateCarrierUncertaintyInMetersPerSec(double);
@@ -19273,6 +19272,7 @@ package android.location {
    method public void setReceivedGpsTowUncertaintyInNs(long);
    method public void setSnrInDb(double);
    method public void setState(short);
    method public void setSvid(short);
    method public void setTimeFromLastBitInMs(short);
    method public void setTimeOffsetInNs(double);
    method public void setUsedInFix(boolean);
@@ -19327,17 +19327,17 @@ package android.location {
    method public int describeContents();
    method public byte[] getData();
    method public short getMessageId();
    method public byte getPrn();
    method public short getStatus();
    method public short getSubmessageId();
    method public short getSvid();
    method public byte getType();
    method public void reset();
    method public void set(android.location.GnssNavigationMessage);
    method public void setData(byte[]);
    method public void setMessageId(short);
    method public void setPrn(byte);
    method public void setStatus(short);
    method public void setSubmessageId(short);
    method public void setSvid(short);
    method public void setType(byte);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
@@ -19383,8 +19383,8 @@ package android.location {
    method public int getConstellationType(int);
    method public float getElevation(int);
    method public int getNumSatellites();
    method public int getPrn(int);
    method public float getSnr(int);
    method public int getSvid(int);
    method public boolean hasAlmanac(int);
    method public boolean hasEphemeris(int);
    method public boolean usedInFix(int);
+11 −10
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import java.lang.annotation.RetentionPolicy;
 */
public final class GnssMeasurement implements Parcelable {
    private int mFlags;
    private byte mPrn;
    private short mSvid;
    private double mTimeOffsetInNs;
    private short mState;
    private long mReceivedGpsTowInNs;
@@ -198,7 +198,7 @@ public final class GnssMeasurement implements Parcelable {
     */
    public void set(GnssMeasurement measurement) {
        mFlags = measurement.mFlags;
        mPrn = measurement.mPrn;
        mSvid = measurement.mSvid;
        mTimeOffsetInNs = measurement.mTimeOffsetInNs;
        mState = measurement.mState;
        mReceivedGpsTowInNs = measurement.mReceivedGpsTowInNs;
@@ -248,15 +248,15 @@ public final class GnssMeasurement implements Parcelable {
     * Gets the Pseudo-random number (PRN).
     * Range: [1, 32]
     */
    public byte getPrn() {
        return mPrn;
    public short getSvid() {
        return mSvid;
    }

    /**
     * Sets the Pseud-random number (PRN).
     */
    public void setPrn(byte value) {
        mPrn = value;
    public void setSvid(short value) {
        mSvid = value;
    }

    /**
@@ -1210,7 +1210,7 @@ public final class GnssMeasurement implements Parcelable {
            GnssMeasurement gnssMeasurement = new GnssMeasurement();

            gnssMeasurement.mFlags = parcel.readInt();
            gnssMeasurement.mPrn = parcel.readByte();
            gnssMeasurement.mSvid = (short) parcel.readInt();
            gnssMeasurement.mTimeOffsetInNs = parcel.readDouble();
            gnssMeasurement.mState = (short) parcel.readInt();
            gnssMeasurement.mReceivedGpsTowInNs = parcel.readLong();
@@ -1253,9 +1253,10 @@ public final class GnssMeasurement implements Parcelable {
        }
    };

    @Override
    public void writeToParcel(Parcel parcel, int flags) {
        parcel.writeInt(mFlags);
        parcel.writeByte(mPrn);
        parcel.writeInt(mSvid);
        parcel.writeDouble(mTimeOffsetInNs);
        parcel.writeInt(mState);
        parcel.writeLong(mReceivedGpsTowInNs);
@@ -1301,7 +1302,7 @@ public final class GnssMeasurement implements Parcelable {
        final String formatWithUncertainty = "   %-29s = %-25s   %-40s = %s\n";
        StringBuilder builder = new StringBuilder("GnssMeasurement:\n");

        builder.append(String.format(format, "Prn", mPrn));
        builder.append(String.format(format, "Svid", mSvid));

        builder.append(String.format(format, "TimeOffsetInNs", mTimeOffsetInNs));

@@ -1422,7 +1423,7 @@ public final class GnssMeasurement implements Parcelable {

    private void initialize() {
        mFlags = HAS_NO_FLAGS;
        setPrn(Byte.MIN_VALUE);
        setSvid((short) 0);
        setTimeOffsetInNs(Long.MIN_VALUE);
        setState(STATE_UNKNOWN);
        setReceivedGpsTowInNs(Long.MIN_VALUE);
+12 −11
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import java.lang.annotation.RetentionPolicy;
import java.security.InvalidParameterException;

/**
 * A class containing a GPS satellite Navigation Message.
 * A class containing a GNSS satellite Navigation Message.
 */
public final class GnssNavigationMessage implements Parcelable {

@@ -84,7 +84,7 @@ public final class GnssNavigationMessage implements Parcelable {
    // End enumerations in sync with gps.h

    private byte mType;
    private byte mPrn;
    private short mSvid;
    private short mMessageId;
    private short mSubmessageId;
    private byte[] mData;
@@ -99,7 +99,7 @@ public final class GnssNavigationMessage implements Parcelable {
     */
    public void set(GnssNavigationMessage navigationMessage) {
        mType = navigationMessage.mType;
        mPrn = navigationMessage.mPrn;
        mSvid = navigationMessage.mSvid;
        mMessageId = navigationMessage.mMessageId;
        mSubmessageId = navigationMessage.mSubmessageId;
        mData = navigationMessage.mData;
@@ -153,15 +153,15 @@ public final class GnssNavigationMessage implements Parcelable {
     * Gets the Pseudo-random number.
     * Range: [1, 32].
     */
    public byte getPrn() {
        return mPrn;
    public short getSvid() {
        return mSvid;
    }

    /**
     * Sets the Pseud-random number.
     */
    public void setPrn(byte value) {
        mPrn = value;
    public void setSvid(short value) {
        mSvid = value;
    }

    /**
@@ -256,7 +256,7 @@ public final class GnssNavigationMessage implements Parcelable {
            GnssNavigationMessage navigationMessage = new GnssNavigationMessage();

            navigationMessage.setType(parcel.readByte());
            navigationMessage.setPrn(parcel.readByte());
            navigationMessage.setSvid((short) parcel.readInt());
            navigationMessage.setMessageId((short) parcel.readInt());
            navigationMessage.setSubmessageId((short) parcel.readInt());

@@ -281,9 +281,10 @@ public final class GnssNavigationMessage implements Parcelable {
        }
    };

    @Override
    public void writeToParcel(Parcel parcel, int flags) {
        parcel.writeByte(mType);
        parcel.writeByte(mPrn);
        parcel.writeInt(mSvid);
        parcel.writeInt(mMessageId);
        parcel.writeInt(mSubmessageId);
        parcel.writeInt(mData.length);
@@ -302,7 +303,7 @@ public final class GnssNavigationMessage implements Parcelable {
        StringBuilder builder = new StringBuilder("GnssNavigationMessage:\n");

        builder.append(String.format(format, "Type", getTypeString()));
        builder.append(String.format(format, "Prn", mPrn));
        builder.append(String.format(format, "Svid", mSvid));
        builder.append(String.format(format, "Status", getStatusString()));
        builder.append(String.format(format, "MessageId", mMessageId));
        builder.append(String.format(format, "SubmessageId", mSubmessageId));
@@ -321,7 +322,7 @@ public final class GnssNavigationMessage implements Parcelable {

    private void initialize() {
        mType = MESSAGE_TYPE_UNKNOWN;
        mPrn = 0;
        mSvid = 0;
        mMessageId = -1;
        mSubmessageId = -1;
        mData = EMPTY_ARRAY;
Loading