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

Commit b65c7fa0 authored by Nate Myren's avatar Nate Myren
Browse files

Remove permission usage from settings search

Remove the ability to find the permission dashboard by searching
settings, and remove the code to handle that intent in the
ManagePermissionActivityTrampoline.

Fixes: 146560886

Test: Go to settings-> search "permission". The "permission dashboard"
should not be in the options

Change-Id: Ib9fc8ab635ed648bc05dcdb23f3d086062bee84c
parent 5538e7c2
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -42,8 +42,6 @@ public class PermissionSearchIndexablesProvider extends BaseSearchIndexablesProv

    public static final String ACTION_MANAGE_PERMISSION_APPS =
            "com.android.permissioncontroller.settingssearch.action.MANAGE_PERMISSION_APPS";
    public static final String ACTION_REVIEW_PERMISSION_USAGE =
            "com.android.permissioncontroller.settingssearch.action.REVIEW_PERMISSION_USAGE";

    @Override
    public Cursor queryRawData(String[] projection) {
@@ -67,12 +65,6 @@ public class PermissionSearchIndexablesProvider extends BaseSearchIndexablesProv
                    .add(COLUMN_INTENT_ACTION, ACTION_MANAGE_PERMISSION_APPS);
        }

        cursor.newRow().add(COLUMN_RANK, 0)
                .add(COLUMN_TITLE, context.getString(R.string.permission_usage_title))
                .add(COLUMN_KEYWORDS, context.getString(R.string.permission_search_keyword))
                .add(COLUMN_KEY, createRawDataKey("permissions usage", context))
                .add(COLUMN_INTENT_ACTION, ACTION_REVIEW_PERMISSION_USAGE);

        return cursor;
    }

+8 −13
Original line number Diff line number Diff line
@@ -45,17 +45,12 @@ public class ManagePermissionsActivityTrampoline extends Activity {

        Intent newIntent = new Intent(this, ManagePermissionsActivity.class)
                .addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
        switch (action) {
            case PermissionSearchIndexablesProvider.ACTION_REVIEW_PERMISSION_USAGE:
                newIntent.setAction(Intent.ACTION_REVIEW_PERMISSION_USAGE);
                break;
            case PermissionSearchIndexablesProvider.ACTION_MANAGE_PERMISSION_APPS:
        if (action.equals(PermissionSearchIndexablesProvider.ACTION_MANAGE_PERMISSION_APPS)) {
            newIntent
                    .setAction(Intent.ACTION_MANAGE_PERMISSION_APPS)
                    .putExtra(Intent.EXTRA_PERMISSION_NAME,
                            PermissionSearchIndexablesProvider.getOriginalKey(intent));
                break;
            default:
        } else {
            finish();
            return;
        }