Move InputApplication to use std::shared_ptr.
Move InputApplicationHandle away from RefBase based.
Modernize the code and make it ready to auto-generate parcelable
InputApplicationInfo from AIDL interface.
Bug: 160010896
Test: atest libinput_tests
Change-Id: Ice64147fb715bfeeb373b1c4bda7a43398151d54
diff --git a/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp b/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp
index 5ce9f23..6c821d4 100644
--- a/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp
+++ b/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp
@@ -47,8 +47,8 @@
private:
void notifyConfigurationChanged(nsecs_t) override {}
- std::chrono::nanoseconds notifyAnr(const sp<InputApplicationHandle>&, const sp<IBinder>&,
- const std::string& name) override {
+ std::chrono::nanoseconds notifyAnr(const std::shared_ptr<InputApplicationHandle>&,
+ const sp<IBinder>&, const std::string& name) override {
ALOGE("The window is not responding : %s", name.c_str());
return 0s;
}
@@ -148,7 +148,7 @@
static const int32_t WIDTH = 200;
static const int32_t HEIGHT = 200;
- FakeWindowHandle(const sp<InputApplicationHandle>& inputApplicationHandle,
+ FakeWindowHandle(const std::shared_ptr<InputApplicationHandle>& inputApplicationHandle,
const sp<InputDispatcher>& dispatcher, const std::string name)
: FakeInputReceiver(dispatcher, name), mFrame(Rect(0, 0, WIDTH, HEIGHT)) {
mDispatcher->registerInputChannel(mServerChannel);
@@ -246,7 +246,7 @@
dispatcher->start();
// Create a window that will receive motion events
- sp<FakeApplicationHandle> application = new FakeApplicationHandle();
+ std::shared_ptr<FakeApplicationHandle> application = std::make_shared<FakeApplicationHandle>();
sp<FakeWindowHandle> window = new FakeWindowHandle(application, dispatcher, "Fake Window");
dispatcher->setInputWindows({{ADISPLAY_ID_DEFAULT, {window}}});
@@ -282,7 +282,7 @@
dispatcher->start();
// Create a window that will receive motion events
- sp<FakeApplicationHandle> application = new FakeApplicationHandle();
+ std::shared_ptr<FakeApplicationHandle> application = std::make_shared<FakeApplicationHandle>();
sp<FakeWindowHandle> window = new FakeWindowHandle(application, dispatcher, "Fake Window");
dispatcher->setInputWindows({{ADISPLAY_ID_DEFAULT, {window}}});