TestDevice
public
class
TestDevice
extends NativeDevice
java.lang.Object | ||
↳ | com.android.tradefed.device.NativeDevice | |
↳ | com.android.tradefed.device.TestDevice |
フルスタック Android デバイス用の ITestDevice
の実装
概要
フィールド | |
---|---|
public
static
final
String |
DISMISS_KEYGUARD_CMD
キーガードを閉じるために使用できるコマンド。 |
パブリック コンストラクタ | |
---|---|
TestDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
|
パブリック メソッド | |
---|---|
boolean
|
clearErrorDialogs()
|
int
|
createUser(String name)
|
int
|
createUser(String name, boolean guest, boolean ephemeral)
|
int
|
createUserNoThrow(String name)
|
void
|
disableKeyguard()
|
boolean
|
doesFileExist(String deviceFilePath)
|
File
|
dumpHeap(String process, String devicePath)
|
|
getActiveApexes()
|
|
getAllSettings(String namespace)
|
String
|
getAndroidId(int userId)
|
|
getAndroidIds()
|
PackageInfo
|
getAppPackageInfo(String packageName)
|
|
getAppPackageInfos()
|
DeviceFoldableState
|
getCurrentFoldableState()
|
int
|
getCurrentUser()
|
|
getFoldableStates()
|
|
getInstalledPackageNames()
|
KeyguardControllerState
|
getKeyguardState()
|
|
getMainlineModuleInfo()
|
int
|
getMaxNumberOfRunningUsersSupported()
|
int
|
getMaxNumberOfUsersSupported()
|
Integer
|
getPrimaryUserId()
|
InputStreamSource
|
getScreenshot()
|
InputStreamSource
|
getScreenshot(String format, boolean rescale)
|
InputStreamSource
|
getScreenshot(String format)
|
InputStreamSource
|
getScreenshot(long displayId)
|
String
|
getSetting(String namespace, String key)
|
String
|
getSetting(int userId, String namespace, String key)
|
|
getUninstallablePackageNames()
|
int
|
getUserFlags(int userId)
|
|
getUserInfos()
|
int
|
getUserSerialNumber(int userId)
|
boolean
|
hasFeature(String feature)
|
String
|
installPackage(File packageFile, boolean reinstall, String... extraArgs)
|
String
|
installPackage(File packageFile, File certFile, boolean reinstall, String... extraArgs)
|
String
|
installPackage(File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
|
String
|
installPackageForUser(File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
|
String
|
installPackageForUser(File packageFile, boolean reinstall, int userId, String... extraArgs)
|
String
|
installPackages(
|
String
|
installPackages(
|
String
|
installPackagesForUser(
|
String
|
installPackagesForUser(
|
String
|
installRemotePackages(
|
String
|
installRemotePackages(
|
boolean
|
isAppEnumerationSupported()
|
boolean
|
isMultiUserSupported()
|
boolean
|
isPackageInstalled(String packageName)
|
boolean
|
isPackageInstalled(String packageName, String userId)
|
boolean
|
isUserRunning(int userId)
|
boolean
|
isUserSecondary(int userId)
|
|
listDisplayIds()
|
|
listUsers()
|
void
|
postInvocationTearDown(Throwable exception)
|
boolean
|
removeAdmin(String componentName, int userId)
|
void
|
removeOwners()
|
boolean
|
removeUser(int userId)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setSetting(String namespace, String key, String value)
|
void
|
setSetting(int userId, String namespace, String key, String value)
|
boolean
|
startUser(int userId)
|
boolean
|
startUser(int userId, boolean waitFlag)
|
boolean
|
stopUser(int userId, boolean waitFlag, boolean forceFlag)
|
boolean
|
stopUser(int userId)
|
boolean
|
switchUser(int userId)
|
boolean
|
switchUser(int userId, long timeout)
|
String
|
uninstallPackage(String packageName)
|
String
|
uninstallPackageForUser(String packageName, int userId)
|
保護されたメソッド | |
---|---|
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
adb で再起動します。 |
long
|
getCheckNewUserSleep()
テスト用に公開されています。 |
long
|
getHostCurrentTime()
テスト用に公開 |
void
|
prePostBootSetup()
各デバイスタイプ(AndroidNativeDevice、TestDevice)が、起動後の特定の設定のためにこのメソッドをオーバーライドできるようにします。 |
フィールド
DISMISS_KEYGUARD_CMD
public static final String DISMISS_KEYGUARD_CMD
キーガードを閉じるために使用できるコマンド。
パブリック コンストラクタ
TestDevice
public TestDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
パブリック メソッド
clearErrorDialogs
public boolean clearErrorDialogs ()
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name)
パラメータ | |
---|---|
name |
String |
戻り値 | |
---|---|
int |
例外 | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name, boolean guest, boolean ephemeral)
パラメータ | |
---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
戻り値 | |
---|---|
int |
例外 | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
パラメータ | |
---|---|
name |
String |
戻り値 | |
---|---|
int |
例外 | |
---|---|
DeviceNotAvailableException |
disableKeyguard
public void disableKeyguard ()
例外 | |
---|---|
DeviceNotAvailableException |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
パラメータ | |
---|---|
deviceFilePath |
String |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
dumpHeap
public File dumpHeap (String process, String devicePath)
パラメータ | |
---|---|
process |
String |
devicePath |
String |
戻り値 | |
---|---|
File |
例外 | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
パラメータ | |
---|---|
namespace |
String |
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
getAndroidId
public String getAndroidId (int userId)
パラメータ | |
---|---|
userId |
int |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
getAndroidIds
publicgetAndroidIds ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
パラメータ | |
---|---|
packageName |
String |
戻り値 | |
---|---|
PackageInfo |
例外 | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
戻り値 | |
---|---|
DeviceFoldableState |
例外 | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
戻り値 | |
---|---|
int |
例外 | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
getInstalledPackageNames
publicgetInstalledPackageNames ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
戻り値 | |
---|---|
KeyguardControllerState |
例外 | |
---|---|
DeviceNotAvailableException |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
戻り値 | |
---|---|
int |
例外 | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
戻り値 | |
---|---|
int |
例外 | |
---|---|
DeviceNotAvailableException |
getPrimaryUserId
public Integer getPrimaryUserId ()
戻り値 | |
---|---|
Integer |
例外 | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot ()
戻り値 | |
---|---|
InputStreamSource |
例外 | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
パラメータ | |
---|---|
format |
String |
rescale |
boolean |
戻り値 | |
---|---|
InputStreamSource |
例外 | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format)
パラメータ | |
---|---|
format |
String |
戻り値 | |
---|---|
InputStreamSource |
例外 | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
パラメータ | |
---|---|
displayId |
long |
戻り値 | |
---|---|
InputStreamSource |
例外 | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
パラメータ | |
---|---|
namespace |
String |
key |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (int userId, String namespace, String key)
パラメータ | |
---|---|
userId |
int |
namespace |
String |
key |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
getUserFlags
public int getUserFlags (int userId)
パラメータ | |
---|---|
userId |
int |
戻り値 | |
---|---|
int |
例外 | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
パラメータ | |
---|---|
userId |
int |
戻り値 | |
---|---|
int |
例外 | |
---|---|
DeviceNotAvailableException |
hasFeature
public boolean hasFeature (String feature)
パラメータ | |
---|---|
feature |
String |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
パラメータ | |
---|---|
packageFile |
File |
reinstall |
boolean |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, File certFile, boolean reinstall, String... extraArgs)
パラメータ | |
---|---|
packageFile |
File |
certFile |
File |
reinstall |
boolean |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
パラメータ | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
パラメータ | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
userId |
int |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
パラメータ | |
---|---|
packageFile |
File |
reinstall |
boolean |
userId |
int |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installPackages
public String installPackages (packageFiles, boolean reinstall, String... extraArgs)
パラメータ | |
---|---|
packageFiles |
|
reinstall |
boolean |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installPackages
public String installPackages (packageFiles, boolean reinstall, boolean grantPermissions, String... extraArgs)
パラメータ | |
---|---|
packageFiles |
|
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installPackagesForUser
public String installPackagesForUser (packageFiles, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
パラメータ | |
---|---|
packageFiles |
|
reinstall |
boolean |
grantPermissions |
boolean |
userId |
int |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installPackagesForUser
public String installPackagesForUser (packageFiles, boolean reinstall, int userId, String... extraArgs)
パラメータ | |
---|---|
packageFiles |
|
reinstall |
boolean |
userId |
int |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installRemotePackages
public String installRemotePackages (remoteApkPaths, boolean reinstall, boolean grantPermissions, String... extraArgs)
パラメータ | |
---|---|
remoteApkPaths |
|
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
installRemotePackages
public String installRemotePackages (remoteApkPaths, boolean reinstall, String... extraArgs)
パラメータ | |
---|---|
remoteApkPaths |
|
reinstall |
boolean |
extraArgs |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
パラメータ | |
---|---|
packageName |
String |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName, String userId)
パラメータ | |
---|---|
packageName |
String |
userId |
String |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
isUserRunning
public boolean isUserRunning (int userId)
パラメータ | |
---|---|
userId |
int |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
パラメータ | |
---|---|
userId |
int |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
listDisplayIds
publiclistDisplayIds ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
listUsers
publiclistUsers ()
戻り値 | |
---|---|
|
例外 | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
パラメータ | |
---|---|
exception |
Throwable |
removeAdmin
public boolean removeAdmin (String componentName, int userId)
パラメータ | |
---|---|
componentName |
String |
userId |
int |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
removeOwners
public void removeOwners ()
例外 | |
---|---|
DeviceNotAvailableException |
removeUser
public boolean removeUser (int userId)
パラメータ | |
---|---|
userId |
int |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
パラメータ | |
---|---|
componentName |
String |
userId |
int |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
setSetting
public void setSetting (String namespace, String key, String value)
パラメータ | |
---|---|
namespace |
String |
key |
String |
value |
String |
例外 | |
---|---|
DeviceNotAvailableException |
setSetting
public void setSetting (int userId, String namespace, String key, String value)
パラメータ | |
---|---|
userId |
int |
namespace |
String |
key |
String |
value |
String |
例外 | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId)
パラメータ | |
---|---|
userId |
int |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId, boolean waitFlag)
パラメータ | |
---|---|
userId |
int |
waitFlag |
boolean |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
パラメータ | |
---|---|
userId |
int |
waitFlag |
boolean |
forceFlag |
boolean |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId)
パラメータ | |
---|---|
userId |
int |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId)
パラメータ | |
---|---|
userId |
int |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId, long timeout)
パラメータ | |
---|---|
userId |
int |
timeout |
long |
戻り値 | |
---|---|
boolean |
例外 | |
---|---|
DeviceNotAvailableException |
uninstallPackage
public String uninstallPackage (String packageName)
パラメータ | |
---|---|
packageName |
String |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
パラメータ | |
---|---|
packageName |
String |
userId |
int |
戻り値 | |
---|---|
String |
例外 | |
---|---|
DeviceNotAvailableException |
保護されたメソッド
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
adb で再起動します。
パラメータ | |
---|---|
rebootMode |
NativeDevice.RebootMode : この再起動のモード。 |
reason |
String : この再起動用。 |
例外 | |
---|---|
DeviceNotAvailableException |
getCheckNewUserSleep
protected long getCheckNewUserSleep ()
テスト用に公開されています。
戻り値 | |
---|---|
long |
getHostCurrentTime
protected long getHostCurrentTime ()
テスト用に公開
戻り値 | |
---|---|
long |
prePostBootSetup
protected void prePostBootSetup ()
各デバイスタイプ(AndroidNativeDevice、TestDevice)が、起動後の特定の設定のためにこのメソッドをオーバーライドできるようにします。
例外 | |
---|---|
DeviceNotAvailableException |