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

Commit f08a718d authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4521654 from de69e329 to pi-release

Change-Id: Ic31d23d4dc5dd14362580053513d06eb155c7908
parents 8f78e391 de69e329
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1942,7 +1942,7 @@ enum VehicleProperty: int32_t {
        0x0BC0
        | VehiclePropertyGroup:SYSTEM
        | VehiclePropertyType:INT32
        | VehicleArea:GLOBAL),
        | VehicleArea:WINDOW),

    /**
     * Window Move
@@ -1959,7 +1959,7 @@ enum VehicleProperty: int32_t {
        0x0BC1
        | VehiclePropertyGroup:SYSTEM
        | VehiclePropertyType:INT32
        | VehicleArea:GLOBAL),
        | VehicleArea:WINDOW),

    /**
     * Window Vent Position
@@ -1976,7 +1976,7 @@ enum VehicleProperty: int32_t {
        0x0BC2
        | VehiclePropertyGroup:SYSTEM
        | VehiclePropertyType:INT32
        | VehicleArea:GLOBAL),
        | VehicleArea:WINDOW),

    /**
     * Window Vent Move
@@ -1993,7 +1993,7 @@ enum VehicleProperty: int32_t {
        0x0BC3
        | VehiclePropertyGroup:SYSTEM
        | VehiclePropertyType:INT32
        | VehicleArea:GLOBAL),
        | VehicleArea:WINDOW),

    /**
     * Window Lock
@@ -2007,7 +2007,7 @@ enum VehicleProperty: int32_t {
        0x0BC4
        | VehiclePropertyGroup:SYSTEM
        | VehiclePropertyType:BOOLEAN
        | VehicleArea:GLOBAL),
        | VehicleArea:WINDOW),


    /**
+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ TunerSession::TunerSession(BroadcastRadio& module, const sp<ITunerCallback>& cal
static ProgramInfo makeDummyProgramInfo(const ProgramSelector& selector) {
    ProgramInfo info = {};
    info.selector = selector;
    info.logicallyTunedTo = utils::make_identifier(
        IdentifierType::AMFM_FREQUENCY, utils::getId(selector, IdentifierType::AMFM_FREQUENCY));
    info.physicallyTunedTo = info.logicallyTunedTo;
    return info;
}

+37 −0
Original line number Diff line number Diff line
@@ -13,11 +13,15 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#define LOG_TAG "BcRadioDef.VirtualProgram"

#include "VirtualProgram.h"

#include "resources.h"

#include <android-base/logging.h>
#include <broadcastradio-utils-2x/Utils.h>
#include <log/log.h>

namespace android {
namespace hardware {
@@ -38,6 +42,39 @@ VirtualProgram::operator ProgramInfo() const {
    auto pType = getType(selector.primaryId);
    auto isDigital = (pType != IdentifierType::AMFM_FREQUENCY && pType != IdentifierType::RDS_PI);

    auto selectId = [&info](IdentifierType type) {
        return utils::make_identifier(type, utils::getId(info.selector, type));
    };

    switch (pType) {
        case IdentifierType::AMFM_FREQUENCY:
            info.logicallyTunedTo = info.physicallyTunedTo =
                selectId(IdentifierType::AMFM_FREQUENCY);
            break;
        case IdentifierType::RDS_PI:
            info.logicallyTunedTo = selectId(IdentifierType::RDS_PI);
            info.physicallyTunedTo = selectId(IdentifierType::AMFM_FREQUENCY);
            break;
        case IdentifierType::HD_STATION_ID_EXT:
            info.logicallyTunedTo = selectId(IdentifierType::HD_STATION_ID_EXT);
            info.physicallyTunedTo = selectId(IdentifierType::AMFM_FREQUENCY);
            break;
        case IdentifierType::DAB_SID_EXT:
            info.logicallyTunedTo = selectId(IdentifierType::DAB_SID_EXT);
            info.physicallyTunedTo = selectId(IdentifierType::DAB_ENSEMBLE);
            break;
        case IdentifierType::DRMO_SERVICE_ID:
            info.logicallyTunedTo = selectId(IdentifierType::DRMO_SERVICE_ID);
            info.physicallyTunedTo = selectId(IdentifierType::DRMO_FREQUENCY);
            break;
        case IdentifierType::SXM_SERVICE_ID:
            info.logicallyTunedTo = selectId(IdentifierType::SXM_SERVICE_ID);
            info.physicallyTunedTo = selectId(IdentifierType::SXM_CHANNEL);
            break;
        default:
            LOG(FATAL) << "Unsupported program type: " << toString(pType);
    }

    info.infoFlags |= ProgramInfoFlags::TUNED;
    info.infoFlags |= ProgramInfoFlags::STEREO;
    info.signalQuality = isDigital ? 100 : 80;
+66 −1
Original line number Diff line number Diff line
@@ -185,6 +185,69 @@ struct ProgramInfo {
     */
    ProgramSelector selector;

    /**
     * Identifier currently used for program selection.
     *
     * It allows to determine which technology is currently used for reception.
     *
     * Some program selectors contain tuning information for different radio
     * technologies (i.e. FM RDS and DAB). For example, user may tune using
     * a ProgramSelector with RDS_PI primary identifier, but the tuner hardware
     * may choose to use DAB technology to make actual tuning. This identifier
     * must reflect that.
     *
     * This field is optional, but must be set for currently tuned program.
     * If it's not set, its value must be initialized to all-zeros.
     *
     * Only primary identifiers for a given radio technology are valid:
     *  - AMFM_FREQUENCY for analog AM/FM;
     *  - RDS_PI for FM RDS;
     *  - HD_STATION_ID_EXT;
     *  - DAB_SID_EXT;
     *  - DRMO_SERVICE_ID;
     *  - SXM_SERVICE_ID;
     *  - VENDOR_*;
     *  - more might come in next minor versions of this HAL.
     */
    ProgramIdentifier logicallyTunedTo;

    /**
     * Identifier currently used by hardware to physically tune to a channel.
     *
     * Some radio technologies broadcast the same program on multiple channels,
     * i.e. with RDS AF the same program may be broadcasted on multiple
     * alternative frequencies; the same DAB program may be broadcast on
     * multiple ensembles. This identifier points to the channel to which the
     * radio hardware is physically tuned to.
     *
     * This field is optional, but must be set for currently tuned program.
     * If it's not set, its type field must be initialized to
     * IdentifierType::INVALID.
     *
     * Only physical identifiers are valid:
     *  - AMFM_FREQUENCY;
     *  - DAB_ENSEMBLE;
     *  - DRMO_FREQUENCY;
     *  - SXM_CHANNEL;
     *  - VENDOR_*;
     *  - more might come in next minor versions of this HAL.
     */
    ProgramIdentifier physicallyTunedTo;

    /**
     * Primary identifiers of related contents.
     *
     * Some radio technologies provide pointers to other programs that carry
     * related content (i.e. DAB soft-links). This field is a list of pointers
     * to other programs on the program list.
     *
     * Please note, that these identifiers does not have to exist on the program
     * list - i.e. DAB tuner may provide information on FM RDS alternatives
     * despite not supporting FM RDS. If the system has multiple tuners, another
     * one may have it on its list.
     */
    vec<ProgramIdentifier> relatedContent;

    bitfield<ProgramInfoFlags> infoFlags;

    /**
@@ -275,6 +338,8 @@ enum IdentifierType : uint32_t {
    /** See VENDOR_START */
    VENDOR_END = 1999,

    INVALID = 0,

    /**
     * Primary identifier for analogue (without RDS) AM/FM stations:
     * frequency in kHz.
@@ -285,7 +350,7 @@ enum IdentifierType : uint32_t {
     *  - 1.71MHz - 30MHz: AM SW;
     *  - >60MHz: FM.
     */
    AMFM_FREQUENCY = 1,
    AMFM_FREQUENCY,

    /**
     * 16bit primary identifier for FM RDS station.
+3 −0
Original line number Diff line number Diff line
@@ -520,6 +520,9 @@ TEST_F(BroadcastRadioHalTest, GetProgramList) {
    EXPECT_TRUE(stopResult.isOk());
}

// TODO(b/70939328): test ProgramInfo's currentlyTunedId and
// currentlyTunedChannel once the program list is implemented.

}  // namespace vts
}  // namespace V2_0
}  // namespace broadcastradio
Loading