/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 2 1 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ @ file : Jvm Name (" Device Actions ") Ċ Ċ package Ġandroidx . test . espress o . device . action Ċ Ċ import Ġandroid . os . Handler Ċ import Ġandroid . os . Looper Ċ import Ġjava . util . concurrent . Executor Ċ Ċ /** ĠEntry Ġpoint Ġfor Ġdevice Ġaction Ġoperations . Ġ*/ Ċ private Ġval Ġmain Executor Ġ= ĠExecutor Ġ{ Ġcommand Ġ-> ĠHandler ( Looper . get Main Looper ()). post ( command ) Ġ} Ċ Ċ /** Ċ Ġ* ĠSet Ġdevice Ġscreen Ġto Ġbe Ġfol ded Ġwith Ġthe Ġh inge Ġin Ġthe Ġhorizontal Ġposition . ĠFor Ġdetails Ġon Ġfold able Ċ Ġ* Ġpost ures , Ġsee Ċ Ġ* Ġhttps :// developer . android . com / guide / topics / large - screens / learn - about - fold ables # fold able _ post ures Ċ Ġ* Ċ Ġ* ĠThis Ġaction Ġis Ġfor Ġfold able Ġdevices Ġonly . ĠCurrently Ġonly Ġsupported Ġfor Ġtests Ġrun Ġon ĠAndroid Ċ Ġ* ĠE mul ators . Ċ Ġ* Ġ@ throws ĠUnsupported Device OperationException Ġif Ġused Ġon Ġa Ġreal Ġdevice . Ċ Ġ* Ġ@ throws ĠDevice Controller OperationException Ġwhen Ġcalled Ġon Ġa Ġnon - fold able ĠEm ulator . Ċ Ġ*/ Ċ fun Ġset Table top Mode (): ĠDevice Action Ġ{ ĊĠ Ġreturn ĠTable top Mode Action ( main Executor ) Ċ } Ċ Ċ /** Ċ Ġ* ĠSet Ġdevice Ġscreen Ġto Ġbe Ġfol ded Ġwith Ġthe Ġh inge Ġin Ġthe Ġvertical Ġposition . ĠFor Ġdetails Ġon Ġfold able Ċ Ġ* Ġpost ures , Ġsee Ċ Ġ* Ġhttps :// developer . android . com / guide / topics / large - screens / learn - about - fold ables # fold able _ post ures Ċ Ġ* Ċ Ġ* ĠThis Ġaction Ġis Ġfor Ġfold able Ġdevices Ġonly . ĠCurrently Ġonly Ġsupported Ġfor Ġtests Ġrun Ġon ĠAndroid Ċ Ġ* ĠE mul ators . Ċ Ġ* Ġ@ throws ĠUnsupported Device OperationException Ġif Ġused Ġon Ġa Ġreal Ġdevice . Ċ Ġ* Ġ@ throws ĠDevice Controller OperationException Ġwhen Ġcalled Ġon Ġa Ġnon - fold able ĠEm ulator . Ċ Ġ*/ Ċ fun Ġset Book Mode (): ĠDevice Action Ġ{ ĊĠ Ġreturn ĠBook Mode Action ( main Executor ) Ċ } Ċ Ċ /** Ċ Ġ* ĠSet Ġdevice Ġscreen Ġto Ġbe Ġcompletely Ġflat , Ġlike Ġa Ġtablet . ĠFor Ġdetails Ġon Ġfold able Ġpost ures , Ġsee Ċ Ġ* Ġhttps :// developer . android . com / guide / topics / large - screens / learn - about - fold ables # fold able _ post ures Ċ Ġ* Ċ Ġ* ĠThis Ġaction Ġis Ġfor Ġfold able Ġdevices Ġonly . ĠCurrently Ġonly Ġsupported Ġfor Ġtests Ġrun Ġon ĠAndroid Ċ Ġ* ĠE mul ators . Ċ Ġ* Ġ@ throws ĠUnsupported Device OperationException Ġif Ġused Ġon Ġa Ġreal Ġdevice . Ċ Ġ* Ġ@ throws ĠDevice Controller OperationException Ġwhen Ġcalled Ġon Ġa Ġnon - fold able ĠEm ulator . Ċ Ġ*/ Ċ fun Ġset Flat Mode (): ĠDevice Action Ġ{ ĊĠ Ġreturn ĠFlat Mode Action ( main Executor ) Ċ } Ċ Ċ /** Ċ Ġ* ĠSet Ġdevice 's Ġscreen Ġorientation . Ċ Ġ* Ġ@ param Ġorientation Ġthe Ġorientation Ġto Ġset Ġthe Ġdevice Ġto Ġ( port ait Ġor Ġlandscape ) Ċ Ġ*/ Ċ fun Ġset Screen Orientation ( orientation : ĠScreen Orientation ): ĠDevice Action Ġ{ ĊĠ Ġreturn ĠScreen Orientation Action ( orientation ) Ċ } Ċ Ċ /** ĠEnum Ġfor Ġscreen Ġorient ations Ġa Ġdevice Ġcan Ġbe Ġset Ġto . Ġ*/ Ċ enum Ġclass ĠScreen Orientation ( val Ġorientation : ĠInt ) Ġ{ ĊĠ ĠP OR TRA IT ( 0 ), ĊĠ ĠL AND SC APE ( 1 ) Ċ } Ċ