package Ġnet . b ony soft . do ity our self ie . camera Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . hardware . camera 2 . Camera AccessException Ċ import Ġandroid . hardware . camera 2 . Camera Character istics Ċ import Ġandroid . hardware . camera 2 . Camera Manager Ċ import Ġtim ber . log . Tim ber Ċ Ċ /** Ċ Ġ* ĠHelp ful Ġdebugging Ġmethod : Ġ ĠDump Ġall Ġsupported Ġcamera Ġformats Ġto Ġlog . Ġ ĠYou Ġdon 't Ġneed Ġto Ġrun Ċ Ġ* Ġthis Ġfor Ġnormal Ġoperation , Ġbut Ġit 's Ġvery Ġhelpful Ġwhen Ġport ing Ġthis Ġcode Ġto Ġdifferent Ċ Ġ* Ġhardware . Ċ Ġ*/ Ċ fun Ġdump Format Info ( context : ĠContext ) Ġ{ ĊĠĠĠ Ġval Ġmanager Ġ= Ġcontext . getSystem Service ( Context . CAMERA _ SERVICE ) Ġas ĠCamera Manager ĊĠĠĠ Ġvar Ġcam Ids Ġ= ĠarrayOf < String >() ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠ Ġcam Ids Ġ= Ġmanager . camera IdList ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠCamera AccessException ) Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . d (" Cam Ġaccess Ġexception Ġgetting ĠIDs ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( cam Ids . isEmpty ()) Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . d (" No Ġcameras Ġfound ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġfor Ġ( cam Id Ġin Ġcam Ids ) Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . d (" Using Ġcamera Ġid Ġ$ cam Id ") ĊĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġcharacteristics Ġ= Ġmanager . get Camera Character istics ( cam Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġconfigs Ġ= Ġcharacteristics . get ( Camera Character istics . SCAL ER _ STREAM _ CONFIGURATION _ MAP ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfor Ġ( format Ġin Ġconfigs !!. output Formats ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . d (" Getting Ġsizes Ġfor Ġformat : Ġ$ format ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfor Ġ( s Ġin Ġconfigs . getOutput Sizes ( format )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . d (" ĉ $ s ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdump Available Characteristic ( character istics , ĠCamera Character istics . CONTROL _ AVAILABLE _ EFFECT S , Ġ" Effect Ġavailable : Ġ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdump Available Characteristic ( character istics , ĠCamera Character istics . CONTROL _ AF _ AVAILABLE _ MODES , Ġ" AF ĠMode s Ġavailable : Ġ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdump Available Characteristic ( character istics , ĠCamera Character istics . CONTROL _ AE _ AVAILABLE _ MODES , Ġ" AE ĠMode s Ġavailable : Ġ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdump Available Characteristic ( character istics , ĠCamera Character istics . CONTROL _ AVAILABLE _ SC ENE _ MODES , Ġ" Scene ĠMode s Ġavailable : Ġ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdump Available Characteristic ( character istics , ĠCamera Character istics . CONTROL _ AW B _ AVAILABLE _ MODES , Ġ" AW B ĠMode s Ġavailable : Ġ") ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠCamera AccessException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTim ber . d (" Cam Ġaccess Ġexception Ġgetting Ġcharacteristics .") ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġ} Ċ } Ċ Ċ private Ġfun Ġdump Available Characteristic ( character istics : ĠCamera Character istics , Ġavailable Modes : ĠCamera Character istics . Key < IntArray >, Ġs 2 : ĠString ) Ġ{ ĊĠĠĠ Ġval Ġselected Character istics Ġ= Ġcharacteristics . get ( available Modes ) Ġ?: Ġreturn ĊĠĠĠ Ġfor Ġ( character istic Ġin Ġselected Character istics ) Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . d ("$ s 2 $ character istic ") ĊĠĠĠ Ġ} Ċ } Ċ