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

Commit 0bd014c4 authored by Jason Chiu's avatar Jason Chiu
Browse files

[Safer intents] Settings misc

To avoid implicit intents, make intents launch explicitly.

Test: build
Bug: 323061508
Change-Id: Ie19cbceb89842a75a180898abcce81b63c18d46c
parent 9507bdb3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -175,7 +175,8 @@
            android:title="@string/financed_device_info"
            android:summary="@string/summary_placeholder"
            settings:controller="com.android.settings.devicelock.DeviceLockPreferenceController">
            <intent android:action="com.android.devicelockcontroller.action.DEVICE_INFO_SETTINGS"/>
            <intent android:action="com.android.devicelockcontroller.action.DEVICE_INFO_SETTINGS"
                    android:targetPackage="@string/config_device_lock_controller_package_name"/>
        </Preference>
    </PreferenceCategory>

+11 −7
Original line number Diff line number Diff line
@@ -19,7 +19,9 @@
        android:shortcutId="manifest-shortcut-wifi"
        android:icon="@drawable/ic_shortcut_wireless"
        android:shortcutShortLabel="@string/wifi_settings">
        <intent android:action="android.settings.WIFI_SETTINGS" />
        <intent
            android:action="android.settings.WIFI_SETTINGS"
            android:targetPackage="${applicationId}"/>
    </shortcut>
    <shortcut
        android:shortcutId="manifest-shortcut-data-usage"
@@ -28,13 +30,15 @@
        android:shortcutShortLabel="@string/data_usage_summary_title">
        <intent
            android:action="android.intent.action.MAIN"
            android:targetPackage="com.android.settings"
            android:targetPackage="${applicationId}"
            android:targetClass="com.android.settings.Settings$DataUsageSummaryActivity"/>
    </shortcut>
    <shortcut
        android:shortcutId="manifest-shortcut-battery"
        android:icon="@drawable/ic_shortcut_battery"
        android:shortcutShortLabel="@string/power_usage_summary_title">
        <intent android:action="android.intent.action.POWER_USAGE_SUMMARY" />
        <intent
            android:action="android.intent.action.POWER_USAGE_SUMMARY"
            android:targetPackage="${applicationId}"/>
    </shortcut>
</shortcuts>
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -31,7 +31,8 @@ public class BrightnessPreference extends Preference {

    @Override
    protected void onClick() {
        getContext().startActivityAsUser(new Intent(Intent.ACTION_SHOW_BRIGHTNESS_DIALOG),
        getContext().startActivityAsUser(new Intent(Intent.ACTION_SHOW_BRIGHTNESS_DIALOG)
                        .setPackage(Utils.SYSTEMUI_PACKAGE_NAME),
                UserHandle.CURRENT_OR_SELF);
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -74,7 +74,8 @@ public class RingtonePreference extends Preference {
                true);
        mShowSilent = a.getBoolean(com.android.internal.R.styleable.RingtonePreference_showSilent,
                true);
        setIntent(new Intent(RingtoneManager.ACTION_RINGTONE_PICKER));
        setIntent(new Intent(RingtoneManager.ACTION_RINGTONE_PICKER)
                .setPackage(context.getString(R.string.config_sound_picker_package_name)));
        setUserId(UserHandle.myUserId());
        a.recycle();
    }
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public class LiveCaptionPreferenceController extends BasePreferenceController {
    public LiveCaptionPreferenceController(Context context, String preferenceKey) {
        super(context, preferenceKey);
        mPackageManager = context.getPackageManager();
        LIVE_CAPTION_INTENT.setPackage(mPackageManager.getSystemCaptionsServicePackageName());
    }

    @Override
Loading