Class AndroidMobileCommandHelper


  • public class AndroidMobileCommandHelper
    extends MobileCommand
    This util class helps to prepare parameters of Android-specific JSONWP commands.
    • Constructor Detail

      • AndroidMobileCommandHelper

        public AndroidMobileCommandHelper()
    • Method Detail

      • currentActivityCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> currentActivityCommand()
        Deprecated.
        This method forms a Map of parameters for the getting of the current activity.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • currentPackageCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> currentPackageCommand()
        Deprecated.
        This method forms a Map of parameters for the getting of the current package.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • getSupportedPerformanceDataTypesCommand

        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> getSupportedPerformanceDataTypesCommand()
        returns the information type of the system state which is supported to read as like cpu, memory, network traffic, and battery.
        Returns:
        output - array like below [cpuinfo, batteryinfo, networkinfo, memoryinfo]
      • getPerformanceDataCommand

        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> getPerformanceDataCommand​(java.lang.String packageName,
                                                                                                                                    java.lang.String dataType,
                                                                                                                                    int dataReadTimeout)
        returns the resource usage information of the application. the resource is one of the system state which means cpu, memory, network traffic, and battery.
        Parameters:
        packageName - the package name of the application
        dataType - the type of system state which wants to read. It should be one of the supported performance data types, the return value of the function "getSupportedPerformanceDataTypes"
        dataReadTimeout - the number of attempts to read
        Returns:
        table of the performance data, The first line of the table represents the type of data. The remaining lines represent the values of the data. in case of battery info : [[power], [23]] in case of memory info : [[totalPrivateDirty, nativePrivateDirty, dalvikPrivateDirty, eglPrivateDirty, glPrivateDirty, totalPss, nativePss, dalvikPss, eglPss, glPss, nativeHeapAllocatedSize, nativeHeapSize], [18360, 8296, 6132, null, null, 42588, 8406, 7024, null, null, 26519, 10344]] in case of network info : [[bucketStart, activeTime, rxBytes, rxPackets, txBytes, txPackets, operations, bucketDuration,], [1478091600000, null, 1099075, 610947, 928, 114362, 769, 0, 3600000], [1478095200000, null, 1306300, 405997, 509, 46359, 370, 0, 3600000]] in case of network info : [[st, activeTime, rb, rp, tb, tp, op, bucketDuration], [1478088000, null, null, 32115296, 34291, 2956805, 25705, 0, 3600], [1478091600, null, null, 2714683, 11821, 1420564, 12650, 0, 3600], [1478095200, null, null, 10079213, 19962, 2487705, 20015, 0, 3600], [1478098800, null, null, 4444433, 10227, 1430356, 10493, 0, 3600]] in case of cpu info : [[user, kernel], [0.9, 1.3]]
      • getDisplayDensityCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> getDisplayDensityCommand()
        Deprecated.
        This method forms a Map of parameters to retrieve the display density of the Android device.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • getNetworkConnectionCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> getNetworkConnectionCommand()
        Deprecated.
        This method forms a Map of parameters for the getting of a network connection value.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • getSystemBarsCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> getSystemBarsCommand()
        Deprecated.
        This method forms a Map of parameters to retrieve visibility and bounds information of the status and navigation bars.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • isLockedCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> isLockedCommand()
        Deprecated.
        This method forms a Map of parameters for the finger print authentication invocation.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • fingerPrintCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> fingerPrintCommand​(int fingerPrintId)
        Deprecated.
        This method forms a Map of parameters for the finger print authentication invocation.
        Parameters:
        fingerPrintId - finger prints stored in Android Keystore system (from 1 to 10)
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • openNotificationsCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> openNotificationsCommand()
        Deprecated.
        This method forms a Map of parameters for the notification opening.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • setConnectionCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> setConnectionCommand​(long bitMask)
        Deprecated.
        This method forms a Map of parameters for the setting of device network connection.
        Parameters:
        bitMask - The bitmask of the desired connection
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • toggleLocationServicesCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> toggleLocationServicesCommand()
        Deprecated.
        This method forms a Map of parameters for the toggling of location services.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • unlockCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> unlockCommand()
        Deprecated.
        This method forms a Map of parameters for the element.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • replaceElementValueCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> replaceElementValueCommand​(org.openqa.selenium.remote.RemoteWebElement remoteWebElement,
                                                                                                                                     java.lang.String value)
        Deprecated.
        This method forms a Map of parameters for the element value replacement. It is used against input elements
        Parameters:
        remoteWebElement - an instance which contains an element ID
        value - a new value
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • sendSMSCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> sendSMSCommand​(java.lang.String phoneNumber,
                                                                                                                         java.lang.String message)
        Deprecated.
        This method forms a Map of parameters for the element value replacement. It is used against input elements
        Parameters:
        phoneNumber - The phone number of message sender
        message - The message content
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • gsmCallCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> gsmCallCommand​(java.lang.String phoneNumber,
                                                                                                                         GsmCallActions gsmCallActions)
        Deprecated.
        This method forms a Map of parameters for the element value replacement. It is used against input elements
        Parameters:
        phoneNumber - The phone number of message sender
        gsmCallActions - One of available GSM call actions
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • gsmSignalStrengthCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> gsmSignalStrengthCommand​(GsmSignalStrength gsmSignalStrength)
        Deprecated.
        This method forms a Map of parameters for the element value replacement. It is used against input elements
        Parameters:
        gsmSignalStrength - One of available GSM signal strength
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • gsmVoiceCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> gsmVoiceCommand​(GsmVoiceState gsmVoiceState)
        Deprecated.
        This method forms a Map of parameters for the element value replacement. It is used against input elements
        Parameters:
        gsmVoiceState - One of available GSM voice state
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • networkSpeedCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> networkSpeedCommand​(NetworkSpeed networkSpeed)
        Deprecated.
        This method forms a Map of parameters for the element value replacement. It is used against input elements
        Parameters:
        networkSpeed - One of possible NETWORK_SPEED values
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • powerCapacityCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> powerCapacityCommand​(int percent)
        Deprecated.
        This method forms a Map of parameters for the element value replacement. It is used against input elements
        Parameters:
        percent - A number in range [0, 4]
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • powerACCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> powerACCommand​(PowerACState powerACState)
        Deprecated.
        This method forms a Map of parameters for the element value replacement. It is used against input elements
        Parameters:
        powerACState - One of available power AC state
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • toggleWifiCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> toggleWifiCommand()
        Deprecated.
        This method forms a Map of parameters for the toggling of wifi.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • toggleAirplaneCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> toggleAirplaneCommand()
        Deprecated.
        This method forms a Map of parameters for the toggle airplane mode.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.
      • toggleDataCommand

        @Deprecated
        public static java.util.Map.Entry<java.lang.String,​java.util.Map<java.lang.String,​?>> toggleDataCommand()
        Deprecated.
        This method forms a Map of parameters for the toggle data.
        Returns:
        a key-value pair. The key is the command name. The value is a Map command arguments.