Fix Applying Material You notification cannot be dismissed.

This commit is contained in:
Alex Ning 2021-08-06 19:48:08 +08:00
parent 43dc0409ac
commit 326cbd4064

View File

@ -82,11 +82,17 @@ public class MaterialYouService extends Service {
MaterialYouUtils.changeTheme(this, executor, new Handler(), redditDataRoomDatabase, MaterialYouUtils.changeTheme(this, executor, new Handler(), redditDataRoomDatabase,
customThemeWrapper, lightThemeSharedPreferences, darkThemeSharedPreferences, customThemeWrapper, lightThemeSharedPreferences, darkThemeSharedPreferences,
amoledThemeSharedPreferences, () -> { amoledThemeSharedPreferences, () -> {
stopForeground(true); stopService();
stopSelf();
}); });
} else {
stopService();
} }
return START_NOT_STICKY; return START_NOT_STICKY;
} }
private void stopService() {
stopForeground(true);
stopSelf();
}
} }