Loading include/powermanager/PowerHalWrapper.h +1 −3 Original line number Diff line number Diff line Loading @@ -201,10 +201,8 @@ private: std::array<std::atomic<HalSupport>, static_cast<int32_t>(hardware::power::Boost::DISPLAY_UPDATE_IMMINENT) + 1> mBoostSupportedArray GUARDED_BY(mBoostMutex) = {HalSupport::UNKNOWN}; // Android framework only sends mode upto DISPLAY_INACTIVE. // Need to increase the array if more mode supported. std::array<std::atomic<HalSupport>, static_cast<int32_t>(hardware::power::Mode::DISPLAY_INACTIVE) + 1> static_cast<int32_t>(*(android::enum_range<hardware::power::Mode>().end() - 1)) + 1> mModeSupportedArray GUARDED_BY(mModeMutex) = {HalSupport::UNKNOWN}; }; Loading services/powermanager/Android.bp +7 −7 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ cc_library_shared { include_dirs: [ "frameworks/base/core/java/android/os", ], export_aidl_headers: true export_aidl_headers: true, }, shared_libs: [ Loading @@ -38,7 +38,7 @@ cc_library_shared { "libutils", "android.hardware.power@1.0", "android.hardware.power@1.1", "android.hardware.power-V2-cpp", "android.hardware.power-V3-cpp", ], cflags: [ Loading services/powermanager/benchmarks/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ cc_benchmark { "libutils", "android.hardware.power@1.0", "android.hardware.power@1.1", "android.hardware.power-V2-cpp", "android.hardware.power-V3-cpp", ], static_libs: [ "libtestUtil", Loading services/powermanager/tests/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ cc_test { "libutils", "android.hardware.power@1.0", "android.hardware.power@1.1", "android.hardware.power-V2-cpp", "android.hardware.power-V3-cpp", ], static_libs: [ "libgmock", Loading services/powermanager/tests/PowerHalWrapperAidlTest.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,10 @@ TEST_F(PowerHalWrapperAidlTest, TestSetModeUnsupported) { auto result = mWrapper->setMode(Mode::LAUNCH, true); ASSERT_TRUE(result.isUnsupported()); EXPECT_CALL(*mMockHal.get(), isModeSupported(Eq(Mode::CAMERA_STREAMING_HIGH), _)) .Times(Exactly(1)) .WillRepeatedly(DoAll(SetArgPointee<1>(false), Return(Status()))); result = mWrapper->setMode(Mode::CAMERA_STREAMING_HIGH, true); ASSERT_TRUE(result.isUnsupported()); } Loading Loading
include/powermanager/PowerHalWrapper.h +1 −3 Original line number Diff line number Diff line Loading @@ -201,10 +201,8 @@ private: std::array<std::atomic<HalSupport>, static_cast<int32_t>(hardware::power::Boost::DISPLAY_UPDATE_IMMINENT) + 1> mBoostSupportedArray GUARDED_BY(mBoostMutex) = {HalSupport::UNKNOWN}; // Android framework only sends mode upto DISPLAY_INACTIVE. // Need to increase the array if more mode supported. std::array<std::atomic<HalSupport>, static_cast<int32_t>(hardware::power::Mode::DISPLAY_INACTIVE) + 1> static_cast<int32_t>(*(android::enum_range<hardware::power::Mode>().end() - 1)) + 1> mModeSupportedArray GUARDED_BY(mModeMutex) = {HalSupport::UNKNOWN}; }; Loading
services/powermanager/Android.bp +7 −7 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ cc_library_shared { include_dirs: [ "frameworks/base/core/java/android/os", ], export_aidl_headers: true export_aidl_headers: true, }, shared_libs: [ Loading @@ -38,7 +38,7 @@ cc_library_shared { "libutils", "android.hardware.power@1.0", "android.hardware.power@1.1", "android.hardware.power-V2-cpp", "android.hardware.power-V3-cpp", ], cflags: [ Loading
services/powermanager/benchmarks/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ cc_benchmark { "libutils", "android.hardware.power@1.0", "android.hardware.power@1.1", "android.hardware.power-V2-cpp", "android.hardware.power-V3-cpp", ], static_libs: [ "libtestUtil", Loading
services/powermanager/tests/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ cc_test { "libutils", "android.hardware.power@1.0", "android.hardware.power@1.1", "android.hardware.power-V2-cpp", "android.hardware.power-V3-cpp", ], static_libs: [ "libgmock", Loading
services/powermanager/tests/PowerHalWrapperAidlTest.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,10 @@ TEST_F(PowerHalWrapperAidlTest, TestSetModeUnsupported) { auto result = mWrapper->setMode(Mode::LAUNCH, true); ASSERT_TRUE(result.isUnsupported()); EXPECT_CALL(*mMockHal.get(), isModeSupported(Eq(Mode::CAMERA_STREAMING_HIGH), _)) .Times(Exactly(1)) .WillRepeatedly(DoAll(SetArgPointee<1>(false), Return(Status()))); result = mWrapper->setMode(Mode::CAMERA_STREAMING_HIGH, true); ASSERT_TRUE(result.isUnsupported()); } Loading