Merge "Convert MotionEvent#getSurfaceRotation to ui::Rotation"

This commit is contained in:
Michael Wright
2022-12-02 17:13:14 +00:00
committed by Android (Google) Code Review

View File

@@ -763,7 +763,12 @@ static void android_view_MotionEvent_nativeScale(jlong nativePtr, jfloat scale)
static jint android_view_MotionEvent_nativeGetSurfaceRotation(jlong nativePtr) {
MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);
return jint(event->getSurfaceRotation());
auto rotation = event->getSurfaceRotation();
if (rotation) {
return static_cast<jint>(rotation.value());
} else {
return -1;
}
}
// ----------------------------------------------------------------------------