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

Commit 2dc1d97c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove android.os.load_haptic_feedback_vibration_customization_from_resources" into main

parents b5a36371 67ac1d2a
Loading
Loading
Loading
Loading
+0 −11
Original line number Original line Diff line number Diff line
@@ -34,17 +34,6 @@ flag {
    }
    }
}
}


flag {
    namespace: "haptics"
    name: "load_haptic_feedback_vibration_customization_from_resources"
    description: "Load haptic feedback vibrations customization from resources."
    is_fixed_read_only: true
    bug: "295142743"
    metadata {
        purpose: PURPOSE_FEATURE
    }
}

flag {
flag {
    namespace: "haptics"
    namespace: "haptics"
    name: "haptic_feedback_input_source_customization_enabled"
    name: "haptic_feedback_input_source_customization_enabled"
+0 −4
Original line number Original line Diff line number Diff line
@@ -25,7 +25,6 @@ import android.content.res.XmlResourceParser;
import android.os.VibrationAttributes;
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
import android.os.VibrationEffect;
import android.os.VibratorInfo;
import android.os.VibratorInfo;
import android.os.vibrator.Flags;
import android.os.vibrator.persistence.ParsedVibration;
import android.os.vibrator.persistence.ParsedVibration;
import android.os.vibrator.persistence.VibrationXmlParser;
import android.os.vibrator.persistence.VibrationXmlParser;
import android.text.TextUtils;
import android.text.TextUtils;
@@ -275,9 +274,6 @@ final class HapticFeedbackCustomization {


    @Nullable
    @Nullable
    private static TypedXmlPullParser readCustomizationResources(Resources res, int xmlResId) {
    private static TypedXmlPullParser readCustomizationResources(Resources res, int xmlResId) {
        if (!Flags.loadHapticFeedbackVibrationCustomizationFromResources()) {
            return null;
        }
        final XmlResourceParser resParser;
        final XmlResourceParser resParser;
        try {
        try {
            resParser = res.getXml(xmlResId);
            resParser = res.getXml(xmlResId);
+1 −3
Original line number Original line Diff line number Diff line
@@ -25,12 +25,11 @@ import static android.os.VibrationEffect.EFFECT_HEAVY_CLICK;
import static android.os.VibrationEffect.EFFECT_TICK;
import static android.os.VibrationEffect.EFFECT_TICK;
import static android.os.vibrator.Flags.FLAG_HAPTIC_FEEDBACK_INPUT_SOURCE_CUSTOMIZATION_ENABLED;
import static android.os.vibrator.Flags.FLAG_HAPTIC_FEEDBACK_INPUT_SOURCE_CUSTOMIZATION_ENABLED;
import static android.os.vibrator.Flags.FLAG_HAPTIC_FEEDBACK_WITH_CUSTOM_USAGE;
import static android.os.vibrator.Flags.FLAG_HAPTIC_FEEDBACK_WITH_CUSTOM_USAGE;
import static android.os.vibrator.Flags.FLAG_LOAD_HAPTIC_FEEDBACK_VIBRATION_CUSTOMIZATION_FROM_RESOURCES;


import static com.android.internal.R.xml.haptic_feedback_customization;
import static com.android.internal.R.xml.haptic_feedback_customization;
import static com.android.internal.R.xml.haptic_feedback_customization_usage_gesture_input;
import static com.android.internal.R.xml.haptic_feedback_customization_source_rotary_encoder;
import static com.android.internal.R.xml.haptic_feedback_customization_source_rotary_encoder;
import static com.android.internal.R.xml.haptic_feedback_customization_source_touchscreen;
import static com.android.internal.R.xml.haptic_feedback_customization_source_touchscreen;
import static com.android.internal.R.xml.haptic_feedback_customization_usage_gesture_input;


import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertThat;


@@ -592,7 +591,6 @@ public class HapticFeedbackCustomizationTest {


    private void setupCustomizationResource(String xml, int xmlResId) throws Exception {
    private void setupCustomizationResource(String xml, int xmlResId) throws Exception {
        mSetFlagsRule.enableFlags(FLAG_HAPTIC_FEEDBACK_INPUT_SOURCE_CUSTOMIZATION_ENABLED);
        mSetFlagsRule.enableFlags(FLAG_HAPTIC_FEEDBACK_INPUT_SOURCE_CUSTOMIZATION_ENABLED);
        mSetFlagsRule.enableFlags(FLAG_LOAD_HAPTIC_FEEDBACK_VIBRATION_CUSTOMIZATION_FROM_RESOURCES);
        mSetFlagsRule.enableFlags(FLAG_HAPTIC_FEEDBACK_WITH_CUSTOM_USAGE);
        mSetFlagsRule.enableFlags(FLAG_HAPTIC_FEEDBACK_WITH_CUSTOM_USAGE);
        doReturn(FakeXmlResourceParser.fromXml(xml)).when(mResourcesMock).getXml(xmlResId);
        doReturn(FakeXmlResourceParser.fromXml(xml)).when(mResourcesMock).getXml(xmlResId);
    }
    }