package Ġme . li 2 . android . common . sd card Ċ Ċ import Ġandroid . content . Intent Ċ Ċ enum Ġclass ĠS d card State ( val Ġaction : ĠString ?) Ġ{ ĊĠĠĠ ĠUNKNOWN ( null ), ĊĠĠĠ ĠMO UNT ED ( Intent . ACTION _ MEDIA _ MOUNT ED ), ĊĠĠĠ ĠE JECT ( Intent . ACTION _ MEDIA _ E JECT ), ĊĠĠĠ ĠUN MOUNT ED ( Intent . ACTION _ MEDIA _ UN MOUNT ED ), ĊĠĠĠ ĠBAD _ RE MO VAL ( Intent . ACTION _ MEDIA _ BAD _ RE MO VAL ); ĊĊĠĠĠ Ġfun Ġis E ject () Ġ= Ġthis Ġ== ĠE JECT ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġmap Ġ= Ġenum Values < Sd card State >(). associate By ( Sd card State :: action ) ĊĊĠĠĠĠĠĠĠ Ġval Ġintent Actions : ĠList < String > Ġ= Ġenum Values < Sd card State >(). map NotNull Ġ{ Ġit . action Ġ} ĊĊĠĠĠĠĠĠĠ Ġfun Ġfrom ( action : ĠString ?): ĠS d card State Ġ= Ġmap [ action ] Ġ?: ĠUNKNOWN ĊĠĠĠ Ġ} Ċ }