|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.baidu.cafe.remote.Armser
public class Armser
Field Summary | |
---|---|
static int |
GPS_PROVIDER
|
static int |
ICON_ALARM_CLOCK
|
static int |
ICON_BATTERY
|
static int |
ICON_BLUETOOTH
|
static int |
ICON_CDMA_ERI
|
static int |
ICON_COM_ANDROID_SYSTEMUI
|
static int |
ICON_COM_BAIDU_INPUT
|
static int |
ICON_COM_BAIDU_SYNC
|
static int |
ICON_DATA_CONNECTION
|
static int |
ICON_GPS
|
static int |
ICON_HEADSET
|
static int |
ICON_MORE
|
static int |
ICON_PHONE_SIGNAL
|
static int |
ICON_SYNC_ACTIVE
|
static int |
ICON_SYNC_FAILING
|
static int |
ICON_TTY
|
static int |
ICON_VOLUME
|
static int |
ICON_WIFI
|
static java.lang.String[] |
iconName
|
static int |
NETWORK_PROVIDER
|
static int |
SCREEN_BRIGHTNESS_MODE_AUTOMATIC
|
static int |
SCREEN_BRIGHTNESS_MODE_MANUAL
|
Constructor Summary | |
---|---|
Armser(android.content.Context context)
|
Method Summary | |
---|---|
java.lang.String |
addContact(java.lang.String name,
java.lang.String phone)
NOT READY YET, COMING SOON... |
boolean |
bind(android.content.Context context)
|
void |
changeLanguage(java.lang.String language)
change language |
boolean |
checkProcessAlive(java.lang.String processName)
check the given processname alive or not |
boolean |
clearApplicationUserData(java.lang.String packageName)
clear application's user data same as click SystemSettings->Applications->Manage Applications->XXXX application->Clear Data; suggest to use this function in teardown |
void |
clearLog()
clear (flush) the entire log, by calling "logcat -c" |
void |
clickScreen(int x,
int y)
click on screen |
boolean |
clickView(java.lang.String searchKey,
java.lang.String searchValue,
int searchMode,
int index,
int timeout,
int xOffset,
int yOffset,
int longClickTime,
java.lang.String scrollViewId,
int scrollViewIndex)
click a view |
boolean |
clickViewById(java.lang.String id)
click on a view by id without auto-scroll and xOffset = 0, yOffset = 0, timeout = 10000, index = 0 |
boolean |
clickViewById(java.lang.String id,
int index,
int timeout,
int xOffset,
int yOffset,
java.lang.String scrollViewId,
int scrollViewIndex)
click on a view by id |
boolean |
clickViewById(java.lang.String id,
int index,
int timeout,
java.lang.String scrollViewId,
int scrollViewIndex)
click on a view by id and xOffset = 0, yOffset = 0 |
boolean |
clickViewById(java.lang.String id,
int index,
java.lang.String scrollViewId,
int scrollViewIndex)
click on a view by id and xOffset = 0, yOffset = 0, timeout = 10000 |
boolean |
clickViewById(java.lang.String id,
java.lang.String scrollViewId,
int scrollViewIndex)
click on a view by id and xOffset = 0, yOffset = 0, timeout = 10000, index = 0 |
boolean |
clickViewByText(java.lang.String text)
click on a view by text without auto-scroll and xOffset=0, yOffset = 0, timeout=10000, index = 0, searchMode = LocalLib.SEARCHMODE_INCLUDE_MATCHING |
boolean |
clickViewByText(java.lang.String text,
int searchMode)
click on a view by text without auto-scroll and xOffset=0, yOffset = 0, timeout=10000, index = 0 |
boolean |
clickViewByText(java.lang.String text,
int searchMode,
int index,
int timeout,
int xOffset,
int yOffset,
java.lang.String scrollViewId,
int scrollViewIndex)
click on a view by text |
boolean |
clickViewByText(java.lang.String text,
int searchMode,
int index,
int timeout,
java.lang.String scrollViewId,
int scrollViewIndex)
click on a view by text without offset |
boolean |
clickViewByText(java.lang.String text,
int searchMode,
int index,
java.lang.String scrollViewId,
int scrollViewIndex)
click on a view by text without offset and timeout = 10000 |
boolean |
clickViewByText(java.lang.String text,
int searchMode,
java.lang.String scrollViewId,
int scrollViewIndex)
click on a view by text without offset and timeout = 10000, index = 0 |
void |
copyAssets(java.lang.String dist)
|
void |
deleteAccount(java.lang.String name,
java.lang.String type)
|
int |
deleteContact(java.lang.String uriStr)
NOT READY YET, COMING SOON... |
java.lang.String[] |
diffLog(java.lang.String[] logStart,
java.lang.String[] logEnd)
diff log |
void |
drag(float fromX,
float toX,
float fromY,
float toY,
int stepCount)
|
void |
dragHalfScreenDown(int stepCount)
drag from (mScreenHeight * 0.5f) to (mScreenHeight) |
void |
dragHalfScreenLeft(int stepCount)
drag from (mScreenWidth * 0.5f) to (0) |
void |
dragHalfScreenRight(int stepCount)
drag from (mScreenWidth * 0.5f) to (mScreenWidth) |
void |
dragHalfScreenUp(int stepCount)
drag from (mScreenHeight * 0.5f) to (0) |
void |
dragQuarterScreenDown(int stepCount)
drag from (mScreenHeight * 0.5f) to (mScreenHeight * 0.75f) |
void |
dragQuarterScreenLeft(int stepCount)
drag from (mScreenWidth * 0.5f) to (mScreenWidth * 0.25f) |
void |
dragQuarterScreenRight(int stepCount)
drag from (mScreenWidth * 0.5f) to (mScreenWidth * 0.75f) |
void |
dragQuarterScreenUp(int stepCount)
drag from (mScreenHeight * 0.5f) to (mScreenHeight * 0.25f) |
void |
enterText(java.lang.String text)
enter a string |
void |
expandStatusBar()
|
void |
factoryResetWithEraseSD()
factory reset with erase sd card |
void |
formatSD()
format sd card |
java.lang.String |
formatSize(long size)
formats a content size to be in the form of bytes, kilobytes, megabytes, etc |
java.lang.String |
getAccountName()
get account name |
java.lang.String |
getAccountType()
get account type |
java.lang.String |
getAllRunningActivities()
NOT READY YET, COMING SOON... |
java.lang.String |
getAllRunningServices()
NOT READY YET, COMING SOON... |
int |
getAudioMode()
get the current audio mode |
int |
getAudioVolume(int streamType)
get the audio volume |
int |
getAutoTimeState()
|
boolean |
getBackgroundDataState()
|
java.lang.String |
getBaseBandVersion()
get baseband version e.g. |
java.lang.String |
getBatteryHealth()
get battery status |
int |
getBatteryIconsmall()
get resource id of battery small icon |
int |
getBatteryLevel()
get battery level |
java.lang.String |
getBatteryPlugged()
get battery plugged category |
boolean |
getBatteryPresent()
get battery present |
int |
getBatteryScale()
get battery scale |
java.lang.String |
getBatteryStatus()
get battery status |
java.lang.String |
getBatteryTechnology()
get battery technology |
int |
getBatteryTemperature()
get battery temperature |
int |
getBatteryVoltage()
get battery voltage |
java.lang.String |
getBlueToothAddress()
get bluetooth address |
java.lang.String |
getBuildNumber()
get build number |
java.lang.String |
getBuildVersion()
get build version |
int |
getCurrentTaskActivitiesNumber()
|
java.lang.String |
getDataState()
get current data state |
java.lang.String |
getDeviceModel()
get device model Full BMOS on Passion |
int |
getDisplayX()
get width of screen |
int |
getDisplayY()
get height of screen |
java.lang.String |
getFocusedWindow()
get focused window name |
boolean |
getInputMethodStatus()
get status of input method |
java.lang.String |
getKernelVersion()
get kernel version |
java.lang.String[] |
getLog()
get log information, by calling logcat with parameters "-d -v -time" |
java.lang.String[] |
getLog(java.lang.String filterSpecs)
get log information, by calling logcat with parameters "-d -v -time" and filterSpecs |
java.lang.String[] |
getLog(java.lang.String[] command)
get log information, by calling logcat with specified parameters |
boolean |
getMasterSyncAutomatically()
|
long |
getMemoryInternalAvail()
get available internal memory |
java.lang.String |
getMyPhoneNumber()
get my phone number |
java.lang.String |
getNetworkType()
get current network type |
int |
getNonMarketAppsAllowed()
check nomarketappsallowed is available |
java.lang.String[] |
getPermissionsForPackage(java.lang.String packageName)
get package's pemissions |
int |
getRingtoneMode()
get the current ringtone mode |
int |
getScreenBrightness()
NOT READY YET, COMING SOON... |
int |
getScreenBrightnessMode()
|
java.lang.String |
getServerIP()
get server ip |
int |
getSimCardState()
get current sim card state |
java.lang.String |
getSmsState()
NOT READY YET, COMING SOON... |
boolean |
getStatusBarIconState(int slot)
get icon state on statusbar |
long |
getStorageCardAvail()
get storage card total size |
long |
getStorageCardSize()
|
java.lang.String |
getStringByName(java.lang.String name)
|
java.lang.String |
getSystemProperties(java.lang.String key)
get system property same as "adb shell get prop" |
java.lang.String |
getSystemTime()
get system time e.g. |
java.lang.String |
getTopActivity()
get top activity |
java.lang.String |
getTopPackage()
|
int[] |
getViewCenterPointById(java.lang.String id)
get view's center point coordinate by id |
int[] |
getViewCenterPointByText(java.lang.String text)
get view's center point coordinate by id |
java.lang.String[] |
getViewProperties(java.lang.String searchKey,
java.lang.String searchValue,
int searchMode,
int targetNumber,
java.lang.String[] getKeys,
boolean getNew)
get view's properties from focused window |
int |
getWifiState()
get current wifi state |
java.lang.String[] |
getWindowList()
Lists all of the available windows in the system |
java.lang.String |
getWlanMacAddress()
get current wifi mac address |
void |
goBack()
press back key |
void |
goHome()
press home key |
void |
goToSleep()
force the devcie to go to sleep |
boolean |
hasAppsAccessingStorage()
check if any app is accessing storage card |
void |
installApk(java.lang.String filename)
you must use "isPackageInstalled(String)" to judge if it is installed finish. |
boolean |
installApkSync(java.lang.String filename,
long timeout)
install a apk in sdcard, return until it install finish. |
boolean |
isAccelerometerRotationEnabled()
|
boolean |
isBluetoothEnabled()
check bluetooth state |
boolean |
isHome()
Judge whether top activity is home. |
boolean |
isLocationProviderEnabled(int provider)
|
boolean |
isMusicActive()
check if any music is active |
boolean |
isNetworkEnable()
ping 8.8.8.8 |
boolean |
isPackageInstalled(java.lang.String packageName)
check a package is installed or not. |
boolean |
isScreenLocked()
check if screen is locked |
boolean |
isScreenOn()
check if screen is currently on |
boolean |
isStorageCardReadOnly()
check if storage card is currently readonly |
boolean |
isStorageCardValid()
check if storage card is currently valid |
boolean |
isViewServerOpen()
|
boolean |
isWifiEnabled()
check if wifi is currently enabled |
void |
killBackgroundProcesses(java.lang.String packageName)
Have the system immediately kill all background processes associated with the given package. |
boolean |
launchActivity(java.lang.String className)
|
boolean |
launchActivity(java.lang.String className,
int flags)
launch a activity via sent intent |
void |
longClickScreen(int x,
int y,
int time)
long click on screen |
boolean |
longClickViewById(java.lang.String id,
int time)
long click on a view without auto-scroll and xOffset=0, yOffset = 0, timeout=10000, index = 0 |
boolean |
longClickViewById(java.lang.String id,
int index,
int time)
long click on a view without auto-scroll and xOffset=0, yOffset = 0, timeout=10000 |
boolean |
longClickViewById(java.lang.String id,
int index,
int timeout,
int time)
long click on a view without auto-scroll and xOffset=0, yOffset = 0 |
boolean |
longClickViewById(java.lang.String id,
int index,
int timeout,
int xOffset,
int yOffset,
int time)
long click on a view without auto-scroll |
boolean |
longClickViewByText(java.lang.String text,
int time)
long click on a view without auto-scroll and xOffset=0, yOffset = 0, timeout=10000, index = 0, searchMode = LocalLib.SEARCHMODE_INCLUDE_MATCHING |
boolean |
longClickViewByText(java.lang.String text,
int searchMode,
int time)
long click on a view without auto-scroll and xOffset=0, yOffset = 0, timeout=10000, index = 0 |
boolean |
longClickViewByText(java.lang.String text,
int searchMode,
int index,
int time)
long click on a view without auto-scroll and xOffset=0, yOffset = 0, timeout=10000 |
boolean |
longClickViewByText(java.lang.String text,
int searchMode,
int index,
int timeout,
int time)
long click on a view without auto-scroll and xOffset=0, yOffset = 0 |
boolean |
longClickViewByText(java.lang.String text,
int searchMode,
int index,
int timeout,
int xOffset,
int yOffset,
int time)
long click on a view without auto-scroll |
void |
longPressKey(int keyCode)
send a key evnet of long press |
void |
mount()
mount storage card |
void |
pressKey(int keyCode)
send a key evnet |
void |
reboot()
reboot device |
void |
rebootToBootloader()
reboot device to bootloader |
void |
rebootToRecoveryMode()
reboot device to recovery mode |
void |
recordVideo()
NOT READY YET, COMING SOON... |
void |
recovery()
|
java.lang.String |
runCmdOnServer(java.lang.String command)
Deprecated. |
void |
screenCap(java.lang.String prefix)
take full screen cap,the function use /system/bin/screencap cmd |
void |
sendKeyEvent(int keycode)
Deprecated. |
void |
setAccelerometerRotationEnabled(boolean enabled)
|
void |
setAirplaneMode(boolean enable)
set airplane mode |
void |
setAudioMuteOff(int streamType)
NOT READY YET, COMING SOON... |
void |
setAudioMuteOn(int streamType)
NOT READY YET, COMING SOON... |
void |
setAudioVolumeDown(int streamType)
set the audio volume down |
void |
setAudioVolumeUp(int streamType)
set the audio volume up |
void |
setAutoTimeDisabled()
|
void |
setAutoTimeEnabled()
|
void |
setBackgroundDataSetting(boolean enabled)
|
void |
setBluetoothState(boolean enabled)
set bluetooth state |
void |
setDataConnectionDisabled()
set mobile data disabled |
void |
setDataConnectionEnabled()
set mobile data enalbed |
void |
setInputMethodShowOff()
NOT READY YET, COMING SOON... |
void |
setInputMethodShowOn()
NOT READY YET, COMING SOON... |
void |
setLocationProviderEnabled(int provider,
boolean enabled)
|
void |
setMasterSyncAutomatically(boolean sync)
|
void |
setNonMarketAppsAllowed(boolean enabled)
set nomarketappsallowed is available |
void |
setScreenBrightness(int brightness)
set screen brightness |
void |
setScreenBrightnessMode(int mode)
|
void |
setScreenLocked()
NOT READY YET, COMING SOON... |
void |
setScreenOn()
set screen still light |
void |
setScreenStayAwake(boolean isAwake)
set the screen stay awake |
void |
setScreenTimeOut(int milisecond)
set the timeout to lock screen |
void |
setScreenUnlocked()
NOT READY YET, COMING SOON... |
void |
setScreenUnlockSecurityNone()
set the screen unlock mode is none |
void |
setStatusBarHeight(int height)
|
void |
setSystemProperties(java.lang.String key,
java.lang.String val)
set system property same as "adb shell set prop" |
void |
setSystemTime(java.lang.String time)
set system time |
boolean |
setWifiDisabled()
set wifi disabled |
boolean |
setWifiDisconnect()
set wifi disconnect |
boolean |
setWifiEnabled()
set wifi enabled |
boolean |
setWifiReconnect()
set wifi reconnect |
boolean |
setWifiStartScan()
set wifi starting scan now |
void |
sleep(int time)
SystemClock.sleep(time); |
void |
sleepMini()
sleep 200ms |
boolean |
unbind(android.content.Context context)
|
void |
uninstallApk(java.lang.String packageName)
uninstall an apk. |
void |
unmount()
unmount storage card |
void |
updatePackagePermission(java.lang.String packageName,
java.lang.String permissionName,
int state)
change package's pemission state for dynamic permission |
boolean |
waitForActivity(java.lang.String activityName,
long timeout)
|
void |
waitForAllDumpCompleted()
only for CafeTestCase.tearDown() or testcase that doesn't inherit CafeTestCase and should be called only one time |
boolean |
waitforTopActivity(java.lang.String className,
long timeout)
|
boolean |
waitForView(java.lang.String searchKey,
java.lang.String searchValue,
int searchMode,
int index,
long timeout)
wait for view appearing |
boolean |
waitForViewById(java.lang.String id,
int index,
long timeout)
wait for view appearing by id and use LocalLib.SEARCHMODE_COMPLETE_MATCHING |
boolean |
waitForViewById(java.lang.String id,
long timeout)
wait for view appearing by id and use LocalLib.SEARCHMODE_COMPLETE_MATCHING and index=0 |
boolean |
waitForViewByText(java.lang.String text,
int searchMode,
int index,
long timeout)
wait for view appearing by text |
boolean |
waitForViewByText(java.lang.String text,
int index,
long timeout)
wait for view appearing by text and use LocalLib.SEARCHMODE_INCLUDE_MATCHING |
boolean |
waitForViewByText(java.lang.String text,
long timeout)
wait for view appearing by text and use LocalLib.SEARCHMODE_INCLUDE_MATCHING and index=0 |
void |
writeLineToSdcard(java.lang.String filename,
java.lang.String line)
NOT READY YET, COMING SOON... |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC
public static final int SCREEN_BRIGHTNESS_MODE_MANUAL
public static final int GPS_PROVIDER
public static final int NETWORK_PROVIDER
public static final int ICON_MORE
public static final int ICON_COM_BAIDU_SYNC
public static final int ICON_COM_BAIDU_INPUT
public static final int ICON_HEADSET
public static final int ICON_COM_ANDROID_SYSTEMUI
public static final int ICON_SYNC_FAILING
public static final int ICON_SYNC_ACTIVE
public static final int ICON_GPS
public static final int ICON_BLUETOOTH
public static final int ICON_TTY
public static final int ICON_VOLUME
public static final int ICON_WIFI
public static final int ICON_CDMA_ERI
public static final int ICON_DATA_CONNECTION
public static final int ICON_PHONE_SIGNAL
public static final int ICON_BATTERY
public static final int ICON_ALARM_CLOCK
public static final java.lang.String[] iconName
Constructor Detail |
---|
public Armser(android.content.Context context)
Method Detail |
---|
public boolean bind(android.content.Context context)
public boolean unbind(android.content.Context context)
public java.lang.String getAccountName()
public java.lang.String getAccountType()
public java.lang.String getAllRunningActivities()
public java.lang.String getAllRunningServices()
public void setInputMethodShowOff()
public void setInputMethodShowOn()
public boolean isScreenLocked()
public void setScreenLocked()
public void setScreenUnlocked()
public java.lang.String getBatteryStatus()
public java.lang.String getBatteryHealth()
public boolean getBatteryPresent()
public int getBatteryLevel()
public int getBatteryScale()
public int getBatteryIconsmall()
public java.lang.String getBatteryPlugged()
public int getBatteryVoltage()
public int getBatteryTemperature()
public java.lang.String getBatteryTechnology()
public java.lang.String getBlueToothAddress()
public java.lang.String getBuildVersion()
public java.lang.String getBaseBandVersion()
public java.lang.String getDeviceModel()
public java.lang.String getBuildNumber()
public java.lang.String getKernelVersion()
public void recordVideo()
public java.lang.String addContact(java.lang.String name, java.lang.String phone)
public int deleteContact(java.lang.String uriStr)
public int getAudioMode()
public int getAudioVolume(int streamType)
streamType
- public int getRingtoneMode()
public boolean isMusicActive()
public void setAudioVolumeDown(int streamType)
streamType
- public void setAudioVolumeUp(int streamType)
streamType
- public void setAudioMuteOn(int streamType)
public void setAudioMuteOff(int streamType)
public long getMemoryInternalAvail()
public void goToSleep()
public boolean isScreenOn()
public void reboot()
public void rebootToRecoveryMode()
public void rebootToBootloader()
public boolean isStorageCardValid()
public boolean isStorageCardReadOnly()
public void writeLineToSdcard(java.lang.String filename, java.lang.String line)
public long getStorageCardSize()
public long getStorageCardAvail()
public boolean hasAppsAccessingStorage()
public void mount()
public void unmount()
public int getDisplayX()
public int getDisplayY()
public int getScreenBrightness()
public java.lang.String getSystemTime()
public void setScreenBrightness(int brightness)
brightness
- , 0 ~ 255public void setSystemTime(java.lang.String time)
time
- , format "yyyy/MM/dd hh:mm:ss", e.g. "2011/11/25 17:30:00"public java.lang.String getMyPhoneNumber()
public java.lang.String getNetworkType()
public java.lang.String getDataState()
public int getSimCardState()
public java.lang.String getSmsState()
public void setAirplaneMode(boolean enable)
enable
- true means open; false means closedpublic void setDataConnectionDisabled()
public void setDataConnectionEnabled()
public java.lang.String formatSize(long size)
public java.lang.String getWlanMacAddress()
public int getWifiState()
public boolean isWifiEnabled()
public boolean setWifiDisabled()
public boolean setWifiEnabled()
public boolean setWifiDisconnect()
public boolean setWifiReconnect()
public boolean setWifiStartScan()
public java.lang.String getServerIP()
@Deprecated public java.lang.String runCmdOnServer(java.lang.String command)
public void goHome()
public void goBack()
public java.lang.String getTopActivity()
public boolean launchActivity(java.lang.String className)
className
- className of activity
e.g."com.android.mms/.ui.ConversationList"
public boolean launchActivity(java.lang.String className, int flags)
className
- className of activity
e.g."com.android.mms/.ui.ConversationList"flags
- param for intent.setFlags()
public boolean waitForActivity(java.lang.String activityName, long timeout)
activityName
- e.g.com.baidu.resmanager.filemanager.FileManagerActivitytimeout
- the delay millisecond waiting for activity
public boolean waitForViewById(java.lang.String id, long timeout)
id
- the id of target viewstimeout
- timeout of wait
public boolean waitForViewById(java.lang.String id, int index, long timeout)
id
- the id of target viewsindex
- the text of target viewstimeout
- timeout of wait
public boolean waitForViewByText(java.lang.String text, long timeout)
text
- the text of target viewstimeout
- timeout of wait
public boolean waitForViewByText(java.lang.String text, int index, long timeout)
text
- the text of target viewsindex
- the index of search resulttimeout
- timeout of wait
public boolean waitForViewByText(java.lang.String text, int searchMode, int index, long timeout)
text
- the text of target viewssearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGindex
- the index of search resulttimeout
- timeout of wait
public boolean waitForView(java.lang.String searchKey, java.lang.String searchValue, int searchMode, int index, long timeout)
searchKey
- the key to search viewsearchValue
- the value to search viewsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGindex
- the index of search resulttimeout
- timeout of wait
public void enterText(java.lang.String text)
text
- public void pressKey(int keyCode)
keyCode
- e.g. KeyEvent.KEYCODE_HOMEpublic void longPressKey(int keyCode)
keyCode
- e.g. KeyEvent.KEYCODE_HOMEpublic void clickScreen(int x, int y)
x
- click.xy
- click.ypublic void longClickScreen(int x, int y, int time)
x
- click.xy
- click.ytime
- time of long presspublic boolean clickViewById(java.lang.String id)
id
- id of view used to search
public boolean clickViewById(java.lang.String id, java.lang.String scrollViewId, int scrollViewIndex)
id
- id of view used to searchscrollViewId
- if want to click a item of {ListView, GridView, ScrollView},
get the id of {ListView, GridView, ScrollView}scrollViewIndex
- the index of target {ListView, GridView, ScrollView}
public boolean clickViewById(java.lang.String id, int index, java.lang.String scrollViewId, int scrollViewIndex)
id
- id of view used to searchindex
- the index of target viewscrollViewId
- if want to click a item of {ListView, GridView, ScrollView},
get the id of {ListView, GridView, ScrollView}scrollViewIndex
- the index of target {ListView, GridView, ScrollView}
public boolean clickViewById(java.lang.String id, int index, int timeout, java.lang.String scrollViewId, int scrollViewIndex)
id
- id of view used to searchindex
- the index of target viewtimeout
- timeout of dumpscrollViewId
- if want to click a item of {ListView, GridView, ScrollView},
get the id of {ListView, GridView, ScrollView}scrollViewIndex
- the index of target {ListView, GridView, ScrollView}
public boolean clickViewById(java.lang.String id, int index, int timeout, int xOffset, int yOffset, java.lang.String scrollViewId, int scrollViewIndex)
id
- id of view used to searchindex
- the index of target viewtimeout
- timeout of dumpxOffset
- Offset.x of target view's center pointyOffset
- Offset.y of target view's center pointscrollViewId
- if want to click a item of {ListView, GridView, ScrollView},
get the id of {ListView, GridView, ScrollView}scrollViewIndex
- the index of target {ListView, GridView, ScrollView}
public boolean clickViewByText(java.lang.String text)
text
- text of view used to search
public boolean clickViewByText(java.lang.String text, int searchMode)
text
- text of view used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHING
public boolean clickViewByText(java.lang.String text, int searchMode, java.lang.String scrollViewId, int scrollViewIndex)
text
- text of view used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGscrollViewId
- if want to click a item of {ListView, GridView, ScrollView},
get the id of {ListView, GridView, ScrollView}scrollViewIndex
- the index of target {ListView, GridView, ScrollView}
public boolean clickViewByText(java.lang.String text, int searchMode, int index, java.lang.String scrollViewId, int scrollViewIndex)
text
- text of view used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGindex
- the index of target viewscrollViewId
- if want to click a item of {ListView, GridView, ScrollView},
get the id of {ListView, GridView, ScrollView}scrollViewIndex
- the index of target {ListView, GridView, ScrollView}
public boolean clickViewByText(java.lang.String text, int searchMode, int index, int timeout, java.lang.String scrollViewId, int scrollViewIndex)
text
- text of view used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGindex
- the index of target viewtimeout
- timeout of dumpscrollViewId
- if want to click a item of {ListView, GridView, ScrollView},
get the id of {ListView, GridView, ScrollView}scrollViewIndex
- the index of target {ListView, GridView, ScrollView}
public boolean clickViewByText(java.lang.String text, int searchMode, int index, int timeout, int xOffset, int yOffset, java.lang.String scrollViewId, int scrollViewIndex)
text
- text of view used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGindex
- the index of target viewtimeout
- timeout of dumpxOffset
- Offset.x of target view's center pointyOffset
- Offset.y of target view's center pointscrollViewId
- if want to click a item of {ListView, GridView, ScrollView},
get the id of {ListView, GridView, ScrollView}scrollViewIndex
- the index of target {ListView, GridView, ScrollView}
public boolean longClickViewById(java.lang.String id, int time)
id
- id of view used to searchtime
- if time > 0, click will change to long click
public boolean longClickViewById(java.lang.String id, int index, int time)
id
- id of view used to searchindex
- the index of target viewtime
- if time > 0, click will change to long click
public boolean longClickViewById(java.lang.String id, int index, int timeout, int time)
id
- id of view used to searchindex
- the index of target viewtimeout
- timeout of dumptime
- if time > 0, click will change to long click
public boolean longClickViewById(java.lang.String id, int index, int timeout, int xOffset, int yOffset, int time)
id
- id of view used to searchindex
- the index of target viewtimeout
- timeout of dumpxOffset
- Offset.x of target view's center pointyOffset
- Offset.y of target view's center pointtime
- if time > 0, click will change to long click
public boolean longClickViewByText(java.lang.String text, int time)
text
- text of view used to searchtime
- if time > 0, click will change to long click
public boolean longClickViewByText(java.lang.String text, int searchMode, int time)
text
- text of view used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGtime
- if time > 0, click will change to long click
public boolean longClickViewByText(java.lang.String text, int searchMode, int index, int time)
text
- text of view used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGindex
- the index of target viewtime
- if time > 0, click will change to long click
public boolean longClickViewByText(java.lang.String text, int searchMode, int index, int timeout, int time)
text
- text of view used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGindex
- the index of target viewtimeout
- timeout of dumptime
- if time > 0, click will change to long click
public boolean longClickViewByText(java.lang.String text, int searchMode, int index, int timeout, int xOffset, int yOffset, int time)
text
- text of view used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGindex
- the index of target viewtimeout
- timeout of dumpxOffset
- Offset.x of target view's center pointyOffset
- Offset.y of target view's center pointtime
- if time > 0, click will change to long click
public boolean clickView(java.lang.String searchKey, java.lang.String searchValue, int searchMode, int index, int timeout, int xOffset, int yOffset, int longClickTime, java.lang.String scrollViewId, int scrollViewIndex)
searchKey
- name of view 's property used to searchsearchValue
- value of view 's property used to searchsearchMode
- the mode of search such as
LocalLib.SEARCHMODE_COMPLETE_MATCHING and
LocalLib.SEARCHMODE_INCLUDE_MATCHINGindex
- the index of target viewtimeout
- timeout of dumpxOffset
- Offset.x of target view's center pointyOffset
- Offset.y of target view's center pointlongClickTime
- if longClickTime > 0, click will change to long clickscrollViewId
- if want to click a item of {ListView, GridView, ScrollView},
get the id of {ListView, GridView, ScrollView}scrollViewIndex
- the index of target {ListView, GridView, ScrollView}
public void dragQuarterScreenDown(int stepCount)
stepCount
- How many move steps to include in the dragpublic void dragQuarterScreenUp(int stepCount)
stepCount
- How many move steps to include in the dragpublic void dragQuarterScreenRight(int stepCount)
stepCount
- How many move steps to include in the dragpublic void dragQuarterScreenLeft(int stepCount)
stepCount
- How many move steps to include in the dragpublic void dragHalfScreenDown(int stepCount)
stepCount
- How many move steps to include in the dragpublic void dragHalfScreenUp(int stepCount)
stepCount
- How many move steps to include in the dragpublic void dragHalfScreenRight(int stepCount)
stepCount
- How many move steps to include in the dragpublic void dragHalfScreenLeft(int stepCount)
stepCount
- How many move steps to include in the dragpublic void drag(float fromX, float toX, float fromY, float toY, int stepCount)
public void waitForAllDumpCompleted()
public void sleep(int time)
time
- sleep timepublic void sleepMini()
public void setScreenOn()
@Deprecated public void sendKeyEvent(int keycode)
keycode
- public boolean waitforTopActivity(java.lang.String className, long timeout)
className
- ex. "com.baidu.baiduclock.BaiduClock"timeout
- delay. in terms of milliseconds
public void factoryResetWithEraseSD()
public void formatSD()
public void setScreenStayAwake(boolean isAwake)
true:
- stay awakepublic void setScreenTimeOut(int milisecond)
milisecond
- : 15000/30000/60000/120000/600000/1800000 can be usedpublic void setScreenUnlockSecurityNone()
public void changeLanguage(java.lang.String language)
language
- : zh---Chinese en---Englishpublic void installApk(java.lang.String filename)
filename
- : the apk name you want to install. for example:
"/data/data/baidumap.apk"public void uninstallApk(java.lang.String packageName)
packageName
- : packagename you want to uninstall,public boolean isPackageInstalled(java.lang.String packageName)
packageName
- : packagename you want to detect
public boolean installApkSync(java.lang.String filename, long timeout)
filename
- : apk location you want to install ,"/sdcard/baidu.apk"timeout
- : the max time you can suffer
public java.lang.String getSystemProperties(java.lang.String key)
key
- e.g. ro.baidu.build.software
public void setSystemProperties(java.lang.String key, java.lang.String val)
key
- e.g. ro.baidu.build.softwareval
- e.g. cafepublic boolean getInputMethodStatus()
public java.lang.String[] getViewProperties(java.lang.String searchKey, java.lang.String searchValue, int searchMode, int targetNumber, java.lang.String[] getKeys, boolean getNew)
searchKey
- property's name use to searchsearchValue
- property's value use to searchsearchMode
- LocalLib.SEARCHMODE_COMPLETE_MATCHING
LocalLib.SEARCHMODE_INCLUDE_MATCHINGtargetNumber
- target index in search result. Beacuse a pair of searchKey and
searchValue can return not only one search result.getKeys
- property's name use to getgetNew
- True means start a new dump. If UI has changed, use true.
False means get propery from last dump. If UI has not changed,
use false.
public java.lang.String getFocusedWindow()
public boolean checkProcessAlive(java.lang.String processName)
public int getNonMarketAppsAllowed()
android.os.RemoteException
public void setNonMarketAppsAllowed(boolean enabled)
true
- enable false disable
android.os.RemoteException
public boolean isBluetoothEnabled()
public void setBluetoothState(boolean enabled)
true
- enabled false disabledpublic void killBackgroundProcesses(java.lang.String packageName)
packageName
- public java.lang.String[] getWindowList()
public boolean clearApplicationUserData(java.lang.String packageName)
packageName
- application's packageNamepublic void updatePackagePermission(java.lang.String packageName, java.lang.String permissionName, int state)
packageName
- target package namepermissionName
- permission namestate
- ALWAYS_ASK_DISABLE = 0; ALWAYS_DISENABLE = 1;
ALWAYS_ASK_ENABLE = 2; ALWAYS_ENABLE = 3;public java.lang.String[] getPermissionsForPackage(java.lang.String packageName)
packageName
- target package name
public int getAutoTimeState()
public void setAutoTimeEnabled()
public void setAutoTimeDisabled()
public boolean getStatusBarIconState(int slot)
slot
- mSlot of StatusBarIconView e.g. 3G icon's name is
data_connection
public java.lang.String[] getLog()
public java.lang.String[] getLog(java.lang.String filterSpecs)
filterspecs
- string including a series of public java.lang.String[] getLog(java.lang.String[] command)
command
- sample here: new String[]{"logcat", "-d", "-v", "time", "-s",
"MyTest:I"}
public void clearLog()
public java.lang.String[] diffLog(java.lang.String[] logStart, java.lang.String[] logEnd)
logStart
- , log in start timelogEnd
- , log in end time
public void screenCap(java.lang.String prefix)
public int[] getViewCenterPointById(java.lang.String id)
id
-
public int[] getViewCenterPointByText(java.lang.String text)
text
-
public int getScreenBrightnessMode()
public void setScreenBrightnessMode(int mode)
mode
- Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC |
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUALpublic void setLocationProviderEnabled(int provider, boolean enabled)
provider
- LocationManager.GPS_PROVIDER |
LocationManager.NETWORK_PROVIDERenabled
- true | falsepublic boolean isLocationProviderEnabled(int provider)
provider
- LocationManager.GPS_PROVIDER |
LocationManager.NETWORK_PROVIDER
public boolean isAccelerometerRotationEnabled()
public void setAccelerometerRotationEnabled(boolean enabled)
public boolean getBackgroundDataState()
public void setBackgroundDataSetting(boolean enabled)
public boolean getMasterSyncAutomatically()
public void setMasterSyncAutomatically(boolean sync)
public void deleteAccount(java.lang.String name, java.lang.String type)
name
- account name e.g. BIT_Erictype
- account type e.g. com.baidupublic void recovery()
public int getCurrentTaskActivitiesNumber()
public void setStatusBarHeight(int height)
public boolean isViewServerOpen()
public boolean isHome()
public boolean isNetworkEnable()
public java.lang.String getTopPackage()
public void copyAssets(java.lang.String dist)
public void expandStatusBar()
public java.lang.String getStringByName(java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |