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

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

Merge "Fix isValidV2 check for HD station location id" into main

parents 850d13c6 af20855c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ enum IdentifierType {
     * - 13 bit: Fractional bits of longitude
     * - 8 bit: Integer bits of longitude
     * - 1 bit: 0 for east and 1 for west for longitude
     * - 1 bit: 0, representing latitude
     * - 1 bit: 0, representing longitude
     * - 5 bit: pad of zeros separating longitude and latitude
     * - 4 bit: Bits 4:7 of altitude
     * - 13 bit: Fractional bits of latitude
+7 −6
Original line number Diff line number Diff line
@@ -102,15 +102,16 @@ bool isValidV2(const ProgramIdentifier& id) {
            expect(val < 1000u, "SXM channel < 1000");
            break;
        case IdentifierType::HD_STATION_LOCATION: {
            val >>= 26;
            uint64_t latitudeBit = val & 0x1;
            expect(latitudeBit == 1u, "Latitude comes first");
            val >>= 27;
            expect(latitudeBit == 0u, "Longitude comes first");
            val >>= 1;
            uint64_t latitudePad = val & 0x1Fu;
            expect(latitudePad == 0u, "Latitude padding");
            val >>= 5;
            expect(latitudePad == 0u, "Longitude padding");
            val >>= 31;
            uint64_t longitudeBit = val & 0x1;
            expect(longitudeBit == 1u, "Longitude comes next");
            val >>= 27;
            expect(longitudeBit == 1u, "Latitude comes next");
            val >>= 1;
            uint64_t longitudePad = val & 0x1Fu;
            expect(longitudePad == 0u, "Latitude padding");
            break;