Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbf18a28 authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Add RECEIVER_EXPORTED flags to screenshots

Builds on T+ require either the RECEIVER_EXPORTED or
RECEIVER_NOT_EXPORTED flag to be set when registering a broadcast
receiver. Recently a change went in to change from logging a
warning to throwing an error, causing sysui to crash when screenshots
are taken. This change adds the RECEIVER_EXPORTED flag to screenshot
code.

Bug: 213406883
Fix: 213406883
Test: verified that warnings no longer appear and sysui does not
crash when taking a screenshot

Change-Id: I0fa1c2272f1a994e51945be5f6c67cdccbb84cc2
parent 06425229
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ public class ScreenshotHelper {
    public ScreenshotHelper(Context context) {
        mContext = context;
        IntentFilter filter = new IntentFilter(ACTION_USER_SWITCHED);
        mContext.registerReceiver(mBroadcastReceiver, filter);
        mContext.registerReceiver(mBroadcastReceiver, filter, Context.RECEIVER_EXPORTED);
    }

    /**
+2 −1
Original line number Diff line number Diff line
@@ -113,7 +113,8 @@ public class TakeScreenshotService extends Service {

    @Override
    public IBinder onBind(@NonNull Intent intent) {
        registerReceiver(mCloseSystemDialogs, new IntentFilter(ACTION_CLOSE_SYSTEM_DIALOGS));
        registerReceiver(mCloseSystemDialogs, new IntentFilter(ACTION_CLOSE_SYSTEM_DIALOGS),
                Context.RECEIVER_EXPORTED);
        final Messenger m = new Messenger(mHandler);
        if (DEBUG_SERVICE) {
            Log.d(TAG, "onBind: returning connection: " + m);