Propagate drop input mode correctly to children
We were short circuting updating input info if the layer
did not have an input channel. This prevented us from
propagating the drop input mode correctly.
Fix this by updating all input states that are tied to
parent states as well regardless of input channel.
Test: presbumit (atest LayerSnapshotBuilderTest)
Fixes: 314350323
Change-Id: I955f81aeec1e6eec62f571edb181bbc5a7351385
diff --git a/services/surfaceflinger/tests/unittests/LayerHierarchyTest.h b/services/surfaceflinger/tests/unittests/LayerHierarchyTest.h
index 48f8923..7e9abce 100644
--- a/services/surfaceflinger/tests/unittests/LayerHierarchyTest.h
+++ b/services/surfaceflinger/tests/unittests/LayerHierarchyTest.h
@@ -478,6 +478,17 @@
mLifecycleManager.applyTransactions(transactions);
}
+ void setDropInputMode(uint32_t id, gui::DropInputMode dropInputMode) {
+ std::vector<TransactionState> transactions;
+ transactions.emplace_back();
+ transactions.back().states.push_back({});
+
+ transactions.back().states.front().state.what = layer_state_t::eDropInputModeChanged;
+ transactions.back().states.front().layerId = id;
+ transactions.back().states.front().state.dropInputMode = dropInputMode;
+ mLifecycleManager.applyTransactions(transactions);
+ }
+
LayerLifecycleManager mLifecycleManager;
};