Use theme color instead of fixed one

Notifications don't have fixed background anymore, their colors
are themed based on a dynamic system palette.

Test: manual
Bug: 173561906
Bug: 173561901
Change-Id: Id0a41e04fe3e27d2ae59ab5c61a174211278c4a7
This commit is contained in:
Lucas Dupin
2020-11-21 00:09:51 +00:00
parent 006fc3486b
commit 56cb882b38

View File

@@ -52,6 +52,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.UiEventLogger;
import com.android.internal.util.ContrastColorUtil; import com.android.internal.util.ContrastColorUtil;
import com.android.settings.R; import com.android.settings.R;
import com.android.settingslib.Utils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@@ -79,8 +80,8 @@ public class NotificationSbnAdapter extends
mPm = pm; mPm = pm;
mUserBadgeCache = new HashMap<>(); mUserBadgeCache = new HashMap<>();
mValues = new ArrayList<>(); mValues = new ArrayList<>();
mBackgroundColor = mContext.getColor( mBackgroundColor = Utils.getColorAttrDefaultColor(context,
com.android.internal.R.color.notification_material_background_color); android.R.attr.colorBackground);
Configuration currentConfig = mContext.getResources().getConfiguration(); Configuration currentConfig = mContext.getResources().getConfiguration();
mInNightMode = (currentConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK) mInNightMode = (currentConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK)
== Configuration.UI_MODE_NIGHT_YES; == Configuration.UI_MODE_NIGHT_YES;