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

Commit b076e00c authored by Bartosz Fabianowski's avatar Bartosz Fabianowski
Browse files

Finish removing N/A DO disclosures from search index

DO disclosures referring to actions that the admin did not actually
take are hidden in the UI, but still show up in the search index. This
CL switches the remaining PreferenceControllers from setting visibility
to implementing isAvailable() instead.

Bug: 32692748
Test: m RunSettingsRoboTests

Change-Id: I54360698f28b549b18cdc230e3b9087cf4e9ff4a
parent 4a196252
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -54,9 +54,10 @@ public interface ApplicationFeatureProvider {
     *
     * @param permissions Only consider apps that have been granted one or more of these permissions
     *        by the admin, either at run-time or install-time
     * @param async Whether to count asynchronously in a background thread
     * @param callback The callback to invoke with the result
     */
    void calculateNumberOfAppsWithAdminGrantedPermissions(String[] permissions,
    void calculateNumberOfAppsWithAdminGrantedPermissions(String[] permissions, boolean async,
            NumberOfAppsCallback callback);

    /**
+9 −3
Original line number Diff line number Diff line
@@ -69,9 +69,15 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide

    @Override
    public void calculateNumberOfAppsWithAdminGrantedPermissions(String[] permissions,
            NumberOfAppsCallback callback) {
        new AllUserAppWithAdminGrantedPermissionsCounter(mContext, permissions, mPm, mPms, mDpm,
                callback).execute();
            boolean async, NumberOfAppsCallback callback) {
        final AllUserAppWithAdminGrantedPermissionsCounter counter =
                new AllUserAppWithAdminGrantedPermissionsCounter(mContext, permissions, mPm, mPms,
                        mDpm, callback);
        if (async) {
            counter.execute();
        } else {
            counter.executeInForeground();
        }
    }

    @Override
+6 −2
Original line number Diff line number Diff line
@@ -17,14 +17,18 @@ package com.android.settings.enterprise;
import android.Manifest;
import android.content.Context;

import com.android.settings.core.lifecycle.Lifecycle;

public class AdminGrantedCameraPermissionPreferenceController extends
        AdminGrantedPermissionsPreferenceControllerBase {

    private static final String KEY_ENTERPRISE_PRIVACY_NUMBER_CAMERA_ACCESS_PACKAGES
            = "enterprise_privacy_number_camera_access_packages";

    public AdminGrantedCameraPermissionPreferenceController(Context context) {
        super(context, new String[] {Manifest.permission.CAMERA}, Manifest.permission_group.CAMERA);
    public AdminGrantedCameraPermissionPreferenceController(Context context, Lifecycle lifecycle,
            boolean async) {
        super(context, lifecycle, async, new String[] {Manifest.permission.CAMERA},
                Manifest.permission_group.CAMERA);
    }

    @Override
+5 −2
Original line number Diff line number Diff line
@@ -17,14 +17,17 @@ package com.android.settings.enterprise;
import android.Manifest;
import android.content.Context;

import com.android.settings.core.lifecycle.Lifecycle;

public class AdminGrantedLocationPermissionsPreferenceController extends
        AdminGrantedPermissionsPreferenceControllerBase {

    private static final String KEY_ENTERPRISE_PRIVACY_NUMBER_LOCATION_ACCESS_PACKAGES
            = "enterprise_privacy_number_location_access_packages";

    public AdminGrantedLocationPermissionsPreferenceController(Context context) {
        super(context, new String[] {Manifest.permission.ACCESS_COARSE_LOCATION,
    public AdminGrantedLocationPermissionsPreferenceController(Context context, Lifecycle lifecycle,
            boolean async) {
        super(context, lifecycle, async, new String[] {Manifest.permission.ACCESS_COARSE_LOCATION,
                Manifest.permission.ACCESS_FINE_LOCATION}, Manifest.permission_group.LOCATION);
    }

+5 −2
Original line number Diff line number Diff line
@@ -17,14 +17,17 @@ package com.android.settings.enterprise;
import android.Manifest;
import android.content.Context;

import com.android.settings.core.lifecycle.Lifecycle;

public class AdminGrantedMicrophonePermissionPreferenceController extends
        AdminGrantedPermissionsPreferenceControllerBase {

    private static final String KEY_ENTERPRISE_PRIVACY_NUMBER_MICROPHONE_ACCESS_PACKAGES
            = "enterprise_privacy_number_microphone_access_packages";

    public AdminGrantedMicrophonePermissionPreferenceController(Context context) {
        super(context, new String[] {Manifest.permission.RECORD_AUDIO},
    public AdminGrantedMicrophonePermissionPreferenceController(Context context,
            Lifecycle lifecycle, boolean async) {
        super(context, lifecycle, async, new String[] {Manifest.permission.RECORD_AUDIO},
                Manifest.permission_group.MICROPHONE);
    }

Loading