@@ -120,16 +120,8 @@ export async function swipeGestureAndroid(
120120 device : DeviceInfo ,
121121 options : AndroidSwipeGestureOptions ,
122122) : Promise < Record < string , unknown > | void > {
123- const providerTouch = resolveAndroidTouchInjector ( device ) ;
124- if ( providerTouch ) {
125- return {
126- backend : 'provider-native-touch' ,
127- ...( ( await providerTouch ( { kind : 'swipe' , ...options } ) ) ?? { } ) ,
128- } ;
129- }
130-
131123 try {
132- return await runAndroidMultiTouchGesture ( device , { kind : 'swipe' , ...options } ) ;
124+ return await performAndroidTouchGesture ( device , { kind : 'swipe' , ...options } ) ;
133125 } catch ( error ) {
134126 emitDiagnostic ( {
135127 level : 'warn' ,
@@ -151,7 +143,7 @@ export async function pinchAndroid(
151143 throw new AppError ( 'INVALID_ARGS' , 'gesture pinch requires scale > 0' ) ;
152144 }
153145 const center = await resolveGestureCenter ( device , options . x , options . y ) ;
154- return await runAndroidMultiTouchGesture ( device , {
146+ return await performAndroidTouchGesture ( device , {
155147 kind : 'pinch' ,
156148 x : center . x ,
157149 y : center . y ,
@@ -175,7 +167,7 @@ export async function rotateGestureAndroid(
175167 }
176168 const center = await resolveGestureCenter ( device , options . x , options . y ) ;
177169 const degrees = options . degrees ;
178- return await runAndroidMultiTouchGesture ( device , {
170+ return await performAndroidTouchGesture ( device , {
179171 kind : 'rotate' ,
180172 x : center . x ,
181173 y : center . y ,
@@ -197,7 +189,7 @@ export async function transformGestureAndroid(
197189 if ( ! [ options . x , options . y , options . dx , options . dy ] . every ( Number . isFinite ) ) {
198190 throw new AppError ( 'INVALID_ARGS' , 'gesture transform requires finite x y dx dy' ) ;
199191 }
200- return await runAndroidMultiTouchGesture ( device , {
192+ return await performAndroidTouchGesture ( device , {
201193 kind : 'transform' ,
202194 x : options . x ,
203195 y : options . y ,
@@ -219,7 +211,7 @@ async function resolveGestureCenter(
219211 return { x : Math . round ( size . width / 2 ) , y : Math . round ( size . height / 2 ) } ;
220212}
221213
222- async function runAndroidMultiTouchGesture (
214+ async function performAndroidTouchGesture (
223215 device : DeviceInfo ,
224216 request : AndroidTouchGestureRequest ,
225217) : Promise < Record < string , unknown > > {
@@ -229,6 +221,13 @@ async function runAndroidMultiTouchGesture(
229221 return { backend : 'provider-native-touch' , ...result } ;
230222 }
231223
224+ return await runAndroidMultiTouchHelperGestureForDevice ( device , request ) ;
225+ }
226+
227+ async function runAndroidMultiTouchHelperGestureForDevice (
228+ device : DeviceInfo ,
229+ request : AndroidTouchGestureRequest ,
230+ ) : Promise < Record < string , unknown > > {
232231 const adb = resolveAndroidAdbExecutor ( device ) ;
233232 const artifact = await resolveAndroidMultiTouchHelperArtifact ( ) ;
234233 const adbProvider = resolveAndroidAdbProvider ( device ) ;
0 commit comments