NativeDevice

public class NativeDevice
extends Object implements IManagedTestDevice , IConfigurationReceiver , ITestLoggerReceiver

java.lang.Object
com.android.tradefed.device.NativeDevice


יישום ברירת מחדל של ITestDevice מכשירי אנדרואיד שאינם מחסנית מלאה.

סיכום

כיתות מקוננות

class NativeDevice.AdbAction

ERROR(DeviceAction/com.android.tradefed.device.NativeDevice.DeviceAction DeviceAction) להפעלת פקודת 'adb ....' של מערכת ההפעלה.

class NativeDevice.AdbShellAction

class NativeDevice.RebootDeviceAction

ERROR(DeviceAction/com.android.tradefed.device.NativeDevice.DeviceAction DeviceAction) לאתחול מכשיר.

קבועים

int INVALID_USER_ID

ערך שהוחזר עבור כל מזהה משתמש לא חוקי/לא נמצא: UserHandle הגדיר את הערך -10000

long MAX_HOST_DEVICE_TIME_OFFSET

int MAX_RETRY_ATTEMPTS

מספר ברירת המחדל של ניסיונות ניסיון חוזר של פקודה לבצע

שדות

public static final String DEBUGFS_PATH

protected static final String SD_CARD

protected static final String STORAGE_EMULATED

protected TestDeviceOptions mOptions

protected final IDeviceStateMonitor mStateMonitor

בנאים ציבוריים

NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

יוצר TestDevice .

שיטות ציבוריות

void batchPrefetchStartupBuildProps ()

מיקרו אופטימיזציה (בערך 400 מיליס) על ידי שליפת כל האביזרים הדרושים לנו במקום לקרוא 'adb getprop' עבור כל אחד מהם.

boolean canSwitchToHeadlessSystemUser ()

מחזירה אם מותר לעבור למשתמש SYSTEM ללא ראש.

boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

בדוק אם תכונה נתמכת כרגע או לא בהינתן רמה נתמכת מינימלית.

boolean checkConnectivity ()

בדוק שלמכשיר יש קישוריות רשת.

boolean clearErrorDialogs ()

נסה לבטל את כל תיבת הדו-שיח של שגיאה המוצגת כעת בממשק המשתמש של המכשיר.

void clearLastConnectedWifiNetwork ()

מנקה את רשת ה-WiFi המחוברת האחרונה.

void clearLogcat ()

מוחק כל נתוני logcat שנצברו.

boolean connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid) connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid)

מתחבר לרשת wifi.

boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)

מתחבר לרשת wifi.

boolean connectToWifiNetwork ( wifiSsidToPsk) connectToWifiNetwork ( wifiSsidToPsk)

מתחבר לרשת wifi.f

boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)

מתחבר לרשת wifi.

boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)

גרסה של connectToWifiNetwork(String, String) שמתחברת רק אם למכשיר אין כרגע קישוריות רשת.

boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)

גרסה של connectToWifiNetwork(String, String) שמתחברת רק אם למכשיר אין כרגע קישוריות רשת.

int createUser (String name, boolean guest, boolean ephemeral)

צור משתמש עם שם נתון והדגלים שסופקו

int createUser (String name, boolean guest, boolean ephemeral, boolean forTesting)

צור משתמש עם שם נתון והדגלים שסופקו

int createUser (String name)

צור משתמש עם שם נתון ודגלי ברירת מחדל 0.

int createUserNoThrow (String name)

צור משתמש עם שם נתון ודגלי ברירת מחדל 0.

void deleteFile (String deviceFilePath)

שיטת עוזר למחיקת קובץ או ספרייה במכשיר.

void deregisterDeviceActionReceiver ( IDeviceActionReceiver deviceActionReceiver)

מסיר את IDeviceActionReceiver הרשום.

boolean deviceSoftRestarted ( ProcessInfo prevSystemServerProcess)

שיטת עוזר לבדוק אם ההתקן הופעל מחדש על ידי השוואת system_server הנוכחי עם system_server הקודם ProcessInfo .

boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)

שיטת עוזר לבדוק אם המכשיר הופעל מחדש מאז זמן UTC מאז התקופה מהמכשיר וה- ERROR(/TimeUnit) שלו.

boolean disableAdbRoot ()

מכבה את ה-adb root.

void disableKeyguard ()

ניסיונות להשבית את מגן המקשים.

boolean disableNetworkMonitor ()

משבית את ניטור הרשת במכשיר.

boolean disconnectFromWifi ()

מתנתק מרשת wifi.

boolean doesFileExist (String deviceFilePath, int userId)

שיטת עוזר לקבוע אם קיים קובץ במכשיר עבור משתמש נתון.

boolean doesFileExist (String deviceFilePath)

שיטת עוזר לקבוע אם קיים קובץ במכשיר.

File dumpHeap (String process, String devicePath)

נסה לזרוק את הערימה מה-system_server.

boolean enableAdbRoot ()

מפעיל את השורש של adb.

boolean enableNetworkMonitor ()

מאפשר ניטור רשת במכשיר.

String executeAdbCommand (long timeout, String... cmdArgs)

שיטת עוזר המבצעת פקודת adb כפקודת מערכת עם פסק זמן מוגדר.

String executeAdbCommand (long timeout, envMap, String... cmdArgs) executeAdbCommand (long timeout, envMap, String... cmdArgs)

שיטת עוזר המבצעת פקודת adb כפקודת מערכת עם פסק זמן מוגדר.

String executeAdbCommand (String... cmdArgs)

שיטת עוזר המבצעת פקודת adb כפקודת מערכת.

CommandResult executeFastbootCommand (String... cmdArgs)

שיטת עוזר המבצעת פקודת fastboot כפקודת מערכת עם פסק זמן ברירת מחדל של 2 דקות.

CommandResult executeFastbootCommand (long timeout, String... cmdArgs)

שיטת עוזר המבצעת פקודת fastboot בתור פקודת מערכת.

CommandResult executeLongFastbootCommand (String... cmdArgs)

שיטת עוזר המבצעת פקודת fastboot שפועלת לאורך זמן בתור פקודת מערכת.

CommandResult executeLongFastbootCommand ( envVarMap, String... cmdArgs) executeLongFastbootCommand ( envVarMap, String... cmdArgs)

שיטת עוזר המבצעת פקודת fastboot ארוכת שנים כפקודה מערכת עם משתני סביבת מערכת.

String executeShellCommand (String command)

שיטת Helper שמבצעת פקודת adb shell ומחזירה String כמחרוזת.

void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

מבצע פקודת מעטפת adb, עם פרמטרים נוספים לשליטה בהתנהגות הפקודה.

void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

מבצע פקודת מעטפת adb, עם פרמטרים נוספים לשליטה בהתנהגות הפקודה.

void executeShellCommand (String command, IShellOutputReceiver receiver)

מבצע את פקודת ה-adb shell הנתונה, מנסה שוב מספר פעמים אם הפקודה נכשלת.

CommandResult executeShellV2Command (String cmd)

שיטת Helper אשר מבצעת פקודת adb shell ומחזירה את התוצאות כ- CommandResult המאוכלסת כהלכה בפלט סטטוס הפקודה, stdout ו-stderr.

CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)

שיטת Helper המבצעת פקודת adb shell ומחזירה את התוצאות כ- CommandResult המאוכלסת כהלכה בפלט סטטוס הפקודה וב-stderr.

CommandResult executeShellV2Command (String cmd, File pipeAsInput)

שיטת Helper אשר מבצעת פקודת adb shell ומחזירה את התוצאות כ- CommandResult המאוכלסת כהלכה בפלט סטטוס הפקודה, stdout ו-stderr.

CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

מבצע פקודת מעטפת adb, עם פרמטרים נוספים לשליטה בהתנהגות הפקודה.

CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)

מבצע פקודת מעטפת adb, עם פרמטרים נוספים לשליטה בהתנהגות הפקודה.

CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

מבצע פקודת מעטפת adb, עם פרמטרים נוספים לשליטה בהתנהגות הפקודה.

CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

מבצע פקודת מעטפת adb, עם פרמטרים נוספים לשליטה בהתנהגות הפקודה.

CommandResult fastbootWipePartition (String partition)

שיטת עוזר המנגבת מחיצה למכשיר.

getActiveApexes ()

אחזר את המידע על APEXs שהופעלו במכשיר.

getAllSettings (String namespace)

החזר צמדי ערכי מפתח של מרחב השמות המבוקש.

DeviceAllocationState getAllocationState ()

החזר את מצב ההקצאה הנוכחי של המכשיר

String getAndroidId (int userId)

מצא והחזר את ה-Android-ID המשויך ל-userId, null אם לא נמצא.

getAndroidIds ()

צור מפה של מזהי אנדרואיד שנמצאו תואמים מזהי משתמש.

int getApiLevel ()

קבל את רמת ה-API של המכשיר.

PackageInfo getAppPackageInfo (String packageName)

אחזר מידע על חבילה המותקנת במכשיר.

getAppPackageInfos ()

אחזר מידע של חבילות המותקנות במכשיר.

String getBasebandVersion ()

שיטת נוחות לקבל את גרסת פס הבסיס (רדיו) של מכשיר זה.

Integer getBattery ()

מחזירה את רמת הסוללה הנוכחית של מכשיר או Null אם רמת הסוללה אינה זמינה.

boolean getBooleanProperty (String name, boolean defaultValue)

מחזירה ערך בוליאני של המאפיין הנתון.

getBootHistory ()

שיטת העזר אוספת את מפת היסטוריית האתחול עם זמן האתחול וסיבת האתחול.

getBootHistorySince (long utcEpochTime, TimeUnit timeUnit)

שיטת העזר אוספת את מפת היסטוריית האתחול עם זמן האתחול וסיבת האתחול מאז הזמן הנתון מאז התקופה מהמכשיר ויחידת הזמן שצוינה.

String getBootloaderVersion ()

שיטת נוחות לקבל את גרסת טוען האתחול של מכשיר זה.

InputStreamSource getBugreport ()

מאחזר דוח באג מהמכשיר.

InputStreamSource getBugreportz ()

מאחזר דיווח באג מהמכשיר.

String getBuildAlias ()

אחזר את הכינוי של ה-build שהמכשיר פועל כעת.

String getBuildFlavor ()

אחזר את טעם המבנה של המכשיר.

String getBuildId ()

אחזר את ה-build שהמכשיר פועל כעת.

String getBuildSigningKeys ()

מחזירה את סוג המפתח המשמש לחתימה על תמונת המכשיר

בדרך כלל מכשירי אנדרואיד עשויים להיות חתומים עם מפתחות בדיקה (כמו ב-AOSP) או מפתחות שחרור (נשלטים על ידי יצרני מכשירים בודדים)

DeviceDescriptor getCachedDeviceDescriptor ()

מחזיר DeviceDescriptor שמור אם ההתקן מוקצה, אחרת מחזיר את DeviceDescriptor הנוכחי.

DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)

מחזיר DeviceDescriptor שמור אם ההתקן מוקצה, אחרת מחזיר את DeviceDescriptor הנוכחי.

String[] getChildren (String path)

חלופה לשימוש IFileEntry שלפעמים לא עובד בגלל הרשאות.

AbstractConnection getConnection ()

החיבור הנוכחי המשויך למכשיר.

DeviceFoldableState getCurrentFoldableState ()

מחזיר את המצב המתקפל הנוכחי של המכשיר או null אם התרחשו בעיות מסוימות.

int getCurrentUser ()

החזר את המזהה של המשתמש הנוכחי הפועל.

String getDeviceClass ()

קבל את שיעור המכשיר.

long getDeviceDate ()

החזר את תאריך המכשיר באלפי שניות מאז התקופה.

DeviceDescriptor getDeviceDescriptor ()

החזר DeviceDescriptor ממידע המכשיר כדי לקבל מידע עליו מבלי להעביר את אובייקט המכשיר בפועל.

DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

החזר DeviceDescriptor ממידע המכשיר כדי לקבל מידע עליו מבלי להעביר את אובייקט המכשיר בפועל.

TestDeviceState getDeviceState ()

קבל את מצב המכשיר.

long getDeviceTimeOffset (Date date)

עוזר לקבל את הפרש הזמן בין המכשיר לבין ERROR(/Date) .

InputStreamSource getEmulatorOutput ()

קבל את הזרם של emulator stdout ו-stderr

Process getEmulatorProcess ()

החזר את Process המתאים לאמולטור זה.

final File getExecuteShellCommandLog ()

היומן המכיל את כל יומני executeShellCommand(String) .

long getExternalStoreFreeSpace ()

שיטת עוזר לקביעת כמות השטח הפנוי באחסון החיצוני של המכשיר.

String getFastbootPath ()

מחזירה את הנתיב של ה-fastboot הבינארי שבו נעשה שימוש.

String getFastbootProductType ()

שיטת נוחות לקבל את סוג המוצר של מכשיר זה כשהוא במצב אתחול מהיר.

String getFastbootProductVariant ()

שיטת נוחות לקבל את סוג המוצר של מכשיר זה כשהוא במצב אתחול מהיר.

String getFastbootSerialNumber ()

מחזיר את המספר הסידורי של מצב האתחול המהיר.

String getFastbootVariable (String variableName)

אחזר את ערך משתנה fastboot הנתון מהמכשיר.

String getFastbootVersion ()

מחזירה את מחרוזת הגרסה של ה-fastboot הבינארי שבו נעשה שימוש.

IFileEntry getFileEntry (String path)

אחזר הפניה לקובץ מרוחק במכשיר.

IFileEntry getFileEntry (FileListingService.FileEntry entry)

עוזר לא רשמי לקבל FileEntry מנתיב שאינו שורש.

getFoldableStates ()

מחזירה את רשימת המצבים הניתנים לקיפול במכשיר.

IDevice getIDevice ()

מחזירה הפניה ל-ddmlib IDevice המשויך.

getInstalledPackageNames ()

אחזר את שמות חבילות היישומים הקיימים במכשיר.

long getIntProperty (String name, long defaultValue)

מחזירה ערך מספר שלם של המאפיין הנתון מהמכשיר.

String getIpAddress ()

מקבל את כתובת ה-IP של המכשיר.

KeyguardControllerState getKeyguardState ()

החזר אובייקט כדי לקבל את המצב הנוכחי של מגן המקשים או null אם לא נתמך.

long getLastExpectedRebootTimeMillis ()

מחזירה את הפעם האחרונה שבה ממשקי API של Tradefed הפעילו אתחול מחדש באלפיות שניות מאז EPOCH כפי שהוחזר על ידי System.currentTimeMillis() .

int getLaunchApiLevel ()

קבל את רמת ה-API הראשונה שהושקה במכשיר.

InputStreamSource getLogcat ()

תופס זרם תמונת מצב של נתוני logcat.

InputStreamSource getLogcat (int maxBytes)

תופס זרם תמונת מצב של maxBytes האחרון של נתוני logcat שנלכדו.

InputStreamSource getLogcatDump ()

קבל dump של ה-logcat הנוכחי עבור המכשיר.

InputStreamSource getLogcatSince (long date)

תופס זרם תמונת מצב של נתוני logcat שנלכדו החל מהתאריך שסופק.

String getMacAddress ()

מחזירה את כתובת ה-MAC של המכשיר, null אם היא לא מצליחה לבצע שאילתה מהמכשיר.

Integer getMainUserId ()

מחזירה את מזהה המשתמש הראשי.

getMainlineModuleInfo ()

קבל את המידע על המודולים המרכזיים המותקנים במכשיר.

int getMaxNumberOfRunningUsersSupported ()

קבל את המספר המרבי של משתמשים שפועלים בו זמנית.

int getMaxNumberOfUsersSupported ()

קבל את המספר המרבי של משתמשים נתמכים.

Process getMicrodroidProcess ()
IDeviceStateMonitor getMonitor ()

החזר את IDeviceStateMonitor המשויך למכשיר.

String getMountPoint (String mountName)

מחזירה נקודת הרכבה.

ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

מחזירה MountPointInfo המתאים לנתיב נקודת ה-mount שצוין, או null אם לנתיב זה לא נטען דבר או בדרך אחרת אינו מופיע ב-/proc/mounts כנקודת mount.

getMountPointInfo ()

מחזירה גרסה מנותחת של המידע ב-/proc/mounts במכשיר

TestDeviceOptions getOptions ()

אחזר את אפשרויות הבדיקה של המכשיר.

long getPartitionFreeSpace (String partition)

שיטת עוזר לקביעת כמות השטח הפנוי במחיצת המכשיר.

Integer getPrimaryUserId ()

מחזירה את מזהה המשתמש הראשי.

ProcessInfo getProcessByName (String processName)

שיטת Helper מפעילה את הפקודה "pidof" ו-"stat" ומחזירה אובייקט ProcessInfo עם PID ושעת תחילת התהליך של התהליך הנתון.

String getProcessPid (String process)

מחזיר את ה-pid של השירות או null אם משהו השתבש.

String getProductType ()

שיטת נוחות לקבל את סוג המוצר של מכשיר זה.

String getProductVariant ()

שיטת נוחות לקבל את גרסת המוצר של מכשיר זה.

String getProperty (String name)

אחזר את ערך המאפיין הנתון מהמכשיר.

ITestDevice.RecoveryMode getRecoveryMode ()

קבל את מצב השחזור הנוכחי המשמש עבור המכשיר.

InputStreamSource getScreenshot (String format)

תופס צילום מסך מהמכשיר.

InputStreamSource getScreenshot (long displayId)

תופס צילום מסך מהמכשיר שקיבל מזהה תצוגה.

InputStreamSource getScreenshot (String format, boolean rescale)

תופס צילום מסך מהמכשיר.

InputStreamSource getScreenshot ()

תופס צילום מסך מהמכשיר.

String getSerialNumber ()

שיטת נוחות לקבלת מספר סידורי של מכשיר זה.

String getSetting (int userId, String namespace, String key)

החזר את הערך של ההגדרה המבוקשת.

String getSetting (String namespace, String key)

ראה getSetting(int, String, String) ובוצע על משתמש מערכת.

String getSimOperator ()

החזר את מפעיל כרטיס ה-SIM או null אם אינו זמין או אם המכשיר אינו זמין.

String getSimState ()

החזר את מצב כרטיס ה-SIM או null אם אינו זמין או שהמכשיר אינו זמין.

getTombstones ()

אחזר והחזר את רשימת המצבות מהמכשירים.

long getTotalMemory ()

מחזירה את גודל הזיכרון הפיזי הכולל בבתים או -1 במקרה של שגיאה פנימית

getUninstallablePackageNames ()

אחזר את שמות חבילות האפליקציות שניתן להסיר.

boolean getUseFastbootErase ()

בדוק אם להשתמש בפורמט Fastboot Erase או Fastboot כדי למחוק מחיצה במכשיר.

int getUserFlags (int userId)

מצא והחזר את הדגלים של משתמש נתון.

getUserInfos ()

מקבל את מפת useId ל- UserInfo במכשיר.

int getUserSerialNumber (int userId)

החזר את המספר הסידורי המשויך ל-userId אם נמצא, -10000 בכל מקרה אחר.

IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

עבד את ה-DeviceEvent הנתון.

עבד את DeviceEvent, שעשוי להעביר את המכשיר הזה למצב הקצאה חדש או לא.

boolean hasFeature (String feature)

בדוק אם תכונה זמינה במכשיר.

String installPackage (File packageFile, boolean reinstall, String... extraArgs)

התקן חבילת אנדרואיד במכשיר.

String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)

התקן חבילת אנדרואיד במכשיר.

String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)

התקן חבילת אנדרואיד במכשיר עבור משתמש נתון.

String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)

התקן חבילת אנדרואיד במכשיר עבור משתמש נתון.

void invalidatePropertyCache ()
boolean isAdbRoot ()

boolean isAdbTcp ()
boolean isAppEnumerationSupported ()

בדוק אם הפלטפורמה במכשיר תומכת בספירת אפליקציות

boolean isBypassLowTargetSdkBlockSupported ()

בדוק אם הפלטפורמה במכשיר תומכת בעקיפה של חסימת יעד נמוך של SDK בהתקנות אפליקציה

boolean isDebugfsMounted ()

בדוק אם ניפוי באגים מותקן.

boolean isDeviceEncrypted ()

חוזר אם המכשיר מוצפן.

boolean isDirectory (String path)

החזר True אם הנתיב במכשיר הוא ספרייה, אחרת false.

boolean isEnableAdbRoot ()
boolean isEncryptionSupported ()

חוזר אם ההצפנה נתמכת במכשיר.

boolean isExecutable (String fullPath)

מחזירה True אם נתיב הקובץ במכשיר הוא קובץ הפעלה, אחרת false.

boolean isFastbootEnabled ()

חזור אם fastboot זמין עבור המכשיר.

boolean isHeadless ()

החזר אמת אם המכשיר חסר ראש (ללא מסך), אחרת שקר.

boolean isHeadlessSystemUserMode ()

מחזירה אם המכשיר משתמש במצב משתמש מערכת ללא ראש.

boolean isMainUserPermanentAdmin ()

מחזירה אם המשתמש הראשי הוא מנהל קבוע ולא ניתן למחוק אותו או לשדרג לאחור למצב שאינו מנהל.

boolean isMultiUserSupported ()

קובע אם ריבוי משתמשים נתמך.

boolean isPackageInstalled (String packageName, String userId)

שאל את המכשיר עבור שם חבילה נתון ומזהה משתמש נתון כדי לבדוק אם הוא מותקן כעת או לא עבור אותו משתמש.

boolean isPackageInstalled (String packageName)

שאל את המכשיר עבור שם חבילה נתון כדי לבדוק אם הוא מותקן כעת או לא.

boolean isRuntimePermissionSupported ()

בדוק אם הפלטפורמה במכשיר תומכת בהענקת הרשאות זמן ריצה

boolean isStateBootloaderOrFastbootd ()

מחזירה true אם המכשיר נמצא ב- TestDeviceState#FASTBOOT או TestDeviceState.FASTBOOTD .

boolean isUserRunning (int userId)

בדוק אם משתמש נתון פועל.

boolean isUserSecondary (int userId)

החזר אם המשתמש שצוין הוא משתמש משני לפי הדגלים שלו.

boolean isUserVisible (int userId)

בודק אם המשתמש הנתון גלוי.

boolean isUserVisibleOnDisplay (int userId, int displayId)

בודק אם המשתמש הנתון גלוי בתצוגה הנתונה.

boolean isVisibleBackgroundUsersOnDefaultDisplaySupported ()

מחזירה אם המכשיר מאפשר הפעלת משתמשים גלויים ברקע ב- ERROR(/java.android.view.Display#DEFAULT_DISPLAY) .

boolean isVisibleBackgroundUsersSupported ()

מחזירה אם המכשיר מאפשר הפעלת משתמשים גלויים ברקע.

boolean isWifiEnabled ()

בדוק אם wifi מופעל.

listDisplayIds ()

אסוף את הרשימה של מזהה תצוגות זמין במכשיר כפי שדווח על ידי "dumpsys SurfaceFlinger".

listDisplayIdsForStartingVisibleBackgroundUsers ()

מקבל את רשימת הצגים שניתן להשתמש בהם כדי start a user visible in the background .

listUsers ()

מקבל את רשימת המשתמשים במכשיר.

boolean logAnrs ( ITestLogger logger)

אוסף ורישום ANR מהמכשיר.

boolean logBugreport (String dataName, ITestLogger listener)

שיטת עוזר לקחת דוח באג ולהתחבר לכתבים.

void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)

התחבר הודעה ב-logcat של המכשיר.

void mountDebugfs ()

הר באגים.

void nonBlockingReboot ()

מוציא פקודה לאתחול מחדש של המכשיר ומחזיר כאשר הפקודה הושלמה וכאשר המכשיר אינו גלוי עוד ל-adb.

void postAdbRootAction ()

תעקוף אם המכשיר זקוק לפעולות ספציפיות שיבוצעו לאחר ה-adb root ולפני שהמכשיר חוזר למצב מקוון.

void postAdbUnrootAction ()

תעקוף אם המכשיר צריך לבצע פעולות ספציפיות לאחר ביטול השורש של adb ולפני שהמכשיר חוזר למצב מקוון.

void postBootSetup ()

בצע הוראות להגדרת ההתקן לבדיקה זאת לאחר כל אתחול.

void postInvocationTearDown (Throwable exception)

שלבים נוספים עבור ניקוי נדרש ספציפי למכשיר שיבוצעו לאחר ביצוע ההזמנה.

void preInvocationSetup ( IBuildInfo info, MultiMap <String, String> attributes)

שלבים נוספים עבור הגדרה נדרשת ספציפית למכשיר שיבוצעו במכשיר לפני זרימת הפנייה.

boolean pullDir (String deviceFilePath, File localDir)

משוך באופן רקורסיבי את תוכן הספרייה מהמכשיר.

boolean pullFile (String remoteFilePath, File localFile)

מאחזר קובץ מחוץ למכשיר.

File pullFile (String remoteFilePath, int userId)

מאחזר קובץ מחוץ להתקן, מאחסן אותו ב- ERROR(/File) ומחזיר את File הזה.

File pullFile (String remoteFilePath)

מאחזר קובץ מחוץ להתקן, מאחסן אותו ב- ERROR(/File) ומחזיר את File הזה.

boolean pullFile (String remoteFilePath, File localFile, int userId)

מאחזר קובץ מחוץ למכשיר.

String pullFileContents (String remoteFilePath)

מאחזר קובץ מחוץ למכשיר ומחזיר את התוכן.

File pullFileFromExternal (String remoteFilePath)

שיטת נוחות לאחזור קובץ מהאחסון החיצוני של המכשיר, מאחסנת אותו ב- ERROR(/File) והחזרת הפניה File זה.

boolean pushDir (File localFileDir, String deviceFilePath, excludedDirectories) pushDir (File localFileDir, String deviceFilePath, excludedDirectories)

דחוף באופן רקורסיבי את תוכן הספרייה למכשיר תוך אי הכללה של מספר ספריות שמסוננות.

boolean pushDir (File localFileDir, String deviceFilePath)

דחוף באופן רקורסיבי את תוכן הספרייה למכשיר.

boolean pushFile (File localFile, String remoteFilePath, boolean evaluateContentProviderNeeded)

וריאנט של pushFile(File, String) שיכול לשקול אופציונלי להעריך את הצורך בספק התוכן.

boolean pushFile (File localFile, String remoteFilePath)

דחוף קובץ למכשיר.

boolean pushString (String contents, String remoteFilePath)

דחיפה של קובץ שנוצר ממחרוזת למכשיר

void reboot (String reason)

מאתחל את המכשיר למצב adb עם reason נתונה להתמיד במהלך אתחול מחדש.

void reboot ()

מאתחל את המכשיר למצב adb.

void rebootIntoBootloader ()

מאתחל את המכשיר למצב טוען אתחול.

void rebootIntoFastbootd ()

מאתחל את המכשיר למצב fastbootd.

void rebootIntoRecovery ()

מאתחל את המכשיר למצב שחזור adb.

void rebootIntoSideload ()

מאתחל את המכשיר למצב adb sideload (שים לב שזהו מצב מיוחד תחת שחזור)

חוסם עד שהמכשיר נכנס למצב עומס צד

void rebootIntoSideload (boolean autoReboot)

מאתחל את המכשיר למצב adb sideload (שים לב שזהו מצב מיוחד תחת שחזור)

חוסם עד שהמכשיר נכנס למצב עומס צד

void rebootUntilOnline ()

חלופי ל- reboot() שחוסם רק עד שהמכשיר מקוון כלומר גלוי ל-adb.

void rebootUntilOnline (String reason)

חלופי ל- reboot() שחוסם רק עד שהמכשיר מקוון כלומר גלוי ל-adb.

void rebootUserspace ()

מאתחל רק חלק של מרחב המשתמש מהמכשיר.

void rebootUserspaceUntilOnline ()

חלופי ל- rebootUserspace() ()} שחוסם רק עד שהמכשיר מקוון, כלומר גלוי ל-adb.

boolean recoverDevice ()

ניסיונות לשחזר את התקשורת במכשיר.

void registerDeviceActionReceiver ( IDeviceActionReceiver deviceActionReceiver)

רושם IDeviceActionReceiver עבור מכשיר זה.

void remountSystemReadOnly ()

הפוך את מחיצת המערכת במכשיר לקריאה בלבד.

void remountSystemWritable ()

הפוך את מחיצת המערכת במכשיר לניתנת לכתיבה.

void remountVendorReadOnly ()

הפוך את מחיצת הספק במכשיר לקריאה בלבד.

void remountVendorWritable ()

הפוך את מחיצת הספק במכשיר לניתנת לכתיבה.

boolean removeAdmin (String componentName, int userId)

הסר מנהל מכשיר נתון במשתמש נתון והחזר true אם זה מצליח, false אחרת.

void removeOwners ()

הסר את כל בעלי פרופיל המכשירים הקיימים במאמץ הטוב ביותר.

boolean removeUser (int userId)

הסר משתמש נתון מהמכשיר.

void resetContentProviderSetup ()

אפס את הדגל עבור הגדרת ספק התוכן כדי להפעיל אותו שוב.

boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)

שיטת נוחות לביצוע ERROR(/#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection)) עם מאזין אחד או יותר שעברו כפרמטרים.

boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners)

מפעיל בדיקות מכשור ומספק שחזור מכשיר.

boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners)

זהה ל- ERROR(ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)/com.android.tradefed.device.ITestDevice#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection) ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)) אך מפעיל את הבדיקה עבור המשתמש הנתון.

boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)

זהה ל- ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, ITestLifeCycleReceiver...) אך מריץ את הבדיקה עבור משתמש נתון.

void setConfiguration ( IConfiguration configuration)

מזריק את IConfiguration בשימוש.

final void setConnectionAvdInfo ( GceAvdInfo avdInfo)
void setDate (Date date)

מגדיר את התאריך במכשיר

הערה: הגדרת התאריך במכשיר דורשת שורש

boolean setDeviceOwner (String componentName, int userId)

הגדר רכיב ניהול מכשיר כבעל מכשיר במשתמש נתון.

void setDeviceState ( TestDeviceState deviceState)

עדכן את מצב המכשיר.

void setEmulatorOutputStream ( SizeLimitedOutputStream output)

עבור אמולטור הגדר את SizeLimitedOutputStream לרישום פלט

void setEmulatorProcess (Process p)

מגדיר את Process , כאשר התקן זה הוא אמולטור.

void setFastbootEnabled (boolean fastbootEnabled)

הגדר את אפשרות האתחול המהיר עבור המכשיר.

void setFastbootPath (String fastbootPath)

מגדיר את הנתיב ל-fastboot הבינארי שבו יש להשתמש.

void setIDevice (IDevice newDevice)

עדכן את ה-IDevice המשויך ל-ITestDevice זה.

void setLogStartDelay (int delay)

מגדיר את הזמן ב-ms להמתין לפני תחילת לכידת logcat עבור מכשיר מקוון.

void setOptions ( TestDeviceOptions options)

הגדר את TestDeviceOptions עבור המכשיר

boolean setProperty (String propKey, String propValue)

מגדיר את ערך המאפיין הנתון במכשיר.

void setRecovery ( IDeviceRecovery recovery)

הגדר את IDeviceRecovery לשימוש עבור מכשיר זה.

void setRecoveryMode ( ITestDevice.RecoveryMode mode)

הגדר את מצב השחזור הנוכחי לשימוש עבור המכשיר.

void setSetting (String namespace, String key, String value)

ראה setSetting(int, String, String, String) ובוצע על משתמש המערכת.

void setSetting (int userId, String namespace, String key, String value)

הוסף ערך הגדרה למרחב השמות של משתמש נתון.

void setTestLogger ( ITestLogger testLogger)

מזריק את המופע ITestLogger

void setUseFastbootErase (boolean useFastbootErase)

הגדר אם להשתמש בפורמט Fastboot Erase או Fastboot כדי למחוק מחיצה במכשיר.

void startLogcat ()

התחל ללכוד פלט logcat מהמכשיר ברקע.

boolean startUser (int userId)

מפעיל משתמש נתון ברקע אם הוא מופסק כעת.

boolean startUser (int userId, boolean waitFlag)

מפעיל משתמש נתון ברקע אם הוא מופסק כעת.

boolean startVisibleBackgroundUser (int userId, int displayId, boolean waitFlag)

מפעיל משתמש נתון ברקע, גלוי בתצוגה הנתונה (כלומר, מאפשר למשתמש להפעיל פעילויות בתצוגה זו).

void stopEmulatorOutput ()

סגור ומחק את פלט האמולטור.

void stopLogcat ()

הפסק ללכוד פלט logcat מהמכשיר, והסר את נתוני logcat השמורים כעת.

boolean stopUser (int userId)

עוצר משתמש נתון.

boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)

עצור משתמש נתון.

String switchToAdbTcp ()

העבר את המכשיר למצב adb-over-tcp.

boolean switchToAdbUsb ()

העבר את המכשיר למצב adb over usb.

boolean switchUser (int userId)

עבור ל-userId אחר עם פסק זמן ברירת מחדל.

boolean switchUser (int userId, long timeout)

עבור ל-userId אחר עם הזמן הקצוב שסופק כתאריך יעד.

boolean syncFiles (File localFileDir, String deviceFilePath)

מסנכרן בהדרגה את התוכן של ספריית קבצים מקומית למכשיר.

Bugreport takeBugreport ()

קח דוח באג ומחזיר אותו בתוך אובייקט Bugreport כדי לטפל בו.

String uninstallPackage (String packageName)

הסר התקנה של חבילת אנדרואיד מהמכשיר.

String uninstallPackageForUser (String packageName, int userId)

הסר התקנה של חבילת אנדרואיד מהמכשיר עבור משתמש נתון.

boolean unlockDevice ()

ביטול נעילת המכשיר אם המכשיר נמצא במצב מוצפן.

void unmountDebugfs ()

בטל טעינת באגים.

boolean waitForBootComplete (long timeOut)

חסימה עד להגדרת דגל השלמת האתחול של המכשיר.

boolean waitForDeviceAvailable ()

ממתין עד שהמכשיר יהיה מגיב וזמין לבדיקה.

boolean waitForDeviceAvailable (long waitTime)

ממתין עד שהמכשיר יהיה מגיב וזמין לבדיקה.

boolean waitForDeviceAvailableInRecoverPath (long waitTime)

ממתין עד שהמכשיר יהיה מגיב וזמין מבלי להתחשב בנתיב השחזור.

void waitForDeviceBootloader ()

חוסם עד שהמכשיר יהיה גלוי באמצעות fastboot.

boolean waitForDeviceInRecovery (long waitTime)

חוסם שהמכשיר יהיה במצב 'adb recovery' (שים לב שזה שונה מ- IDeviceRecovery ).

boolean waitForDeviceInSideload (long waitTime)

חוסם שהמכשיר יהיה במצב 'עומס צד של adb'

boolean waitForDeviceNotAvailable (long waitTime)

חוסמים שהמכשיר לא יהיה זמין כלומר חסרים ב-adb

void waitForDeviceOnline ()

חסימה עד שהמכשיר יהיה גלוי דרך adb.

void waitForDeviceOnline (long waitTime)

חסימה עד שהמכשיר יהיה גלוי דרך adb.

boolean waitForDeviceShell (long waitTime)

ממתין עד שהמכשיר יגיב לפקודה בסיסית של adb shell.

שיטות מוגנות

void addExtraConnectionBuilderArgs ( DefaultConnection.ConnectionBuilder builder)
String[] buildAdbShellCommand (String command, boolean forceExitStatusDetection)

בונה את פקודת מערכת ההפעלה עבור פגישת הפקודות של ה-adb shell הנתונה ו-args

void checkApiLevelAgainst (String feature, int strictMinLevel)
NativeDevice.RebootDeviceAction createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason)

צור RebootDeviceAction לשימוש בעת ביצוע פעולת אתחול מחדש.

IRunUtil createRunUtil ()
void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

בצע אתחול של adb.

void ensureRuntimePermissionSupported ()

שיטת עוזר לזרוק חריג אם הרשאת זמן ריצה אינה נתמכת

int getApiLevelSafe ()
ITestLogger getLogger ()
IRunUtil getRunUtil ()

קבל את מופע RunUtil לשימוש.

void initializeConnection ( IBuildInfo info, MultiMap <String, String> attributes)
String internalGetProperty (String propName, String fastbootVar, String description)

אחזר מאפיין מכשיר, מהמטמון ddmlib כברירת מחדל, וחזור ל-'adb shell getprop' או 'fastboot getvar' תלוי אם המכשיר נמצא ב-Fastboot או לא.

boolean isInRebootCallback ()

מחזירה האם התקשרות חוזרת לאתחול מחדש מתבצעת כעת או לא.

boolean isNewer (File localFile, IFileEntry entry)

החזר true אם הקובץ המקומי חדש יותר מהקובץ המרוחק.

void notifyRebootEnded ()

מודיע לכל IDeviceActionReceiver על אירוע סיום אתחול מחדש.

void notifyRebootStarted ()

מודיע לכל IDeviceActionReceiver על אירוע התחלת אתחול מחדש.

boolean performDeviceAction (String actionDescription, NativeDevice.DeviceAction action, int retryAttempts)

מבצע פעולה במכשיר זה.

void postAdbReboot ()

פעולות נוספות אפשריות שניתן לבצע לאחר אתחול מחדש.

void prePostBootSetup ()

מאפשר לכל סוג מכשיר (AndroidNativeDevice, TestDevice) לעקוף שיטה זו עבור הגדרה ספציפית לאחר האתחול.

boolean pullFileInternal (String remoteFilePath, File localFile)
void setClock (Clock clock)

הגדר את מופע השעון לשימוש.

void setMicrodroidProcess (Process process)

מסמן את ה-TestDevice כ-microdroid ומגדיר את ה-CID שלו.

void setTestDeviceOptions ( deviceOptions) setTestDeviceOptions ( deviceOptions)
CommandResult simpleFastbootCommand (long timeout, envVarMap, String[] fullCmd) simpleFastbootCommand (long timeout, envVarMap, String[] fullCmd)

מבצע פקודת fastboot פשוטה עם משתני סביבה ודיווח על מצב הפקודה.

CommandResult simpleFastbootCommand (long timeout, String[] fullCmd)

מבצע פקודת fastboot פשוטה ודווח על מצב הפקודה.

boolean waitForDeviceNotAvailable (String operationDesc, long time)

המתן לראות שהמכשיר לא זמין (הפסק לדווח ל-adb).

קבועים

INVALID_USER_ID

public static final int INVALID_USER_ID

ערך שהוחזר עבור כל מזהה משתמש לא חוקי/לא נמצא: UserHandle הגדיר את הערך -10000

ערך קבוע: -10000 (0xffffd8f0)

MAX_HOST_DEVICE_TIME_OFFSET

protected static final long MAX_HOST_DEVICE_TIME_OFFSET

ערך קבוע: 5000 (0x0000000000001388)

MAX_RETRY_ATTEMPTS

protected static final int MAX_RETRY_ATTEMPTS

מספר ברירת המחדל של ניסיונות ניסיון חוזר של פקודה לבצע

ערך קבוע: 2 (0x00000002)

שדות

DEBUGFS_PATH

public static final String DEBUGFS_PATH

כרטיס זיכרון

protected static final String SD_CARD

STORAGE_EMULATED

protected static final String STORAGE_EMULATED

mOptions

protected TestDeviceOptions mOptions

mStateMonitor

protected final IDeviceStateMonitor mStateMonitor

בנאים ציבוריים

NativeDevice

public NativeDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)

יוצר TestDevice .

פרמטרים
device IDevice : ה- IDevice המשויך

stateMonitor IDeviceStateMonitor : מנגנון IDeviceStateMonitor לשימוש

allocationMonitor IDeviceMonitor : ה- IDeviceMonitor ליידע על שינויים במצב ההקצאה. יכול להיות ריק

שיטות ציבוריות

batchPrefetchStartupBuildProps

public void batchPrefetchStartupBuildProps ()

מיקרו אופטימיזציה (בערך 400 מיליס) על ידי שליפת כל האביזרים הדרושים לנו במקום לקרוא 'adb getprop' עבור כל אחד מהם. כלומר, זה מהיר לאסוף את כל המאפיינים כמו להביא אחד. דברים כמו device.getApiLevel(), checkApiLevelAgainstNextRelease ו-getBuildAlias ​​קוראים כולם 'adb getprop' מתחת למכסה המנוע. אנו מביאים אותם בשיחה אחת ומתקשרים ל-NativeDevice.setProperty. גם אם לא נעשה זאת, NativeDevice יקרא בעצמו ל-setProperty ותשמור את התוצאה במטמון עבור שיחות עתידיות. אנחנו רק עושים את זה מעט מוקדם יותר. אם המכשיר נמצא בשחזור או שיש שגיאות אחרות בהבאת האביזרים, אנחנו פשוט מתעלמים מהן.

canSwitchToHeadlessSystemUser

public boolean canSwitchToHeadlessSystemUser ()

מחזירה אם מותר לעבור למשתמש SYSTEM ללא ראש.

החזרות
boolean

זורק
DeviceNotAvailableException

checkApiLevelAgainstNextRelease

public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

בדוק אם תכונה נתמכת כרגע או לא בהינתן רמה נתמכת מינימלית. שיטה זו לוקחת בחשבון תכונות שטרם פורסמו, לפני העלאת רמת ה-API.

פרמטרים
strictMinLevel int : הרמה המינימלית האפשרית הקפדנית התומכת בתכונה.

החזרות
boolean נכון אם הרמה נתמכת. שקר אחרת.

זורק
DeviceNotAvailableException

לבדוק קישוריות

public boolean checkConnectivity ()

בדוק שלמכשיר יש קישוריות רשת.

החזרות
boolean true אם למכשיר יש חיבור רשת עובד, false יתר על המידה.

זורק
DeviceNotAvailableException

clearErrorDialogs

public boolean clearErrorDialogs ()

נסה לבטל את כל תיבת הדו-שיח של שגיאה המוצגת כעת בממשק המשתמש של המכשיר.

החזרות
boolean true אם לא היו תיבות דו-שיח או אם תיבות דו-שיח נוקו בהצלחה. false אחרת.

זורק
DeviceNotAvailableException

clearLastConnectedWifiNetwork

public void clearLastConnectedWifiNetwork ()

מנקה את רשת ה-WiFi המחוברת האחרונה. יש לקרוא לזה כאשר מתחילים הזמנה חדשה כדי להימנע מחיבור לרשת ה-WiFi ששימשה בבדיקה הקודמת לאחר אתחול המכשיר.

clearLogcat

public void clearLogcat ()

מוחק כל נתוני logcat שנצברו.

זה שימושי למקרים שבהם אתה רוצה להבטיח ITestDevice#getLogcat() מחזיר רק נתוני יומן שנוצרו לאחר נקודה מסוימת (כגון לאחר הבזק של בניית מכשיר חדש וכו').

connectToWifiNetwork

public boolean connectToWifiNetwork ( wifiSsidToPsk, 
                boolean scanSsid)

מתחבר לרשת wifi.

מפעיל wifi וחוסם עד ליצירת חיבור מוצלח עם אחת מרשתות ה- wifi המפורטות במפת wifiSsidToPsk. לאחר יצירת חיבור, המופע ינסה לשחזר את החיבור לאחר כל אתחול מחדש עד לקריאת ITestDevice#disconnectFromWifi() או ITestDevice#clearLastConnectedWifiNetwork() .

פרמטרים
wifiSsidToPsk : מפה של Wi-Fi SSIDs לסיסמאות.

scanSsid boolean : האם לסרוק SSIDs מוסתרים עבור רשת זו.

החזרות
boolean true אם מחובר לרשת wifi בהצלחה. false אחרת

זורק
DeviceNotAvailableException

connectToWifiNetwork

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk)

מתחבר לרשת wifi.

מפעיל wifi וחוסם עד לחיבור מוצלח לרשת wifi שצוינה. לאחר יצירת חיבור, המופע ינסה לשחזר את החיבור לאחר כל אתחול מחדש עד לקריאת ITestDevice#disconnectFromWifi() או ITestDevice#clearLastConnectedWifiNetwork() .

פרמטרים
wifiSsid String : ה-ssid של wifi שאליו יש להתחבר

wifiPsk String : ביטוי סיסמה PSK או null אם לא מוצפן

החזרות
boolean true אם מחובר לרשת wifi בהצלחה. false אחרת

זורק
DeviceNotAvailableException

connectToWifiNetwork

public boolean connectToWifiNetwork ( wifiSsidToPsk)

מתחבר לרשת wifi.

מפעיל wifi וחוסם עד ליצירת חיבור מוצלח עם אחת מרשתות ה- wifi המפורטות במפת wifiSsidToPsk. לאחר יצירת חיבור, המופע ינסה לשחזר את החיבור לאחר כל אתחול מחדש עד ל- ITestDevice#disconnectFromWifi() או ITestDevice#clearLastConnectedWifiNetwork() ייקרא.f

פרמטרים
wifiSsidToPsk : מפה של Wi-Fi SSIDs לסיסמאות.

החזרות
boolean true אם מחובר לרשת wifi בהצלחה. false אחרת

זורק
DeviceNotAvailableException

connectToWifiNetwork

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk, 
                boolean scanSsid)

מתחבר לרשת wifi.

מפעיל wifi וחוסם עד לחיבור מוצלח לרשת wifi שצוינה. לאחר יצירת חיבור, המופע ינסה לשחזר את החיבור לאחר כל אתחול מחדש עד לקריאת ITestDevice#disconnectFromWifi() או ITestDevice#clearLastConnectedWifiNetwork() .

פרמטרים
wifiSsid String : ה-ssid של wifi שאליו יש להתחבר

wifiPsk String : ביטוי סיסמה PSK או null אם לא מוצפן

scanSsid boolean : האם לסרוק SSID מוסתר עבור רשת זו.

החזרות
boolean true אם מחובר לרשת wifi בהצלחה. false אחרת

זורק
DeviceNotAvailableException

connectToWifiNetworkIfNeeded

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk, 
                boolean scanSsid)

גרסה של connectToWifiNetwork(String, String) שמתחברת רק אם למכשיר אין כרגע קישוריות רשת.

פרמטרים
scanSsid boolean : האם לסרוק SSID מוסתר עבור רשת זו

החזרות
boolean true אם מחובר לרשת wifi בהצלחה. false אחרת

זורק
DeviceNotAvailableException

connectToWifiNetworkIfNeeded

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk)

גרסה של connectToWifiNetwork(String, String) שמתחברת רק אם למכשיר אין כרגע קישוריות רשת.

החזרות
boolean true אם מחובר לרשת wifi בהצלחה. false אחרת

זורק
DeviceNotAvailableException

צור משתמש

public int createUser (String name, 
                boolean guest, 
                boolean ephemeral)

צור משתמש עם שם נתון והדגלים שסופקו

פרמטרים
name String : של המשתמש ליצור במכשיר

guest boolean : אפשר את דגל המשתמש --guest במהלך היצירה

ephemeral boolean : אפשר את דגל המשתמש - ארעית במהלך היצירה

החזרות
int מזהה המשתמש שנוצר

זורק
DeviceNotAvailableException

צור משתמש

public int createUser (String name, 
                boolean guest, 
                boolean ephemeral, 
                boolean forTesting)

צור משתמש עם שם נתון והדגלים שסופקו

פרמטרים
name String : של המשתמש ליצור במכשיר

guest boolean : אפשר את דגל המשתמש --guest במהלך היצירה

ephemeral boolean : אפשר את דגל המשתמש - ארעית במהלך היצירה

forTesting boolean : אפשר את דגל הבדיקה --לבדיקה במהלך היצירה

החזרות
int מזהה המשתמש שנוצר

זורק
DeviceNotAvailableException

צור משתמש

public int createUser (String name)

צור משתמש עם שם נתון ודגלי ברירת מחדל 0.

פרמטרים
name String : של המשתמש ליצור במכשיר

החזרות
int המספר השלם עבור מזהה המשתמש שנוצר

זורק
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

צור משתמש עם שם נתון ודגלי ברירת מחדל 0.

פרמטרים
name String : של המשתמש ליצור במכשיר

החזרות
int המספר השלם עבור מזהה המשתמש שנוצר או -1 עבור שגיאה.

זורק
DeviceNotAvailableException

מחק קובץ

public void deleteFile (String deviceFilePath)

שיטת עוזר למחיקת קובץ או ספרייה במכשיר.

פרמטרים
deviceFilePath String : הנתיב המוחלט של הקובץ במכשיר.

זורק
DeviceNotAvailableException

deregisterDeviceActionReceiver

public void deregisterDeviceActionReceiver (IDeviceActionReceiver deviceActionReceiver)

מסיר את IDeviceActionReceiver הרשום.

פרמטרים
deviceActionReceiver IDeviceActionReceiver : IDeviceActionReceiver שיוסר.

deviceSoftRestarted

public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)

שיטת עוזר לבדוק אם ההתקן הופעל מחדש על ידי השוואת system_server הנוכחי עם system_server הקודם ProcessInfo . השתמש getProcessByName(String) כדי לקבל ProcessInfo .

פרמטרים
prevSystemServerProcess ProcessInfo : תהליך system_server הקודם ProcessInfo .

החזרות
boolean true אם המכשיר מופעל מחדש

זורק
DeviceNotAvailableException

deviceSoftRestartedSince

public boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

שיטת עוזר לבדוק אם המכשיר הופעל מחדש מאז זמן UTC מאז התקופה מהמכשיר וה- ERROR(/TimeUnit) שלו. Soft-Restart מתייחס ל-system_server שהופעל מחדש מחוץ לאתחול קשיח של התקן (לדוגמה: אתחול מחדש מבוקש). ניתן להשיג את המכשיר הנוכחי utcEpochTime ב-Millisecond באמצעות השיטה getDeviceDate() .

פרמטרים
utcEpochTime long : זמן המכשיר בשנייה מאז התקופה.

timeUnit TimeUnit : יחידת הזמן TimeUnit עבור utcEpochTime הנתון.

החזרות
boolean true אם המכשיר מופעל מחדש

זורק
DeviceNotAvailableException

disableAdbRoot

public boolean disableAdbRoot ()

מכבה את ה-adb root.

השבתת ה-adb root עלולה לגרום למכשיר להתנתק מ-adb. שיטה זו תחסום עד שהמכשיר יהיה זמין.

החזרות
boolean true אם מצליח.

זורק
DeviceNotAvailableException

disableKeyguard

public void disableKeyguard ()

ניסיונות להשבית את מגן המקשים.

ראשית יש להמתין לשליחת הקלט כדי להיות מוכנה, זה קורה בערך באותו זמן כאשר המכשיר מדווח על BOOT_COMPLETE, ככל הנראה באופן אסינכרוני, מכיוון שליישום המסגרת הנוכחי יש מצב מרוץ מדי פעם. לאחר מכן נשלחת הפקודה כדי לבטל את שמירת המקשים (עובד על אלה שאינם מאובטחים בלבד)

זורק
DeviceNotAvailableException

השבת את NetworkMonitor

public boolean disableNetworkMonitor ()

משבית את ניטור הרשת במכשיר.

החזרות
boolean true אם הניטור מושבת בהצלחה. false אם זה נכשל.

זורק
DeviceNotAvailableException

disconnectFromWifi

public boolean disconnectFromWifi ()

מתנתק מרשת wifi.

מסיר את כל הרשתות מרשימת הרשתות המוכרות ומשבית את ה-wifi.

החזרות
boolean true אם התנתק מרשת wifi בהצלחה. false אם הניתוק נכשל.

זורק
DeviceNotAvailableException

doesFileExist

public boolean doesFileExist (String deviceFilePath, 
                int userId)

שיטת עוזר לקבוע אם קיים קובץ במכשיר עבור משתמש נתון.

פרמטרים
deviceFilePath String : הנתיב המוחלט של הקובץ במכשיר שיש לבדוק

userId int : מזהה המשתמש שכנגדו יש לבדוק את קיום הקובץ

החזרות
boolean true אם הקובץ קיים, false אחרת.

זורק
DeviceNotAvailableException

doesFileExist

public boolean doesFileExist (String deviceFilePath)

שיטת עוזר לקבוע אם קיים קובץ במכשיר.

פרמטרים
deviceFilePath String : הנתיב המוחלט של הקובץ במכשיר שיש לבדוק

החזרות
boolean true אם הקובץ קיים, false אחרת.

זורק
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

נסה לזרוק את הערימה מה-system_server. באחריות המתקשר לנקות את הקובץ שנזרק.

פרמטרים
process String : שם תהליך ההתקן שעליו dumpheap.

devicePath String : הנתיב במכשיר שבו לשים את המזבלה. זה חייב להיות מיקום שבו ההרשאות מאפשרות זאת.

החזרות
File ה- ERROR(/File) המכילה את הדוח. ריק אם משהו נכשל.

זורק
DeviceNotAvailableException

enableAdbRoot

public boolean enableAdbRoot ()

מפעיל את השורש של adb. אם ההגדרה "enable-root" היא "false", תירשם הודעה ותחזור מבלי להפעיל את ה-root.

הפעלת ה-adb root עלולה לגרום למכשיר להתנתק מ-adb. שיטה זו תחסום עד שהמכשיר יהיה זמין.

החזרות
boolean true אם מצליח.

זורק
DeviceNotAvailableException

אפשר NetworkMonitor

public boolean enableNetworkMonitor ()

מאפשר ניטור רשת במכשיר.

החזרות
boolean true אם הניטור מופעל בהצלחה. false אם זה נכשל.

זורק
DeviceNotAvailableException

executeAdbCommand

public String executeAdbCommand (long timeout, 
                String... cmdArgs)

שיטת עוזר המבצעת פקודת adb כפקודת מערכת עם פסק זמן מוגדר.

במקום זאת יש להשתמש executeShellCommand(String) בכל מקום אפשרי, שכן שיטה זו מספקת זיהוי וביצועים טובים יותר של כשלים.

פרמטרים
timeout long : הזמן באלפיות שניות לפני שהמכשיר נחשב ללא מגיב, 0L ללא פסק זמן

cmdArgs String : פקודת adb והארגומנטים להפעלה

החזרות
String הסטדאוט מהפקודה. null אם הפקודה נכשלה בביצוע.

זורק
DeviceNotAvailableException

executeAdbCommand

public String executeAdbCommand (long timeout, 
                 envMap, 
                String... cmdArgs)

שיטת עוזר המבצעת פקודת adb כפקודת מערכת עם פסק זמן מוגדר.

במקום זאת יש להשתמש executeShellCommand(String) בכל מקום אפשרי, שכן שיטה זו מספקת זיהוי וביצועים טובים יותר של כשלים.

פרמטרים
timeout long : הזמן באלפיות שניות לפני שהמכשיר נחשב ללא מגיב, 0L ללא פסק זמן

envMap : סביבה להגדיר עבור הפקודה

cmdArgs String : פקודת adb והארגומנטים להפעלה

החזרות
String הסטדאוט מהפקודה. null אם הפקודה נכשלה בביצוע.

זורק
DeviceNotAvailableException

executeAdbCommand

public String executeAdbCommand (String... cmdArgs)

שיטת עוזר המבצעת פקודת adb כפקודת מערכת.

במקום זאת יש להשתמש executeShellCommand(String) בכל מקום אפשרי, שכן שיטה זו מספקת זיהוי וביצועים טובים יותר של כשלים.

פרמטרים
cmdArgs String : פקודת adb והארגומנטים להפעלה

החזרות
String הסטדאוט מהפקודה. null אם הפקודה נכשלה בביצוע.

זורק
DeviceNotAvailableException

executeFastbootCommand

public CommandResult executeFastbootCommand (String... cmdArgs)

שיטת עוזר המבצעת פקודת fastboot כפקודת מערכת עם פסק זמן ברירת מחדל של 2 דקות.

צפוי להיות בשימוש כאשר המכשיר כבר נמצא במצב אתחול מהיר.

פרמטרים
cmdArgs String : פקודת fastboot והארגומנטים להפעלה

החזרות
CommandResult תוצאת הפקודה המכילה פלט של הפקודה

זורק
DeviceNotAvailableException

executeFastbootCommand

public CommandResult executeFastbootCommand (long timeout, 
                String... cmdArgs)

שיטת עוזר המבצעת פקודת fastboot בתור פקודת מערכת.

צפוי להיות בשימוש כאשר המכשיר כבר נמצא במצב אתחול מהיר.

פרמטרים
timeout long : הזמן באלפיות שניות לפני פקיעת הפקודה

cmdArgs String : פקודת fastboot והארגומנטים להפעלה

החזרות
CommandResult תוצאת הפקודה המכילה פלט של הפקודה

זורק
DeviceNotAvailableException

executeLongFastbootCommand

public CommandResult executeLongFastbootCommand (String... cmdArgs)

שיטת עוזר המבצעת פקודת fastboot שפועלת לאורך זמן בתור פקודת מערכת.

זהה ל- executeFastbootCommand(String) למעט שימוש בפסק זמן ארוך יותר.

פרמטרים
cmdArgs String : פקודת fastboot והארגומנטים להפעלה

החזרות
CommandResult תוצאת הפקודה המכילה פלט של הפקודה

זורק
DeviceNotAvailableException

ExecuteLongStootCommand

public CommandResult executeLongFastbootCommand ( envVarMap, 
                String... cmdArgs)

שיטת עוזר המבצעת פקודה ארוכה של FastBoot כפקודה מערכתית עם משתני סביבת מערכת.

זהה ל- executeFastbootCommand(String) למעט משתמש בפסק זמן ארוך יותר.

פרמטרים
envVarMap : משתני סביבת המערכת שהפקודה FastBoot פועלת איתם

cmdArgs String : הפקודה FastBoot וטיעונים להפעלה

החזרות
CommandResult ה- CommanderSull המכיל פלט פקודה

זורק
DeviceNotAvailableException

ExecuteShellCommand

public String executeShellCommand (String command)

שיטת עוזר המבצעת פקודה מעטפת ADB ומחזרת את String כמחרוזת.

פרמטרים
command String : פקודת מעטפת ADB להפעלה

החזרות
String פלט הקליפה

זורק
DeviceNotAvailableException

ExecuteShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

מבצע פקודת מעטפת ADB, עם פרמטרים נוספים לשליטה על התנהגות הפקודה.

פרמטרים
command String : פקודת מעטפת ADB להפעלה

receiver IShellOutputReceiver : IShellOutputReceiver כדי לכוון את תפוקת הקליפה אליו.

maxTimeToOutputShellResponse long : משך הזמן המרבי שבמהלכו מותר לפקודה לא להגיש תגובה כלשהי; היחידה כמפורט ב- timeUnit

timeUnit TimeUnit : יחידה ל- maxTimeToOutputShellResponse

retryAttempts int : המספר המקסימלי של הפעמים לנסות שוב לפקודה אם היא נכשלת בגלל חריג. DevicenotresponsiveSception יושלך אם יבוצעו retryAttempts ללא הצלחה.

זורק
DeviceNotAvailableException

ExecuteShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeoutForCommand, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

מבצע פקודת מעטפת ADB, עם פרמטרים נוספים לשליטה על התנהגות הפקודה.

פרמטרים
command String : פקודת מעטפת ADB להפעלה

receiver IShellOutputReceiver : IShellOutputReceiver כדי לכוון את תפוקת הקליפה אליו.

maxTimeoutForCommand long : הפסק זמן מקסימלי להשלמת הפקודה; היחידה כמפורט ב- timeUnit

maxTimeToOutputShellResponse long : משך הזמן המרבי שבמהלכו מותר לפקודה לא להגיש תגובה כלשהי; היחידה כמפורט ב- timeUnit

timeUnit TimeUnit : יחידה ל- maxTimeToOutputShellResponse

retryAttempts int : המספר המקסימלי של הפעמים לנסות שוב לפקודה אם היא נכשלת בגלל חריג. DevicenotresponsiveSception יושלך אם יבוצעו retryAttempts ללא הצלחה.

זורק
DeviceNotAvailableException

ExecuteShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

מבצע את הפקודה הנתונה של adb מעטפת, נסה מחדש מספר פעמים אם הפקודה נכשלת.

צורה פשוטה יותר של executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit, int) עם ערכי ברירת מחדל.

פרמטרים
command String : פקודת מעטפת ADB להפעלה

receiver IShellOutputReceiver : IShellOutputReceiver כדי לכוון את תפוקת הקליפה אליו.

זורק
DeviceNotAvailableException

ExecuteShellV2Command

public CommandResult executeShellV2Command (String cmd)

שיטת עוזר המבצעת פקודה של פגז ADB ומחזירה את התוצאות כ- CommandResult שמאוכלסת כראוי בפלט סטטוס הפקודה, STDOUT ו- STDERR.

פרמטרים
cmd String : הפקודה שצריך להפעיל.

החזרות
CommandResult התוצאה ב- CommandResult .

זורק
DeviceNotAvailableException

ExecuteShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                OutputStream pipeToOutput)

שיטת עוזר המבצעת פקודה מעטפת ADB ומחזירה את התוצאות כ- CommandResult שמאוכלס כראוי בפלט סטטוס הפקודה ו- STDERR. STDOUT מופנה לזרם שצוין.

פרמטרים
cmd String : הפקודה שצריך להפעיל.

pipeToOutput OutputStream : ERROR(/OutputStream) כאשר פלט ה- STD יופנה מחדש, או NULL.

החזרות
CommandResult התוצאה ב- CommandResult .

זורק
DeviceNotAvailableException

ExecuteShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput)

שיטת עוזר המבצעת פקודה מעטפת ADB ומחזירה את התוצאות כ- CommandResult מאוכלס כראוי בפלט סטטוס הפקודה, STDOUT ו- STDERR.

פרמטרים
cmd String : הפקודה שצריך להפעיל.

pipeAsInput File : ERROR(/File) שתועבר כקלט לפקודה, או null.

החזרות
CommandResult התוצאה ב- CommandResult .

זורק
DeviceNotAvailableException

ExecuteShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

מבצע פקודת מעטפת ADB, עם פרמטרים נוספים לשליטה על התנהגות הפקודה.

פרמטרים
cmd String : פקודת מעטפת ADB להפעלה

maxTimeoutForCommand long : הפסק זמן מקסימלי להשלמת הפקודה; היחידה כמפורט ב- timeUnit

timeUnit TimeUnit : יחידה ל- maxTimeToOutputShellResponse

retryAttempts int : המספר המקסימלי של הפעמים לנסות שוב לפקודה אם היא נכשלת בגלל חריג. DevicenotresponsiveSception יושלך אם יבוצעו retryAttempts ללא הצלחה.

החזרות
CommandResult

זורק
DeviceNotAvailableException

ExecuteShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit)

מבצע פקודת מעטפת ADB, עם פרמטרים נוספים לשליטה על התנהגות הפקודה.

פרמטרים
cmd String : פקודת מעטפת ADB להפעלה

maxTimeoutForCommand long : הפסק זמן מקסימלי להשלמת הפקודה; היחידה כמפורט ב- timeUnit

timeUnit TimeUnit : יחידה ל- maxTimeToOutputShellResponse

החזרות
CommandResult

זורק
DeviceNotAvailableException

ExecuteShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

מבצע פקודת מעטפת ADB, עם פרמטרים נוספים לשליטה על התנהגות הפקודה.

פרמטרים
cmd String : פקודת מעטפת ADB להפעלה

pipeAsInput File : ERROR(/File) שתועבר כקלט לפקודה, או null.

pipeToOutput OutputStream : ERROR(/OutputStream) כאשר פלט ה- STD יופנה מחדש, או NULL.

maxTimeoutForCommand long : הפסק זמן מקסימלי להשלמת הפקודה; היחידה כמפורט ב- timeUnit

timeUnit TimeUnit : יחידה ל- maxTimeToOutputShellResponse

retryAttempts int : המספר המקסימלי של הפעמים לנסות שוב לפקודה אם היא נכשלת בגלל חריג. DevicenotresponsiveSception יושלך אם יבוצעו retryAttempts ללא הצלחה.

החזרות
CommandResult

זורק
DeviceNotAvailableException

ExecuteShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                OutputStream pipeToError, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

מבצע פקודת מעטפת ADB, עם פרמטרים נוספים לשליטה על התנהגות הפקודה.

פרמטרים
cmd String : פקודת מעטפת ADB להפעלה

pipeAsInput File : ERROR(/File) שתועבר כקלט לפקודה, או null.

pipeToOutput OutputStream : ERROR(/OutputStream) כאשר פלט ה- STD יופנה מחדש, או NULL.

pipeToError OutputStream : ERROR(/OutputStream) כאשר שגיאת STD תופנה מחדש או NULL.

maxTimeoutForCommand long : הפסק זמן מקסימלי להשלמת הפקודה; היחידה כמפורט ב- timeUnit

timeUnit TimeUnit : יחידה ל- maxTimeToOutputShellResponse

retryAttempts int : המספר המקסימלי של הפעמים לנסות שוב לפקודה אם היא נכשלת בגלל חריג. DevicenotresponsiveSception יושלך אם יבוצעו retryAttempts ללא הצלחה.

החזרות
CommandResult

זורק
DeviceNotAvailableException

FastBootWipePartition

public CommandResult fastbootWipePartition (String partition)

שיטת עוזר שמנגבת מחיצה למכשיר.

אם getUseFastbootErase() true , אז מחק FastBoot ישמש כדי למחוק את המחיצה. לאחר מכן על המכשיר ליצור מערכת קבצים בפעם הבאה שהמכשיר מתגלה. אחרת, נעשה שימוש בפורמט FastBoot אשר תיצור מערכת קבצים חדשה במכשיר.

צפוי לשמש כאשר המכשיר כבר במצב FastBoot.

פרמטרים
partition String : המחיצה לנגב

החזרות
CommandResult ה- CommanderSull המכיל פלט פקודה

זורק
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

הביאו את המידע על איפקסים המופעלים במכשיר.

החזרות
ERROR(/Set) של ApexInfo המופעלת כעת במכשיר

זורק
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

החזר זוגות ערך מפתח של מרחב השמות המבוקש.

פרמטרים
namespace String : חייבת להיות אחת מ- {"מערכת", "מאובטח", "גלובלי"}

החזרות
המפה של זוגות ערך מפתח. NULL אם מרחב השמות אינו נתמך.

זורק
DeviceNotAvailableException

getAllocationState

public DeviceAllocationState getAllocationState ()

להחזיר את מצב ההקצאה הנוכחי של המכשיר

החזרות
DeviceAllocationState

getAndroidid

public String getAndroidId (int userId)

מצא והחזיר את ה- Android-ID המשויך למשתמש, null אם לא נמצא.

פרמטרים
userId int

החזרות
String

זורק
DeviceNotAvailableException

getAndroidids

public  getAndroidIds ()

צור מפה של מזהי אנדרואיד שנמצאו מזהי משתמש תואמים. אין ביטוח שכל מזהה משתמש ימצא מזהה אנדרואיד המשויך בפונקציה זו כך שמזהי משתמש מסוימים עשויים להתאים ל- NULL.

החזרות
מפה של מזהי אנדרואיד מצאו מזהי משתמש תואמים.

זורק
DeviceNotAvailableException

getApileVel

public int getApiLevel ()

קבל את רמת ה- API של המכשיר. ברירת המחדל ל- UNKNOWN_API_LEVEL .

החזרות
int מספר שלם המציין את רמת ה- API של המכשיר

זורק
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

השג מידע על חבילה המותקנת במכשיר.

פרמטרים
packageName String

החזרות
PackageInfo את PackageInfo או null אם לא ניתן לאחזר מידע

זורק
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

השג את מידע החבילות המותקנות במכשיר.

החזרות
ERROR(/List) של PackageInfo המותקנת במכשיר.

זורק
DeviceNotAvailableException

getBaseBandVersion

public String getBasebandVersion ()

שיטת נוחות לקבלת גרסת Baseband (רדיו) של מכשיר זה. קבלת גרסת הרדיו היא ספציפית למכשירים, כך שהיא עשויה לא להחזיר את המידע הנכון עבור כל המכשירים. שיטה זו מסתמכת על gsm.version.baseband propery להחזרת פרטי הגרסה הנכונה. זה לא מדויק עבור כמה מכשירי CDMA והגרסה שהוחזרה כאן עשויה לא להתאים לגירסה המדווחת מ- FastBoot ואולי לא תחזיר את הגרסה לרדיו CDMA. TL; DR שיטה זו מדווחת רק על גרסה מדויקת אם המאפיין GSM.Version.BaseBand זהה לגירסה שהוחזרה על ידי fastboot getvar version-baseband .

החזרות
String גרסת Base Base String או null אם לא ניתן לקבוע אותה (לא ניתן לקרוא למכשיר לא ניתן לקרוא את רדיו או מחרוזת גרסה)

זורק
DeviceNotAvailableException

getBattery

public Integer getBattery ()

מחזיר את רמת הסוללה הנוכחית של מכשיר או בטל אם רמת הסוללה אינה זמינה.

החזרות
Integer

getBooleanProperty

public boolean getBooleanProperty (String name, 
                boolean defaultValue)

מחזיר ערך בוליאני של הנכס הנתון.

פרמטרים
name String : שם המאפיין

defaultValue boolean : ערך ברירת מחדל להחזרתו אם המאפיין ריק או אינו קיים.

החזרות
boolean true אם לנכס יש ערך "1" , "y" , "yes" , "on" או "true" , false אם לנכס יש ערך של "0" , "n" , "no" , "off" , "false" , או defaultValue אחרת.

זורק
DeviceNotAvailableException

getBoothistory

public  getBootHistory ()

שיטת Helper אוספת את מפת היסטוריית האתחול עם זמן האתחול וסיבת האתחול.

החזרות
מפת זמן האתחול (זמן UTC בשנייה מאז התקופה) וסיבת האתחול

זורק
DeviceNotAvailableException

getBoothistorySince

public  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

שיטת Helper אוספת את מפת היסטוריית האתחול עם זמן האתחול וסיבת האתחול מאז הזמן הנתון מאז התקופה מהמכשיר ויחידת הזמן שצוינה. ניתן להשיג את המכשיר הנוכחי utcocochtime באלפיות השנייה בשיטה getDeviceDate() .

פרמטרים
utcEpochTime long : זמן המכשיר מאז התקופה.

timeUnit TimeUnit : יחידת הזמן TimeUnit .

החזרות
מפת זמן האתחול (זמן UTC בשנייה מאז התקופה) וסיבת האתחול

זורק
DeviceNotAvailableException

getBootloaderversion

public String getBootloaderVersion ()

שיטת הנוחות כדי לקבל את גרסת ה- Bootloader של מכשיר זה.

ינסה לאחזר את גרסת ה- Bootloader מהמצב הנוכחי של המכשיר. (כלומר אם המכשיר נמצא במצב FastBoot, הוא ינסה לאחזר גרסה מ- FastBoot)

החזרות
String את גרסת המחרוזת String או null אם לא ניתן למצוא אותה

זורק
DeviceNotAvailableException

getBugReport

public InputStreamSource getBugreport ()

מאחזר דופק bugrepiors מהמכשיר.

יישום זה מובטח להמשיך לעבוד על מכשיר ללא כרטיס SD (או כאשר ה- SDCard עדיין לא מורכב).

החזרות
InputStreamSource InputStreamSource שיניב את תוכן הדור של Bugreport לפי דרישה. במקרה של כישלון, ה- InputStreamSource יפיק ERROR(/InputStream) .

getBugReportz

public InputStreamSource getBugreportz ()

מאחזרת BugrePortz מהמכשיר. פורמט ZIP BugrePort מכיל את ה- BugrePort הראשי וקבצי יומן אחרים המועילים לניפוי באגים.

נתמך רק עבור 'גרסת ADB'> 1.0.36

החזרות
InputStreamSource InputStreamSource של קובץ ה- zip המכיל את BugrePortz, החזיר null במקרה של כישלון.

getBuildalias

public String getBuildAlias ()

אחזר את הכינוי של הבנייה שהמכשיר פועל כעת.

בניית כינוי היא בדרך כלל מחרוזת קריאה יותר מאשר מזהה בנייה (בדרך כלל מספר עבור Nexus Builds). לדוגמה, שחרור אנדרואיד 4.2 סופי של Build alias JDQ39, ו- Build ID 573038

החזרות
String את כינוי הבנייה או נופל חזרה לבניית תעודת זהות אם לא ניתן יהיה לאחזר אותו

זורק
DeviceNotAvailableException

getBuildflaver

public String getBuildFlavor ()

אחזר את טעם הבנייה למכשיר.

החזרות
String את הטעם הבנייה או האפס אם לא ניתן לאחזר אותו

זורק
DeviceNotAvailableException

getBuildid

public String getBuildId ()

אחזר את הבנייה המכשיר פועל כעת.

החזרות
String מזהה הבנייה או IBuildInfo#UNKNOWN_BUILD_ID אם לא ניתן יהיה לאחזר אותו

זורק
DeviceNotAvailableException

getBuildSigningKeys

public String getBuildSigningKeys ()

מחזיר את סוג המפתח המשמש לחתימת תמונת המכשיר

בדרך כלל מכשירי אנדרואיד עשויים להיות חתומים במקשי מבחן (כמו ב- AOSP) או במקסי שחרור (נשלטים על ידי יצרני מכשירים בודדים)

החזרות
String מפתח החתימה אם נמצא, בטל אחרת.

זורק
DeviceNotAvailableException

getCachedDeviedingEscriptor

public DeviceDescriptor getCachedDeviceDescriptor ()

מחזיר DeviceDescriptor במטמון אם המכשיר מוקצה, אחרת מחזיר את DeviceDescriptor הנוכחי.

החזרות
DeviceDescriptor

getCachedDeviedingEscriptor

public DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)

מחזיר DeviceDescriptor במטמון אם המכשיר מוקצה, אחרת מחזיר את DeviceDescriptor הנוכחי.

פרמטרים
shortDescriptor boolean : בין אם להגביל את המתאר למידע מינימלי חשוף או לא

החזרות
DeviceDescriptor

GetChildren

public String[] getChildren (String path)

אלטרנטיבה לשימוש IFileEntry שלעתים לא תעבוד בגלל הרשאות.

פרמטרים
path String : האם הנתיב במכשיר היכן ניתן לבצע את החיפוש

החזרות
String[] מערך מחרוזת המכיל את כל הקובץ בנתיב במכשיר.

זורק
DeviceNotAvailableException

GetConnection

public AbstractConnection getConnection ()

החיבור הנוכחי המשויך למכשיר.

החזרות
AbstractConnection

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

מחזיר את המצב המתקפל הנוכחי של המכשיר או null אם התרחשו בעיות מסוימות.

החזרות
DeviceFoldableState

זורק
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

החזר את המזהה של המשתמש המריץ הנוכחי. במקרה של שגיאה, חזור -10000.

החזרות
int

זורק
DeviceNotAvailableException

getDeviceClass

public String getDeviceClass ()

קבל את מחלקת המכשירים.

החזרות
String מחלקת מכשירי String .

GetDevedateate

public long getDeviceDate ()

החזיר את תאריך המכשיר באלפיות השנייה מאז התקופה.

החזרות
long תאריך המכשיר בפורמט Epoch.

זורק
DeviceNotAvailableException

getDeviedSeescriptor

public DeviceDescriptor getDeviceDescriptor ()

החזיר DeviceDescriptor ממידע המכשיר כדי לקבל מידע עליו מבלי להעביר את אובייקט המכשיר בפועל.

החזרות
DeviceDescriptor

getDeviedSeescriptor

public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

החזיר DeviceDescriptor ממידע המכשיר כדי לקבל מידע עליו מבלי להעביר את אובייקט המכשיר בפועל.

פרמטרים
shortDescriptor boolean : בין אם להגביל את המתאר למידע מינימלי חשוף או לא

החזרות
DeviceDescriptor

GetDevicestate

public TestDeviceState getDeviceState ()

קבל את מצב המכשיר.

החזרות
TestDeviceState

getDeviceTimeOffset

public long getDeviceTimeOffset (Date date)

עוזר כדי לקבל את הפרש הזמן בין המכשיר ERROR(/Date) . השתמש בזמן Epoch באופן פנימי.

פרמטרים
date Date

החזרות
long ההבדל באלפיות השנייה

זורק
DeviceNotAvailableException

getemulatoroutput

public InputStreamSource getEmulatorOutput ()

קבל את זרם האמולטור סטאוט וסטדרר

החזרות
InputStreamSource פלט אמולטור

getemulatorprocess

public Process getEmulatorProcess ()

החזירו את Process המתאים לאמולטור זה.

החזרות
Process Process או null

getExecuteshellCommandLog

public final File getExecuteShellCommandLog ()

היומן שמכיל את כל יומני executeShellCommand(String) .

החזרות
File

getExternalStoreFreespace

public long getExternalStoreFreeSpace ()

שיטת עוזר לקביעת כמות השטח הפנוי באחסון חיצוני של מכשירים.

החזרות
long כמות השטח הפנוי ב- KB

זורק
DeviceNotAvailableException

GetFastBootPath

public String getFastbootPath ()

מחזיר את הנתיב של השימוש בינארי FastBoot. עדיין דורש isFastbootEnabled() להיות נכון, כדי להפעיל פונקציות מהירות.

החזרות
String

getFastBootProductType

public String getFastbootProductType ()

שיטת הנוחות כדי לקבל את סוג המוצר של מכשיר זה כאשר היא במצב FastBoot.

יש להשתמש בשיטה זו רק אם המכשיר צריך להיות ב- FastBoot. זה קצת יותר בטוח יותר משיטת getProductType() בגנרית במקרה זה, מכיוון ש- ItestDevice יידע לשחזר את המכשיר ל- FastBoot אם המכשיר במצב שגוי או אינו מגיב.

החזרות
String את שם המוצר של String או null אם לא ניתן לקבוע אותו

זורק
DeviceNotAvailableException

GetFastBootProductVariant

public String getFastbootProductVariant ()

שיטת הנוחות כדי לקבל את סוג המוצר של מכשיר זה כאשר היא במצב FastBoot.

יש להשתמש בשיטה זו רק אם המכשיר צריך להיות ב- FastBoot. זה קצת יותר בטוח יותר משיטת getProductType() בגנרית במקרה זה, מכיוון ש- ItestDevice יידע לשחזר את המכשיר ל- FastBoot אם המכשיר במצב שגוי או אינו מגיב.

החזרות
String את שם המוצר של String או null אם לא ניתן לקבוע אותו

זורק
DeviceNotAvailableException

getFastBootserialNumber

public String getFastbootSerialNumber ()

מחזיר את המספר הסידורי של מצב FastBoot.

החזרות
String

GetFastBootVariable

public String getFastbootVariable (String variableName)

אחזר את הערך המשתנה FastBoot הנתון מהמכשיר.

פרמטרים
variableName String : השם המשתנה

החזרות
String ערך הנכס או null אם הוא לא קיים

זורק
DeviceNotAvailableException

getFastBootversion

public String getFastbootVersion ()

מחזיר את מחרוזת הגרסאות של השימוש בינארי FastBoot. או null אם משהו משתבש.

החזרות
String

getFileEntry

public IFileEntry getFileEntry (String path)

אחזר הפניה לקובץ מרוחק במכשיר.

פרמטרים
path String : נתיב הקובץ לאחזור. יכול להיות מסלול מוחלט או מסלול ביחס ל '/'. (כלומר, תחביר "/מערכת" וגם "מערכת" נתמכת)

החזרות
IFileEntry IFileEntry או null אם לא ניתן למצוא קובץ path נתון

זורק
DeviceNotAvailableException

getFileEntry

public IFileEntry getFileEntry (FileListingService.FileEntry entry)

עוזר לא רשמי כדי לקבל FileEntry מנקודה ללא שורש. FIXME: Refactor מערכת FileEntry כך שתזמין אותה מכל נתיב. (אפילו לא שורש).

פרמטרים
entry FileListingService.FileEntry : FileEntry לא בהכרח שורש כפי שדורש DDMLIB.

החזרות
IFileEntry FileEntryWrapper המייצג את הקובץ.

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getFoldAblestates

public  getFoldableStates ()

מחזירה את רשימת המצבים המתקפלים במכשיר. ניתן להשיג באמצעות "CMD DEVICE_STATE PRINT-STATES".

החזרות

זורק
DeviceNotAvailableException

getidevice

public IDevice getIDevice ()

מחזיר הפניה ל- DDMLIB IDevice המשויך.

ניתן להקצות IDevice חדש על ידי DDMS בכל פעם שהמכשיר מתנתק ומחבר מחדש מ- ADB. לפיכך, המתקשרים לא צריכים לשמור על התייחסות ל- IDevice , מכיוון שההפניה הזו עשויה להיות מעופשת.

החזרות
IDevice ה- IDevice

getInstalledPackagenames

public  getInstalledPackageNames ()

השג את שמות חבילות היישומים הקיימים במכשיר.

החזרות
ERROR(/Set) של שמות חבילות String המותקנות כעת במכשיר.

זורק
DeviceNotAvailableException

getIntproperty

public long getIntProperty (String name, 
                long defaultValue)

מחזיר ערך שלם של הנכס הנתון מהמכשיר.

פרמטרים
name String : שם המאפיין

defaultValue long : ערך ברירת מחדל להחזרה אם המאפיין ריק או אינו קיים.

החזרות
long ערך המאפיין או defaultValue אם הנכס ריק, אינו קיים או שאין לו ערך שלם.

זורק
DeviceNotAvailableException

getIpaddress

public String getIpAddress ()

מקבל את כתובת ה- IP של המכשיר.

החזרות
String כתובת ה- IP של המכשיר, או null אם למכשיר אין כתובת IP

זורק
DeviceNotAvailableException

GetKeyGuardState

public KeyguardControllerState getKeyguardState ()

החזיר אובייקט כדי לקבל את המצב הנוכחי של משמר המפתח או NULL אם לא נתמך.

החזרות
KeyguardControllerState KeyguardControllerState המכיל תמונת מצב של מצב משמר המפתח ומחזיר את NULL אם שאילתת שומר המפתח אינה נתמכת.

זורק
DeviceNotAvailableException

getLastexpentReboottiMemillis

public long getLastExpectedRebootTimeMillis ()

מחזירים בפעם האחרונה ש- APIs Tradefed עוררו אתחול מחדש באלפיות השנייה מאז התקופה שהוחזר על ידי System.currentTimeMillis() .

החזרות
long

getLaunchapileVel

public int getLaunchApiLevel ()

קבל את רמת ה- API הראשונה של המכשיר שהושק. ברירת המחדל ל- UNKNOWN_API_LEVEL .

החזרות
int מספר שלם המציין את רמת ה- API הראשונה של המכשיר

זורק
DeviceNotAvailableException

getLogcat

public InputStreamSource getLogcat ()

תופס זרם תמונת מצב של נתוני Logcat.

עובד בשני מצבים:

  • אם ה- Logcat נלכד כרגע ברקע, יחזור ל- TestDeviceOptions.getMaxLogcatDataSize() בתים של התוכן הנוכחי של לכידת Logcat הרקע
  • אחרת, יחזירו זבל סטטי של נתוני Logcat אם המכשיר מגיב כרגע

    החזרות
    InputStreamSource

  • getLogcat

    public InputStreamSource getLogcat (int maxBytes)

    תופס זרם תמונת מצב של maxBytes האחרונים של נתוני Logcat שנלכדו.

    שימושי למקרים כאשר ברצונך לצלם תמונות תצלומים תכופות של נתוני Logcat שנלכדו מבלי להתייחס לעונש שטח הדיסק הגדול שעלול לקבל את כל תמונת המצב של getLogcat() .

    פרמטרים
    maxBytes int : כמות הנתונים המרבית להחזרתם. צריך להיות כמות שיכולה להתאים בנוחות בזיכרון

    החזרות
    InputStreamSource

    getLogcatDump

    public InputStreamSource getLogcatDump ()

    השג את המזבלה של ה- logcat הנוכחי עבור המכשיר. שלא כמו getLogcat() , שיטה זו תמיד תחזיר מזבלה סטטית של הלוגקט.

    יש את החיסרון ששום דבר לא יוחזר אם לא ניתן להגיע למכשיר.

    החזרות
    InputStreamSource InputStreamSource של נתוני Logcat. זרם ריק מוחזר אם לא מצליח ללכוד נתוני logcat.

    getLogcatsince

    public InputStreamSource getLogcatSince (long date)

    תופס זרם תמונת מצב של נתוני Logcat שנלכדו החל מהתאריך שסופק. יש להשתמש בזמן במכשיר getDeviceDate() .

    פרמטרים
    date long : באלפיות השנייה מאז הפורמט של אפוק של מתי להתחיל את תמונת המצב עד להווה. (ניתן להשיג באמצעות 'תאריך +%s')

    החזרות
    InputStreamSource

    getMacaddress

    public String getMacAddress ()

    מחזיר את כתובת ה- MAC של המכשיר, NULL אם הוא לא מצליח לבצע שאילתה מהמכשיר.

    החזרות
    String

    getMainUserID

    public Integer getMainUserId ()

    מחזיר את מזהה המשתמש הראשי.

    החזרות
    Integer המשתמש של המשתמש הראשי אם יש אחד, וב- NULL אם אין משתמש עיקרי.

    זורק
    DeviceNotAvailableException

    getMainlineModuleInfo

    public  getMainlineModuleInfo ()

    קבל את המידע על מודולי הקו המותקנים במכשיר.

    החזרות
    ERROR(/Set) של מודולי String מערך המחרוזת המותקנים כעת במכשיר.

    זורק
    DeviceNotAvailableException

    getMaxNumberOfrunningUsersSupported

    public int getMaxNumberOfRunningUsersSupported ()

    קבלו את המספר המרבי של המשתמשים המריצים בו זמנית. ברירת מחדל ל 0.

    החזרות
    int מספר שלם המציין את מספר המשתמשים המריצים בו זמנית

    זורק
    DeviceNotAvailableException

    getMaxNumberoFusersSupported

    public int getMaxNumberOfUsersSupported ()

    קבל את המספר המרבי של משתמשים נתמכים. ברירת מחדל ל 0.

    החזרות
    int מספר שלם המציין את מספר המשתמשים הנתמכים

    זורק
    DeviceNotAvailableException

    getMicrodroidProcess

    public Process getMicrodroidProcess ()

    החזרות
    Process מחזיר את תהליך ה- Microdroid VM. אם TestDevice אינו מיקרו -אנד, מחזיר null.

    GetMonitor

    public IDeviceStateMonitor getMonitor ()

    החזיר את ה- IDeviceStateMonitor המשויך למכשיר.

    החזרות
    IDeviceStateMonitor

    getMountPoint

    public String getMountPoint (String mountName)

    מחזיר נקודת הרכבה.

    שואב את המכשיר ישירות אם המידע במטמון ב- IDevice אינו זמין.

    TODO: העבירו התנהגות זו ל- IDevice#getMountPoint(String)

    פרמטרים
    mountName String : שם נקודת ההר

    החזרות
    String נקודת הר או null

    getMountPointInfo

    public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

    מחזיר MountPointInfo המתאים לנתיב נקודת ההרכב שצוין, או null אם הנתיב הזה לא מותקן או אחר אינו מופיע ב- /proc /mounts כנקודת הרכבה.

    פרמטרים
    mountpoint String

    החזרות
    ITestDevice.MountPointInfo ERROR(/List) של MountPointInfo המכילה את המידע ב "/proc/mounts"

    זורק
    DeviceNotAvailableException

    getMountPointInfo

    public  getMountPointInfo ()

    מחזיר גרסה מנותחת של המידע ב- /proc /mounts במכשיר

    החזרות
    ERROR(/List) של MountPointInfo המכילה את המידע ב "/proc/mounts"

    זורק
    DeviceNotAvailableException

    getOptions

    public TestDeviceOptions getOptions ()

    השג את אפשרויות הבדיקה עבור המכשיר.

    החזרות
    TestDeviceOptions TestDeviceOptions הקשורים למכשיר הנבדק.

    getPartitionFreespace

    public long getPartitionFreeSpace (String partition)

    שיטת עוזר לקביעת כמות השטח הפנוי במחיצת המכשירים.

    פרמטרים
    partition String

    החזרות
    long כמות השטח הפנוי ב- KB

    זורק
    DeviceNotAvailableException

    getPrimaryUserID

    public Integer getPrimaryUserId ()

    מחזיר את מזהה המשתמש הראשי.

    החזרות
    Integer המשתמש של המשתמש הראשי אם יש אחד, וב- NULL אם אין משתמש ראשי.

    זורק
    DeviceNotAvailableException

    getProcessbyName

    public ProcessInfo getProcessByName (String processName)

    שיטת Helper מפעילה את הפקודה "PIDOF" ו- "STAT" ומחזירה את האובייקט ProcessInfo עם זמן התחלה של PID ותהליך של התהליך הנתון.

    פרמטרים
    processName String : מחרוזת השם Proces.

    החזרות
    ProcessInfo תהליך של שם תהליך נתון

    זורק
    DeviceNotAvailableException

    getProcessPid

    public String getProcessPid (String process)

    מחזיר את PID של השירות או NULL אם משהו ישתבש.

    פרמטרים
    process String : מחרוזת השם Proces.

    החזרות
    String

    זורק
    DeviceNotAvailableException

    getProductType

    public String getProductType ()

    שיטת נוחות כדי לקבל את סוג המוצר של מכשיר זה.

    שיטה זו תעבוד אם המכשיר נמצא במצב ADB או FastBoot.

    החזרות
    String שם סוג המוצר String . לא יהיה null

    זורק
    DeviceNotAvailableException

    getProductVariant

    public String getProductVariant ()

    שיטת הנוחות כדי לקבל את גרסת המוצר של מכשיר זה.

    שיטה זו תעבוד אם המכשיר נמצא במצב ADB או FastBoot.

    החזרות
    String את שם גרסת המוצר של String או null אם לא ניתן לקבוע אותו

    זורק
    DeviceNotAvailableException

    GetProperty

    public String getProperty (String name)

    אחזר את ערך הנכס הנתון מהמכשיר.

    פרמטרים
    name String : שם המאפיין

    החזרות
    String ערך הנכס או null אם הוא לא קיים

    זורק
    DeviceNotAvailableException

    getRecoveryMode

    public ITestDevice.RecoveryMode getRecoveryMode ()

    קבל את מצב השחזור הנוכחי המשמש למכשיר.

    החזרות
    ITestDevice.RecoveryMode מצב השחזור הנוכחי המשמש למכשיר.

    getCreenShot

    public InputStreamSource getScreenshot (String format)

    תופס צילום מסך מהמכשיר. מומלץ להשתמש getCreenshot (פורמט) במקום עם קידוד JPEG לגודל קטן יותר

    פרמטרים
    format String : PNG נתמך, JPEG

    החזרות
    InputStreamSource InputStreamSource של צילום המסך בפורמט, או null אם צילום המסך לא היה מוצלח.

    זורק
    DeviceNotAvailableException

    getCreenShot

    public InputStreamSource getScreenshot (long displayId)

    תופס צילום מסך מהמכשיר שנתון מזהה תצוגה. הפורמט הוא PNG.

    TODO: הרחב את היישומים שלמעלה כדי לתמוך ב'פורמט 'ו'משתנה'

    פרמטרים
    displayId long : מזהה התצוגה של המסך כדי לקבל צילום מסך ממנו.

    החזרות
    InputStreamSource InputStreamSource של צילום המסך בפורמט, או null אם צילום המסך לא היה מוצלח.

    זורק
    DeviceNotAvailableException

    getCreenShot

    public InputStreamSource getScreenshot (String format, 
                    boolean rescale)

    תופס צילום מסך מהמכשיר. מומלץ להשתמש getScreenshot(String) במקום עם קידוד JPEG לגודל קטן יותר.

    פרמטרים
    format String : PNG נתמך, JPEG

    rescale boolean : אם יש לחדש את צילום המסך כדי להפחית את גודל התמונה המתקבלת

    החזרות
    InputStreamSource InputStreamSource של צילום המסך בפורמט, או null אם צילום המסך לא היה מוצלח.

    זורק
    DeviceNotAvailableException

    getCreenShot

    public InputStreamSource getScreenshot ()

    תופס צילום מסך מהמכשיר.

    החזרות
    InputStreamSource InputStreamSource של צילום המסך בפורמט PNG, או null אם צילום המסך לא היה מוצלח.

    זורק
    DeviceNotAvailableException

    getSerialNumber

    public String getSerialNumber ()

    שיטת הנוחות כדי לקבל מספר סידורי של מכשיר זה.

    החזרות
    String המספר הסידורי String

    GetSetting

    public String getSetting (int userId, 
                    String namespace, 
                    String key)

    החזיר את ערך ההגדרה המבוקשת. מרחב השמות חייב להיות אחד מ: {"מערכת", "מאובטח", "גלובלי"}

    פרמטרים
    userId int

    namespace String

    key String

    החזרות
    String הערך המשויך למרחב השמות: מפתח המשתמש. Null אם לא נמצא.

    זורק
    DeviceNotAvailableException

    GetSetting

    public String getSetting (String namespace, 
                    String key)

    ראה getSetting(int, String, String) ובוצע על ידי משתמש המערכת.

    פרמטרים
    namespace String

    key String

    החזרות
    String

    זורק
    DeviceNotAvailableException

    GetSimoperator

    public String getSimOperator ()

    החזר את מפעיל כרטיס ה- SIM או NULL אם אינו זמין או אם המכשיר אינו זמין.

    החזרות
    String

    GetSimstate

    public String getSimState ()

    החזר את מצב כרטיס ה- SIM או NULL אם אינו זמין או שאינו זמין.

    החזרות
    String

    GetTombstones

    public  getTombstones ()

    השג והחזיר את רשימת המצבות מהמכשירים. דורש שורש.

    השיטה היא המאמץ הטוב ביותר, כך שאם מצבה אחת לא מצליחה להימשך מכל סיבה שהיא היא תהיה חסרה מהרשימה. רק DeviceNotAvailableException יסיים את השיטה מוקדם.

    החזרות
    רשימה של קבצי מצבה, ריקים אם אין מצבה.

    זורק
    DeviceNotAvailableException

    getTotalMemory

    public long getTotalMemory ()

    מחזיר את גודל הזיכרון הפיזי הכולל בבתים או -1 במקרה של שגיאה פנימית

    החזרות
    long

    GetUnInstallablePackagenames

    public  getUninstallablePackageNames ()

    השג את שמות חבילות היישומים שניתן להסיר. זה מוגדר כיום כחבילות שאינן מערכות, וחבילות מערכת מעודכנות.

    החזרות
    ERROR(/Set) של שמות חבילות String שלא ניתן להתקנה המותקנות כעת במכשיר.

    זורק
    DeviceNotAvailableException

    getUseFastBooterase

    public boolean getUseFastbootErase ()

    קבל אם להשתמש בפורמט מחק של FastBoot או FastBoot כדי למחוק מחיצה במכשיר.

    החזרות
    boolean true אם ישתמש במחיקה של FastBoot או false אם ישתמש בפורמט FastBoot.

    getUserFlags

    public int getUserFlags (int userId)

    מצא והחזיר את הדגלים של משתמש נתון. דגלים מוגדרים בכיתה "Android.content.pm.userinfo" בפרויקט קוד פתוח של אנדרואיד.

    פרמטרים
    userId int

    החזרות
    int הדגלים המשויכים ל- UserID סיפקו אם נמצא, -10000 במקרים אחרים.

    זורק
    DeviceNotAvailableException

    getuserinfos

    public  getUserInfos ()

    מקבל את מפת השימוש ל- UserInfo במכשיר. יזרוק DeviceRuntimeException אם הפלט מהמכשיר אינו כצפוי.

    החזרות
    רשימת האובייקטים של userinfo.

    זורק
    DeviceNotAvailableException

    getUserSerialNumber

    public int getUserSerialNumber (int userId)

    החזיר את המספר הסידורי המשויך ל- UserID אם נמצא, -10000 במקרים אחרים.

    פרמטרים
    userId int

    החזרות
    int

    זורק
    DeviceNotAvailableException

    HandlealLocationEvent

    public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

    עבד את המכשיר הנתון. מאי מעבר למצב חדש. יודיע ל- IDeviceMonitor על כל מעברים ממלכתיים.

    עבד את DeviceEvent, שעשוי לעבור או לא להעביר מכשיר זה למצב הקצאה חדש.

    פרמטרים
    event DeviceEvent

    החזרות
    IManagedTestDevice.DeviceEventResponse

    hasfeature

    public boolean hasFeature (String feature)

    בדוק אם תכונה זמינה במכשיר.

    פרמטרים
    feature String : איזה פורמט צריך להיות "תכונה: "או" " באופן ישיר.

    החזרות
    boolean נכון אם תכונה נמצאת, שקרית אחרת.

    זורק
    DeviceNotAvailableException

    packpackage

    public String installPackage (File packageFile, 
                    boolean reinstall, 
                    String... extraArgs)

    התקן חבילת אנדרואיד במכשיר.

    פרמטרים
    packageFile File : קובץ ה- APK להתקנה

    reinstall boolean : true אם יש לבצע התקנה מחדש

    extraArgs String : טיעונים נוספים אופציונליים לעבור. ראה 'ADB Shell PM -H' לקבלת אפשרויות זמינות.

    החזרות
    String String עם קוד שגיאה, או null אם הצלחה.

    זורק
    DeviceNotAvailableException

    packpackage

    public String installPackage (File packageFile, 
                    boolean reinstall, 
                    boolean grantPermissions, 
                    String... extraArgs)

    התקן חבילת אנדרואיד במכשיר.

    הערה: השתמש רק במקרים הדורשים שליטה מפורשת על מתן אישור זמן ריצה בזמן ההתקנה אמור להתקשר לפונקציה זו.

    פרמטרים
    packageFile File : קובץ ה- APK להתקנה

    reinstall boolean : true אם יש לבצע התקנה מחדש

    grantPermissions boolean : אם יש להעניק כל הרשאות זמן ריצה בזמן ההתקנה

    extraArgs String : טיעונים נוספים אופציונליים לעבור. ראה 'ADB Shell PM -H' לקבלת אפשרויות זמינות.

    החזרות
    String String עם קוד שגיאה, או null אם הצלחה.

    זורק
    DeviceNotAvailableException

    installpackageForuser

    public String installPackageForUser (File packageFile, 
                    boolean reinstall, 
                    int userId, 
                    String... extraArgs)

    התקן חבילת אנדרואיד במכשיר למשתמש נתון.

    פרמטרים
    packageFile File : קובץ ה- APK להתקנה

    reinstall boolean : true אם יש לבצע התקנה מחדש

    userId int : מזהה המשתמש שלם שלם להתקנה עבורו.

    extraArgs String : טיעונים נוספים אופציונליים לעבור. ראה 'ADB Shell PM -H' לקבלת אפשרויות זמינות.

    החזרות
    String String עם קוד שגיאה, או null אם הצלחה.

    זורק
    DeviceNotAvailableException

    installpackageForuser

    public String installPackageForUser (File packageFile, 
                    boolean reinstall, 
                    boolean grantPermissions, 
                    int userId, 
                    String... extraArgs)

    התקן חבילת אנדרואיד במכשיר למשתמש נתון.

    הערה: השתמש רק במקרים הדורשים שליטה מפורשת על מתן אישור זמן ריצה בזמן ההתקנה אמור להתקשר לפונקציה זו.

    פרמטרים
    packageFile File : קובץ ה- APK להתקנה

    reinstall boolean : true אם יש לבצע התקנה מחדש

    grantPermissions boolean : אם יש להעניק כל הרשאות זמן ריצה בזמן ההתקנה

    userId int : מזהה המשתמש שלם שלם להתקנה עבורו.

    extraArgs String : טיעונים נוספים אופציונליים לעבור. ראה 'ADB Shell PM -H' לקבלת אפשרויות זמינות.

    החזרות
    String String עם קוד שגיאה, או null אם הצלחה.

    זורק
    DeviceNotAvailableException

    InvalidatePropertyCache

    public void invalidatePropertyCache ()

    ISADBROOT

    public boolean isAdbRoot ()

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    ISADBTCP

    public boolean isAdbTcp ()

    החזרות
    boolean

    ISAPPENUMERATIONS נתמך

    public boolean isAppEnumerationSupported ()

    בדוק אם פלטפורמה במכשיר תומכת במינוי אפליקציות

    החזרות
    boolean נכון אם ספירה של אפליקציות נתמכת, שקרית אחרת

    זורק
    DeviceNotAvailableException

    isbypasslowtargetsdkblocksupported

    public boolean isBypassLowTargetSdkBlockSupported ()

    בדוק אם הפלטפורמה במכשיר תומכת בעקוף חסימת SDK יעד נמוך בהתקנות האפליקציות

    החזרות
    boolean נכון אם עוקף חסימת SDK יעד נמוך, שקר אחרת

    זורק
    DeviceNotAvailableException

    isdebugfsmounted

    public boolean isDebugfsMounted ()

    בדוק אם Debugfs מותקן.

    החזרות
    boolean true אם Debugfs מורכב

    זורק
    DeviceNotAvailableException

    isdeviceencrypted

    public boolean isDeviceEncrypted ()

    חוזר אם המכשיר מוצפן.

    החזרות
    boolean true אם המכשיר מוצפן.

    זורק
    DeviceNotAvailableException

    ISDIREPTORY

    public boolean isDirectory (String path)

    חזור נכון אם הנתיב במכשיר הוא ספרייה, שקרית אחרת.

    פרמטרים
    path String

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    isenableAdbroot

    public boolean isEnableAdbRoot ()

    החזרות
    boolean true אם יש להפעיל שורש ADB במכשיר

    isencryptionsupport

    public boolean isEncryptionSupported ()

    מחזיר אם הצפנה נתמכת במכשיר.

    החזרות
    boolean true אם המכשיר תומך בהצפנה.

    זורק
    DeviceNotAvailableException

    ניתן להבחין

    public boolean isExecutable (String fullPath)

    חוזר נכון אם נתיב הקובץ במכשיר הוא קובץ הפעלה, לא נכון.

    פרמטרים
    fullPath String

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    ISFastBootenabled

    public boolean isFastbootEnabled ()

    חזור אם FastBoot זמין עבור המכשיר.

    החזרות
    boolean

    חסר ראש

    public boolean isHeadless ()

    חזור נכון אם המכשיר חסר ראש (ללא מסך), לא נכון.

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    IsheadlessSystemUserMode

    public boolean isHeadlessSystemUserMode ()

    מחזיר אם המכשיר משתמש במצב משתמש ללא ראש.

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    ismainuserpermanentadmin

    public boolean isMainUserPermanentAdmin ()

    מחזיר בין אם המשתמש הראשי הוא מנהל קבוע ולא ניתן למחוק אותו או לא לשדרג אותו למצב שאינו ADMIN.

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    Ismultiusersupported

    public boolean isMultiUserSupported ()

    קובע אם מרובי משתמש נתמך.

    החזרות
    boolean נכון אם מרובי משתמש נתמך, כוזב אחרת

    זורק
    DeviceNotAvailableException

    ispackageinstainted

    public boolean isPackageInstalled (String packageName, 
                    String userId)

    שאילתה את המכשיר לשם חבילה נתון ומזהה משתמש נתון כדי לבדוק אם הוא מותקן כרגע או לא עבור אותו משתמש.

    פרמטרים
    packageName String : החבילה שאנו בודקים אם היא מותקנת.

    userId String : מזהה המשתמש שאנו בודקים את החבילה מותקן עבורו. אם NULL, ישמש אפס משתמש ראשי.

    החזרות
    boolean נכון אם החבילה מדווחת כמותקנת. שקר אחרת.

    זורק
    DeviceNotAvailableException

    ispackageinstainted

    public boolean isPackageInstalled (String packageName)

    שאילתה את המכשיר לשם חבילה נתון כדי לבדוק אם הוא מותקן כרגע או לא.

    פרמטרים
    packageName String

    החזרות
    boolean נכון אם החבילה מדווחת כמותקנת. שקר אחרת.

    זורק
    DeviceNotAvailableException

    ISRUNTIMEPERMISSISSUPERIDED

    public boolean isRuntimePermissionSupported ()

    בדוק אם פלטפורמה במכשיר תומכת בהיתר זמן ריצה

    החזרות
    boolean נכון אם נתמכים הרשאת זמן ריצה, שקרית אחרת.

    זורק
    DeviceNotAvailableException

    isstateBootloaderorFastBootd

    public boolean isStateBootloaderOrFastbootd ()

    מחזיר נכון אם המכשיר נמצא ב- TestDeviceState#FASTBOOT או TestDeviceState.FASTBOOTD .

    החזרות
    boolean

    isuserrunning

    public boolean isUserRunning (int userId)

    בדוק אם משתמש נתון פועל.

    פרמטרים
    userId int

    החזרות
    boolean נכון אם המשתמש פועל, שקר בכל מקרים אחרים.

    זורק
    DeviceNotAvailableException

    isusersecondary

    public boolean isUserSecondary (int userId)

    חזור בין אם המשתמש שצוין הוא משתמש משני על פי דגליו.

    פרמטרים
    userId int

    החזרות
    boolean נכון אם המשתמש משני, לא נכון אחרת.

    זורק
    DeviceNotAvailableException

    isuservis

    public boolean isUserVisible (int userId)

    בודק אם המשתמש הנתון גלוי.

    משתמש "גלוי" הוא משתמש שמתקשר עם המשתמש "האנושי" ומכאן שהוא מסוגל להפעיל פעילויות השקה (בדרך כלל בתצוגת ברירת המחדל).

    פרמטרים
    userId int

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    isuservisebleondisplay

    public boolean isUserVisibleOnDisplay (int userId, 
                    int displayId)

    בודק אם המשתמש הנתון גלוי בתצוגה הנתונה.

    משתמש "גלוי" הוא משתמש שמתקשר עם המשתמש "האנושי" ומכאן שהוא מסוגל להפעיל פעילויות השקה בתצוגה זו.

    פרמטרים
    userId int

    displayId int

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    isvisibleBackgroundersersondefaultDisplays נתמכת

    public boolean isVisibleBackgroundUsersOnDefaultDisplaySupported ()

    מחזיר אם המכשיר מאפשר להתחיל למשתמשים גלוי ברקע ERROR(/java.android.view.Display#DEFAULT_DISPLAY) .

    אם כן, תוכל להתקשר startVisibleBackgroundUser(int, int, boolean) , להעביר תצוגה שהוחזרה על ידי listDisplayIdsForStartingVisibleBackgroundUsers() (שצריכה לכלול ERROR(/java.android.view.Display#DEFAULT_DISPLAY) ).

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    isvisibleBackgroundersssupported

    public boolean isVisibleBackgroundUsersSupported ()

    מחזיר אם המכשיר מאפשר להתחיל למשתמשים גלוי ברקע.

    אם כן, תוכל להתקשר startVisibleBackgroundUser(int, int, boolean) , להעביר תצוגה שהוחזרה על ידי listDisplayIdsForStartingVisibleBackgroundUsers() .

    החזרות
    boolean

    זורק
    DeviceNotAvailableException

    iswifienabled

    public boolean isWifiEnabled ()

    בדוק אם WiFi מופעל.

    בודק אם WiFi מופעל במכשיר. שימושי להטענת סטטוס WiFi לפני בדיקות שלא אמורים לפעול עם WiFi, למשל בדיקות נתונים ניידים.

    החזרות
    boolean true אם WiFi מופעל. false אם מושבת

    זורק
    DeviceNotAvailableException

    ListDisplayids

    public  listDisplayIds ()

    אסוף את רשימת המזהה המוצג הזמין במכשיר כפי שדווח על ידי "Dumpsys SurfaceFlinger".

    החזרות
    רשימת התצוגות. ברירת המחדל מחזירה תמיד את תצוגת ברירת המחדל 0.

    זורק
    DeviceNotAvailableException

    ListDisplayidsforStartingVisibleBackgrounders

    public  listDisplayIdsForStartingVisibleBackgroundUsers ()

    מקבל את רשימת התצוגות שניתן להשתמש בהן כדי start a user visible in the background .

    החזרות

    זורק
    DeviceNotAvailableException

    רושמים

    public  listUsers ()

    מקבל את רשימת המשתמשים במכשיר. יזרוק DeviceRuntimeException אם הפלט מהמכשיר אינו כצפוי.

    החזרות
    רשימת מזהי המשתמש.

    זורק
    DeviceNotAvailableException

    Loganrs

    public boolean logAnrs (ITestLogger logger)

    אוסף ויומן ANR מהמכשיר.

    פרמטרים
    logger ITestLogger : ITestLogger לרישום ה- ANRS.

    החזרות
    boolean נכון אם הרישום היה מוצלח, לא נכון אחרת.

    זורק
    DeviceNotAvailableException

    LogbugReport

    public boolean logBugreport (String dataName, 
                    ITestLogger listener)

    שיטת עוזר לקחת דו"ח BUGREPORT ולהתחבר לעיתונאים.

    פרמטרים
    dataName String : שם שמתחתיו ידווח דורו של BugrePort.

    listener ITestLogger : ITestLogger לרישום דופק BUGREPORT.

    החזרות
    boolean נכון אם הרישום היה מוצלח, לא נכון אחרת.

    Logondevice

    public void logOnDevice (String tag, 
                    Log.LogLevel level, 
                    String format, 
                    Object... args)

    רשום הודעה ב- Logcat של המכשיר. זוהי קריאה בטוחה שלא תזרוק גם אם הרישום נכשל.

    פרמטרים
    tag String : התג שמתחתיו אנו רושמים את ההודעה שלנו ב- Logcat.

    level Log.LogLevel : רמת הבאגים של ההודעה ב- Logcat.

    format String : פורמט ההודעה.

    args Object : הארגונים שיוחלפו באמצעות string.format ().

    mountDebugfs

    public void mountDebugfs ()

    הר באגים.

    זורק
    DeviceNotAvailableException

    NonblockingRoot

    public void nonBlockingReboot ()

    מנפיקה פקודה לאתחל מחדש את המכשיר וחוזרת על הפקודה השלמה וכאשר המכשיר כבר לא נראה ל- ADB.

    זורק
    DeviceNotAvailableException

    PostAdbrootaction

    public void postAdbRootAction ()

    עקוף אם המכשיר זקוק לנקוט בפעולות ספציפיות לאחר שורש ADB ולפני שהמכשיר יחזור לרשת. יישום ברירת מחדל אינו כולל פעולות תוספת. שורש ADB אינו מובטח להפעיל בשלב זה.

    זורק
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    PostAdBunRootaction

    public void postAdbUnrootAction ()

    עוקף אם המכשיר זקוק לנקוט בפעולות ספציפיות לאחר ADB UNROOT ולפני שהמכשיר יחזור לרשת. יישום ברירת מחדל אינו כולל פעולות נוספות. שורש ADB אינו מובטח להיות מושבת בשלב זה.

    זורק
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    PostBootsetup

    public void postBootSetup ()

    בצע הוראות להגדרת מכשיר לבדיקה שאחרי כל מגף.

    צריך לקרוא לאחר שהתקן אתחול/זמין במלואו

    בנסיבות רגילות שיטה זו אינה צריכה להיקרא במפורש, מכיוון שהיישומים צריכים לבצע צעדים אלה באופן אוטומטי בעת ביצוע אתחול מחדש.

    היכן שייתכן שיהיה צורך לקרוא לו הוא כאשר התפרצות מחדש של מכשירים בגלל אירועים אחרים (למשל כאשר הפקודה עדכון FastBoot הושלמה)

    זורק
    DeviceNotAvailableException

    PostInvocationTeardown

    public void postInvocationTearDown (Throwable exception)

    שלבים נוספים לניקוי נדרש ספציפי למכשירים שיבוצעו לאחר סיום הפתיחה.

    פרמטרים
    exception Throwable : אם בכלל, החריג הסופי שהועלה על ידי כישלון הפתיחה.

    preinvocationsetup

    public void preInvocationSetup (IBuildInfo info, 
                    MultiMap<String, String> attributes)

    שלבים נוספים עבור התקנים ספציפיים להגדרה שנדרשת שתבוצע במכשיר לפני זרימת הפתיחה.

    פרמטרים
    info IBuildInfo : IBuildInfo של המכשיר.

    attributes MultiMap : התכונות המאוחסנות בהקשר של הפתיחה

    זורק
    DeviceNotAvailableException
    TargetSetupError

    Pulldir

    public boolean pullDir (String deviceFilePath, 
                    File localDir)

    משוך רקורסיבית תוכן ספרייה מהמכשיר.

    פרמטרים
    deviceFilePath String : נתיב הקובץ המוחלט של המקור המרוחק

    localDir File : הספרייה המקומית כדי למשוך קבצים

    החזרות
    boolean true אם הקובץ נמשך בהצלחה. false אחרת.

    זורק
    DeviceNotAvailableException

    Pullfile

    public boolean pullFile (String remoteFilePath, 
                    File localFile)

    מאחזר מכשיר קובץ OFF.

    פרמטרים
    remoteFilePath String : הנתיב המוחלט לקובץ במכשיר.

    localFile File : the local file to store contents in. If non-empty, contents will be replaced.

    החזרות
    boolean true if file was retrieved successfully. false otherwise.

    Throws
    DeviceNotAvailableException

    pullFile

    public File pullFile (String remoteFilePath, 
                    int userId)

    Retrieves a file off device, stores it in a local temporary ERROR(/File) , and returns that File .

    פרמטרים
    remoteFilePath String : the absolute path to file on device.

    userId int : The user id to pull from

    החזרות
    File A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem)

    Throws
    DeviceNotAvailableException

    pullFile

    public File pullFile (String remoteFilePath)

    Retrieves a file off device, stores it in a local temporary ERROR(/File) , and returns that File .

    פרמטרים
    remoteFilePath String : the absolute path to file on device.

    החזרות
    File A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem)

    Throws
    DeviceNotAvailableException

    pullFile

    public boolean pullFile (String remoteFilePath, 
                    File localFile, 
                    int userId)

    Retrieves a file off device.

    פרמטרים
    remoteFilePath String : the absolute path to file on device.

    localFile File : the local file to store contents in. If non-empty, contents will be replaced.

    userId int : The user id to pull from

    החזרות
    boolean true if file was retrieved successfully. false otherwise.

    Throws
    DeviceNotAvailableException

    pullFileContents

    public String pullFileContents (String remoteFilePath)

    Retrieves a file off device, and returns the contents.

    פרמטרים
    remoteFilePath String : the absolute path to file on device.

    החזרות
    String A String containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem)

    Throws
    DeviceNotAvailableException

    pullFileFromExternal

    public File pullFileFromExternal (String remoteFilePath)

    A convenience method to retrieve a file from the device's external storage, stores it in a local temporary ERROR(/File) , and return a reference to that File .

    פרמטרים
    remoteFilePath String : the path to file on device, relative to the device's external storage mountpoint

    החזרות
    File A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem)

    Throws
    DeviceNotAvailableException

    pushDir

    public boolean pushDir (File localFileDir, 
                    String deviceFilePath, 
                     excludedDirectories)

    Recursively push directory contents to device while excluding some directories that are filtered.

    פרמטרים
    localFileDir File : the local directory to push

    deviceFilePath String : the absolute file path of the remote destination

    excludedDirectories : Set of excluded directories names that shouldn't be pushed.

    החזרות
    boolean true if file was pushed successfully. false otherwise.

    Throws
    DeviceNotAvailableException

    pushDir

    public boolean pushDir (File localFileDir, 
                    String deviceFilePath)

    Recursively push directory contents to device.

    פרמטרים
    localFileDir File : the local directory to push

    deviceFilePath String : the absolute file path of the remote destination

    החזרות
    boolean true if file was pushed successfully. false otherwise.

    Throws
    DeviceNotAvailableException

    pushFile

    public boolean pushFile (File localFile, 
                    String remoteFilePath, 
                    boolean evaluateContentProviderNeeded)

    Variant of pushFile(File, String) which can optionally consider evaluating the need for the content provider.

    פרמטרים
    localFile File : the local file to push

    remoteFilePath String : the remote destination absolute file path

    evaluateContentProviderNeeded boolean : whether to check if we need the content provider

    החזרות
    boolean true if file was pushed successfully. false otherwise.

    Throws
    DeviceNotAvailableException

    pushFile

    public boolean pushFile (File localFile, 
                    String remoteFilePath)

    Push a file to device. By default using a content provider.

    פרמטרים
    localFile File : the local file to push

    remoteFilePath String : the remote destination absolute file path

    החזרות
    boolean true if file was pushed successfully. false otherwise.

    Throws
    DeviceNotAvailableException

    pushString

    public boolean pushString (String contents, 
                    String remoteFilePath)

    Push file created from a string to device

    פרמטרים
    contents String : the contents of the file to push

    remoteFilePath String : the remote destination absolute file path

    החזרות
    boolean true if string was pushed successfully. false otherwise.

    Throws
    DeviceNotAvailableException

    לְאַתחֵל

    public void reboot (String reason)

    Reboots the device into adb mode with given reason to be persisted across reboot.

    Blocks until device becomes available.

    Last reboot reason can be obtained by querying sys.boot.reason propety.

    פרמטרים
    reason String : a reason for this reboot, or null if no reason is specified.

    Throws
    DeviceNotAvailableException

    לְאַתחֵל

    public void reboot ()

    Reboots the device into adb mode.

    Blocks until device becomes available.

    זורק
    DeviceNotAvailableException

    rebootIntoBootloader

    public void rebootIntoBootloader ()

    Reboots the device into bootloader mode.

    Blocks until device is in bootloader mode.

    Throws
    DeviceNotAvailableException

    rebootIntoFastbootd

    public void rebootIntoFastbootd ()

    Reboots the device into fastbootd mode.

    Blocks until device is in fastbootd mode.

    Throws
    DeviceNotAvailableException

    rebootIntoRecovery

    public void rebootIntoRecovery ()

    Reboots the device into adb recovery mode.

    Blocks until device enters recovery

    Throws
    DeviceNotAvailableException

    rebootIntoSideload

    public void rebootIntoSideload ()

    Reboots the device into adb sideload mode (note that this is a special mode under recovery)

    Blocks until device enters sideload mode

    Throws
    DeviceNotAvailableException

    rebootIntoSideload

    public void rebootIntoSideload (boolean autoReboot)

    Reboots the device into adb sideload mode (note that this is a special mode under recovery)

    Blocks until device enters sideload mode

    פרמטרים
    autoReboot boolean : whether to automatically reboot the device after sideload

    זורק
    DeviceNotAvailableException

    rebootUntilOnline

    public void rebootUntilOnline ()

    An alternate to reboot() that only blocks until device is online ie visible to adb.

    Throws
    DeviceNotAvailableException

    rebootUntilOnline

    public void rebootUntilOnline (String reason)

    An alternate to reboot() that only blocks until device is online ie visible to adb.

    פרמטרים
    reason String : a reason for this reboot, or null if no reason is specified.

    Throws
    DeviceNotAvailableException

    rebootUserspace

    public void rebootUserspace ()

    Reboots only userspace part of device.

    Blocks until device becomes available.

    אַזהָרָה. Userspace reboot is currently under active development, use it on your own risk.

    Throws
    DeviceNotAvailableException

    rebootUserspaceUntilOnline

    public void rebootUserspaceUntilOnline ()

    An alternate to rebootUserspace() ()} that only blocks until device is online ie visible to adb.

    Throws
    DeviceNotAvailableException

    recoverDevice

    public boolean recoverDevice ()

    Attempts to recover device communication.

    החזרות
    boolean True if recovery attempted and successful, returns False if recovery was skipped

    Throws
    DeviceNotAvailableException if device is no longer available

    registerDeviceActionReceiver

    public void registerDeviceActionReceiver (IDeviceActionReceiver deviceActionReceiver)

    Registers a IDeviceActionReceiver for this device.

    All registered IDeviceActionReceiver s will be notified before a device action starts and after the device action ends.

    פרמטרים
    deviceActionReceiver IDeviceActionReceiver : A IDeviceActionReceiver which will be registered.

    remountSystemReadOnly

    public void remountSystemReadOnly ()

    Make the system partition on the device read-only. May reboot the device.

    Throws
    DeviceNotAvailableException

    remountSystemWritable

    public void remountSystemWritable ()

    Make the system partition on the device writable. May reboot the device.

    Throws
    DeviceNotAvailableException

    remountVendorReadOnly

    public void remountVendorReadOnly ()

    Make the vendor partition on the device read-only. May reboot the device.

    Throws
    DeviceNotAvailableException

    remountVendorWritable

    public void remountVendorWritable ()

    Make the vendor partition on the device writable. May reboot the device.

    Throws
    DeviceNotAvailableException

    removeAdmin

    public boolean removeAdmin (String componentName, 
                    int userId)

    Remove given device admin in given user and return true if it is successful, false otherwise.

    פרמטרים
    componentName String : of device admin to be removed.

    userId int : of user that the device admin lives in.

    החזרות
    boolean True if it is successful, false otherwise.

    זורק
    DeviceNotAvailableException

    removeOwners

    public void removeOwners ()

    Remove all existing device profile owners with the best effort.

    Throws
    DeviceNotAvailableException

    removeUser

    public boolean removeUser (int userId)

    Remove a given user from the device.

    פרמטרים
    userId int : of the user to remove

    החזרות
    boolean true if we were successful in removing the user, false otherwise.

    Throws
    DeviceNotAvailableException

    resetContentProviderSetup

    public void resetContentProviderSetup ()

    Reset the flag for content provider setup in order to trigger it again.

    runInstrumentationTests

    public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                    ITestLifeCycleReceiver... listeners)

    Convenience method for performing ERROR(/#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection)) with one or more listeners passed as parameters.

    פרמטרים
    runner IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests

    listeners ITestLifeCycleReceiver : the test result listener(s)

    החזרות
    boolean true if test command completed. false if it failed to complete, but recovery succeeded

    Throws
    DeviceNotAvailableException

    runInstrumentationTests

    public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                     listeners)

    Runs instrumentation tests, and provides device recovery.

    If connection with device is lost before test run completes, and recovery succeeds, all listeners will be informed of testRunFailed and "false" will be returned. The test command will not be rerun. It is left to callers to retry if necessary.

    If connection with device is lost before test run completes, and recovery fails, all listeners will be informed of testRunFailed and DeviceNotAvailableException will be thrown.

    פרמטרים
    runner IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests

    listeners : the test result listeners

    החזרות
    boolean true if test command completed. false if it failed to complete due to device communication exception, but recovery succeeded

    Throws
    DeviceNotAvailableException

    runInstrumentationTestsAsUser

    public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                    int userId, 
                     listeners)

    Same as ERROR(ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)/com.android.tradefed.device.ITestDevice#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection) ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)) but runs the test for the given user.

    פרמטרים
    runner IRemoteAndroidTestRunner

    userId int

    listeners

    החזרות
    boolean

    Throws
    DeviceNotAvailableException

    runInstrumentationTestsAsUser

    public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                    int userId, 
                    ITestLifeCycleReceiver... listeners)

    Same as ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, ITestLifeCycleReceiver...) but runs the test for a given user.

    פרמטרים
    runner IRemoteAndroidTestRunner

    userId int

    listeners ITestLifeCycleReceiver

    החזרות
    boolean

    Throws
    DeviceNotAvailableException

    setConfiguration

    public void setConfiguration (IConfiguration configuration)

    מזריק את IConfiguration בשימוש.

    פרמטרים
    configuration IConfiguration

    setConnectionAvdInfo

    public final void setConnectionAvdInfo (GceAvdInfo avdInfo)

    פרמטרים
    avdInfo GceAvdInfo

    קבע תאריך

    public void setDate (Date date)

    Sets the date on device

    Note: setting date on device requires root

    פרמטרים
    date Date : specify a particular date; will use host date if null

    Throws
    DeviceNotAvailableException

    setDeviceOwner

    public boolean setDeviceOwner (String componentName, 
                    int userId)

    Set a device admin component as device owner in given user.

    פרמטרים
    componentName String : of device admin to be device owner.

    userId int : of the user that the device owner lives in.

    החזרות
    boolean True if it is successful, false otherwise.

    Throws
    DeviceNotAvailableException

    setDeviceState

    public void setDeviceState (TestDeviceState deviceState)

    Update the device's state.

    פרמטרים
    deviceState TestDeviceState : the TestDeviceState

    setEmulatorOutputStream

    public void setEmulatorOutputStream (SizeLimitedOutputStream output)

    For emulator set SizeLimitedOutputStream to log output

    פרמטרים
    output SizeLimitedOutputStream : to log the output

    setEmulatorProcess

    public void setEmulatorProcess (Process p)

    Sets the Process , when this device is an emulator.

    פרמטרים
    p Process

    setFastbootEnabled

    public void setFastbootEnabled (boolean fastbootEnabled)

    Set the fastboot option for the device. Should be set when device is first allocated.

    פרמטרים
    fastbootEnabled boolean : whether fastboot is available for the device or not

    setFastbootPath

    public void setFastbootPath (String fastbootPath)

    Sets the path to the fastboot binary that should be used. Still requires isFastbootEnabled() to be true, to have fastboot functions enabled.

    פרמטרים
    fastbootPath String

    setIDevice

    public void setIDevice (IDevice newDevice)

    Update the IDevice associated with this ITestDevice.

    The new IDevice must refer the same physical device as the current reference. This method will be called if DDMS has allocated a new IDevice

    פרמטרים
    newDevice IDevice : the IDevice

    setLogStartDelay

    public void setLogStartDelay (int delay)

    Sets the time in ms to wait before starting logcat capture for a online device.

    פרמטרים
    delay int : the delay in ms

    setOptions

    public void setOptions (TestDeviceOptions options)

    Set the TestDeviceOptions for the device

    פרמטרים
    options TestDeviceOptions

    setProperty

    public boolean setProperty (String propKey, 
                    String propValue)

    Sets the given property value on the device. Requires adb root is true.

    פרמטרים
    propKey String : The key targeted to be set.

    propValue String : The property value to be set.

    החזרות
    boolean returns True if the setprop command was successful, False otherwise.

    Throws
    DeviceNotAvailableException

    setRecovery

    public void setRecovery (IDeviceRecovery recovery)

    Set the IDeviceRecovery to use for this device. Should be set when device is first allocated.

    פרמטרים
    recovery IDeviceRecovery : the IDeviceRecovery

    setRecoveryMode

    public void setRecoveryMode (ITestDevice.RecoveryMode mode)

    Set the current recovery mode to use for the device.

    Used to control what recovery method to use when a device communication problem is encountered. Its recommended to only use this method sparingly when needed (for example, when framework is down, etc

    פרמטרים
    mode ITestDevice.RecoveryMode : whether 'recover till online only' mode should be on or not.

    setSetting

    public void setSetting (String namespace, 
                    String key, 
                    String value)

    See setSetting(int, String, String, String) and performed on system user.

    פרמטרים
    namespace String

    key String

    value String

    Throws
    DeviceNotAvailableException

    setSetting

    public void setSetting (int userId, 
                    String namespace, 
                    String key, 
                    String value)

    Add a setting value to the namespace of a given user. Some settings will only be available after a reboot. namespace must be one of: {"system", "secure", "global"}

    פרמטרים
    userId int

    namespace String

    key String

    value String

    Throws
    DeviceNotAvailableException

    setTestLogger

    public void setTestLogger (ITestLogger testLogger)

    מזריק את המופע ITestLogger

    פרמטרים
    testLogger ITestLogger

    setUseFastbootErase

    public void setUseFastbootErase (boolean useFastbootErase)

    Set whether to use fastboot erase or fastboot format to wipe a partition on the device.

    פרמטרים
    useFastbootErase boolean : true if fastboot erase should be used or false if fastboot format should be used.

    startLogcat

    public void startLogcat ()

    Start capturing logcat output from device in the background.

    Will have no effect if logcat output is already being captured. Data can be later retrieved via getLogcat.

    When the device is no longer in use, stopLogcat() must be called.

    startLogcat() and stopLogcat() do not normally need to be called when within a TF invocation context, as the TF framework will start and stop logcat.

    startUser

    public boolean startUser (int userId)

    Starts a given user in the background if it is currently stopped. If the user is already running in the background, this method is a NOOP.

    פרמטרים
    userId int : of the user to start in the background

    החזרות
    boolean true if the user was successfully started in the background.

    Throws
    DeviceNotAvailableException

    startUser

    public boolean startUser (int userId, 
                    boolean waitFlag)

    Starts a given user in the background if it is currently stopped. If the user is already running in the background, this method is a NOOP. Possible to provide extra flag to wait for the operation to have effect.

    פרמטרים
    userId int : of the user to start in the background

    waitFlag boolean : will make the command wait until user is started and unlocked.

    החזרות
    boolean true if the user was successfully started in the background.

    Throws
    DeviceNotAvailableException

    startVisibleBackgroundUser

    public boolean startVisibleBackgroundUser (int userId, 
                    int displayId, 
                    boolean waitFlag)

    Starts a given user in the background, visible in the given display (ie, allowing the user to launch activities in that display).

    NOTE: this command doesn't check if the user exists, display is available, device supports such feature , etc.

    פרמטרים
    userId int : of the user to start in the background

    displayId int : display to start user visible on

    waitFlag boolean : will make the command wait until user is started and unlocked.

    החזרות
    boolean true if the user was successfully started visible in the background.

    Throws
    DeviceNotAvailableException

    stopEmulatorOutput

    public void stopEmulatorOutput ()

    Close and delete the emulator output.

    stopLogcat

    public void stopLogcat ()

    Stop capturing logcat output from device, and discard currently saved logcat data.

    Will have no effect if logcat output is not being captured.

    stopUser

    public boolean stopUser (int userId)

    Stops a given user. If the user is already stopped, this method is a NOOP. Cannot stop current and system user.

    פרמטרים
    userId int : of the user to stop.

    החזרות
    boolean true if the user was successfully stopped.

    Throws
    DeviceNotAvailableException

    stopUser

    public boolean stopUser (int userId, 
                    boolean waitFlag, 
                    boolean forceFlag)

    Stop a given user. Possible to provide extra flags to wait for the operation to have effect, and force terminate the user. Cannot stop current and system user.

    פרמטרים
    userId int : of the user to stop.

    waitFlag boolean : will make the command wait until user is stopped.

    forceFlag boolean : will force stop the user.

    החזרות
    boolean true if the user was successfully stopped.

    Throws
    DeviceNotAvailableException

    switchToAdbTcp

    public String switchToAdbTcp ()

    Switch device to adb-over-tcp mode.

    החזרות
    String the tcp serial number or null if device could not be switched

    Throws
    DeviceNotAvailableException

    switchToAdbUsb

    public boolean switchToAdbUsb ()

    Switch device to adb over usb mode.

    החזרות
    boolean true if switch was successful, false otherwise.

    Throws
    DeviceNotAvailableException

    החלף משתמש

    public boolean switchUser (int userId)

    Switch to another userId with a default timeout. switchUser(int, long) .

    פרמטרים
    userId int

    החזרות
    boolean True if the new userId matches the userId provider. שקר אחרת.

    Throws
    DeviceNotAvailableException

    החלף משתמש

    public boolean switchUser (int userId, 
                    long timeout)

    Switch to another userId with the provided timeout as deadline. Attempt to disable keyguard after user change is successful.

    פרמטרים
    userId int

    timeout long : to wait before returning false for switch-user failed.

    החזרות
    boolean True if the new userId matches the userId provider. שקר אחרת.

    Throws
    DeviceNotAvailableException

    syncFiles

    public boolean syncFiles (File localFileDir, 
                    String deviceFilePath)

    Incrementally syncs the contents of a local file directory to device.

    Decides which files to push by comparing timestamps of local files with their remote equivalents. Only 'newer' or non-existent files will be pushed to device. Thus overhead should be relatively small if file set on device is already up to date.

    Hidden files (with names starting with ".") will be ignored.

    Example usage: syncFiles("/tmp/files", "/sdcard") will created a /sdcard/files directory if it doesn't already exist, and recursively push the /tmp/files contents to /sdcard/files.

    פרמטרים
    localFileDir File : the local file directory containing files to recursively push.

    deviceFilePath String : the remote destination absolute file path root. All directories in thos file path must be readable. ie pushing to /data/local/tmp when adb is not root will fail

    החזרות
    boolean true if files were synced successfully. false otherwise.

    Throws
    DeviceNotAvailableException

    takeBugreport

    public Bugreport takeBugreport ()

    Take a bugreport and returns it inside a Bugreport object to handle it. Return null in case of issue. File referenced in the Bugreport object need to be cleaned via Bugreport.close() .

    החזרות
    Bugreport

    uninstallPackage

    public String uninstallPackage (String packageName)

    Uninstall an Android package from device.

    פרמטרים
    packageName String : the Android package to uninstall

    החזרות
    String a String with an error code, or null if success.

    Throws
    DeviceNotAvailableException

    uninstallPackageForUser

    public String uninstallPackageForUser (String packageName, 
                    int userId)

    Uninstall an Android package from device for a given user.

    פרמטרים
    packageName String : the Android package to uninstall

    userId int : the integer user id to uninstall for.

    החזרות
    String a String with an error code, or null if success.

    Throws
    DeviceNotAvailableException

    unlockDevice

    public boolean unlockDevice ()

    Unlocks the device if the device is in an encrypted state.

    This method may restart the framework but will not call postBootSetup() . Therefore, the device might not be fully ready to be tested when this method returns.

    החזרות
    boolean true if successful or if the device is unencrypted.

    Throws
    DeviceNotAvailableException

    unmountDebugfs

    public void unmountDebugfs ()

    Unmount debugfs.

    Throws
    DeviceNotAvailableException

    waitForBootComplete

    public boolean waitForBootComplete (long timeOut)

    Blocks until the device's boot complete flag is set.

    פרמטרים
    timeOut long : time in msecs to wait for the flag to be set

    החזרות
    boolean true if device's boot complete flag is set within the timeout

    Throws
    DeviceNotAvailableException

    waitForDeviceAvailable

    public boolean waitForDeviceAvailable ()

    Waits for the device to be responsive and available for testing. Uses default timeout.

    החזרות
    boolean True if device is available, False if recovery is disabled and unavailable.

    Throws
    DeviceNotAvailableException

    waitForDeviceAvailable

    public boolean waitForDeviceAvailable (long waitTime)

    Waits for the device to be responsive and available for testing.

    פרמטרים
    waitTime long : the time in ms to wait

    החזרות
    boolean True if device is available, False if recovery is disabled and unavailable.

    Throws
    DeviceNotAvailableException

    waitForDeviceAvailableInRecoverPath

    public boolean waitForDeviceAvailableInRecoverPath (long waitTime)

    Waits for the device to be responsive and available without considering recovery path.

    פרמטרים
    waitTime long

    החזרות
    boolean True if device is available, False if unavailable.

    Throws
    DeviceNotAvailableException

    waitForDeviceBootloader

    public void waitForDeviceBootloader ()

    Blocks until device is visible via fastboot. Use default timeout.

    זורק
    DeviceNotAvailableException

    waitForDeviceInRecovery

    public boolean waitForDeviceInRecovery (long waitTime)

    Blocks for the device to be in the 'adb recovery' state (note this is distinct from IDeviceRecovery ).

    פרמטרים
    waitTime long : the time in ms to wait

    החזרות
    boolean true if device boots into recovery before time expires. false otherwise

    waitForDeviceInSideload

    public boolean waitForDeviceInSideload (long waitTime)

    Blocks for the device to be in the 'adb sideload' state

    פרמטרים
    waitTime long : the time in ms to wait

    החזרות
    boolean true if device boots into sideload before time expires. false otherwise

    waitForDeviceNotAvailable

    public boolean waitForDeviceNotAvailable (long waitTime)

    Blocks for the device to be not available ie missing from adb

    פרמטרים
    waitTime long : the time in ms to wait

    החזרות
    boolean true if device becomes not available before time expires. false otherwise

    waitForDeviceOnline

    public void waitForDeviceOnline ()

    Blocks until device is visible via adb. Uses default timeout

    Note the device may not necessarily be responsive to commands on completion. Use waitForDeviceAvailable() instead.

    Throws
    DeviceNotAvailableException

    waitForDeviceOnline

    public void waitForDeviceOnline (long waitTime)

    Blocks until device is visible via adb.

    Note the device may not necessarily be responsive to commands on completion. Use waitForDeviceAvailable() instead.

    פרמטרים
    waitTime long : the time in ms to wait

    Throws
    DeviceNotAvailableException

    waitForDeviceShell

    public boolean waitForDeviceShell (long waitTime)

    Waits for device to be responsive to a basic adb shell command.

    פרמטרים
    waitTime long : the time in ms to wait

    החזרות
    boolean true if device becomes responsive before waitTime elapses.

    שיטות מוגנות

    addExtraConnectionBuilderArgs

    protected void addExtraConnectionBuilderArgs (DefaultConnection.ConnectionBuilder builder)

    פרמטרים
    builder DefaultConnection.ConnectionBuilder

    buildAdbShellCommand

    protected String[] buildAdbShellCommand (String command, 
                    boolean forceExitStatusDetection)

    Builds the OS command for the given adb shell command session and args

    פרמטרים
    command String

    forceExitStatusDetection boolean

    החזרות
    String[]

    checkApiLevelAgainst

    protected void checkApiLevelAgainst (String feature, 
                    int strictMinLevel)

    פרמטרים
    feature String

    strictMinLevel int

    createRebootDeviceAction

    protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, 
                    String reason)

    Create a RebootDeviceAction to be used when performing a reboot action.

    פרמטרים
    rebootMode NativeDevice.RebootMode : a mode of this reboot.

    reason String : for this reboot.

    החזרות
    NativeDevice.RebootDeviceAction the created RebootDeviceAction .

    createRunUtil

    protected IRunUtil createRunUtil ()

    החזרות
    IRunUtil

    doAdbReboot

    protected void doAdbReboot (NativeDevice.RebootMode rebootMode, 
                    String reason)

    Perform a adb reboot.

    פרמטרים
    rebootMode NativeDevice.RebootMode : a mode of this reboot.

    reason String : for this reboot.

    Throws
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    ensureRuntimePermissionSupported

    protected void ensureRuntimePermissionSupported ()

    helper method to throw exception if runtime permission isn't supported

    Throws
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    getApiLevelSafe

    protected int getApiLevelSafe ()

    החזרות
    int

    getLogger

    protected ITestLogger getLogger ()

    החזרות
    ITestLogger

    getRunUtil

    protected IRunUtil getRunUtil ()

    Get the RunUtil instance to use.

    החזרות
    IRunUtil

    initializeConnection

    protected void initializeConnection (IBuildInfo info, 
                    MultiMap<String, String> attributes)

    פרמטרים
    info IBuildInfo

    attributes MultiMap

    Throws
    DeviceNotAvailableException
    TargetSetupError

    internalGetProperty

    protected String internalGetProperty (String propName, 
                    String fastbootVar, 
                    String description)

    Fetch a device property, from the ddmlib cache by default, and falling back to either `adb shell getprop` or `fastboot getvar` depending on whether the device is in Fastboot or not.

    פרמטרים
    propName String : The name of the device property as returned by `adb shell getprop`

    fastbootVar String : The name of the equivalent fastboot variable to query. if null , fastboot query will not be attempted

    description String : A simple description of the variable. First letter should be capitalized.

    החזרות
    String A string, possibly null or empty, containing the value of the given property

    Throws
    DeviceNotAvailableException

    isInRebootCallback

    protected boolean isInRebootCallback ()

    Returns whether reboot callbacks is currently being executed or not. All public api's for reboot should be disabled if true.

    החזרות
    boolean

    isNewer

    protected boolean isNewer (File localFile, 
                    IFileEntry entry)

    Return true if local file is newer than remote file. IFileEntry being accurate to the minute, in case of equal times, the file will be considered newer.

    פרמטרים
    localFile File

    entry IFileEntry

    החזרות
    boolean

    notifyRebootEnded

    protected void notifyRebootEnded ()

    Notifies all IDeviceActionReceiver about reboot end event.

    Throws
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    notifyRebootStarted

    protected void notifyRebootStarted ()

    Notifies all IDeviceActionReceiver about reboot start event.

    Throws
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    performDeviceAction

    protected boolean performDeviceAction (String actionDescription, 
                    NativeDevice.DeviceAction action, 
                    int retryAttempts)

    Performs an action on this device. Attempts to recover device and optionally retry command if action fails.

    פרמטרים
    actionDescription String : a short description of action to be performed. Used for logging purposes only.

    action NativeDevice.DeviceAction : the action to be performed

    retryAttempts int : the retry attempts to make for action if it fails but recovery succeeds

    החזרות
    boolean true if action was performed successfully

    זורק
    DeviceNotAvailableException if recovery attempt fails or max attempts done without success

    postAdbReboot

    protected void postAdbReboot ()

    Possible extra actions that can be taken after a reboot.

    Throws
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    prePostBootSetup

    protected void prePostBootSetup ()

    Allows each device type (AndroidNativeDevice, TestDevice) to override this method for specific post boot setup.

    Throws
    com.android.tradefed.device.DeviceNotAvailableException
    DeviceNotAvailableException

    pullFileInternal

    protected boolean pullFileInternal (String remoteFilePath, 
                    File localFile)

    פרמטרים
    remoteFilePath String

    localFile File

    החזרות
    boolean

    Throws
    DeviceNotAvailableException

    לכוון שעון

    protected void setClock (Clock clock)

    Set the Clock instance to use.

    פרמטרים
    clock Clock

    setMicrodroidProcess

    protected void setMicrodroidProcess (Process process)

    Marks the TestDevice as microdroid and sets its CID.

    פרמטרים
    process Process : Process of the Microdroid VM.

    setTestDeviceOptions

    protected void setTestDeviceOptions ( deviceOptions)

    פרמטרים
    deviceOptions

    simpleFastbootCommand

    protected CommandResult simpleFastbootCommand (long timeout, 
                     envVarMap, 
                    String[] fullCmd)

    Executes a simple fastboot command with environment variables and report the status of the command.

    פרמטרים
    timeout long

    envVarMap

    fullCmd String

    החזרות
    CommandResult

    simpleFastbootCommand

    protected CommandResult simpleFastbootCommand (long timeout, 
                    String[] fullCmd)

    Executes a simple fastboot command and report the status of the command.

    פרמטרים
    timeout long

    fullCmd String

    החזרות
    CommandResult

    waitForDeviceNotAvailable

    protected boolean waitForDeviceNotAvailable (String operationDesc, 
                    long time)

    Wait to see the device going unavailable (stop reporting to adb).

    פרמטרים
    operationDesc String : The name of the operation that is waiting for unavailable.

    time long : The time to wait for unavailable to occur.

    החזרות
    boolean True if device did become unavailable.