Skip to content

Commit fbbfa3c

Browse files
committed
Add inline for extensions
1 parent 888c744 commit fbbfa3c

22 files changed

+301
-111
lines changed

AdvancedSharpAdbClient/DeviceCommands/DeviceExtensions.Async.cs

Lines changed: 46 additions & 45 deletions
Large diffs are not rendered by default.

AdvancedSharpAdbClient/DeviceCommands/DeviceExtensions.cs

Lines changed: 42 additions & 40 deletions
Large diffs are not rendered by default.

AdvancedSharpAdbClient/DeviceCommands/PackageManager.Async.cs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,9 @@ await splitRemoteFilePaths.Select(async (splitRemoteFilePath, index) =>
356356
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
357357
/// <param name="arguments">The arguments to pass to <c>adb install</c>.</param>
358358
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
359-
public async Task InstallPackageAsync(string packageFilePath, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
360-
await InstallPackageAsync(packageFilePath, progress.AsAction(), cancellationToken, arguments).ConfigureAwait(false);
359+
[MethodImpl((MethodImplOptions)0x100)]
360+
public Task InstallPackageAsync(string packageFilePath, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
361+
InstallPackageAsync(packageFilePath, progress.AsAction(), cancellationToken, arguments);
361362

362363
/// <summary>
363364
/// Asynchronously installs the application package that was pushed to a temporary location on the device.
@@ -368,8 +369,9 @@ public async Task InstallPackageAsync(string packageFilePath, IProgress<InstallP
368369
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
369370
/// <param name="arguments">The arguments to pass to <c>pm install</c>.</param>
370371
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
371-
public async Task InstallRemotePackageAsync(string remoteFilePath, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
372-
await InstallRemotePackageAsync(remoteFilePath, progress.AsAction(), cancellationToken, arguments).ConfigureAwait(false);
372+
[MethodImpl((MethodImplOptions)0x100)]
373+
public Task InstallRemotePackageAsync(string remoteFilePath, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
374+
InstallRemotePackageAsync(remoteFilePath, progress.AsAction(), cancellationToken, arguments);
373375

374376
/// <summary>
375377
/// Asynchronously installs Android multiple application on device.
@@ -381,8 +383,9 @@ public async Task InstallRemotePackageAsync(string remoteFilePath, IProgress<Ins
381383
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
382384
/// <param name="arguments">The arguments to pass to <c>pm install-create</c>.</param>
383385
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
384-
public async Task InstallMultiplePackageAsync(string basePackageFilePath, IEnumerable<string> splitPackageFilePaths, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
385-
await InstallMultiplePackageAsync(basePackageFilePath, splitPackageFilePaths, progress.AsAction(), cancellationToken, arguments).ConfigureAwait(false);
386+
[MethodImpl((MethodImplOptions)0x100)]
387+
public Task InstallMultiplePackageAsync(string basePackageFilePath, IEnumerable<string> splitPackageFilePaths, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
388+
InstallMultiplePackageAsync(basePackageFilePath, splitPackageFilePaths, progress.AsAction(), cancellationToken, arguments);
386389

387390
/// <summary>
388391
/// Asynchronously installs Android multiple application on device.
@@ -394,8 +397,9 @@ public async Task InstallMultiplePackageAsync(string basePackageFilePath, IEnume
394397
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
395398
/// <param name="arguments">The arguments to pass to <c>pm install-create</c>.</param>
396399
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
397-
public async Task InstallMultiplePackageAsync(IEnumerable<string> splitPackageFilePaths, string packageName, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
398-
await InstallMultiplePackageAsync(splitPackageFilePaths, packageName, progress.AsAction(), cancellationToken, arguments).ConfigureAwait(false);
400+
[MethodImpl((MethodImplOptions)0x100)]
401+
public Task InstallMultiplePackageAsync(IEnumerable<string> splitPackageFilePaths, string packageName, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
402+
InstallMultiplePackageAsync(splitPackageFilePaths, packageName, progress.AsAction(), cancellationToken, arguments);
399403

400404
/// <summary>
401405
/// Asynchronously installs the multiple application package that was pushed to a temporary location on the device.
@@ -407,8 +411,9 @@ public async Task InstallMultiplePackageAsync(IEnumerable<string> splitPackageFi
407411
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
408412
/// <param name="arguments">The arguments to pass to <c>pm install-create</c>.</param>
409413
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
410-
public async Task InstallMultipleRemotePackageAsync(string baseRemoteFilePath, IEnumerable<string> splitRemoteFilePaths, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
411-
await InstallMultipleRemotePackageAsync(baseRemoteFilePath, splitRemoteFilePaths, progress.AsAction(), cancellationToken, arguments).ConfigureAwait(false);
414+
[MethodImpl((MethodImplOptions)0x100)]
415+
public Task InstallMultipleRemotePackageAsync(string baseRemoteFilePath, IEnumerable<string> splitRemoteFilePaths, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
416+
InstallMultipleRemotePackageAsync(baseRemoteFilePath, splitRemoteFilePaths, progress.AsAction(), cancellationToken, arguments);
412417

413418
/// <summary>
414419
/// Asynchronously installs the multiple application package that was pushed to a temporary location on the device.
@@ -420,8 +425,9 @@ public async Task InstallMultipleRemotePackageAsync(string baseRemoteFilePath, I
420425
/// <param name="cancellationToken">A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.</param>
421426
/// <param name="arguments">The arguments to pass to <c>pm install-create</c>.</param>
422427
/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns>
423-
public async Task InstallMultipleRemotePackageAsync(IEnumerable<string> splitRemoteFilePaths, string packageName, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
424-
await InstallMultipleRemotePackageAsync(splitRemoteFilePaths, packageName, progress.AsAction(), cancellationToken, arguments).ConfigureAwait(false);
428+
[MethodImpl((MethodImplOptions)0x100)]
429+
public Task InstallMultipleRemotePackageAsync(IEnumerable<string> splitRemoteFilePaths, string packageName, IProgress<InstallProgressEventArgs>? progress = null, CancellationToken cancellationToken = default, params string[] arguments) =>
430+
InstallMultipleRemotePackageAsync(splitRemoteFilePaths, packageName, progress.AsAction(), cancellationToken, arguments);
425431
#endif
426432

427433
/// <summary>

AdvancedSharpAdbClient/DeviceCommands/PackageManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ public void InstallMultipleRemotePackage(IEnumerable<string> splitRemoteFilePath
418418
/// <param name="progress">An optional parameter which, when specified, returns progress notifications.
419419
/// The progress is reported as <see cref="InstallProgressEventArgs"/>, representing the state of installation.</param>
420420
/// <param name="arguments">The arguments to pass to <c>adb install</c>.</param>
421+
[MethodImpl((MethodImplOptions)0x100)]
421422
public void InstallPackage(string packageFilePath, IProgress<InstallProgressEventArgs>? progress = null, params string[] arguments) =>
422423
InstallPackage(packageFilePath, progress.AsAction(), arguments);
423424

@@ -428,6 +429,7 @@ public void InstallPackage(string packageFilePath, IProgress<InstallProgressEven
428429
/// <param name="progress">An optional parameter which, when specified, returns progress notifications.
429430
/// The progress is reported as <see cref="InstallProgressEventArgs"/>, representing the state of installation.</param>
430431
/// <param name="arguments">The arguments to pass to <c>adb install</c>.</param>
432+
[MethodImpl((MethodImplOptions)0x100)]
431433
public void InstallRemotePackage(string remoteFilePath, IProgress<InstallProgressEventArgs>? progress = null, params string[] arguments) =>
432434
InstallRemotePackage(remoteFilePath, progress.AsAction(), arguments);
433435

@@ -439,6 +441,7 @@ public void InstallRemotePackage(string remoteFilePath, IProgress<InstallProgres
439441
/// <param name="progress">An optional parameter which, when specified, returns progress notifications.
440442
/// The progress is reported as <see cref="InstallProgressEventArgs"/>, representing the state of installation.</param>
441443
/// <param name="arguments">The arguments to pass to <c>pm install-create</c>.</param>
444+
[MethodImpl((MethodImplOptions)0x100)]
442445
public void InstallMultiplePackage(string basePackageFilePath, IEnumerable<string> splitPackageFilePaths, IProgress<InstallProgressEventArgs>? progress = null, params string[] arguments) =>
443446
InstallMultiplePackage(basePackageFilePath, splitPackageFilePaths, progress.AsAction(), arguments);
444447

@@ -450,6 +453,7 @@ public void InstallMultiplePackage(string basePackageFilePath, IEnumerable<strin
450453
/// <param name="progress">An optional parameter which, when specified, returns progress notifications.
451454
/// The progress is reported as <see cref="InstallProgressEventArgs"/>, representing the state of installation.</param>
452455
/// <param name="arguments">The arguments to pass to <c>pm install-create</c>.</param>
456+
[MethodImpl((MethodImplOptions)0x100)]
453457
public void InstallMultiplePackage(IEnumerable<string> splitPackageFilePaths, string packageName, IProgress<InstallProgressEventArgs>? progress = null, params string[] arguments) =>
454458
InstallMultiplePackage(splitPackageFilePaths, packageName, progress.AsAction(), arguments);
455459

@@ -461,6 +465,7 @@ public void InstallMultiplePackage(IEnumerable<string> splitPackageFilePaths, st
461465
/// <param name="progress">An optional parameter which, when specified, returns progress notifications.
462466
/// The progress is reported as <see cref="InstallProgressEventArgs"/>, representing the state of installation.</param>
463467
/// <param name="arguments">The arguments to pass to <c>pm install-create</c>.</param>
468+
[MethodImpl((MethodImplOptions)0x100)]
464469
public void InstallMultipleRemotePackage(string baseRemoteFilePath, IEnumerable<string> splitRemoteFilePaths, IProgress<InstallProgressEventArgs>? progress = null, params string[] arguments) =>
465470
InstallMultipleRemotePackage(baseRemoteFilePath, splitRemoteFilePaths, progress.AsAction(), arguments);
466471

@@ -472,6 +477,7 @@ public void InstallMultipleRemotePackage(string baseRemoteFilePath, IEnumerable<
472477
/// <param name="progress">An optional parameter which, when specified, returns progress notifications.
473478
/// The progress is reported as <see cref="InstallProgressEventArgs"/>, representing the state of installation.</param>
474479
/// <param name="arguments">The arguments to pass to <c>pm install-create</c>.</param>
480+
[MethodImpl((MethodImplOptions)0x100)]
475481
public void InstallMultipleRemotePackage(IEnumerable<string> splitRemoteFilePaths, string packageName, IProgress<InstallProgressEventArgs>? progress = null, params string[] arguments) =>
476482
InstallMultipleRemotePackage(splitRemoteFilePaths, packageName, progress.AsAction(), arguments);
477483
#endif

0 commit comments

Comments
 (0)