subdirs = [
"cmds/*",
+ "headers",
"libs/*",
"opengl",
"services/*",
--- /dev/null
+//
+// 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.
+
+cc_defaults {
+ name: "dumpstate_defaults",
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-missing-field-initializers",
+ "-Wno-unused-variable",
+ "-Wunused-parameter",
+ ],
+}
+
+cc_library_headers {
+ name: "dumpstate_headers",
+ vendor_available: true,
+ export_include_dirs: ["."],
+ header_libs: [
+ "libbase_headers",
+ "libutils_headers",
+ ],
+ export_header_lib_headers: [
+ "libbase_headers",
+ "libutils_headers",
+ ],
+}
+
+cc_library_shared {
+ name: "libdumpstateutil",
+ defaults: ["dumpstate_defaults"],
+ vendor_available: true,
+ header_libs: ["dumpstate_headers"],
+ export_header_lib_headers: ["dumpstate_headers"],
+ srcs: [
+ "DumpstateInternal.cpp",
+ "DumpstateUtil.cpp",
+ ],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ ],
+}
+
+cc_library_shared {
+ name: "libdumpstateaidl",
+ defaults: ["dumpstate_defaults"],
+ shared_libs: [
+ "libbinder",
+ "libutils",
+ ],
+ aidl: {
+ local_include_dirs: ["binder"],
+ export_aidl_headers: true,
+ },
+ srcs: [
+ "binder/android/os/IDumpstate.aidl",
+ "binder/android/os/IDumpstateListener.aidl",
+ "binder/android/os/IDumpstateToken.aidl",
+ ],
+}
+
+cc_binary {
+ name: "dumpstate",
+ defaults: ["dumpstate_defaults"],
+ header_libs: ["dumpstate_headers"],
+ shared_libs: [
+ "android.hardware.dumpstate@1.0",
+ "libziparchive",
+ "libbase",
+ "libbinder",
+ "libcrypto",
+ "libcutils",
+ "libdebuggerd_client",
+ "libdumpstateaidl",
+ "libdumpstateutil",
+ "libhidlbase",
+ "libhidltransport",
+ "liblog",
+ "libutils",
+ ],
+ srcs: [
+ "DumpstateInternal.cpp",
+ "DumpstateService.cpp",
+ "utils.cpp",
+ "dumpstate.cpp",
+ ],
+ init_rc: ["dumpstate.rc"],
+}
+
+cc_test {
+ name: "dumpstate_test",
+ defaults: ["dumpstate_defaults"],
+ header_libs: ["dumpstate_headers"],
+ shared_libs: [
+ "libziparchive",
+ "libbase",
+ "libbinder",
+ "libcutils",
+ "libdebuggerd_client",
+ "libdumpstateaidl",
+ "libdumpstateutil",
+ "libhidlbase",
+ "libhidltransport",
+ "liblog",
+ "libutils",
+ ],
+ srcs: [
+ "DumpstateInternal.cpp",
+ "DumpstateService.cpp",
+ "utils.cpp",
+ "tests/dumpstate_test.cpp",
+ ],
+ static_libs: ["libgmock"],
+}
LOCAL_PATH:= $(call my-dir)
-# ================#
-# Common settings #
-# ================#
-# ZipArchive support, the order matters here to get all symbols.
-COMMON_ZIP_LIBRARIES := libziparchive libz libcrypto
-
-# TODO: ideally the tests should depend on a shared dumpstate library, but currently libdumpstate
-# is used to define the device-specific HAL library. Instead, both dumpstate and dumpstate_test
-# shares a lot of common settings
-COMMON_LOCAL_CFLAGS := \
- -Wall -Werror -Wno-missing-field-initializers -Wno-unused-variable -Wunused-parameter
-COMMON_SRC_FILES := \
- DumpstateInternal.cpp \
- utils.cpp
-COMMON_SHARED_LIBRARIES := \
- android.hardware.dumpstate@1.0 \
- libhidlbase \
- libhidltransport \
- libbase \
- libbinder \
- libcutils \
- libdebuggerd_client \
- libdumpstateaidl \
- libdumpstateutil \
- liblog \
- libselinux \
- libutils \
- $(COMMON_ZIP_LIBRARIES)
-
-# ====================#
-# libdumpstateutil #
-# ====================#
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libdumpstateutil
-
-LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
-LOCAL_C_INCLUDES := $(LOCAL_PATH)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_SRC_FILES := \
- DumpstateInternal.cpp \
- DumpstateUtil.cpp
-LOCAL_SHARED_LIBRARIES := \
- libbase \
- liblog \
-
-include $(BUILD_SHARED_LIBRARY)
-
-# ====================#
-# libdumpstateheaders #
-# ====================#
-# TODO: this module is necessary so the device-specific libdumpstate implementations do not
-# need to add any other dependency (like libbase). Should go away once dumpstate HAL changes.
-include $(CLEAR_VARS)
-
-LOCAL_EXPORT_C_INCLUDE_DIRS = $(LOCAL_PATH)
-LOCAL_MODULE := libdumpstateheaders
-LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := \
- $(COMMON_SHARED_LIBRARIES)
-LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := \
- $(COMMON_STATIC_LIBRARIES)
-# Soong requires that whats is on LOCAL_EXPORTED_ is also on LOCAL_
-LOCAL_SHARED_LIBRARIES := $(LOCAL_EXPORT_SHARED_LIBRARY_HEADERS)
-LOCAL_STATIC_LIBRARIES := $(LOCAL_EXPORT_STATIC_LIBRARY_HEADERS)
-
-include $(BUILD_STATIC_LIBRARY)
-
-# ================ #
-# libdumpstateaidl #
-# =================#
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libdumpstateaidl
-
-LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
-
-LOCAL_SHARED_LIBRARIES := \
- libbinder \
- libutils
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/binder
-LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/binder
-LOCAL_SRC_FILES := \
- binder/android/os/IDumpstate.aidl \
- binder/android/os/IDumpstateListener.aidl \
- binder/android/os/IDumpstateToken.aidl
-
-include $(BUILD_SHARED_LIBRARY)
-
-# ==========#
-# dumpstate #
-# ==========#
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(COMMON_SRC_FILES) \
- DumpstateService.cpp \
- dumpstate.cpp
-
-LOCAL_MODULE := dumpstate
-
-LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
-
-LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES)
-
-LOCAL_CFLAGS += $(COMMON_LOCAL_CFLAGS)
-
-LOCAL_INIT_RC := dumpstate.rc
-
-include $(BUILD_EXECUTABLE)
-
-# ===============#
-# dumpstate_test #
-# ===============#
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := dumpstate_test
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
-
-LOCAL_SRC_FILES := $(COMMON_SRC_FILES) \
- DumpstateService.cpp \
- tests/dumpstate_test.cpp
-
-LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES) \
- libgmock
-
-LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)
-
-include $(BUILD_NATIVE_TEST)
-
# =======================#
# dumpstate_test_fixture #
# =======================#
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_MODULE_TAGS := tests
-LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
+LOCAL_CFLAGS := \
+ -Wall -Werror -Wno-missing-field-initializers -Wno-unused-variable -Wunused-parameter
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <unistd.h>
#include <cstdint>
#include <string>
#include <vector>
#include <android-base/file.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include <private/android_filesystem_config.h>
uint64_t Nanotime() {
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
-#include <cutils/log.h>
+#include <log/log.h>
#include "DumpstateInternal.h"
#include <vector>
#include <android-base/macros.h>
+#include <android/os/IDumpstateListener.h>
+#include <utils/StrongPointer.h>
#include <ziparchive/zip_writer.h>
#include "DumpstateUtil.h"
-#include "android/os/BnDumpstate.h"
// Workaround for const char *args[MAX_ARGS_ARRAY_SIZE] variables until they're converted to
// std::vector<std::string>
} // namespace os
} // namespace android
+class ZipWriter;
+
// TODO: remove once moved to HAL
#ifdef __cplusplus
extern "C" {
--- /dev/null
+cc_library_headers {
+ name: "media_plugin_headers",
+ export_include_dirs: ["media_plugin"],
+ header_libs: [
+ "libstagefright_headers",
+ "libcutils_headers",
+ "libutils_headers",
+ "libstagefright_foundation_headers",
+ ],
+ export_header_lib_headers: [
+ "libstagefright_headers",
+ "libcutils_headers",
+ "libutils_headers",
+ "libstagefright_foundation_headers",
+ ],
+}
--- /dev/null
+../headers/media_plugin/media
\ No newline at end of file
* to figure out if the content or size of a surface has changed.
*/
Region latchBuffer(bool& recomputeVisibleRegions, nsecs_t latchTime);
+ bool isBufferLatched() const { return mRefreshPending; }
bool isPotentialCursor() const { return mPotentialCursor;}
const Region dirty(layer->latchBuffer(visibleRegions, latchTime));
layer->useSurfaceDamage();
invalidateLayerStack(layer->getLayerStack(), dirty);
- if (!dirty.isEmpty()) {
+ if (layer->isBufferLatched()) {
newDataLatched = true;
}
}
// If we will need to wake up at some time in the future to deal with a
// queued frame that shouldn't be displayed during this vsync period, wake
// up during the next vsync period to check again.
- if (frameQueued && mLayersWithQueuedFrames.empty()) {
+ if (frameQueued && (mLayersWithQueuedFrames.empty() || !newDataLatched)) {
signalLayerUpdate();
}
return lhs.info.z_order < rhs.info.z_order;
});
- int first_client_layer = -1, last_client_layer = -1;
+ const size_t no_layer = std::numeric_limits<size_t>::max();
+ size_t first_client_layer = no_layer, last_client_layer = no_layer;
for (size_t i = 0; i < layers_.size(); ++i) {
switch (layers_[i].composition_type) {
case IComposerClient::Composition::SOLID_COLOR:
case IComposerClient::Composition::CURSOR:
case IComposerClient::Composition::SIDEBAND:
- if (first_client_layer < 0)
+ if (first_client_layer == no_layer)
first_client_layer = i;
last_client_layer = i;