diff --git a/lib/client.js b/lib/client.js index 70a98216..f0ab9c27 100644 --- a/lib/client.js +++ b/lib/client.js @@ -49,7 +49,7 @@ export class SettingsApp { * @throws {Error} If Appium Settings has failed to start * @returns {Promise} self instance for chaining */ - async requireRunningSettingsApp (opts = {}) { + async requireRunning (opts = {}) { if (await this.adb.processExists(SETTINGS_HELPER_ID)) { return this; } diff --git a/lib/commands/clipboard.js b/lib/commands/clipboard.js index 3b367c9f..7003d24d 100644 --- a/lib/commands/clipboard.js +++ b/lib/commands/clipboard.js @@ -22,7 +22,7 @@ import { */ export async function getClipboard () { this.log.debug(LOG_PREFIX, 'Getting the clipboard content'); - await this.requireRunningSettingsApp({shouldRestoreCurrentApp: true}); + await this.requireRunning({shouldRestoreCurrentApp: true}); const retrieveClipboard = async () => await this.adb.shell([ 'am', 'broadcast', '-n', CLIPBOARD_RECEIVER, diff --git a/lib/commands/geolocation.js b/lib/commands/geolocation.js index c256c4fa..3f5b5885 100644 --- a/lib/commands/geolocation.js +++ b/lib/commands/geolocation.js @@ -112,7 +112,7 @@ export async function setGeoLocation (location, isEmulator = false) { * @throws {Error} If the current location cannot be retrieved */ export async function getGeoLocation () { - await this.requireRunningSettingsApp({shouldRestoreCurrentApp: true}); + await this.requireRunning({shouldRestoreCurrentApp: true}); let output; try { @@ -155,7 +155,7 @@ export async function getGeoLocation () { * @throws {Error} If the GPS cache cannot be refreshed. */ export async function refreshGeoLocationCache (timeoutMs = 20000) { - await this.requireRunningSettingsApp({shouldRestoreCurrentApp: true}); + await this.requireRunning({shouldRestoreCurrentApp: true}); let logcatMonitor; let monitoringPromise; diff --git a/lib/commands/media.js b/lib/commands/media.js index 420d4c9e..6eda03e1 100644 --- a/lib/commands/media.js +++ b/lib/commands/media.js @@ -13,7 +13,7 @@ import { MEDIA_SCAN_ACTION, MEDIA_SCAN_RECEIVER } from '../constants.js'; */ export async function scanMedia (destination) { this.log.debug(LOG_PREFIX, `Scanning '${destination}' for media files`); - await this.requireRunningSettingsApp({shouldRestoreCurrentApp: true}); + await this.requireRunning({shouldRestoreCurrentApp: true}); const output = await this.adb.shell([ 'am', 'broadcast', '-n', MEDIA_SCAN_RECEIVER, diff --git a/lib/commands/network.js b/lib/commands/network.js index b0433bbe..aa2c1ff6 100644 --- a/lib/commands/network.js +++ b/lib/commands/network.js @@ -26,7 +26,7 @@ export async function setWifiState (on, isEmulator = false) { // Android below API 30 does not have a dedicated adb command // to manipulate wifi connection state, so try to do it via Settings app // as a workaround - await this.requireRunningSettingsApp({shouldRestoreCurrentApp: true}); + await this.requireRunning({shouldRestoreCurrentApp: true}); await this.adb.shell([ 'am', 'broadcast', @@ -58,7 +58,7 @@ export async function setDataState (on, isEmulator = false) { } if (await this.adb.getApiLevel() < 30) { - await this.requireRunningSettingsApp({shouldRestoreCurrentApp: true}); + await this.requireRunning({shouldRestoreCurrentApp: true}); await this.adb.shell([ 'am', 'broadcast', diff --git a/lib/commands/notifications.js b/lib/commands/notifications.js index ba355107..14da363b 100644 --- a/lib/commands/notifications.js +++ b/lib/commands/notifications.js @@ -55,7 +55,7 @@ export async function getNotifications () { // renders the broadcast to fail instead of starting the // Appium Settings app. This only happens to the notifications // receiver - await this.requireRunningSettingsApp({shouldRestoreCurrentApp: true}); + await this.requireRunning({shouldRestoreCurrentApp: true}); let output; try { output = await this.adb.shell([ diff --git a/lib/commands/sms.js b/lib/commands/sms.js index 3da917c2..1b69108a 100644 --- a/lib/commands/sms.js +++ b/lib/commands/sms.js @@ -71,7 +71,7 @@ import { SMS_LIST_RECEIVER, SMS_LIST_RETRIEVAL_ACTION } from '../constants.js'; */ export async function getSmsList (opts = {}) { this.log.debug(LOG_PREFIX, 'Retrieving the recent SMS messages'); - await this.requireRunningSettingsApp({shouldRestoreCurrentApp: true}); + await this.requireRunning({shouldRestoreCurrentApp: true}); const args = [ 'am', 'broadcast', '-n', SMS_LIST_RECEIVER,