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

Commit 70f72351 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Link ColorInversionTile to Preference

Add key in the intent to highlight the correct preference when the tile
is long pressed.

Test: manual
Fixes: 158874079
Change-Id: I44953b4ab7d625636c5e41dcf0402bd02c224f1a
parent dc91aaab
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.qs.tiles;

import android.content.Intent;
import android.os.Bundle;
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.service.quicksettings.Tile;
@@ -35,6 +36,10 @@ import javax.inject.Inject;
/** Quick settings tile: Invert colors **/
public class ColorInversionTile extends QSTileImpl<BooleanState> {

    private static final String EXTRA_FRAGMENT_ARGS_KEY = ":settings:fragment_args_key";
    private static final String EXTRA_SHOW_FRAGMENT_ARGS_KEY = ":settings:show_fragment_args";
    private static final String COLOR_INVERSION_PREFERENCE_KEY = "toggle_inversion_preference";

    private final Icon mIcon = ResourceIcon.get(drawable.ic_invert_colors);
    private final SecureSetting mSetting;

@@ -78,7 +83,11 @@ public class ColorInversionTile extends QSTileImpl<BooleanState> {

    @Override
    public Intent getLongClickIntent() {
        return new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
        Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
        Bundle bundle = new Bundle();
        bundle.putString(EXTRA_FRAGMENT_ARGS_KEY, COLOR_INVERSION_PREFERENCE_KEY);
        intent.putExtra(EXTRA_SHOW_FRAGMENT_ARGS_KEY, bundle);
        return intent;
    }

    @Override