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

Commit b4ed9473 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "ContentSuggestionsService - allow user manager to disable content suggestions."

parents 64d8e5cd 3e12ac74
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -35493,6 +35493,7 @@ package android.os {
    field public static final String DISALLOW_CONFIG_VPN = "no_config_vpn";
    field public static final String DISALLOW_CONFIG_WIFI = "no_config_wifi";
    field public static final String DISALLOW_CONTENT_CAPTURE = "no_content_capture";
    field public static final String DISALLOW_CONTENT_SUGGESTIONS = "no_content_suggestions";
    field public static final String DISALLOW_CREATE_WINDOWS = "no_create_windows";
    field public static final String DISALLOW_CROSS_PROFILE_COPY_PASTE = "no_cross_profile_copy_paste";
    field public static final String DISALLOW_DATA_ROAMING = "no_data_roaming";
+15 −0
Original line number Diff line number Diff line
@@ -953,6 +953,21 @@ public class UserManager {
     */
    public static final String DISALLOW_CONTENT_CAPTURE = "no_content_capture";

    /**
     * Specifies if the current user is able to receive content suggestions for selections based on
     * the contents of their screen.
     *
     * <p>Device owner and profile owner can set this restriction. When it is set by device owner,
     * only the target user will be affected.
     *
     * <p>The default value is <code>false</code>.
     *
     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
     * @see #getUserRestrictions()
     */
    public static final String DISALLOW_CONTENT_SUGGESTIONS = "no_content_suggestions";

    /**
     * Specifies if user switching is blocked on the current user.
     *
+3 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.os.RemoteException;
import android.os.ResultReceiver;
import android.os.ShellCallback;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Slog;

import com.android.server.LocalServices;
@@ -63,7 +64,8 @@ public class ContentSuggestionsManagerService extends

    public ContentSuggestionsManagerService(Context context) {
        super(context, new FrameworkResourcesServiceNameResolver(context,
                com.android.internal.R.string.config_defaultContentSuggestionsService), null);
                com.android.internal.R.string.config_defaultContentSuggestionsService),
                UserManager.DISALLOW_CONTENT_SUGGESTIONS);
        mActivityTaskManagerInternal = LocalServices.getService(ActivityTaskManagerInternal.class);
    }

+1 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_UNMUTE_DEVICE,
            UserManager.DISALLOW_AUTOFILL,
            UserManager.DISALLOW_CONTENT_CAPTURE,
            UserManager.DISALLOW_CONTENT_SUGGESTIONS,
            UserManager.DISALLOW_USER_SWITCH,
            UserManager.DISALLOW_UNIFIED_PASSWORD,
            UserManager.DISALLOW_CONFIG_LOCATION,