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

Commit ee522d79 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Remove get/setPendingIntentBackgroundActivityLaunchAllowedByPermission

As the final step in reactoring the API usage remove the old methods.

Test: atest BackgroundActivityStartControllerExemptionTests BackgroundActivityStartControllerTests ActivityOptionsTest ActivityStarterTests BackgroundActivityLaunchTest
Flag: EXEMPT refactor
Bug: 352182359
Change-Id: I2004ccf5a1fc21d03bd869a365ba1ffe7b382307
parent f6f83051
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();