diff options
-rw-r--r-- | aidl/gui/android/view/LayerMetadataKey.aidl | 26 | ||||
-rw-r--r-- | libs/gui/Android.bp | 5 | ||||
-rw-r--r-- | libs/gui/LayerMetadata.cpp | 10 |
3 files changed, 37 insertions, 4 deletions
diff --git a/aidl/gui/android/view/LayerMetadataKey.aidl b/aidl/gui/android/view/LayerMetadataKey.aidl new file mode 100644 index 0000000000..7026ca8fad --- /dev/null +++ b/aidl/gui/android/view/LayerMetadataKey.aidl @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2019 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.view; + +/** @hide */ +@Backing(type="int") +enum LayerMetadataKey { + METADATA_OWNER_UID = 1, + METADATA_WINDOW_TYPE = 2, + METADATA_TASK_ID = 3, + METADATA_MOUSE_CURSOR = 4, +} diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp index 1ae148c787..59593409df 100644 --- a/libs/gui/Android.bp +++ b/libs/gui/Android.bp @@ -40,6 +40,7 @@ cc_library_shared { defaults: ["libgui_bufferqueue-defaults"], srcs: [ + ":framework_native_aidl", ":libgui_bufferqueue_sources", "BitTube.cpp", @@ -106,6 +107,10 @@ cc_library_shared { "libdvr_headers", "libpdx_headers", ], + + aidl: { + export_aidl_headers: true, + } } // Used by media codec services exclusively as a static lib for diff --git a/libs/gui/LayerMetadata.cpp b/libs/gui/LayerMetadata.cpp index 04d2871c77..b3eb9940b2 100644 --- a/libs/gui/LayerMetadata.cpp +++ b/libs/gui/LayerMetadata.cpp @@ -18,6 +18,8 @@ #include <binder/Parcel.h> #include <gui/LayerMetadata.h> +#include "android/view/LayerMetadataKey.h" + using android::base::StringPrintf; namespace android { @@ -113,12 +115,12 @@ void LayerMetadata::setInt32(uint32_t key, int32_t value) { std::string LayerMetadata::itemToString(uint32_t key, const char* separator) const { if (!has(key)) return std::string(); - switch (key) { - case METADATA_OWNER_UID: + switch (static_cast<view::LayerMetadataKey>(key)) { + case view::LayerMetadataKey::METADATA_OWNER_UID: return StringPrintf("ownerUID%s%d", separator, getInt32(key, 0)); - case METADATA_WINDOW_TYPE: + case view::LayerMetadataKey::METADATA_WINDOW_TYPE: return StringPrintf("windowType%s%d", separator, getInt32(key, 0)); - case METADATA_TASK_ID: + case view::LayerMetadataKey::METADATA_TASK_ID: return StringPrintf("taskId%s%d", separator, getInt32(key, 0)); default: return StringPrintf("%d%s%dbytes", key, separator, |