Send a broadcast when turning grayscale off

When users turn grayscale off in Settings, Settings will send an intent
to receivers who have requested the CONTROL_DISPLAY_COLOR_TRANSFORMS
permission. We also specify FLAG_RECIEVER_INCLUDE_BACKGROUND to make
sure that the intent could be sent to manifest receivers.

Bug: 118387886
Test: robotests
Change-Id: Ib0c959e72dd4068014951347df35409790c77ab5
This commit is contained in:
Mill Chen
2019-03-29 23:44:57 -07:00
parent 77d8cff015
commit 526fb9f8fb

View File

@@ -113,8 +113,8 @@ public class GrayscaleConditionController implements ConditionalCardController {
} }
private void sendBroadcast() { private void sendBroadcast() {
final Intent intent = new Intent(); final Intent intent = new Intent(ACTION_GRAYSCALE_CHANGED);
intent.setAction(ACTION_GRAYSCALE_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
mAppContext.sendBroadcast(intent, Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS); mAppContext.sendBroadcast(intent, Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS);
} }