Update dependent properties when deviceType is updated

During TouchInputMapper configuration change, some properties
such as mDisplayBounds, mRawToDisplay transform, etc are calculated
based on the the deviceType of the input device. For
VirtualNavigationTouchpad, these properties are not updated when the
deviceType changes to "touchNavigation", resulting in wrong calculation
of transforms. Hence, update these properties whenever deviceType
changes during a configuration change.

Test: atest SingleTouchInputMapperTest
Test: atest android.hardware.input.cts.tests.VirtualDeviceMirrorDisplayTest#virtualNavigationTouchpad_touchEvent --iterations 100
Flag: EXEMPT minor fix
Fixes: 337818012
Change-Id: I5f67bd24730c63473260ff8a630bbdc90325d375
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
index beba3b8..984e217 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -977,8 +977,9 @@
         viewportChanged = mViewport != newViewport;
     }
 
+    const bool deviceModeChanged = mDeviceMode != oldDeviceMode;
     bool skipViewportUpdate = false;
-    if (viewportChanged) {
+    if (viewportChanged || deviceModeChanged) {
         const bool viewportOrientationChanged = mViewport.orientation != newViewport.orientation;
         const bool viewportDisplayIdChanged = mViewport.displayId != newViewport.displayId;
         mViewport = newViewport;
@@ -1020,7 +1021,6 @@
     }
 
     // If moving between pointer modes, need to reset some state.
-    bool deviceModeChanged = mDeviceMode != oldDeviceMode;
     if (deviceModeChanged) {
         mOrientedRanges.clear();
     }