Change MotionPredictor API to only support a single device
Before this CL, the MotionPredictor API was inconvenient to use. The MotionPredictor.predict returned a list of MotionEvents, with one MotionEvent per-device. The goal was to force applications to consider multi-device streams. However, even if the apps use this API, there's no way they can currently test this behaviour, since the multi-device feature is not yet available. For the multi-device streams feature, the current plan is to provide a new View callback to get these raw streams. In those streams, the per-device MotionEvents would continue to look the same. However, the events may now be interleaved between different devices. For example, a sequence like this would be possible: DOWN(deviceId=2) -> DOWN(deviceId=3) -> MOVE(deviceId=2). That means that the app will likely have to do per-device bookkeeping anyways. So the app might as well just create a per-device MotionPredictor object, as well. Bug: 167946763 Test: (cd frameworks/native/services/inputflinger && atest) Change-Id: I34b8dc02d4f995146cb3eed33888ae34abde29d6
Loading
Please register or sign in to comment