Get system_notification_accent_color from public resources.

LockdownVpnTracker gets system_notification_accent_color from
com.android.internal.R. This is not stable across releases, so it
can crash ConnectivityCoverageTests when run on older releases.

Use the system API constant instead, since that is guaranteeed to
be stable. The constant was added in ag/5795405.

Test: atest ConnectivityCoverageTests
Change-Id: I956f9fac4b89cf8429bf46682b52c0203cc4210e
This commit is contained in:
Lorenzo Colitti
2022-02-21 15:52:23 +09:00
parent dad3c928d8
commit ea9b16facf

View File

@@ -293,7 +293,7 @@ public class LockdownVpnTracker {
.addAction(R.drawable.ic_menu_refresh, mContext.getString(R.string.reset),
mResetIntent)
.setColor(mContext.getColor(
com.android.internal.R.color.system_notification_accent_color));
android.R.color.system_notification_accent_color));
mNotificationManager.notify(null /* tag */, SystemMessage.NOTE_VPN_STATUS,
builder.build());