package Ġcom . in fin um . th im ble . builders Ċ Ċ import Ġandroid . app . Pending Intent Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġcom . in fin um . th im ble . models . Bundle Keys Ċ import Ġcom . in fin um . th im ble . models . Service Action Ċ import Ġcom . in fin um . th im ble . ui . Th im ble Activity Ċ import Ġcom . in fin um . th im ble . ui . Th im ble Service Ċ Ċ internal Ġclass ĠTh im ble Intent Builder ( ĊĠĠĠ Ġprivate Ġval Ġcontext : ĠContext Ċ ) Ġ{ ĊĊĠĠĠ Ġfun Ġsettings (): ĠPending Intent Ġ= ĊĠĠĠĠĠĠĠ ĠPending Intent . getActivity ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠIntent ( context , ĠTh im ble Activity :: class . java ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPending Intent . FLAG _ UPDATE _ CURRENT ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġfun Ġreset (): ĠPending Intent Ġ= ĊĠĠĠĠĠĠĠ ĠPending Intent . getService ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠIntent ( context , ĠTh im ble Service :: class . java ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaction Ġ= ĠService Action . RESET . code ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPending Intent . FLAG _ UPDATE _ CURRENT ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġfun Ġstop (): ĠPending Intent Ġ= ĊĠĠĠĠĠĠĠ ĠPending Intent . getService ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠIntent ( context , ĠTh im ble Service :: class . java ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaction Ġ= ĠService Action . STOP . code ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPending Intent . FLAG _ CANCEL _ CURRENT ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġfun Ġtoggle Grid ( enabled : ĠBoolean ): ĠPending Intent Ġ= ĊĠĠĠĠĠĠĠ ĠPending Intent . getService ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠIntent ( context , ĠTh im ble Service :: class . java ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaction Ġ= ĠService Action . GRID . code ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġput Extra ( Bundle Keys . TO GGLE . name , Ġenabled ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPending Intent . FLAG _ UPDATE _ CURRENT ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġfun Ġtoggle Mock up ( enabled : ĠBoolean ): ĠPending Intent Ġ= ĊĠĠĠĠĠĠĠ ĠPending Intent . getService ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠIntent ( context , ĠTh im ble Service :: class . java ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaction Ġ= ĠService Action . MOCK UP . code ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġput Extra ( Bundle Keys . TO GGLE . name , Ġenabled ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPending Intent . FLAG _ UPDATE _ CURRENT ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġfun Ġtoggle M agn ifier ( enabled : ĠBoolean ): ĠPending Intent Ġ= ĊĠĠĠĠĠĠĠ ĠPending Intent . getService ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠIntent ( context , ĠTh im ble Service :: class . java ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaction Ġ= ĠService Action . MAG NI FIER . code ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġput Extra ( Bundle Keys . TO GGLE . name , Ġenabled ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPending Intent . FLAG _ UPDATE _ CURRENT ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġfun Ġtoggle Recorder ( enabled : ĠBoolean ): ĠPending Intent Ġ= ĊĠĠĠĠĠĠĠ ĠPending Intent . getService ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠIntent ( context , ĠTh im ble Service :: class . java ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaction Ġ= ĠService Action . REC ORDER . code ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġput Extra ( Bundle Keys . TO GGLE . name , Ġenabled ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPending Intent . FLAG _ UPDATE _ CURRENT ĊĠĠĠĠĠĠĠ Ġ) Ċ } Ċ