package Ġme . hen ne ke . we ar auth n . ui Ċ Ċ import Ġandroid . app . Activity Ċ import Ġandroid . app . Key guard Manager Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . os . Result Receiver Ċ import Ġandroid . support . we arable . activity . W ear able Activity Ċ Ċ const Ġval ĠEX TRA _ CONFIRM _ DEVICE _ CRED ENTIAL _ RECE IVER Ġ= ĊĠĠĠ Ġ" me . hen ne ke . we ar auth n . common . EXTRA _ CONFIRM _ DEVICE _ CRED ENTIAL _ RECE IVER " Ċ Ċ private Ġconst Ġval ĠREQUEST _ CONFIRM _ CRED ENTIAL Ġ= Ġ 5 Ċ Ċ class ĠConfirm Device Credential Activity Ġ: ĠW ear able Activity () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonStart () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onStart () ĊĠĠĠĠĠĠĠ Ġval Ġkey guard Manager Ġ= Ġget System Service ( Key guard Manager :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġlaunch Intent Ġ= Ġkey guard Manager ?. create Confirm Device Credential Intent ( null , Ġnull ) ĊĠĠĠĠĠĠĠ Ġif Ġ( launch Intent Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Result ( Activity . RESULT _ C ANCE LED ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ ĠstartActivity For Result ( launch Intent , ĠREQUEST _ CONFIRM _ CRED ENTIAL ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Activity Result ( request Code : ĠInt , ĠresultCode : ĠInt , Ġdata : ĠIntent ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Activity Result ( request Code , ĠresultCode , Ġdata ) ĊĠĠĠĠĠĠĠ Ġif Ġ( request Code Ġ== ĠREQUEST _ CONFIRM _ CRED ENTIAL ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Result ( result Code ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġreturn Result ( result Code : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġintent . get Parcelable Extra < Result Receiver >( EXTRA _ CONFIRM _ DEVICE _ CRED ENTIAL _ RECE IVER ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ? . send ( result Code , ĠBundle ()) ĊĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠ Ġ} Ċ } Ċ