Merge "Add IAudioManager method for releasing a recorder." into qt-dev am: 21c85a62aa
am: 4ee28f0bfe
Change-Id: I91adaf4c0d0d556b1e95d3a4e71addc9ca4d0029
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index 1a932c3..4f7cdf3 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -4,13 +4,16 @@
[Builtin Hooks Options]
# Only turn on clang-format check for the following subfolders.
clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
+ include/input/
libs/binder/ndk/
libs/graphicsenv/
libs/gui/
+ libs/input/
libs/renderengine/
libs/ui/
libs/vr/
services/bufferhub/
+ services/inputflinger/
services/surfaceflinger/
services/vr/
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index c730ab9..59c19d1 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -581,10 +581,6 @@
// No code cache on shared storage
} else {
// Clear everything on shared storage
- path = StringPrintf("%s/Android/sandbox/%s", extPath.c_str(), pkgname);
- if (delete_dir_contents(path, true) != 0) {
- res = error("Failed to delete contents of " + path);
- }
path = StringPrintf("%s/Android/data/%s", extPath.c_str(), pkgname);
if (delete_dir_contents(path, true) != 0) {
res = error("Failed to delete contents of " + path);
@@ -668,10 +664,6 @@
}
auto extPath = findDataMediaPath(uuid, userId);
- path = StringPrintf("%s/Android/sandbox/%s", extPath.c_str(), pkgname);
- if (delete_dir_contents_and_dir(path, true) != 0) {
- res = error("Failed to delete " + path);
- }
path = StringPrintf("%s/Android/data/%s", extPath.c_str(), pkgname);
if (delete_dir_contents_and_dir(path, true) != 0) {
res = error("Failed to delete " + path);
@@ -1694,8 +1686,6 @@
}
ATRACE_BEGIN("external");
- auto sandboxPath = create_data_media_package_path(uuid_, userId, "sandbox", pkgname);
- calculate_tree_size(sandboxPath, &extStats.dataSize);
auto extPath = create_data_media_package_path(uuid_, userId, "data", pkgname);
collectManualStats(extPath, &extStats);
auto mediaPath = create_data_media_package_path(uuid_, userId, "media", pkgname);
diff --git a/include/android/surface_control.h b/include/android/surface_control.h
index ef2ad99..abb8368 100644
--- a/include/android/surface_control.h
+++ b/include/android/surface_control.h
@@ -130,7 +130,7 @@
/**
* Returns a sync fence that signals when the transaction has been presented.
* The recipient of the callback takes ownership of the fence and is responsible for closing
- * it.
+ * it. If a device does not support present fences, a -1 will be returned.
*/
int ASurfaceTransactionStats_getPresentFenceFd(ASurfaceTransactionStats* surface_transaction_stats)
__INTRODUCED_IN(29);
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index c659a97..0c57335 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -616,7 +616,7 @@
return err == NO_ERROR;
}
-uid_t Parcel::readCallingWorkSourceUid()
+uid_t Parcel::readCallingWorkSourceUid() const
{
if (!mRequestHeaderPresent) {
return IPCThreadState::kUnsetWorkSource;
diff --git a/libs/binder/include/binder/Parcel.h b/libs/binder/include/binder/Parcel.h
index 0cdabb0..0046e3a 100644
--- a/libs/binder/include/binder/Parcel.h
+++ b/libs/binder/include/binder/Parcel.h
@@ -399,7 +399,7 @@
bool replaceCallingWorkSourceUid(uid_t uid);
// Returns the work source provided by the caller. This can only be trusted for trusted calling
// uid.
- uid_t readCallingWorkSourceUid();
+ uid_t readCallingWorkSourceUid() const;
void readRequestHeaders() const;
private:
diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp
index 34575f5..b2a7557 100644
--- a/libs/gui/Android.bp
+++ b/libs/gui/Android.bp
@@ -15,6 +15,10 @@
name: "libgui_headers",
vendor_available: true,
export_include_dirs: ["include"],
+
+ // we must build this module to get the required header as that is generated
+ export_shared_lib_headers: [ "android.hidl.token@1.0-utils" ],
+ shared_libs: [ "android.hidl.token@1.0-utils" ],
}
cc_library_shared {
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 5d4367d..db404eb 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -622,6 +622,7 @@
layer_state_t* s = getLayerState(sc);
if (!s) {
mStatus = BAD_INDEX;
+ return *this;
}
s->what |= layer_state_t::eRelativeLayerChanged;
s->relativeLayerHandle = relativeTo;
@@ -1050,6 +1051,7 @@
layer_state_t* s = getLayerState(sc);
if (!s) {
mStatus = BAD_INDEX;
+ return *this;
}
s->what |= layer_state_t::eDetachChildren;
diff --git a/libs/gui/tests/RegionSampling_test.cpp b/libs/gui/tests/RegionSampling_test.cpp
index d33ecfb..c9de37d 100644
--- a/libs/gui/tests/RegionSampling_test.cpp
+++ b/libs/gui/tests/RegionSampling_test.cpp
@@ -297,4 +297,70 @@
composer->removeRegionSamplingListener(grayListener);
}
+TEST_F(RegionSamplingTest, DISABLED_TestIfInvalidInputParameters) {
+ sp<ISurfaceComposer> composer = ComposerService::getComposerService();
+ sp<Listener> listener = new Listener();
+ const Rect sampleArea{100, 100, 200, 200};
+ // Invalid input sampleArea
+ EXPECT_EQ(BAD_VALUE,
+ composer->addRegionSamplingListener(Rect::INVALID_RECT, mTopLayer->getHandle(),
+ listener));
+ listener->reset();
+ // Invalid input binder
+ EXPECT_EQ(NO_ERROR, composer->addRegionSamplingListener(sampleArea, NULL, listener));
+ // Invalid input listener
+ EXPECT_EQ(BAD_VALUE,
+ composer->addRegionSamplingListener(sampleArea, mTopLayer->getHandle(), NULL));
+ EXPECT_EQ(BAD_VALUE, composer->removeRegionSamplingListener(NULL));
+ // remove the listener
+ composer->removeRegionSamplingListener(listener);
+}
+
+TEST_F(RegionSamplingTest, DISABLED_TestCallbackAfterRemoveListener) {
+ fill_render(rgba_green);
+ sp<ISurfaceComposer> composer = ComposerService::getComposerService();
+ sp<Listener> listener = new Listener();
+ const Rect sampleArea{100, 100, 200, 200};
+ composer->addRegionSamplingListener(sampleArea, mTopLayer->getHandle(), listener);
+ fill_render(rgba_green);
+
+ EXPECT_TRUE(listener->wait_event(300ms)) << "timed out waiting for luma event to be received";
+ EXPECT_NEAR(listener->luma(), luma_green, error_margin);
+
+ listener->reset();
+ composer->removeRegionSamplingListener(listener);
+ fill_render(rgba_green);
+ EXPECT_FALSE(listener->wait_event(100ms))
+ << "callback should stop after remove the region sampling listener";
+}
+
+TEST_F(RegionSamplingTest, DISABLED_CollectsLumaFromMovingLayer) {
+ sp<ISurfaceComposer> composer = ComposerService::getComposerService();
+ sp<Listener> listener = new Listener();
+ Rect sampleArea{100, 100, 200, 200};
+
+ // Test: listener in (100, 100). See layer before move, no layer after move.
+ fill_render(rgba_blue);
+ composer->addRegionSamplingListener(sampleArea, mTopLayer->getHandle(), listener);
+ EXPECT_TRUE(listener->wait_event(300ms)) << "timed out waiting for luma event to be received";
+ EXPECT_NEAR(listener->luma(), luma_blue, error_margin);
+ listener->reset();
+ SurfaceComposerClient::Transaction{}.setPosition(mContentLayer, 600, 600).apply();
+ EXPECT_TRUE(listener->wait_event(300ms)) << "timed out waiting for luma event to be received";
+ EXPECT_NEAR(listener->luma(), luma_gray, error_margin);
+ composer->removeRegionSamplingListener(listener);
+
+ // Test: listener offset to (600, 600). No layer before move, see layer after move.
+ fill_render(rgba_green);
+ sampleArea.offsetTo(600, 600);
+ composer->addRegionSamplingListener(sampleArea, mTopLayer->getHandle(), listener);
+ EXPECT_TRUE(listener->wait_event(300ms)) << "timed out waiting for luma event to be received";
+ EXPECT_NEAR(listener->luma(), luma_gray, error_margin);
+ listener->reset();
+ SurfaceComposerClient::Transaction{}.setPosition(mContentLayer, 600, 600).apply();
+ EXPECT_TRUE(listener->wait_event(300ms)) << "timed out waiting for luma event to be received";
+ EXPECT_NEAR(listener->luma(), luma_green, error_margin);
+ composer->removeRegionSamplingListener(listener);
+}
+
} // namespace android::test
diff --git a/libs/nativewindow/libnativewindow.map.txt b/libs/nativewindow/libnativewindow.map.txt
index 23a05f3..bad8b11 100644
--- a/libs/nativewindow/libnativewindow.map.txt
+++ b/libs/nativewindow/libnativewindow.map.txt
@@ -8,6 +8,7 @@
AHardwareBuffer_isSupported; # introduced=29
AHardwareBuffer_lock;
AHardwareBuffer_lockAndGetInfo; # introduced=29
+ AHardwareBuffer_lockPlanes; # introduced=29
AHardwareBuffer_recvHandleFromUnixSocket;
AHardwareBuffer_release;
AHardwareBuffer_sendHandleToUnixSocket;
diff --git a/services/surfaceflinger/TimeStats/TimeStats.h b/services/surfaceflinger/TimeStats/TimeStats.h
index 4e040a3..2bcb568 100644
--- a/services/surfaceflinger/TimeStats/TimeStats.h
+++ b/services/surfaceflinger/TimeStats/TimeStats.h
@@ -41,7 +41,7 @@
virtual void parseArgs(bool asProto, const Vector<String16>& args, std::string& result) = 0;
virtual bool isEnabled() = 0;
- virtual std::string miniDump();
+ virtual std::string miniDump() = 0;
virtual void incrementTotalFrames() = 0;
virtual void incrementMissedFrames() = 0;
diff --git a/vulkan/libvulkan/api_gen.cpp b/vulkan/libvulkan/api_gen.cpp
index df86af0..ad46c3b 100644
--- a/vulkan/libvulkan/api_gen.cpp
+++ b/vulkan/libvulkan/api_gen.cpp
@@ -16,12 +16,11 @@
// WARNING: This file is generated. See ../README.md for instructions.
+#include <log/log.h>
#include <string.h>
#include <algorithm>
-#include <log/log.h>
-
// to catch mismatches between vulkan.h and this file
#undef VK_NO_PROTOTYPES
#include "api.h"
diff --git a/vulkan/libvulkan/api_gen.h b/vulkan/libvulkan/api_gen.h
index 4bedbeb..f582224 100644
--- a/vulkan/libvulkan/api_gen.h
+++ b/vulkan/libvulkan/api_gen.h
@@ -20,7 +20,9 @@
#define LIBVULKAN_API_GEN_H
#include <vulkan/vulkan.h>
+
#include <bitset>
+
#include "driver_gen.h"
namespace vulkan {
diff --git a/vulkan/libvulkan/code-generator.tmpl b/vulkan/libvulkan/code-generator.tmpl
index bdd3573..940b747 100644
--- a/vulkan/libvulkan/code-generator.tmpl
+++ b/vulkan/libvulkan/code-generator.tmpl
@@ -37,8 +37,10 @@
#ifndef LIBVULKAN_API_GEN_H
#define LIBVULKAN_API_GEN_H
¶
-#include <bitset>
#include <vulkan/vulkan.h>
+¶
+#include <bitset>
+¶
#include "driver_gen.h"
¶
namespace vulkan {«
@@ -90,12 +92,11 @@
¶
// WARNING: This file is generated. See ../README.md for instructions.
¶
+#include <log/log.h>
#include <string.h>
¶
#include <algorithm>
¶
-#include <log/log.h>
-¶
// to catch mismatches between vulkan.h and this file
#undef VK_NO_PROTOTYPES
#include "api.h"
@@ -217,9 +218,10 @@
#ifndef LIBVULKAN_DRIVER_GEN_H
#define LIBVULKAN_DRIVER_GEN_H
¶
-#include <bitset>
-#include <vulkan/vulkan.h>
#include <vulkan/vk_android_native_buffer.h>
+#include <vulkan/vulkan.h>
+¶
+#include <bitset>
¶
namespace vulkan {«
namespace driver {«
@@ -271,12 +273,11 @@
¶
// WARNING: This file is generated. See ../README.md for instructions.
¶
+#include <log/log.h>
#include <string.h>
¶
#include <algorithm>
¶
-#include <log/log.h>
-¶
#include "driver.h"
¶
namespace vulkan {«
diff --git a/vulkan/libvulkan/driver_gen.cpp b/vulkan/libvulkan/driver_gen.cpp
index 574c327..7020be1 100644
--- a/vulkan/libvulkan/driver_gen.cpp
+++ b/vulkan/libvulkan/driver_gen.cpp
@@ -16,12 +16,11 @@
// WARNING: This file is generated. See ../README.md for instructions.
+#include <log/log.h>
#include <string.h>
#include <algorithm>
-#include <log/log.h>
-
#include "driver.h"
namespace vulkan {
diff --git a/vulkan/libvulkan/driver_gen.h b/vulkan/libvulkan/driver_gen.h
index 3faf6c0..c299549 100644
--- a/vulkan/libvulkan/driver_gen.h
+++ b/vulkan/libvulkan/driver_gen.h
@@ -21,6 +21,7 @@
#include <vulkan/vk_android_native_buffer.h>
#include <vulkan/vulkan.h>
+
#include <bitset>
namespace vulkan {
diff --git a/vulkan/nulldrv/null_driver.tmpl b/vulkan/nulldrv/null_driver.tmpl
index ce15517..0f53015 100644
--- a/vulkan/nulldrv/null_driver.tmpl
+++ b/vulkan/nulldrv/null_driver.tmpl
@@ -97,9 +97,10 @@
¶
// WARNING: This file is generated. See ../README.md for instructions.
¶
-#include "null_driver_gen.h"
#include <algorithm>
¶
+#include "null_driver_gen.h"
+¶
using namespace null_driver;
¶
namespace {
diff --git a/vulkan/nulldrv/null_driver_gen.cpp b/vulkan/nulldrv/null_driver_gen.cpp
index 92b7468..b8d7d2b 100644
--- a/vulkan/nulldrv/null_driver_gen.cpp
+++ b/vulkan/nulldrv/null_driver_gen.cpp
@@ -17,6 +17,7 @@
// WARNING: This file is generated. See ../README.md for instructions.
#include <algorithm>
+
#include "null_driver_gen.h"
using namespace null_driver;