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

Commit e322b1bf authored by Richard MacGregor's avatar Richard MacGregor
Browse files

Create intent actions for AppFunction access UI

Intents for AppFunction access settings

Bug: 414806028
Flag: android.permission.flags.app_function_access_ui_enabled
Test: build
Change-Id: Ia233bc32e6eac4dcd136682ead3475e481a799dc
parent 353de5eb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -8953,6 +8953,9 @@ package android.app.appfunctions {
    method @RequiresPermission(value=android.Manifest.permission.EXECUTE_APP_FUNCTIONS, conditional=true) public void isAppFunctionEnabled(@NonNull String, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,java.lang.Exception>);
    method public void isAppFunctionEnabled(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,java.lang.Exception>);
    method public void setAppFunctionEnabled(@NonNull String, int, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,java.lang.Exception>);
    field @FlaggedApi("android.permission.flags.app_function_access_ui_enabled") public static final String ACTION_MANAGE_AGENT_APP_FUNCTION_ACCESS = "android.app.appfunctions.action.MANAGE_AGENT_APP_FUNCTION_ACCESS";
    field @FlaggedApi("android.permission.flags.app_function_access_ui_enabled") public static final String ACTION_MANAGE_APP_FUNCTION_ACCESS = "android.app.appfunctions.action.MANAGE_APP_FUNCTION_ACCESS";
    field @FlaggedApi("android.permission.flags.app_function_access_ui_enabled") public static final String ACTION_MANAGE_TARGET_APP_FUNCTION_ACCESS = "android.app.appfunctions.action.MANAGE_TARGET_APP_FUNCTION_ACCESS";
    field public static final int APP_FUNCTION_STATE_DEFAULT = 0; // 0x0
    field public static final int APP_FUNCTION_STATE_DISABLED = 2; // 0x2
    field public static final int APP_FUNCTION_STATE_ENABLED = 1; // 0x1
+50 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.app.appfunctions;

import static android.app.appfunctions.AppFunctionException.ERROR_SYSTEM_ERROR;
import static android.app.appfunctions.flags.Flags.FLAG_ENABLE_APP_FUNCTION_MANAGER;
import static android.permission.flags.Flags.FLAG_APP_FUNCTION_ACCESS_UI_ENABLED;

import android.Manifest;
import android.annotation.CallbackExecutor;
@@ -25,6 +26,7 @@ import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SystemService;
import android.annotation.UserHandleAware;
import android.app.appfunctions.AppFunctionManagerHelper.AppFunctionNotFoundException;
@@ -90,6 +92,54 @@ import java.util.concurrent.Executor;
@SystemService(Context.APP_FUNCTION_SERVICE)
public final class AppFunctionManager {

    /**
     * Activity action: Launch UI to manage App Function access.
     * <p>
     * Input: Nothing.
     * </p>
     * <p>
     * Output: Nothing.
     * </p>
     */
    @FlaggedApi(FLAG_APP_FUNCTION_ACCESS_UI_ENABLED)
    @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_MANAGE_APP_FUNCTION_ACCESS =
            "android.app.appfunctions.action.MANAGE_APP_FUNCTION_ACCESS";

    /**
     * Activity action: Launch UI to manage App Function access for a specific agent app.
     * <p>
     * Input: {@link android.content.Intent#EXTRA_PACKAGE_NAME} specifies the package whose access
     * will be managed by the launched UI.
     * </p>
     * <p>
     * Output: Nothing.
     * </p>
     *
     * @see android.content.Intent#EXTRA_PACKAGE_NAME
     */
    @FlaggedApi(FLAG_APP_FUNCTION_ACCESS_UI_ENABLED)
    @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_MANAGE_AGENT_APP_FUNCTION_ACCESS =
            "android.app.appfunctions.action.MANAGE_AGENT_APP_FUNCTION_ACCESS";

    /**
     * Activity action: Launch UI to manage App Function access for a specific target app.
     * <p>
     * Input: {@link android.content.Intent#EXTRA_PACKAGE_NAME} specifies the package whose access
     * will be managed by the launched UI.
     * </p>
     * <p>
     * Output: Nothing.
     * </p>
     *
     * @see android.content.Intent#EXTRA_PACKAGE_NAME
     */
    @FlaggedApi(FLAG_APP_FUNCTION_ACCESS_UI_ENABLED)
    @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_MANAGE_TARGET_APP_FUNCTION_ACCESS =
            "android.app.appfunctions.action.MANAGE_TARGET_APP_FUNCTION_ACCESS";

    /**
     * The default state of the app function. Call {@link #setAppFunctionEnabled} with this to reset
     * enabled state to the default value.