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

Commit 57c032bf authored by Ricky Wai's avatar Ricky Wai
Browse files

Only add boolean extra to bundle when the value is false

As the default value is false, we don't need to put it in bundle if the value is false.

Bug: 234070143
Test: atest android.app.cts.BroadcastOptionsTest#testTemporaryAppAllowlistBroadcastOptions_defaultValues
Change-Id: Ia23d2a03f8c3c64d25b47ed9a8d02ae22ce9246b
parent b67a965f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -99,8 +99,10 @@ public class ComponentOptions {
    public Bundle toBundle() {
        Bundle b = new Bundle();
        b.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED, mPendingIntentBalAllowed);
        if (mPendingIntentBalAllowedByPermission) {
            b.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION,
                    mPendingIntentBalAllowedByPermission);
        }
        return b;
    }
}