הגדרת מכשיר

public class DeviceSetup
extends BaseTargetPreparer implements IExternalDependency

java.lang.Object
com.android.tradefed.targetprep.BaseTargetPreparer
com.android.tradefed.targetprep.DeviceSetup


ITargetPreparer שמגדיר מכשיר לבדיקה בהתבסס על Option שסופקו.

דורש מכשיר שבו 'adb root' אפשרי, בדרך כלל סוג build של userdebug.

יש לבצע לאחר הבזק של בנייה חדשה.

הערה: מכין זה מיועד למעבדות בדיקה מתמשכות ומניח שהמכשיר הנבדק יובהב וימחה לפני הריצה הבאה. ככזה, הוא מבצע ניקוי מינימלי במהלך הפירוק ואין להשתמש בו במודול בדיקה.

סיכום

שדות

protected BinaryState mAirplaneMode

protected BinaryState mAutoRotate

protected BinaryState mAutoUpdateTime

protected BinaryState mAutoUpdateTimezone

protected BinaryState mBatterySaver

protected Integer mBatterySaverTrigger

protected BinaryState mBluetooth

protected BinaryState mCell

protected BinaryState mCellAutoSetting

protected BinaryState mData

protected Integer mDefaultSimData

protected Integer mDefaultSimSms

protected Integer mDefaultSimVoice

protected boolean mDisableAudio

protected BinaryState mDisableCwWifiMediator

protected boolean mDisableDalvikVerifier

protected boolean mDisableDialing

protected boolean mDisableDoze

protected boolean mEnableFullBatteryStatsHistory

protected BinaryState mEthernet

protected boolean mForceSkipRunCommands

protected boolean mForceSkipSettings

protected boolean mForceSkipSystemProps

protected MultiMap <String, String> mGlobalSettings

protected BinaryState mHideErrorDialogs

protected BinaryState mInstallNonMarketApps

protected File mLocalDataFile

protected BinaryState mLocationGps

protected BinaryState mLocationNetwork

protected long mMinExternalStorageKb

protected BinaryState mNfc

protected BinaryState mNotificationLed

protected boolean mOptimizedPropertySetting

protected File mPreviousProperties

protected String mRemoteDataPath

protected boolean mRestoreProperties

protected boolean mRestoreSettings

protected mRunCommandAfterSettings

protected mRunCommandBeforeSettings

protected BinaryState mScreenAdaptiveBrightness

protected BinaryState mScreenAlwaysOn

protected BinaryState mScreenAmbientMode

protected Integer mScreenBrightness

protected BinaryState mScreenSaver

protected Long mScreenTimeoutSecs

protected MultiMap <String, String> mSecureSettings

protected mSetProps

protected boolean mSetTestHarness

protected BinaryState mSyncTimezoneWithHost

protected MultiMap <String, String> mSystemSettings

protected String mTimezone

protected boolean mTriggerMediaMounted

protected BinaryState mWakeGesture

protected BinaryState mWifi

protected String mWifiPsk

protected BinaryState mWifiScanAlwaysEnabled

protected String mWifiSsid

protected mWifiSsidToPsk

protected BinaryState mWifiWatchdog

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

DeviceSetup ()

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

void changeSettings ( ITestDevice device)

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

getDependencies ()
ITestDevice getDevice ( TestInformation testInfo)
boolean isForceSkipSystemProps ()
void processDeprecatedOptions ( ITestDevice device)

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

void processOptions ( ITestDevice device)

עבדו את כל Option והפכו אותן לאביזרים למערכת, להגדרות או לפקודות הפעלה.

static void setCommandForBinaryState ( BinaryState state, commands, String onCommand, String offCommand) setCommandForBinaryState ( BinaryState state, commands, String onCommand, String offCommand)

שיטת עוזר להוספת פקודת הפעלה ON/OFF שתתבצע במכשיר.

void setGlobalSetting (String key, String value)

נחשף לבדיקת יחידה

void setSecureSetting (String key, String value)

נחשף לבדיקת יחידה

static void setSettingForBinaryState ( BinaryState state, MultiMap <String, String> settingsMap, String setting, String onValue, String offValue)

שיטת עוזר להוספת הגדרת הפעלה/כיבוי למפת הגדרות.

void setSystemSetting (String key, String value)

נחשף לבדיקת יחידה

void setUp ( TestInformation testInfo)

void tearDown ( TestInformation testInfo, Throwable e)

שיטות מוגנות

void setAirplaneMode ( BinaryState airplaneMode)

נחשף לבדיקת יחידה

void setAutoRotate ( BinaryState autoRotate)

נחשף לבדיקת יחידה

void setAutoUpdateTime ( BinaryState autoUpdateTime)

נחשף לבדיקת יחידה

void setAutoUpdateTimezone ( BinaryState autoUpdateTimezone)

נחשף לבדיקת יחידה

void setBatterySaver ( BinaryState batterySaver)

נחשף לבדיקת יחידה

void setBatterySaverTrigger (Integer batterySaverTrigger)

נחשף לבדיקת יחידה

void setBluetooth ( BinaryState bluetooth)

נחשף לבדיקת יחידה

void setCell ( BinaryState cell)
void setCellAutoSetting ( BinaryState cellAutoSetting)
void setData ( BinaryState data)
void setDefaultSimData (Integer defaultSimData)

נחשף לבדיקת יחידה

void setDefaultSimSms (Integer defaultSimSms)

נחשף לבדיקת יחידה

void setDefaultSimVoice (Integer defaultSimVoice)

נחשף לבדיקת יחידה

void setDeprecatedAudioSilent (boolean silent)

שיטה זו הוצאה משימוש. השתמש במקום זאת setDisableAudio(boolean) .

void setDeprecatedMinExternalStoreSpace (long storeSpace)

שיטה זו הוצאה משימוש. השתמש במקום זאת setMinExternalStorageKb(long) .

void setDeprecatedSetProp (String prop)

שיטה זו הוצאה משימוש. השתמש במקום זאת setProperty(String, String) .

void setDisableAudio (boolean disable)

נחשף לבדיקת יחידה

void setDisableCwWifiMediator ( BinaryState disableCwWifiMediator)
void setDisableDalvikVerifier (boolean disableDalvikVerifier)

נחשף לבדיקת יחידה

void setDisableDialing (boolean disableDialing)

נחשף לבדיקת יחידה

void setDisableDoze (boolean disableDoze)

נחשף לבדיקת יחידה

void setEnableFullBatteryStatsHistory (boolean enableFullBatteryStatsHistory)

נחשף לבדיקת יחידה

void setEthernet ( BinaryState ethernet)

נחשף לבדיקת יחידה

void setForceRootSetup (boolean force)
void setForceSkipSystemProps (boolean force)

נחשף לבדיקת יחידה

void setInstallNonMarketApps ( BinaryState installNonMarketApps)

נחשף לבדיקת יחידה

void setLocalDataPath (File path)

נחשף לבדיקת יחידה

void setLocationGps ( BinaryState locationGps)

נחשף לבדיקת יחידה

void setLocationNetwork ( BinaryState locationNetwork)

נחשף לבדיקת יחידה

void setMinExternalStorageKb (long storageKb)

נחשף לבדיקת יחידה

void setNfc ( BinaryState nfc)

נחשף לבדיקת יחידה

void setNotificationLed ( BinaryState notificationLed)

נחשף לבדיקת יחידה

void setProperty (String key, String value)

נחשף לבדיקת יחידה

void setRestoreProperties (boolean restoreProperties)

נחשף לבדיקת יחידה

void setRestoreSettings (boolean restoreSettings)

נחשף לבדיקת יחידה

void setScreenAdaptiveBrightness ( BinaryState screenAdaptiveBrightness)

נחשף לבדיקת יחידה

void setScreenAlwaysOn ( BinaryState screenAlwaysOn)

נחשף לבדיקת יחידה

void setScreenAmbientMode ( BinaryState screenAmbientMode)

נחשף לבדיקת יחידה

void setScreenBrightness (Integer screenBrightness)

נחשף לבדיקת יחידה

void setScreenSaver ( BinaryState screenSaver)

נחשף לבדיקת יחידה

void setScreenTimeoutSecs (Long screenTimeoutSecs)

נחשף לבדיקת יחידה

void setTestHarness (boolean setTestHarness)

נחשף לבדיקת יחידה

void setTimezone (String timezone)

נחשף לבדיקת יחידה

void setTriggerMediaMounted (boolean triggerMediaMounted)

נחשף לבדיקת יחידה

void setWakeGesture ( BinaryState wakeGesture)

נחשף לבדיקת יחידה

void setWifi ( BinaryState wifi)

נחשף לבדיקת יחידה

void setWifiNetwork (String wifiNetwork)

נחשף לבדיקת יחידה

void setWifiPsk (String wifiPsk)
void setWifiScanAlwaysEnabled ( BinaryState wifiScanAlwaysEnabled)

נחשף לבדיקת יחידה

void setWifiSsidToPsk ( wifiSssidToPsk) setWifiSsidToPsk ( wifiSssidToPsk)
void setWifiWatchdog ( BinaryState wifiWatchdog)

נחשף לבדיקת יחידה

שדות

mAirplaneMode

protected BinaryState mAirplaneMode

mAutoRotate

protected BinaryState mAutoRotate

mAutoUpdateTime

protected BinaryState mAutoUpdateTime

mAutoUpdatezoneTime

protected BinaryState mAutoUpdateTimezone

mBatterySaver

protected BinaryState mBatterySaver

mBatterySaverTrigger

protected Integer mBatterySaverTrigger

mBluetooth

protected BinaryState mBluetooth

mCell

protected BinaryState mCell

mCellAutoSetting

protected BinaryState mCellAutoSetting

mData

protected BinaryState mData

mDefaultSimData

protected Integer mDefaultSimData

mDefaultSimSms

protected Integer mDefaultSimSms

mDefaultSimVoice

protected Integer mDefaultSimVoice

mDisableAudio

protected boolean mDisableAudio

mDisableCwWifiMediator

protected BinaryState mDisableCwWifiMediator

mDisableDalvikVerifier

protected boolean mDisableDalvikVerifier

mDisableDialing

protected boolean mDisableDialing

mDisableDoze

protected boolean mDisableDoze

mEnableFullBatteryStatsHistory

protected boolean mEnableFullBatteryStatsHistory

mEthernet

protected BinaryState mEthernet

mForceSkipRunCommands

protected boolean mForceSkipRunCommands

mForceSkipSettings

protected boolean mForceSkipSettings

mForceSkipSystemProps

protected boolean mForceSkipSystemProps

mGlobalSettings

protected MultiMap<String, String> mGlobalSettings

mHideErrorDialogs

protected BinaryState mHideErrorDialogs

mInstallNonMarketApps

protected BinaryState mInstallNonMarketApps

mLocalDataFile

protected File mLocalDataFile

mLocationGps

protected BinaryState mLocationGps

mLocationNetwork

protected BinaryState mLocationNetwork

mMinExternalStorageKb

protected long mMinExternalStorageKb

mNfc

protected BinaryState mNfc

mNotificationLed

protected BinaryState mNotificationLed

mOptimizedPropertySetting

protected boolean mOptimizedPropertySetting

mPreviousProperties

protected File mPreviousProperties

mRemoteDataPath

protected String mRemoteDataPath

mRestoreProperties

protected boolean mRestoreProperties

mRestoreSettings

protected boolean mRestoreSettings

mRunCommandAfterSettings

protected  mRunCommandAfterSettings

mRunCommandBeforeSettings

protected  mRunCommandBeforeSettings

mScreenAdaptiveBrightness

protected BinaryState mScreenAdaptiveBrightness

mScreenAlwaysOn

protected BinaryState mScreenAlwaysOn

mScreenAmbientMode

protected BinaryState mScreenAmbientMode

mScreenBrightness

protected Integer mScreenBrightness

mscreenSaver

protected BinaryState mScreenSaver

mScreenTimeoutSecs

protected Long mScreenTimeoutSecs

mSecureSettings

protected MultiMap<String, String> mSecureSettings

mSetProps

protected  mSetProps

mSetTestHarness

protected boolean mSetTestHarness

mSyncTimezoneWithHost

protected BinaryState mSyncTimezoneWithHost

mSystemSettings

protected MultiMap<String, String> mSystemSettings

mTimezone

protected String mTimezone

mTriggerMediaMounted

protected boolean mTriggerMediaMounted

mWakeGesture

protected BinaryState mWakeGesture

mWifi

protected BinaryState mWifi

mWifiPsk

protected String mWifiPsk

mWifiScanAlwaysEnabled

protected BinaryState mWifiScanAlwaysEnabled

mWifiSsid

protected String mWifiSsid

mWifiSsidToPsk

protected  mWifiSsidToPsk

mWifiWatchdog

protected BinaryState mWifiWatchdog

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

הגדרת מכשיר

public DeviceSetup ()

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

שינוי הגדרות

public void changeSettings (ITestDevice device)

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

חשוף כך ששיעורי הילדים עשויים לעקוף.

פרמטרים
device ITestDevice : ה- ITestDevice

זורק
DeviceNotAvailableException אם המכשיר אינו זמין
TargetSetupError אם היה כשל בהגדרת ההגדרות

getDependencies

public  getDependencies ()

החזרות

getDevice

public ITestDevice getDevice (TestInformation testInfo)

פרמטרים
testInfo TestInformation

החזרות
ITestDevice

isForceSkipSystemProps

public boolean isForceSkipSystemProps ()

החזרות
boolean

processDeprecatedOptions

public void processDeprecatedOptions (ITestDevice device)

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

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

פרמטרים
device ITestDevice

זורק
TargetSetupError אם יש עימות

processOptions

public void processOptions (ITestDevice device)

עבדו את כל Option והפכו אותן לאביזרים למערכת, להגדרות או לפקודות הפעלה. לא מפעיל שום פקודה במכשיר בשלב זה.

חשוף כך ששיעורי ילדים עשויים לעקוף זאת.

פרמטרים
device ITestDevice : ה- ITestDevice

זורק
DeviceNotAvailableException אם המכשיר אינו זמין
TargetSetupError אם Option מתנגשת

setCommandForBinaryState

public static void setCommandForBinaryState (BinaryState state, 
                 commands, 
                String onCommand, 
                String offCommand)

שיטת עוזר להוספת פקודת הפעלה ON/OFF שתתבצע במכשיר.

פרמטרים
state BinaryState : ה- BinaryState

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

onCommand String : הפקודה להפעלה אם מופעלת. התעלם אם הפקודה היא null

offCommand String : הפקודה להפעלה אם כבויה. התעלם אם הפקודה היא null

setGlobalSetting

public void setGlobalSetting (String key, 
                String value)

נחשף לבדיקת יחידה

פרמטרים
key String

value String

setSecureSetting

public void setSecureSetting (String key, 
                String value)

נחשף לבדיקת יחידה

פרמטרים
key String

value String

setSettingForBinaryState

public static void setSettingForBinaryState (BinaryState state, 
                MultiMap<String, String> settingsMap, 
                String setting, 
                String onValue, 
                String offValue)

שיטת עוזר להוספת הגדרת הפעלה/כיבוי למפת הגדרות.

פרמטרים
state BinaryState : ה- BinaryState

settingsMap MultiMap : MultiMap המשמש לאחסון ההגדרות.

setting String : מקש ההגדרה

onValue String : הערך אם פועל

offValue String : הערך אם כבוי

setSystemSetting

public void setSystemSetting (String key, 
                String value)

נחשף לבדיקת יחידה

פרמטרים
key String

value String

להכין

public void setUp (TestInformation testInfo)

פרמטרים
testInfo TestInformation

זורק
BuildError
DeviceNotAvailableException
TargetSetupError

לקרוע

public void tearDown (TestInformation testInfo, 
                Throwable e)

פרמטרים
testInfo TestInformation

e Throwable

זורק
DeviceNotAvailableException

שיטות מוגנות

setAirplaneMode

protected void setAirplaneMode (BinaryState airplaneMode)

נחשף לבדיקת יחידה

פרמטרים
airplaneMode BinaryState

setAutoRotate

protected void setAutoRotate (BinaryState autoRotate)

נחשף לבדיקת יחידה

פרמטרים
autoRotate BinaryState

setAutoUpdateTime

protected void setAutoUpdateTime (BinaryState autoUpdateTime)

נחשף לבדיקת יחידה

פרמטרים
autoUpdateTime BinaryState

setAutoUpdateTimezone

protected void setAutoUpdateTimezone (BinaryState autoUpdateTimezone)

נחשף לבדיקת יחידה

פרמטרים
autoUpdateTimezone BinaryState

setBatterySaver

protected void setBatterySaver (BinaryState batterySaver)

נחשף לבדיקת יחידה

פרמטרים
batterySaver BinaryState

setBatterySaverTrigger

protected void setBatterySaverTrigger (Integer batterySaverTrigger)

נחשף לבדיקת יחידה

פרמטרים
batterySaverTrigger Integer

setBluetooth

protected void setBluetooth (BinaryState bluetooth)

נחשף לבדיקת יחידה

פרמטרים
bluetooth BinaryState

setCell

protected void setCell (BinaryState cell)

פרמטרים
cell BinaryState

setCellAutoSetting

protected void setCellAutoSetting (BinaryState cellAutoSetting)

פרמטרים
cellAutoSetting BinaryState

setData

protected void setData (BinaryState data)

פרמטרים
data BinaryState

setDefaultSimData

protected void setDefaultSimData (Integer defaultSimData)

נחשף לבדיקת יחידה

פרמטרים
defaultSimData Integer

setDefaultSimSms

protected void setDefaultSimSms (Integer defaultSimSms)

נחשף לבדיקת יחידה

פרמטרים
defaultSimSms Integer

setDefaultSimVoice

protected void setDefaultSimVoice (Integer defaultSimVoice)

נחשף לבדיקת יחידה

פרמטרים
defaultSimVoice Integer

setDeprecatedAudioSilent

protected void setDeprecatedAudioSilent (boolean silent)

שיטה זו הוצאה משימוש.
השתמש במקום זאת setDisableAudio(boolean) .

נחשף לבדיקת יחידה

פרמטרים
silent boolean

setDeprecatedMinExternalStoreSpace

protected void setDeprecatedMinExternalStoreSpace (long storeSpace)

שיטה זו הוצאה משימוש.
השתמש במקום זאת setMinExternalStorageKb(long) .

נחשף לבדיקת יחידה

פרמטרים
storeSpace long

setDeprecatedSetProp

protected void setDeprecatedSetProp (String prop)

שיטה זו הוצאה משימוש.
השתמש במקום זאת setProperty(String, String) .

נחשף לבדיקת יחידה

פרמטרים
prop String

setDisableAudio

protected void setDisableAudio (boolean disable)

נחשף לבדיקת יחידה

פרמטרים
disable boolean

setDisableCwWifiMediator

protected void setDisableCwWifiMediator (BinaryState disableCwWifiMediator)

פרמטרים
disableCwWifiMediator BinaryState

setDisableDalvikVerifier

protected void setDisableDalvikVerifier (boolean disableDalvikVerifier)

נחשף לבדיקת יחידה

פרמטרים
disableDalvikVerifier boolean

setDisableDialing

protected void setDisableDialing (boolean disableDialing)

נחשף לבדיקת יחידה

פרמטרים
disableDialing boolean

setDisableDoze

protected void setDisableDoze (boolean disableDoze)

נחשף לבדיקת יחידה

פרמטרים
disableDoze boolean

setEnableFullBatteryStatsHistory

protected void setEnableFullBatteryStatsHistory (boolean enableFullBatteryStatsHistory)

נחשף לבדיקת יחידה

פרמטרים
enableFullBatteryStatsHistory boolean

setEthernet

protected void setEthernet (BinaryState ethernet)

נחשף לבדיקת יחידה

פרמטרים
ethernet BinaryState

setForceRootSetup

protected void setForceRootSetup (boolean force)

פרמטרים
force boolean

setForceSkipSystemProps

protected void setForceSkipSystemProps (boolean force)

נחשף לבדיקת יחידה

פרמטרים
force boolean

setInstallNonMarketApps

protected void setInstallNonMarketApps (BinaryState installNonMarketApps)

נחשף לבדיקת יחידה

פרמטרים
installNonMarketApps BinaryState

setLocalDataPath

protected void setLocalDataPath (File path)

נחשף לבדיקת יחידה

פרמטרים
path File

setLocationGps

protected void setLocationGps (BinaryState locationGps)

נחשף לבדיקת יחידה

פרמטרים
locationGps BinaryState

setLocationNetwork

protected void setLocationNetwork (BinaryState locationNetwork)

נחשף לבדיקת יחידה

פרמטרים
locationNetwork BinaryState

setMinExternalStorageKb

protected void setMinExternalStorageKb (long storageKb)

נחשף לבדיקת יחידה

פרמטרים
storageKb long

setNfc

protected void setNfc (BinaryState nfc)

נחשף לבדיקת יחידה

פרמטרים
nfc BinaryState

setNotificationLed

protected void setNotificationLed (BinaryState notificationLed)

נחשף לבדיקת יחידה

פרמטרים
notificationLed BinaryState

setProperty

protected void setProperty (String key, 
                String value)

נחשף לבדיקת יחידה

פרמטרים
key String

value String

setRestoreProperties

protected void setRestoreProperties (boolean restoreProperties)

נחשף לבדיקת יחידה

פרמטרים
restoreProperties boolean

setRestoreSettings

protected void setRestoreSettings (boolean restoreSettings)

נחשף לבדיקת יחידה

פרמטרים
restoreSettings boolean

setScreenAdaptiveBrightness

protected void setScreenAdaptiveBrightness (BinaryState screenAdaptiveBrightness)

נחשף לבדיקת יחידה

פרמטרים
screenAdaptiveBrightness BinaryState

setScreenAlwaysOn

protected void setScreenAlwaysOn (BinaryState screenAlwaysOn)

נחשף לבדיקת יחידה

פרמטרים
screenAlwaysOn BinaryState

setScreenAmbientMode

protected void setScreenAmbientMode (BinaryState screenAmbientMode)

נחשף לבדיקת יחידה

פרמטרים
screenAmbientMode BinaryState

setScreenBrightness

protected void setScreenBrightness (Integer screenBrightness)

נחשף לבדיקת יחידה

פרמטרים
screenBrightness Integer

setScreenSaver

protected void setScreenSaver (BinaryState screenSaver)

נחשף לבדיקת יחידה

פרמטרים
screenSaver BinaryState

setScreenTimeoutSecs

protected void setScreenTimeoutSecs (Long screenTimeoutSecs)

נחשף לבדיקת יחידה

פרמטרים
screenTimeoutSecs Long

setTestHarness

protected void setTestHarness (boolean setTestHarness)

נחשף לבדיקת יחידה

פרמטרים
setTestHarness boolean

setTimezone

protected void setTimezone (String timezone)

נחשף לבדיקת יחידה

פרמטרים
timezone String

setTriggerMediaMounted

protected void setTriggerMediaMounted (boolean triggerMediaMounted)

נחשף לבדיקת יחידה

פרמטרים
triggerMediaMounted boolean

setWakeGesture

protected void setWakeGesture (BinaryState wakeGesture)

נחשף לבדיקת יחידה

פרמטרים
wakeGesture BinaryState

setWifi

protected void setWifi (BinaryState wifi)

נחשף לבדיקת יחידה

פרמטרים
wifi BinaryState

setWifiNetwork

protected void setWifiNetwork (String wifiNetwork)

נחשף לבדיקת יחידה

פרמטרים
wifiNetwork String

setWifiPsk

protected void setWifiPsk (String wifiPsk)

פרמטרים
wifiPsk String

setWifiScanAlwaysEnabled

protected void setWifiScanAlwaysEnabled (BinaryState wifiScanAlwaysEnabled)

נחשף לבדיקת יחידה

פרמטרים
wifiScanAlwaysEnabled BinaryState

setWifiSsidToPsk

protected void setWifiSsidToPsk ( wifiSssidToPsk)

פרמטרים
wifiSssidToPsk

setWifiWatchdog

protected void setWifiWatchdog (BinaryState wifiWatchdog)

נחשף לבדיקת יחידה

פרמטרים
wifiWatchdog BinaryState