Merge "Prevent bad apps from getting Setting Slices" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7f9a86d869
@@ -18,9 +18,11 @@ package com.android.settings.slices;
|
||||
|
||||
import static android.Manifest.permission.READ_SEARCH_INDEXABLES;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.app.slice.SliceManager;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.Uri;
|
||||
import android.os.StrictMode;
|
||||
@@ -32,6 +34,8 @@ import android.util.KeyValueListParser;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.collection.ArraySet;
|
||||
import androidx.slice.Slice;
|
||||
@@ -295,6 +299,16 @@ public class SettingsSliceProvider extends SliceProvider {
|
||||
return descendants;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PendingIntent onCreatePermissionRequest(@NonNull Uri sliceUri,
|
||||
@NonNull String callingPackage) {
|
||||
final Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS);
|
||||
final PendingIntent noOpIntent = PendingIntent.getActivity(getContext(),
|
||||
0 /* requestCode */, settingsIntent, 0 /* flags */);
|
||||
return noOpIntent;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
static void grantWhitelistedPackagePermissions(Context context, List<Uri> descendants) {
|
||||
if (descendants == null) {
|
||||
|
Reference in New Issue
Block a user