Skip to content

Commit 6275776

Browse files
committed
SF: Clean up warnings around AidlComposer.{h,cpp}
This CL was uploaded with some corresponding fixes affecting the ComposerCommandBuffer.h headers in hardware/interfaces. The pragmas to disable specific warnings when including those files are no longer needed, as those headers have been fixed. There were some warnings about using calling functions marked deprecated. For those I disabled the deprecation warning for the call, since SurfaceFlinger still needs to make the legacy call if that's what the vendor implementation supports. clangd also reported three unused "using ..." directives at the top of the file. I went ahead and remove these. Flag: EXEMPT build and lint warnings only Bug: None Test: Builds Change-Id: I160785bc44850ba8b202ed6874e1530d1fbe13e1
1 parent 2721b5c commit 6275776

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737

3838
namespace android {
3939

40-
using hardware::hidl_handle;
41-
using hardware::hidl_vec;
42-
using hardware::Return;
43-
4440
using aidl::android::hardware::graphics::composer3::BnComposerCallback;
4541
using aidl::android::hardware::graphics::composer3::Capability;
4642
using aidl::android::hardware::graphics::composer3::ClientTargetPropertyWithBrightness;
@@ -524,11 +520,15 @@ Error AidlComposer::getColorModes(Display display, std::vector<ColorMode>* outMo
524520

525521
Error AidlComposer::getDisplayAttribute(Display display, Config config,
526522
IComposerClient::Attribute attribute, int32_t* outValue) {
523+
#pragma clang diagnostic push
524+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
527525
const auto status =
528526
mAidlComposerClient->getDisplayAttribute(translate<int64_t>(display),
529527
translate<int32_t>(config),
530528
static_cast<AidlDisplayAttribute>(attribute),
531529
outValue);
530+
#pragma clang diagnostic pop
531+
532532
if (!status.isOk()) {
533533
ALOGE("getDisplayAttribute failed %s", status.getDescription().c_str());
534534
return static_cast<Error>(status.getServiceSpecificError());
@@ -538,8 +538,13 @@ Error AidlComposer::getDisplayAttribute(Display display, Config config,
538538

539539
Error AidlComposer::getDisplayConfigs(Display display, std::vector<Config>* outConfigs) {
540540
std::vector<int32_t> configs;
541+
542+
#pragma clang diagnostic push
543+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
541544
const auto status =
542545
mAidlComposerClient->getDisplayConfigs(translate<int64_t>(display), &configs);
546+
#pragma clang diagnostic pop
547+
543548
if (!status.isOk()) {
544549
ALOGE("getDisplayConfigs failed %s", status.getDescription().c_str());
545550
return static_cast<Error>(status.getServiceSpecificError());

services/surfaceflinger/DisplayHardware/AidlComposerHal.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
#include <utility>
2828
#include <vector>
2929

30-
// TODO(b/129481165): remove the #pragma below and fix conversion issues
31-
#pragma clang diagnostic push
32-
#pragma clang diagnostic ignored "-Wconversion"
33-
#pragma clang diagnostic ignored "-Wextra"
34-
3530
#include <android/hardware/graphics/composer/2.4/IComposer.h>
3631
#include <android/hardware/graphics/composer/2.4/IComposerClient.h>
3732

@@ -43,9 +38,6 @@
4338
#include <aidl/android/hardware/graphics/composer3/Composition.h>
4439
#include <aidl/android/hardware/graphics/composer3/DisplayCapability.h>
4540

46-
// TODO(b/129481165): remove the #pragma below and fix conversion issues
47-
#pragma clang diagnostic pop // ignored "-Wconversion -Wextra"
48-
4941
namespace android::Hwc2 {
5042

5143
using aidl::android::hardware::graphics::common::DisplayDecorationSupport;

0 commit comments

Comments
 (0)