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

Commit 873dea16 authored by Achim Thesmann's avatar Achim Thesmann Committed by Android (Google) Code Review
Browse files

Merge "Remove get/setPendingIntentBackgroundActivityLaunchAllowedByPermission" into main

parents 53ac1c63 ee522d79
Loading
Loading
Loading
Loading
+1 −37
Original line number Diff line number Diff line
@@ -105,17 +105,10 @@ public class ComponentOptions {
    public @NonNull ComponentOptions setPendingIntentBackgroundActivityStartMode(
            @BackgroundActivityStartMode int state) {
        switch (state) {
            case MODE_BACKGROUND_ACTIVITY_START_ALLOWED:
                if (mPendingIntentBalAllowed != MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS) {
                    // do not overwrite ALWAYS with ALLOWED for backwards compatibility,
                    // if setPendingIntentBackgroundActivityLaunchAllowedByPermission is used
                    // before this method.
                    mPendingIntentBalAllowed = state;
                }
                break;
            case MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED:
            case MODE_BACKGROUND_ACTIVITY_START_DENIED:
            case MODE_BACKGROUND_ACTIVITY_START_COMPAT:
            case MODE_BACKGROUND_ACTIVITY_START_ALLOWED:
            case MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS:
            case MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE:
                mPendingIntentBalAllowed = state;
@@ -139,35 +132,6 @@ public class ComponentOptions {
        return mPendingIntentBalAllowed;
    }

    /**
     * Get PendingIntent activity is allowed to be started in the background if the caller
     * has BAL permission.
     * @hide
     * @deprecated check for #MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
     */
    @Deprecated
    public boolean isPendingIntentBackgroundActivityLaunchAllowedByPermission() {
        return mPendingIntentBalAllowed == MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS;
    }

    /**
     * Set PendingIntent activity can be launched from background if caller has BAL permission.
     * @hide
     * @deprecated use #MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
     */
    @Deprecated
    public void setPendingIntentBackgroundActivityLaunchAllowedByPermission(boolean allowed) {
        if (allowed) {
            setPendingIntentBackgroundActivityStartMode(
                    MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
        } else {
            if (getPendingIntentBackgroundActivityStartMode()
                    == MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS) {
                setPendingIntentBackgroundActivityStartMode(MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
            }
        }
    }

    /** @hide */
    public Bundle toBundle() {
        Bundle b = new Bundle();