RunOnSecondaryUserTargetPreparer

public class RunOnSecondaryUserTargetPreparer
extends BaseTargetPreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.RunOnSecondaryUserTargetPreparer


ITargetPreparer כדי לוודא שהבדיקה תפעל כמשתמש משני. בנוסף, אם האפשרות ERROR(/#START_BACKGROUND_USER) היא true והמשתמש הנוכחי הוא כבר משתמש משני, המערכת תוודא שמשתמש משני ברקע יפעל בצורה גלויה במסך משני.

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

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

סיכום

שדות

protected boolean mStartBackgroundUser

protected List<String> mTestPackages

protected int originalUserId

protected int secondaryUserId

‫constructors ציבוריים

RunOnSecondaryUserTargetPreparer()

‫methods ציבוריים

void setUp(TestInformation testInfo)
void tearDown(TestInformation testInfo, Throwable e)

שיטות מוגנות

boolean canCreateAdditionalSecondaryUsers(ITestDevice device, int numberOfUsers)

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

שדות

mStartBackgroundUser

protected boolean mStartBackgroundUser

mTestPackages

protected List<String> mTestPackages

originalUserId

protected int originalUserId

secondaryUserId

protected int secondaryUserId

‫constructors ציבוריים

RunOnSecondaryUserTargetPreparer

public RunOnSecondaryUserTargetPreparer ()

‫methods ציבוריים

setUp

public void setUp (TestInformation testInfo)

פרמטרים
testInfo TestInformation

הקפצת הודעות שגיאה (throw)
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

פרמטרים
testInfo TestInformation

e Throwable

הקפצת הודעות שגיאה (throw)
DeviceNotAvailableException

שיטות מוגנות

canCreateAdditionalSecondaryUsers

protected boolean canCreateAdditionalSecondaryUsers (ITestDevice device, 
                int numberOfUsers)

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

פרמטרים
device ITestDevice

numberOfUsers int

החזרות
boolean

הקפצת הודעות שגיאה (throw)
DeviceNotAvailableException