[Safer intents] Permission controller
To avoid implicit intents, make intents launch explicitly. Test: build, manual Bug: 323061508 Change-Id: Ib95b417fc8682f690890fc55f321b4fece2c0369
This commit is contained in:
@@ -18,11 +18,16 @@ package com.android.settings.applications;
|
||||
|
||||
import android.app.role.RoleManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.icu.text.ListFormatter;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.text.BidiFormatter;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.applications.AppUtils;
|
||||
@@ -47,6 +52,17 @@ public class DefaultAppsPreferenceController extends BasePreferenceController {
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayPreference(@NonNull PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
|
||||
Preference pref = screen.findPreference(getPreferenceKey());
|
||||
if (pref != null) {
|
||||
pref.setIntent(new Intent(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS)
|
||||
.setPackage(mPackageManager.getPermissionControllerPackageName()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
final List<CharSequence> defaultAppLabels = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user