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

Commit 6566cc3d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add NavIC L1 support in GnssNavigationMessage" into main

parents 0c8c883e 30eecd45
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ aconfig_srcjars = [
    ":android.content.pm.flags-aconfig-java{.generated_srcjars}",
    ":android.content.res.flags-aconfig-java{.generated_srcjars}",
    ":android.hardware.radio.flags-aconfig-java{.generated_srcjars}",
    ":android.location.flags-aconfig-java{.generated_srcjars}",
    ":android.nfc.flags-aconfig-java{.generated_srcjars}",
    ":android.os.flags-aconfig-java{.generated_srcjars}",
    ":android.os.vibrator.flags-aconfig-java{.generated_srcjars}",
@@ -142,6 +143,21 @@ cc_aconfig_library {
    aconfig_declarations: "com.android.text.flags-aconfig",
}

// Location
aconfig_declarations {
    name: "android.location.flags-aconfig",
    package: "android.location.flags",
    srcs: [
        "location/java/android/location/flags/*.aconfig",
    ],
}

java_aconfig_library {
    name: "android.location.flags-aconfig-java",
    aconfig_declarations: "android.location.flags-aconfig",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// NFC
aconfig_declarations {
    name: "android.nfc.flags-aconfig",
+3 −1
Original line number Diff line number Diff line
@@ -412,7 +412,9 @@ package android.location {
    field public static final int TYPE_GPS_L1CA = 257; // 0x101
    field public static final int TYPE_GPS_L2CNAV = 258; // 0x102
    field public static final int TYPE_GPS_L5CNAV = 259; // 0x103
    field public static final int TYPE_IRN_L5CA = 1793; // 0x701
    field @FlaggedApi(Flags.FLAG_GNSS_API_NAVIC_L1) public static final int TYPE_IRN_L1 = 1795; // 0x703
    field @FlaggedApi(Flags.FLAG_GNSS_API_NAVIC_L1) public static final int TYPE_IRN_L5 = 1794; // 0x702
    field @Deprecated public static final int TYPE_IRN_L5CA = 1793; // 0x701
    field public static final int TYPE_QZS_L1CA = 1025; // 0x401
    field public static final int TYPE_SBS = 513; // 0x201
    field public static final int TYPE_UNKNOWN = 0; // 0x0
+34 −7
Original line number Diff line number Diff line
@@ -16,10 +16,12 @@

package android.location;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.TestApi;
import android.location.flags.Flags;
import android.os.Parcel;
import android.os.Parcelable;

@@ -41,7 +43,7 @@ public final class GnssNavigationMessage implements Parcelable {
    @Retention(RetentionPolicy.SOURCE)
    @IntDef({TYPE_UNKNOWN, TYPE_GPS_L1CA, TYPE_GPS_L2CNAV, TYPE_GPS_L5CNAV, TYPE_GPS_CNAV2,
            TYPE_SBS, TYPE_GLO_L1CA, TYPE_QZS_L1CA, TYPE_BDS_D1, TYPE_BDS_D2, TYPE_BDS_CNAV1,
            TYPE_BDS_CNAV2, TYPE_GAL_I, TYPE_GAL_F, TYPE_IRN_L5CA})
            TYPE_BDS_CNAV2, TYPE_GAL_I, TYPE_GAL_F, TYPE_IRN_L5CA, TYPE_IRN_L5, TYPE_IRN_L1})
    public @interface GnssNavigationMessageType {}

    // The following enumerations must be in sync with the values declared in gps.h
@@ -74,8 +76,18 @@ public final class GnssNavigationMessage implements Parcelable {
    public static final int TYPE_GAL_I = 0x0601;
    /** Galileo F/NAV message contained in the structure. */
    public static final int TYPE_GAL_F = 0x0602;
    /** IRNSS L5 C/A message contained in the structure. */
    /**
     * NavIC L5 C/A message contained in the structure.
     * @deprecated Use {@link #TYPE_IRN_L5} instead.
     */
    @Deprecated
    public static final int TYPE_IRN_L5CA = 0x0701;
    /** NavIC L5 message contained in the structure. */
    @FlaggedApi(Flags.FLAG_GNSS_API_NAVIC_L1)
    public static final int TYPE_IRN_L5 = 0x0702;
    /** NavIC L1 message contained in the structure. */
    @FlaggedApi(Flags.FLAG_GNSS_API_NAVIC_L1)
    public static final int TYPE_IRN_L1 = 0x0703;

    /**
     * The status of the GNSS Navigation Message
@@ -254,8 +266,15 @@ public final class GnssNavigationMessage implements Parcelable {
            case TYPE_GAL_F:
                return "Galileo F";
            case TYPE_IRN_L5CA:
                return "IRNSS L5 C/A";
                return "NavIC L5 C/A";
            default:
                if (Flags.gnssApiNavicL1()) {
                    if (mType == TYPE_IRN_L5) {
                        return "NavIC L5";
                    } else if (mType == TYPE_IRN_L1) {
                        return "NavIC L1";
                    }
                }
                return "<Invalid:" + mType + ">";
        }
    }
@@ -303,9 +322,12 @@ public final class GnssNavigationMessage implements Parcelable {
     * navigation message, in the range of 1-25 (Subframe 1, 2, 3 does not contain a 'frame id' and
     * this value can be set to -1.)</li>
     * <li> For Beidou CNAV1 this refers to the page type number in the range of 1-63.</li>
     * <li> For IRNSS L5 C/A subframe 3 and 4, this value corresponds to the Message Id of the
     * <li> For NavIC L5 subframe 3 and 4, this value corresponds to the Message Id of the
     * navigation message, in the range of 1-63. (Subframe 1 and 2 does not contain a message type
     * id and this value can be set to -1.)</li>
     * <li> For NavIC L1 subframe 3, this value corresponds to the Message Id of the navigation
     * message, in the range of 1-63. (Subframe 1 and 2 does not contain a message type id and this
     * value can be set to -1.)</li>
     * </ul>
     */
    @IntRange(from = -1, to = 120)
@@ -339,8 +361,10 @@ public final class GnssNavigationMessage implements Parcelable {
     * navigation message, in the range of 1-3.</li>
     * <li> For Beidou CNAV2, the submessage id corresponds to the message type, in the range
     * 1-63.</li>
     * <li> For IRNSS L5 C/A, the submessage id corresponds to the subframe number of the
     * navigation message, in the range of 1-4.</li>
     * <li> For NavIC L5, the submessage id corresponds to the subframe number of the navigation
     * message, in the range of 1-4.</li>
     * <li> For NavIC L1, the submessage id corresponds to the subframe number of the navigation
     * message, in the range of 1-3.</li>
     * </ul>
     */
    @IntRange(from = 1)
@@ -363,7 +387,7 @@ public final class GnssNavigationMessage implements Parcelable {
     * <p>The bytes (or words) specified using big endian format (MSB first).
     *
     * <ul>
     * <li>For GPS L1 C/A, IRNSS L5 C/A, Beidou D1 &amp; Beidou D2, each subframe contains 10
     * <li>For GPS L1 C/A, NavIC L5, Beidou D1 &amp; Beidou D2, each subframe contains 10
     * 30-bit words. Each word (30 bits) should be fit into the last 30 bits in a 4-byte word (skip
     * B31 and B32), with MSB first, for a total of 40 bytes, covering a time period of 6, 6, and
     * 0.6 seconds, respectively.</li>
@@ -383,6 +407,9 @@ public final class GnssNavigationMessage implements Parcelable {
     * 75 bytes. subframe #3 consists of 264 data bits that should be fit into 33 bytes.</li>
     * <li>For Beidou CNAV2, each subframe consists of 288 data bits, that should be fit into 36
     * bytes.</li>
     * <li> For NavIC L1, subframe #1 consists of 9 data bits that should be fit into 2 bytes (skip
     * B10-B16). subframe #2 consists of 600 bits that should be fit into 75 bytes. subframe #3
     * consists of 274 data bits that should be fit into 35 bytes (skip B275-B280).</li>
     * </ul>
     */
    @NonNull
+8 −0
Original line number Diff line number Diff line
package: "android.location.flags"

flag {
    name: "gnss_api_navic_l1"
    namespace: "location"
    description: "Flag for GNSS API for NavIC L1"
    bug: "302199306"
}
 No newline at end of file