diff options
author | 2024-03-27 22:07:08 +0000 | |
---|---|---|
committer | 2024-03-27 22:59:21 +0000 | |
commit | 969c4de7ba53db35ae2023674f7cfee67a0e5c8f (patch) | |
tree | 94ee6a7f04ed9b5bfefd8211e4f729ce4161e6be | |
parent | 3fa9d8501e249f5b696adbd11a4b61252340a148 (diff) |
Remove getLayerDebugInfo in SF and Layer
Part of effort to clean SF code prior to removing
legacy layer frontend. getLayerDebugInfo is no longer
used and can be removed.
Bug: b/330785038
Test: atest CredentialsTest
Change-Id: Iac9ac3c5934cb320331e9937cb604afc4f62eeb4
-rw-r--r-- | libs/gui/Android.bp | 1 | ||||
-rw-r--r-- | libs/gui/LayerDebugInfo.cpp | 152 | ||||
-rw-r--r-- | libs/gui/aidl/android/gui/ISurfaceComposer.aidl | 8 | ||||
-rw-r--r-- | libs/gui/aidl/android/gui/LayerDebugInfo.aidl | 19 | ||||
-rw-r--r-- | libs/gui/include/gui/ISurfaceComposer.h | 1 | ||||
-rw-r--r-- | libs/gui/include/gui/LayerDebugInfo.h | 74 | ||||
-rw-r--r-- | libs/gui/tests/Surface_test.cpp | 4 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 48 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.h | 6 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 30 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 3 | ||||
-rw-r--r-- | services/surfaceflinger/tests/Credentials_test.cpp | 31 |
12 files changed, 0 insertions, 377 deletions
diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp index 70cb36bad3..b70e80ea9b 100644 --- a/libs/gui/Android.bp +++ b/libs/gui/Android.bp @@ -241,7 +241,6 @@ filegroup { "IProducerListener.cpp", "ISurfaceComposer.cpp", "ITransactionCompletedListener.cpp", - "LayerDebugInfo.cpp", "LayerMetadata.cpp", "LayerStatePermissions.cpp", "LayerState.cpp", diff --git a/libs/gui/LayerDebugInfo.cpp b/libs/gui/LayerDebugInfo.cpp deleted file mode 100644 index 15b2221464..0000000000 --- a/libs/gui/LayerDebugInfo.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <gui/LayerDebugInfo.h> - -#include <android-base/stringprintf.h> - -#include <ui/DebugUtils.h> - -#include <binder/Parcel.h> - -using namespace android; -using android::base::StringAppendF; - -#define RETURN_ON_ERROR(X) do {status_t res = (X); if (res != NO_ERROR) return res;} while(false) - -namespace android::gui { - -status_t LayerDebugInfo::writeToParcel(Parcel* parcel) const { - RETURN_ON_ERROR(parcel->writeCString(mName.c_str())); - RETURN_ON_ERROR(parcel->writeCString(mParentName.c_str())); - RETURN_ON_ERROR(parcel->writeCString(mType.c_str())); - RETURN_ON_ERROR(parcel->write(mTransparentRegion)); - RETURN_ON_ERROR(parcel->write(mVisibleRegion)); - RETURN_ON_ERROR(parcel->write(mSurfaceDamageRegion)); - RETURN_ON_ERROR(parcel->writeUint32(mLayerStack)); - RETURN_ON_ERROR(parcel->writeFloat(mX)); - RETURN_ON_ERROR(parcel->writeFloat(mY)); - RETURN_ON_ERROR(parcel->writeUint32(mZ)); - RETURN_ON_ERROR(parcel->writeInt32(mWidth)); - RETURN_ON_ERROR(parcel->writeInt32(mHeight)); - RETURN_ON_ERROR(parcel->write(mCrop)); - RETURN_ON_ERROR(parcel->writeFloat(mColor.r)); - RETURN_ON_ERROR(parcel->writeFloat(mColor.g)); - RETURN_ON_ERROR(parcel->writeFloat(mColor.b)); - RETURN_ON_ERROR(parcel->writeFloat(mColor.a)); - RETURN_ON_ERROR(parcel->writeUint32(mFlags)); - RETURN_ON_ERROR(parcel->writeInt32(mPixelFormat)); - RETURN_ON_ERROR(parcel->writeUint32(static_cast<uint32_t>(mDataSpace))); - for (size_t index = 0; index < 4; index++) { - RETURN_ON_ERROR(parcel->writeFloat(mMatrix[index / 2][index % 2])); - } - RETURN_ON_ERROR(parcel->writeInt32(mActiveBufferWidth)); - RETURN_ON_ERROR(parcel->writeInt32(mActiveBufferHeight)); - RETURN_ON_ERROR(parcel->writeInt32(mActiveBufferStride)); - RETURN_ON_ERROR(parcel->writeInt32(mActiveBufferFormat)); - RETURN_ON_ERROR(parcel->writeInt32(mNumQueuedFrames)); - RETURN_ON_ERROR(parcel->writeBool(mIsOpaque)); - RETURN_ON_ERROR(parcel->writeBool(mContentDirty)); - RETURN_ON_ERROR(parcel->write(mStretchEffect)); - return NO_ERROR; -} - -status_t LayerDebugInfo::readFromParcel(const Parcel* parcel) { - mName = parcel->readCString(); - RETURN_ON_ERROR(parcel->errorCheck()); - mParentName = parcel->readCString(); - RETURN_ON_ERROR(parcel->errorCheck()); - mType = parcel->readCString(); - RETURN_ON_ERROR(parcel->errorCheck()); - RETURN_ON_ERROR(parcel->read(mTransparentRegion)); - RETURN_ON_ERROR(parcel->read(mVisibleRegion)); - RETURN_ON_ERROR(parcel->read(mSurfaceDamageRegion)); - RETURN_ON_ERROR(parcel->readUint32(&mLayerStack)); - RETURN_ON_ERROR(parcel->readFloat(&mX)); - RETURN_ON_ERROR(parcel->readFloat(&mY)); - RETURN_ON_ERROR(parcel->readUint32(&mZ)); - RETURN_ON_ERROR(parcel->readInt32(&mWidth)); - RETURN_ON_ERROR(parcel->readInt32(&mHeight)); - RETURN_ON_ERROR(parcel->read(mCrop)); - mColor.r = parcel->readFloat(); - RETURN_ON_ERROR(parcel->errorCheck()); - mColor.g = parcel->readFloat(); - RETURN_ON_ERROR(parcel->errorCheck()); - mColor.b = parcel->readFloat(); - RETURN_ON_ERROR(parcel->errorCheck()); - mColor.a = parcel->readFloat(); - RETURN_ON_ERROR(parcel->errorCheck()); - RETURN_ON_ERROR(parcel->readUint32(&mFlags)); - RETURN_ON_ERROR(parcel->readInt32(&mPixelFormat)); - // \todo [2017-07-25 kraita]: Static casting mDataSpace pointer to an uint32 does work. Better ways? - mDataSpace = static_cast<android_dataspace>(parcel->readUint32()); - RETURN_ON_ERROR(parcel->errorCheck()); - for (size_t index = 0; index < 4; index++) { - RETURN_ON_ERROR(parcel->readFloat(&mMatrix[index / 2][index % 2])); - } - RETURN_ON_ERROR(parcel->readInt32(&mActiveBufferWidth)); - RETURN_ON_ERROR(parcel->readInt32(&mActiveBufferHeight)); - RETURN_ON_ERROR(parcel->readInt32(&mActiveBufferStride)); - RETURN_ON_ERROR(parcel->readInt32(&mActiveBufferFormat)); - RETURN_ON_ERROR(parcel->readInt32(&mNumQueuedFrames)); - RETURN_ON_ERROR(parcel->readBool(&mIsOpaque)); - RETURN_ON_ERROR(parcel->readBool(&mContentDirty)); - RETURN_ON_ERROR(parcel->read(mStretchEffect)); - return NO_ERROR; -} - -std::string to_string(const LayerDebugInfo& info) { - std::string result; - - StringAppendF(&result, "+ %s (%s)\n", info.mType.c_str(), info.mName.c_str()); - info.mTransparentRegion.dump(result, "TransparentRegion"); - info.mVisibleRegion.dump(result, "VisibleRegion"); - info.mSurfaceDamageRegion.dump(result, "SurfaceDamageRegion"); - if (info.mStretchEffect.hasEffect()) { - const auto& se = info.mStretchEffect; - StringAppendF(&result, - " StretchEffect width = %f, height = %f vec=(%f, %f) " - "maxAmount=(%f, %f)\n", - se.width, se.height, - se.vectorX, se.vectorY, se.maxAmountX, se.maxAmountY); - } - - StringAppendF(&result, " layerStack=%4d, z=%9d, pos=(%g,%g), size=(%4d,%4d), ", - info.mLayerStack, info.mZ, static_cast<double>(info.mX), - static_cast<double>(info.mY), info.mWidth, info.mHeight); - - StringAppendF(&result, "crop=%s, ", to_string(info.mCrop).c_str()); - StringAppendF(&result, "isOpaque=%1d, invalidate=%1d, ", info.mIsOpaque, info.mContentDirty); - StringAppendF(&result, "dataspace=%s, ", dataspaceDetails(info.mDataSpace).c_str()); - StringAppendF(&result, "pixelformat=%s, ", decodePixelFormat(info.mPixelFormat).c_str()); - StringAppendF(&result, "color=(%.3f,%.3f,%.3f,%.3f), flags=0x%08x, ", - static_cast<double>(info.mColor.r), static_cast<double>(info.mColor.g), - static_cast<double>(info.mColor.b), static_cast<double>(info.mColor.a), - info.mFlags); - StringAppendF(&result, "tr=[%.2f, %.2f][%.2f, %.2f]", static_cast<double>(info.mMatrix[0][0]), - static_cast<double>(info.mMatrix[0][1]), static_cast<double>(info.mMatrix[1][0]), - static_cast<double>(info.mMatrix[1][1])); - result.append("\n"); - StringAppendF(&result, " parent=%s\n", info.mParentName.c_str()); - StringAppendF(&result, " activeBuffer=[%4ux%4u:%4u,%s],", info.mActiveBufferWidth, - info.mActiveBufferHeight, info.mActiveBufferStride, - decodePixelFormat(info.mActiveBufferFormat).c_str()); - StringAppendF(&result, " queued-frames=%d", info.mNumQueuedFrames); - result.append("\n"); - return result; -} - -} // namespace android::gui diff --git a/libs/gui/aidl/android/gui/ISurfaceComposer.aidl b/libs/gui/aidl/android/gui/ISurfaceComposer.aidl index 51e01930d3..a2549e7e3f 100644 --- a/libs/gui/aidl/android/gui/ISurfaceComposer.aidl +++ b/libs/gui/aidl/android/gui/ISurfaceComposer.aidl @@ -43,7 +43,6 @@ import android.gui.ITunnelModeEnabledListener; import android.gui.IWindowInfosListener; import android.gui.IWindowInfosPublisher; import android.gui.LayerCaptureArgs; -import android.gui.LayerDebugInfo; import android.gui.OverlayProperties; import android.gui.PullAtomData; import android.gui.ScreenCaptureResults; @@ -289,13 +288,6 @@ interface ISurfaceComposer { PullAtomData onPullAtom(int atomId); /** - * Gets the list of active layers in Z order for debugging purposes - * - * Requires the ACCESS_SURFACE_FLINGER permission. - */ - List<LayerDebugInfo> getLayerDebugInfo(); - - /** * Gets the composition preference of the default data space and default pixel format, * as well as the wide color gamut data space and wide color gamut pixel format. * If the wide color gamut data space is V0_SRGB, then it implies that the platform diff --git a/libs/gui/aidl/android/gui/LayerDebugInfo.aidl b/libs/gui/aidl/android/gui/LayerDebugInfo.aidl deleted file mode 100644 index faca980f3c..0000000000 --- a/libs/gui/aidl/android/gui/LayerDebugInfo.aidl +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.gui; - -parcelable LayerDebugInfo cpp_header "gui/LayerDebugInfo.h"; diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h index a836f4642a..738c73a24b 100644 --- a/libs/gui/include/gui/ISurfaceComposer.h +++ b/libs/gui/include/gui/ISurfaceComposer.h @@ -74,7 +74,6 @@ namespace gui { struct DisplayCaptureArgs; struct LayerCaptureArgs; -class LayerDebugInfo; } // namespace gui diff --git a/libs/gui/include/gui/LayerDebugInfo.h b/libs/gui/include/gui/LayerDebugInfo.h deleted file mode 100644 index dbb80e583c..0000000000 --- a/libs/gui/include/gui/LayerDebugInfo.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include <binder/Parcelable.h> - -#include <ui/PixelFormat.h> -#include <ui/Region.h> -#include <ui/StretchEffect.h> - -#include <string> -#include <math/vec4.h> - -namespace android::gui { - -/* Class for transporting debug info from SurfaceFlinger to authorized - * recipients. The class is intended to be a data container. There are - * no getters or setters. - */ -class LayerDebugInfo : public Parcelable { -public: - LayerDebugInfo() = default; - LayerDebugInfo(const LayerDebugInfo&) = default; - virtual ~LayerDebugInfo() = default; - - virtual status_t writeToParcel(Parcel* parcel) const; - virtual status_t readFromParcel(const Parcel* parcel); - - std::string mName = std::string("NOT FILLED"); - std::string mParentName = std::string("NOT FILLED"); - std::string mType = std::string("NOT FILLED"); - Region mTransparentRegion = Region::INVALID_REGION; - Region mVisibleRegion = Region::INVALID_REGION; - Region mSurfaceDamageRegion = Region::INVALID_REGION; - uint32_t mLayerStack = 0; - float mX = 0.f; - float mY = 0.f; - uint32_t mZ = 0 ; - int32_t mWidth = -1; - int32_t mHeight = -1; - android::Rect mCrop = android::Rect::INVALID_RECT; - half4 mColor = half4(1.0_hf, 1.0_hf, 1.0_hf, 0.0_hf); - uint32_t mFlags = 0; - PixelFormat mPixelFormat = PIXEL_FORMAT_NONE; - android_dataspace mDataSpace = HAL_DATASPACE_UNKNOWN; - // Row-major transform matrix (SurfaceControl::setMatrix()) - float mMatrix[2][2] = {{0.f, 0.f}, {0.f, 0.f}}; - int32_t mActiveBufferWidth = -1; - int32_t mActiveBufferHeight = -1; - int32_t mActiveBufferStride = 0; - PixelFormat mActiveBufferFormat = PIXEL_FORMAT_NONE; - int32_t mNumQueuedFrames = -1; - bool mIsOpaque = false; - bool mContentDirty = false; - StretchEffect mStretchEffect = {}; -}; - -std::string to_string(const LayerDebugInfo& info); - -} // namespace android::gui diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp index 577d2394c6..93bf4faa13 100644 --- a/libs/gui/tests/Surface_test.cpp +++ b/libs/gui/tests/Surface_test.cpp @@ -815,10 +815,6 @@ public: return binder::Status::ok(); } - binder::Status getLayerDebugInfo(std::vector<gui::LayerDebugInfo>* /*outLayers*/) override { - return binder::Status::ok(); - } - binder::Status getCompositionPreference(gui::CompositionPreference* /*outPref*/) override { return binder::Status::ok(); } diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index cd2120e990..4cc2f9e1e7 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -40,7 +40,6 @@ #include <ftl/enum.h> #include <ftl/fake_guard.h> #include <gui/BufferItem.h> -#include <gui/LayerDebugInfo.h> #include <gui/Surface.h> #include <gui/TraceUtils.h> #include <math.h> @@ -1566,53 +1565,6 @@ void Layer::updateTransformHint(ui::Transform::RotationFlags transformHint) { // debugging // ---------------------------------------------------------------------------- -// TODO(marissaw): add new layer state info to layer debugging -gui::LayerDebugInfo Layer::getLayerDebugInfo(const DisplayDevice* display) const { - using namespace std::string_literals; - - gui::LayerDebugInfo info; - const State& ds = getDrawingState(); - info.mName = getName(); - sp<Layer> parent = mDrawingParent.promote(); - info.mParentName = parent ? parent->getName() : "none"s; - info.mType = getType(); - - info.mVisibleRegion = getVisibleRegion(display); - info.mSurfaceDamageRegion = surfaceDamageRegion; - info.mLayerStack = getLayerStack().id; - info.mX = ds.transform.tx(); - info.mY = ds.transform.ty(); - info.mZ = ds.z; - info.mCrop = ds.crop; - info.mColor = ds.color; - info.mFlags = ds.flags; - info.mPixelFormat = getPixelFormat(); - info.mDataSpace = static_cast<android_dataspace>(getDataSpace()); - info.mMatrix[0][0] = ds.transform[0][0]; - info.mMatrix[0][1] = ds.transform[0][1]; - info.mMatrix[1][0] = ds.transform[1][0]; - info.mMatrix[1][1] = ds.transform[1][1]; - { - sp<const GraphicBuffer> buffer = getBuffer(); - if (buffer != 0) { - info.mActiveBufferWidth = buffer->getWidth(); - info.mActiveBufferHeight = buffer->getHeight(); - info.mActiveBufferStride = buffer->getStride(); - info.mActiveBufferFormat = buffer->format; - } else { - info.mActiveBufferWidth = 0; - info.mActiveBufferHeight = 0; - info.mActiveBufferStride = 0; - info.mActiveBufferFormat = 0; - } - } - info.mNumQueuedFrames = getQueuedFrameCount(); - info.mIsOpaque = isOpaque(ds); - info.mContentDirty = contentDirty; - info.mStretchEffect = getStretchEffect(); - return info; -} - void Layer::miniDumpHeader(std::string& result) { result.append(kDumpTableRowLength, '-'); result.append("\n"); diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index d283d6fda9..edf2ae260b 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -71,10 +71,6 @@ class OutputLayer; struct LayerFECompositionState; } -namespace gui { -class LayerDebugInfo; -} - namespace frametimeline { class SurfaceFrame; } // namespace frametimeline @@ -703,8 +699,6 @@ public: inline const State& getDrawingState() const { return mDrawingState; } inline State& getDrawingState() { return mDrawingState; } - gui::LayerDebugInfo getLayerDebugInfo(const DisplayDevice*) const; - void miniDumpLegacy(std::string& result, const DisplayDevice&) const; void miniDump(std::string& result, const frontend::LayerSnapshot&, const DisplayDevice&) const; void dumpFrameStats(std::string& result) const; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index cf94f942fa..29f8e3fb73 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -65,7 +65,6 @@ #include <gui/BufferQueue.h> #include <gui/DebugEGLImageTracker.h> #include <gui/IProducerListener.h> -#include <gui/LayerDebugInfo.h> #include <gui/LayerMetadata.h> #include <gui/LayerState.h> #include <gui/Surface.h> @@ -1834,19 +1833,6 @@ status_t SurfaceFlinger::isWideColorDisplay(const sp<IBinder>& displayToken, return NO_ERROR; } -status_t SurfaceFlinger::getLayerDebugInfo(std::vector<gui::LayerDebugInfo>* outLayers) { - outLayers->clear(); - auto future = mScheduler->schedule([=, this] { - const auto display = FTL_FAKE_GUARD(mStateLock, getDefaultDisplayDeviceLocked()); - mDrawingState.traverseInZOrder([&](Layer* layer) { - outLayers->push_back(layer->getLayerDebugInfo(display.get())); - }); - }); - - future.wait(); - return NO_ERROR; -} - status_t SurfaceFlinger::getCompositionPreference( Dataspace* outDataspace, ui::PixelFormat* outPixelFormat, Dataspace* outWideColorGamutDataspace, @@ -9895,22 +9881,6 @@ binder::Status SurfaceComposerAIDL::onPullAtom(int32_t atomId, gui::PullAtomData return binderStatusFromStatusT(status); } -binder::Status SurfaceComposerAIDL::getLayerDebugInfo(std::vector<gui::LayerDebugInfo>* outLayers) { - if (!outLayers) { - return binderStatusFromStatusT(UNEXPECTED_NULL); - } - - IPCThreadState* ipc = IPCThreadState::self(); - const int pid = ipc->getCallingPid(); - const int uid = ipc->getCallingUid(); - if ((uid != AID_SHELL) && !PermissionCache::checkPermission(sDump, pid, uid)) { - ALOGE("Layer debug info permission denied for pid=%d, uid=%d", pid, uid); - return binderStatusFromStatusT(PERMISSION_DENIED); - } - status_t status = mFlinger->getLayerDebugInfo(outLayers); - return binderStatusFromStatusT(status); -} - binder::Status SurfaceComposerAIDL::getCompositionPreference(gui::CompositionPreference* outPref) { ui::Dataspace dataspace; ui::PixelFormat pixelFormat; diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index c106abda37..704fcef263 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -38,7 +38,6 @@ #include <gui/FrameTimestamps.h> #include <gui/ISurfaceComposer.h> #include <gui/ITransactionCompletedListener.h> -#include <gui/LayerDebugInfo.h> #include <gui/LayerState.h> #include <layerproto/LayerProtoHeader.h> #include <math/mat4.h> @@ -599,7 +598,6 @@ private: status_t overrideHdrTypes(const sp<IBinder>& displayToken, const std::vector<ui::Hdr>& hdrTypes); status_t onPullAtom(const int32_t atomId, std::vector<uint8_t>* pulledData, bool* success); - status_t getLayerDebugInfo(std::vector<gui::LayerDebugInfo>* outLayers); status_t getCompositionPreference(ui::Dataspace* outDataspace, ui::PixelFormat* outPixelFormat, ui::Dataspace* outWideColorGamutDataspace, ui::PixelFormat* outWideColorGamutPixelFormat) const; @@ -1601,7 +1599,6 @@ public: binder::Status overrideHdrTypes(const sp<IBinder>& display, const std::vector<int32_t>& hdrTypes) override; binder::Status onPullAtom(int32_t atomId, gui::PullAtomData* outPullData) override; - binder::Status getLayerDebugInfo(std::vector<gui::LayerDebugInfo>* outLayers) override; binder::Status getCompositionPreference(gui::CompositionPreference* outPref) override; binder::Status getDisplayedContentSamplingAttributes( const sp<IBinder>& display, gui::ContentSamplingAttributes* outAttrs) override; diff --git a/services/surfaceflinger/tests/Credentials_test.cpp b/services/surfaceflinger/tests/Credentials_test.cpp index 9b83713f50..3b6a51a224 100644 --- a/services/surfaceflinger/tests/Credentials_test.cpp +++ b/services/surfaceflinger/tests/Credentials_test.cpp @@ -21,7 +21,6 @@ #include <android/gui/ISurfaceComposer.h> #include <gtest/gtest.h> #include <gui/AidlStatusUtil.h> -#include <gui/LayerDebugInfo.h> #include <gui/Surface.h> #include <gui/SurfaceComposerClient.h> #include <private/android_filesystem_config.h> @@ -36,7 +35,6 @@ namespace android { using Transaction = SurfaceComposerClient::Transaction; -using gui::LayerDebugInfo; using gui::aidl_utils::statusTFromBinderStatus; using ui::ColorMode; @@ -292,35 +290,6 @@ TEST_F(CredentialsTest, CaptureLayersTest) { /** * The following tests are for methods accessible directly through SurfaceFlinger. */ -TEST_F(CredentialsTest, GetLayerDebugInfo) { - setupBackgroundSurface(); - sp<gui::ISurfaceComposer> sf(ComposerServiceAIDL::getComposerService()); - - // Historically, only root and shell can access the getLayerDebugInfo which - // is called when we call dumpsys. I don't see a reason why we should change this. - std::vector<LayerDebugInfo> outLayers; - binder::Status status = binder::Status::ok(); - // Check with root. - { - UIDFaker f(AID_ROOT); - status = sf->getLayerDebugInfo(&outLayers); - ASSERT_EQ(NO_ERROR, statusTFromBinderStatus(status)); - } - - // Check as a shell. - { - UIDFaker f(AID_SHELL); - status = sf->getLayerDebugInfo(&outLayers); - ASSERT_EQ(NO_ERROR, statusTFromBinderStatus(status)); - } - - // Check as anyone else. - { - UIDFaker f(AID_BIN); - status = sf->getLayerDebugInfo(&outLayers); - ASSERT_EQ(PERMISSION_DENIED, statusTFromBinderStatus(status)); - } -} TEST_F(CredentialsTest, IsWideColorDisplayBasicCorrectness) { const auto display = getFirstDisplayToken(); |