package Ġcom . example . ambient _ app Ċ Ċ import Ġandroidx . annotation . Worker Thread Ċ import Ġkotlinx . coroutines . flow . Flow Ċ Ċ class ĠF avorites Repository ( private Ġval Ġfavor ites DAO : ĠF avorites DAO ) Ġ{ ĊĠĠĠ Ġ// ĠRoom Ġqueries Ġwill Ġexecute Ġon Ġa Ġseparate Ġthread Ġand Ġnotify Ġan Ġobserver Ġof Ġchanges . ĊĠĠĠ Ġval Ġall Entries : ĠFlow < List < F avorites Entry >> Ġ= Ġfavor ites DAO . getAll () ĊĊĠĠĠ Ġ@ Suppress (" Red undant Suspend Modifier ") ĊĠĠĠ Ġ@ Worker Thread ĊĠĠĠ Ġsuspend Ġfun Ġinsert ( favorites Entry : ĠF avorites Entry ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfavor ites DAO . insert ( favorites Entry ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Suppress (" Red undant Suspend Modifier ") ĊĠĠĠ Ġ@ Worker Thread ĊĠĠĠ Ġsuspend Ġfun Ġdelete Entry ( favorites Entry : ĠF avorites Entry ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfavor ites DAO . delete ( favorites Entry ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Suppress (" Red undant Suspend Modifier ") ĊĠĠĠ Ġ@ Worker Thread ĊĠĠĠ Ġsuspend Ġfun Ġdelete Id ( favorites Id : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfavor ites DAO . delete Id ( favorites Id ) ĊĠĠĠ Ġ} Ċ }