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

Commit aee3513e authored by Haofan Wang's avatar Haofan Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix default implementation and VTS error" into main

parents baaa5576 b0457dde
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -62,15 +62,15 @@ impl MediaQualityService {
    pub fn new() -> Self {
        Self {
            callback: Arc::new(Mutex::new(None)),
            ambient_backlight_supported: Arc::new(Mutex::new(false)),
            ambient_backlight_enabled: Arc::new(Mutex::new(true)),
            ambient_backlight_supported: Arc::new(Mutex::new(true)),
            ambient_backlight_enabled: Arc::new(Mutex::new(false)),
            ambient_backlight_detector_settings:
                    Arc::new(Mutex::new(AmbientBacklightSettings::default())),
            auto_pq_supported: Arc::new(Mutex::new(false)),
            auto_pq_supported: Arc::new(Mutex::new(true)),
            auto_pq_enabled: Arc::new(Mutex::new(false)),
            auto_sr_supported: Arc::new(Mutex::new(false)),
            auto_sr_supported: Arc::new(Mutex::new(true)),
            auto_sr_enabled: Arc::new(Mutex::new(false)),
            auto_aq_supported: Arc::new(Mutex::new(false)),
            auto_aq_supported: Arc::new(Mutex::new(true)),
            auto_aq_enabled: Arc::new(Mutex::new(false)),
            picture_profile_adjustment_listener: Arc::new(Mutex::new(None)),
            sound_profile_adjustment_listener: Arc::new(Mutex::new(None)),
@@ -236,7 +236,7 @@ impl IMediaQuality for MediaQualityService {
    fn getPictureProfileListener(&self) -> binder::Result<binder::Strong<dyn IPictureProfileChangedListener>> {
        println!("getPictureProfileListener");
        let listener = self.picture_profile_changed_listener.lock().unwrap();
        listener.clone().ok_or(binder::StatusCode::UNKNOWN_ERROR.into())
        Ok(listener.clone().expect("NONE"))
    }

    fn setPictureProfileAdjustmentListener(
+12 −0
Original line number Diff line number Diff line
@@ -578,6 +578,18 @@ TEST_P(MediaQualityAidl, TestSetMediaQualityCallback) {
    ASSERT_OK(mediaquality->setAmbientBacklightCallback(callback));
}

TEST_P(MediaQualityAidl, TestGetPictureProfileChangedListener) {
    std::shared_ptr<::aidl::android::hardware::tv::mediaquality::IPictureProfileChangedListener>
            aidlListener;
    mediaquality->getPictureProfileListener(&aidlListener);
}

TEST_P(MediaQualityAidl, TestGetSoundProfileChangedListener) {
    std::shared_ptr<::aidl::android::hardware::tv::mediaquality::ISoundProfileChangedListener>
            aidlListener;
    mediaquality->getSoundProfileListener(&aidlListener);
}

TEST_P(MediaQualityAidl, TestSetPictureProfileAdjustmentListener) {
    std::shared_ptr<PictureProfileAdjustmentListener> listener =
            ndk::SharedRefBase::make<PictureProfileAdjustmentListener>(