Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Jan 8, 2024
1 parent 707161d commit 2c25079
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class SettingsApp {
* @throws {Error} If Appium Settings has failed to start
* @returns {Promise<SettingsApp>} self instance for chaining
*/
async requireRunningSettingsApp (opts = {}) {
async requireRunning (opts = {}) {
if (await this.adb.processExists(SETTINGS_HELPER_ID)) {
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/geolocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/sms.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2c25079

Please sign in to comment.