Cleanup flag "audio_balance_state_description"
Bug: b/319575109 Test: atest BalanceSeekBarTest Flag: EXEMPT flag cleanup Change-Id: I5057a7732f5986533ff8a6b0ebf60e8a55a1dc9f
This commit is contained in:
committed by
Camden Bickel
parent
bf47e4419d
commit
330834b819
@@ -89,7 +89,7 @@ public class BalanceSeekBar extends SeekBar {
|
|||||||
Settings.System.MASTER_BALANCE, balance, UserHandle.USER_CURRENT);
|
Settings.System.MASTER_BALANCE, balance, UserHandle.USER_CURRENT);
|
||||||
}
|
}
|
||||||
final int max = getMax();
|
final int max = getMax();
|
||||||
if (Flags.audioBalanceStateDescription() && max > 0) {
|
if (max > 0) {
|
||||||
seekBar.setStateDescription(createStateDescription(mContext,
|
seekBar.setStateDescription(createStateDescription(mContext,
|
||||||
R.string.audio_seek_bar_state_left_first,
|
R.string.audio_seek_bar_state_left_first,
|
||||||
R.string.audio_seek_bar_state_right_first,
|
R.string.audio_seek_bar_state_right_first,
|
||||||
|
@@ -28,8 +28,6 @@ import static org.mockito.Mockito.verify;
|
|||||||
import static org.robolectric.Shadows.shadowOf;
|
import static org.robolectric.Shadows.shadowOf;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.platform.test.annotations.EnableFlags;
|
|
||||||
import android.platform.test.flag.junit.SetFlagsRule;
|
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
|
|
||||||
@@ -38,7 +36,6 @@ import com.android.settings.Utils;
|
|||||||
import com.android.settings.testutils.shadow.ShadowSystemSettings;
|
import com.android.settings.testutils.shadow.ShadowSystemSettings;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.robolectric.RobolectricTestRunner;
|
import org.robolectric.RobolectricTestRunner;
|
||||||
@@ -52,9 +49,6 @@ import java.util.Locale;
|
|||||||
ShadowSystemSettings.class,
|
ShadowSystemSettings.class,
|
||||||
})
|
})
|
||||||
public class BalanceSeekBarTest {
|
public class BalanceSeekBarTest {
|
||||||
@Rule
|
|
||||||
public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
|
|
||||||
|
|
||||||
// Fix the maximum process value to 200 for testing the BalanceSeekBar.
|
// Fix the maximum process value to 200 for testing the BalanceSeekBar.
|
||||||
// It affects the SeekBar value of center(100) and snapThreshold(200 * SNAP_TO_PERCENTAGE).
|
// It affects the SeekBar value of center(100) and snapThreshold(200 * SNAP_TO_PERCENTAGE).
|
||||||
private static final int MAX_PROGRESS_VALUE = 200;
|
private static final int MAX_PROGRESS_VALUE = 200;
|
||||||
@@ -154,7 +148,6 @@ public class BalanceSeekBarTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@EnableFlags(Flags.FLAG_AUDIO_BALANCE_STATE_DESCRIPTION)
|
|
||||||
public void onProgressChanged_getStateDescription_centered_leftFirst() {
|
public void onProgressChanged_getStateDescription_centered_leftFirst() {
|
||||||
// Seek bar centered
|
// Seek bar centered
|
||||||
int progress = (int) (0.50f * MAX_PROGRESS_VALUE);
|
int progress = (int) (0.50f * MAX_PROGRESS_VALUE);
|
||||||
@@ -168,7 +161,6 @@ public class BalanceSeekBarTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@EnableFlags(Flags.FLAG_AUDIO_BALANCE_STATE_DESCRIPTION)
|
|
||||||
public void onProgressChanged_getStateDescription_centered_rtl_rightFirst() {
|
public void onProgressChanged_getStateDescription_centered_rtl_rightFirst() {
|
||||||
// RTL layout
|
// RTL layout
|
||||||
mContext.getResources().getConfiguration().setLayoutDirection(new Locale("iw", "IL"));
|
mContext.getResources().getConfiguration().setLayoutDirection(new Locale("iw", "IL"));
|
||||||
@@ -184,7 +176,6 @@ public class BalanceSeekBarTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@EnableFlags(Flags.FLAG_AUDIO_BALANCE_STATE_DESCRIPTION)
|
|
||||||
public void onProgressChanged_getStateDescription_25percent_leftFirst() {
|
public void onProgressChanged_getStateDescription_25percent_leftFirst() {
|
||||||
// Seek bar 3/4th toward the left
|
// Seek bar 3/4th toward the left
|
||||||
int progress = (int) (0.25f * MAX_PROGRESS_VALUE);
|
int progress = (int) (0.25f * MAX_PROGRESS_VALUE);
|
||||||
@@ -197,7 +188,6 @@ public class BalanceSeekBarTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@EnableFlags(Flags.FLAG_AUDIO_BALANCE_STATE_DESCRIPTION)
|
|
||||||
public void onProgressChanged_getStateDescription_75percent_rightFirst() {
|
public void onProgressChanged_getStateDescription_75percent_rightFirst() {
|
||||||
// Seek bar 3/4th toward the right
|
// Seek bar 3/4th toward the right
|
||||||
int progress = (int) (0.75f * MAX_PROGRESS_VALUE);
|
int progress = (int) (0.75f * MAX_PROGRESS_VALUE);
|
||||||
|
Reference in New Issue
Block a user