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( packageFiles, boolean reinstall, String... extraArgs)

String installPackages( packageFiles, boolean reinstall, boolean grantPermissions, String... extraArgs)

String installPackagesForUser( packageFiles, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)

String installPackagesForUser( packageFiles, boolean reinstall, int userId, String... extraArgs)

String installRemotePackages( remoteApkPaths, boolean reinstall, boolean grantPermissions, String... extraArgs)

String installRemotePackages( remoteApkPaths, boolean reinstall, String... extraArgs)

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 reboot करें.

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

public  getActiveApexes ()

रिटर्न

थ्रो
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

पैरामीटर
namespace String

रिटर्न

थ्रो
DeviceNotAvailableException

getAndroidId

public String getAndroidId (int userId)

पैरामीटर
userId int

रिटर्न
String

थ्रो
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

रिटर्न

थ्रो
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

पैरामीटर
packageName String

रिटर्न
PackageInfo

थ्रो
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

रिटर्न

थ्रो
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

रिटर्न
DeviceFoldableState

थ्रो
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

रिटर्न
int

थ्रो
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

रिटर्न

थ्रो
DeviceNotAvailableException

getInstalledPackageNames

public  getInstalledPackageNames ()

रिटर्न

थ्रो
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

रिटर्न
KeyguardControllerState

थ्रो
DeviceNotAvailableException

getMainlineModuleInfo

public  getMainlineModuleInfo ()

रिटर्न

थ्रो
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

public  getUninstallablePackageNames ()

रिटर्न

थ्रो
DeviceNotAvailableException

getUserFlags

public int getUserFlags (int userId)

पैरामीटर
userId int

रिटर्न
int

थ्रो
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

रिटर्न

थ्रो
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

public  listDisplayIds ()

रिटर्न

थ्रो
DeviceNotAvailableException

listUsers

public  listUsers ()

रिटर्न

थ्रो
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 reboot करें.

पैरामीटर
rebootMode NativeDevice.RebootMode: रीबूट का मोड.

reason String: इस रीबूट के लिए.

थ्रो
DeviceNotAvailableException

getCheckNewUserSleep

protected long getCheckNewUserSleep ()

टेस्टिंग के लिए एक्सपोज़ किया गया.

रिटर्न
long

getHostCurrentTime

protected long getHostCurrentTime ()

टेस्टिंग के लिए एक्सपोज़्ड

रिटर्न
long

prePostBootSetup

protected void prePostBootSetup ()

इससे हर डिवाइस टाइप (AndroidNativeDevice, TestDevice) को, बूट के बाद किए जाने वाले किसी खास सेटअप के लिए, इस तरीके को बदलने की अनुमति मिलती है.

थ्रो
DeviceNotAvailableException