Snap for 11830997 from ee501485b8 to 24Q3-release
Change-Id: Ia0c04cbb6708fd620e0cee69dff805cea363749f
This commit is contained in:
35
TEST_MAPPING
35
TEST_MAPPING
@@ -6,25 +6,22 @@
|
||||
{
|
||||
"name": "SettingsUnitTests",
|
||||
"options": [
|
||||
{
|
||||
"include-filter": "com.android.settings.biometrics"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.biometrics2"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.password"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.privatespace"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.safetycenter"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.security"
|
||||
}
|
||||
]
|
||||
{
|
||||
"exclude-filter": "com.android.settings.fuelgauge.batterysaver"
|
||||
},
|
||||
{
|
||||
"exclude-filter": "com.android.settings.network.telephony"
|
||||
},
|
||||
{
|
||||
"exclude-filter": "com.android.settings.privatespace"
|
||||
},
|
||||
{
|
||||
"exclude-filter": "com.android.settings.regionalpreferences"
|
||||
},
|
||||
{
|
||||
"exclude-filter": "com.android.settings.vpn2"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"postsubmit": [
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:hyphenationFrequency="normalFast"
|
||||
android:lineBreakWordStyle="phrase"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@android:id/checkbox"
|
||||
@@ -58,6 +60,8 @@
|
||||
android:id="@android:id/summary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hyphenationFrequency="normalFast"
|
||||
android:lineBreakWordStyle="phrase"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
app:layout_constrainedHeight="true"
|
||||
|
||||
@@ -384,6 +384,13 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
||||
|| enableAngleController.isDefaultValue())) {
|
||||
disableDeveloperOptions();
|
||||
} else {
|
||||
// Disabling developer options in page-agnostic mode isn't supported as device
|
||||
// isn't in production state
|
||||
if (Enable16kUtils.isPageAgnosticModeOn(getContext())) {
|
||||
Enable16kUtils.showPageAgnosticWarning(getContext());
|
||||
onDisableDevelopmentOptionsRejected();
|
||||
return;
|
||||
}
|
||||
DisableDevSettingsDialogFragment.show(this /* host */);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,10 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen
|
||||
int status = data.getInt(SystemUpdateManager.KEY_STATUS);
|
||||
if (status != SystemUpdateManager.STATUS_UNKNOWN
|
||||
&& status != SystemUpdateManager.STATUS_IDLE) {
|
||||
throw new RuntimeException("System has pending update!");
|
||||
throw new RuntimeException(
|
||||
"System has pending update! Please restart the device to complete applying"
|
||||
+ " pending update. If you are seeing this after using 16KB developer"
|
||||
+ " options, please check configuration and OTA packages!");
|
||||
}
|
||||
|
||||
// Publish system update info
|
||||
@@ -313,7 +316,7 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen
|
||||
}
|
||||
|
||||
private void displayToast(String message) {
|
||||
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(mContext, message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -330,7 +333,7 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Throwable t) {
|
||||
Log.e(TAG, "Failed to change the /data partition with ext4");
|
||||
Log.e(TAG, "Failed to change the /data partition to ext4");
|
||||
displayToast(mContext.getString(R.string.format_ext4_failure_toast));
|
||||
}
|
||||
},
|
||||
@@ -405,6 +408,7 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
progressBar.setLayoutParams(params);
|
||||
progressBar.setPadding(0, 24, 0, 24);
|
||||
builder.setView(progressBar);
|
||||
builder.setCancelable(false);
|
||||
return builder.create();
|
||||
|
||||
@@ -70,8 +70,9 @@ public class EnableExt4WarningDialog extends InstrumentedDialogFragment
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setTitle(R.string.confirm_format_ext4_title)
|
||||
.setIcon(R.drawable.ic_delete_accent)
|
||||
.setMessage(R.string.confirm_format_ext4_text)
|
||||
.setPositiveButton(android.R.string.ok, this /* onClickListener */)
|
||||
.setPositiveButton(R.string.main_clear_confirm_title, this /* onClickListener */)
|
||||
.setNegativeButton(android.R.string.cancel, this /* onClickListener */)
|
||||
.create();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.android.settings.fuelgauge.BatteryUsageHistoricalLogEntry.Action;
|
||||
import com.android.settings.fuelgauge.batteryusage.bugreport.BatteryUsageLogUtils;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.time.Duration;
|
||||
|
||||
/** Manages the periodic job to schedule or cancel the next job. */
|
||||
@@ -41,8 +40,6 @@ public final class PeriodicJobManager {
|
||||
private final Context mContext;
|
||||
private final AlarmManager mAlarmManager;
|
||||
|
||||
@VisibleForTesting static final int DATA_FETCH_INTERVAL_MINUTE = 60;
|
||||
|
||||
@VisibleForTesting static long sBroadcastDelayFromBoot = Duration.ofMinutes(40).toMillis();
|
||||
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
|
||||
@@ -76,20 +73,21 @@ public final class PeriodicJobManager {
|
||||
// Cancels the previous alert job and schedules the next one.
|
||||
final PendingIntent pendingIntent = getPendingIntent();
|
||||
cancelJob(pendingIntent);
|
||||
// Uses UTC time to avoid scheduler is impacted by different timezone.
|
||||
final long triggerAtMillis = getTriggerAtMillis(mContext, Clock.systemUTC(), fromBoot);
|
||||
// Uses the timestamp of next full hour in local timezone.
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
final long triggerAtMillis = getTriggerAtMillis(currentTimeMillis, fromBoot);
|
||||
mAlarmManager.setExactAndAllowWhileIdle(
|
||||
AlarmManager.RTC_WAKEUP, triggerAtMillis, pendingIntent);
|
||||
|
||||
final String utcToLocalTime = ConvertUtils.utcToLocalTimeForLogging(triggerAtMillis);
|
||||
final String timeForLogging = ConvertUtils.utcToLocalTimeForLogging(triggerAtMillis);
|
||||
BatteryUsageLogUtils.writeLog(
|
||||
mContext,
|
||||
Action.SCHEDULE_JOB,
|
||||
String.format("triggerTime=%s, fromBoot=%b", utcToLocalTime, fromBoot));
|
||||
Log.d(TAG, "schedule next alarm job at " + utcToLocalTime);
|
||||
String.format("triggerTime=%s, fromBoot=%b", timeForLogging, fromBoot));
|
||||
Log.d(TAG, "schedule next alarm job at " + timeForLogging);
|
||||
}
|
||||
|
||||
void cancelJob(PendingIntent pendingIntent) {
|
||||
private void cancelJob(PendingIntent pendingIntent) {
|
||||
if (mAlarmManager != null) {
|
||||
mAlarmManager.cancel(pendingIntent);
|
||||
} else {
|
||||
@@ -97,22 +95,21 @@ public final class PeriodicJobManager {
|
||||
}
|
||||
}
|
||||
|
||||
/** Gets the next alarm trigger UTC time in milliseconds. */
|
||||
static long getTriggerAtMillis(Context context, Clock clock, final boolean fromBoot) {
|
||||
long currentTimeMillis = clock.millis();
|
||||
/** Gets the next alarm trigger time in milliseconds. */
|
||||
@VisibleForTesting
|
||||
static long getTriggerAtMillis(final long currentTimeMillis, final boolean fromBoot) {
|
||||
final boolean delayHourlyJobWhenBooting =
|
||||
FeatureFactory.getFeatureFactory()
|
||||
.getPowerUsageFeatureProvider()
|
||||
.delayHourlyJobWhenBooting();
|
||||
// Rounds to the previous nearest time slot and shifts to the next one.
|
||||
long timeSlotUnit = Duration.ofMinutes(DATA_FETCH_INTERVAL_MINUTE).toMillis();
|
||||
long targetTime = (currentTimeMillis / timeSlotUnit) * timeSlotUnit + timeSlotUnit;
|
||||
long targetTimeMillis = TimestampUtils.getNextHourTimestamp(currentTimeMillis);
|
||||
if (delayHourlyJobWhenBooting
|
||||
&& fromBoot
|
||||
&& (targetTime - currentTimeMillis) <= sBroadcastDelayFromBoot) {
|
||||
targetTime += timeSlotUnit;
|
||||
&& (targetTimeMillis - currentTimeMillis) <= sBroadcastDelayFromBoot) {
|
||||
// Skips this time broadcast, schedule in the next alarm trigger.
|
||||
targetTimeMillis = TimestampUtils.getNextHourTimestamp(targetTimeMillis);
|
||||
}
|
||||
return targetTime;
|
||||
return targetTimeMillis;
|
||||
}
|
||||
|
||||
private PendingIntent getPendingIntent() {
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.settings.fuelgauge.batteryusage;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.robolectric.Shadows.shadowOf;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
@@ -25,7 +26,7 @@ import android.content.Context;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
|
||||
import com.android.settings.testutils.FakeClock;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -35,6 +36,8 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadows.ShadowAlarmManager;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Calendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/** Tests of {@link PeriodicJobManager}. */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@@ -42,11 +45,14 @@ public final class PeriodicJobManagerTest {
|
||||
private Context mContext;
|
||||
private ShadowAlarmManager mShadowAlarmManager;
|
||||
private PeriodicJobManager mPeriodicJobManager;
|
||||
private FakeFeatureFactory mFeatureFactory;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mContext = ApplicationProvider.getApplicationContext();
|
||||
mPeriodicJobManager = PeriodicJobManager.getInstance(mContext);
|
||||
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||
doReturn(false).when(mFeatureFactory.powerUsageFeatureProvider).delayHourlyJobWhenBooting();
|
||||
mShadowAlarmManager = shadowOf(mContext.getSystemService(AlarmManager.class));
|
||||
}
|
||||
|
||||
@@ -68,28 +74,102 @@ public final class PeriodicJobManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTriggerAtMillis_withoutOffset_returnsExpectedResult() {
|
||||
long timeSlotUnit = PeriodicJobManager.DATA_FETCH_INTERVAL_MINUTE;
|
||||
// Sets the current time.
|
||||
Duration currentTimeDuration = Duration.ofMinutes(timeSlotUnit * 2);
|
||||
FakeClock fakeClock = new FakeClock();
|
||||
fakeClock.setCurrentTime(currentTimeDuration);
|
||||
public void getTriggerAtMillis_halfFullHourTimeZoneWithoutOffset_returnsExpectedResult() {
|
||||
final int minutesOffset = 0;
|
||||
final long currentTimestamp =
|
||||
setTimeZoneAndGenerateTestTimestamp(/* isFullHourTimeZone= */ false, minutesOffset);
|
||||
final long expectedTimestamp =
|
||||
currentTimestamp + Duration.ofMinutes(60 - minutesOffset).toMillis();
|
||||
|
||||
assertThat(
|
||||
PeriodicJobManager.getTriggerAtMillis(
|
||||
mContext, fakeClock, /* fromBoot= */ false))
|
||||
.isEqualTo(currentTimeDuration.plusMinutes(timeSlotUnit).toMillis());
|
||||
/* currentTimeMillis= */ currentTimestamp, /* fromBoot= */ false))
|
||||
.isEqualTo(expectedTimestamp);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTriggerAtMillis_withOffset_returnsExpectedResult() {
|
||||
long timeSlotUnit = PeriodicJobManager.DATA_FETCH_INTERVAL_MINUTE;
|
||||
// Sets the current time.
|
||||
Duration currentTimeDuration = Duration.ofMinutes(timeSlotUnit * 2);
|
||||
FakeClock fakeClock = new FakeClock();
|
||||
fakeClock.setCurrentTime(currentTimeDuration.plusMinutes(1L).plusMillis(51L));
|
||||
public void getTriggerAtMillis_halfFullHourTimeZoneWithOffset_returnsExpectedResult() {
|
||||
final int minutesOffset = 21;
|
||||
final long currentTimestamp =
|
||||
setTimeZoneAndGenerateTestTimestamp(/* isFullHourTimeZone= */ false, minutesOffset);
|
||||
final long expectedTimestamp =
|
||||
currentTimestamp + Duration.ofMinutes(60 - minutesOffset).toMillis();
|
||||
|
||||
assertThat(PeriodicJobManager.getTriggerAtMillis(mContext, fakeClock, /* fromBoot= */ true))
|
||||
.isEqualTo(currentTimeDuration.plusMinutes(timeSlotUnit).toMillis());
|
||||
assertThat(
|
||||
PeriodicJobManager.getTriggerAtMillis(
|
||||
/* currentTimeMillis= */ currentTimestamp, /* fromBoot= */ false))
|
||||
.isEqualTo(expectedTimestamp);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTriggerAtMillis_halfFullHourTimeZoneWithBroadcastDelay_returnsExpectedResult() {
|
||||
doReturn(true).when(mFeatureFactory.powerUsageFeatureProvider).delayHourlyJobWhenBooting();
|
||||
|
||||
final int minutesOffset = 21;
|
||||
final long currentTimestamp =
|
||||
setTimeZoneAndGenerateTestTimestamp(/* isFullHourTimeZone= */ false, minutesOffset);
|
||||
final long expectedTimestamp =
|
||||
currentTimestamp + Duration.ofMinutes(60 * 2 - minutesOffset).toMillis();
|
||||
|
||||
assertThat(
|
||||
PeriodicJobManager.getTriggerAtMillis(
|
||||
/* currentTimeMillis= */ currentTimestamp, /* fromBoot= */ true))
|
||||
.isEqualTo(expectedTimestamp);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTriggerAtMillis_fullHourTimeZoneWithoutOffset_returnsExpectedResult() {
|
||||
final int minutesOffset = 0;
|
||||
final long currentTimestamp =
|
||||
setTimeZoneAndGenerateTestTimestamp(/* isFullHourTimeZone= */ true, minutesOffset);
|
||||
final long expectedTimestamp =
|
||||
currentTimestamp + Duration.ofMinutes(60 - minutesOffset).toMillis();
|
||||
|
||||
assertThat(
|
||||
PeriodicJobManager.getTriggerAtMillis(
|
||||
/* currentTimeMillis= */ currentTimestamp, /* fromBoot= */ false))
|
||||
.isEqualTo(expectedTimestamp);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTriggerAtMillis_fullHourTimeZoneWithOffset_returnsExpectedResult() {
|
||||
final int minutesOffset = 21;
|
||||
final long currentTimestamp =
|
||||
setTimeZoneAndGenerateTestTimestamp(/* isFullHourTimeZone= */ true, minutesOffset);
|
||||
final long expectedTimestamp =
|
||||
currentTimestamp + Duration.ofMinutes(60 - minutesOffset).toMillis();
|
||||
|
||||
assertThat(
|
||||
PeriodicJobManager.getTriggerAtMillis(
|
||||
/* currentTimeMillis= */ currentTimestamp, /* fromBoot= */ false))
|
||||
.isEqualTo(expectedTimestamp);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTriggerAtMillis_fullHourTimeZoneWithBroadcastDelay_returnsExpectedResult() {
|
||||
doReturn(true).when(mFeatureFactory.powerUsageFeatureProvider).delayHourlyJobWhenBooting();
|
||||
|
||||
final int minutesOffset = 21;
|
||||
final long currentTimestamp =
|
||||
setTimeZoneAndGenerateTestTimestamp(/* isFullHourTimeZone= */ true, minutesOffset);
|
||||
final long expectedTimestamp =
|
||||
currentTimestamp + Duration.ofMinutes(60 * 2 - minutesOffset).toMillis();
|
||||
|
||||
assertThat(
|
||||
PeriodicJobManager.getTriggerAtMillis(
|
||||
/* currentTimeMillis= */ currentTimestamp, /* fromBoot= */ true))
|
||||
.isEqualTo(expectedTimestamp);
|
||||
}
|
||||
|
||||
private static long setTimeZoneAndGenerateTestTimestamp(
|
||||
final boolean isFullHourTimeZone, final int minutesOffset) {
|
||||
final TimeZone timeZone =
|
||||
TimeZone.getTimeZone(isFullHourTimeZone ? "UTC" : /* GMT+05:30 */ "Asia/Kalkata");
|
||||
TimeZone.setDefault(timeZone);
|
||||
Calendar calendar = (Calendar) Calendar.getInstance().clone();
|
||||
calendar.set(Calendar.MINUTE, minutesOffset);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTimeInMillis();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ import com.android.settingslib.RestrictedSwitchPreference;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -188,6 +189,7 @@ public class ApprovalPreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_MODES_API)
|
||||
@Ignore("b/339550695")
|
||||
public void disable() {
|
||||
mController.disable(mCn);
|
||||
verify(mFeatureFactory.metricsFeatureProvider).action(
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.settings.bluetooth;
|
||||
import static org.mockito.Mockito.doNothing;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
@@ -28,11 +27,13 @@ import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import com.android.settingslib.bluetooth.BluetoothBroadcastUtils;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@Ignore("b/337418017")
|
||||
public class QrCodeScanModeActivityTest {
|
||||
|
||||
@Mock
|
||||
|
||||
@@ -32,12 +32,14 @@ import com.android.settings.Utils;
|
||||
import com.android.settings.testutils.ResourcesUtils;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@Ignore("b/337417918")
|
||||
public class CommunalPreferenceControllerTest {
|
||||
@Mock
|
||||
private UserManager mUserManager;
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito.mock
|
||||
import org.mockito.Mockito.spy
|
||||
import java.util.concurrent.Executor
|
||||
import org.junit.Ignore
|
||||
|
||||
/** Unit tests for [ThreadNetworkFragmentController]. */
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
@@ -99,6 +100,7 @@ class ThreadNetworkFragmentControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339767488")
|
||||
fun getSummary_ThreadIsDisabled_returnsOff() {
|
||||
startController(controller)
|
||||
fakeThreadNetworkController.setEnabled(false, executor) {}
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito.mock
|
||||
import org.mockito.Mockito.spy
|
||||
import java.util.concurrent.Executor
|
||||
import org.junit.Ignore
|
||||
|
||||
/** Unit tests for [ThreadNetworkToggleController]. */
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
@@ -88,6 +89,7 @@ class ThreadNetworkToggleControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339767488")
|
||||
fun isChecked_threadSetEnabled_returnsTrue() {
|
||||
fakeThreadNetworkController.setEnabled(true, executor) { }
|
||||
startController(controller)
|
||||
@@ -113,6 +115,7 @@ class ThreadNetworkToggleControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339767488")
|
||||
fun setChecked_setUnchecked_threadIsDisabled() {
|
||||
startController(controller)
|
||||
|
||||
|
||||
@@ -28,12 +28,14 @@ import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@Ignore("b/337417779")
|
||||
public class CellDataPreferenceTest {
|
||||
|
||||
@Mock
|
||||
|
||||
@@ -37,12 +37,14 @@ import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@Ignore("b/339148064")
|
||||
public class BluetoothStackLogPreferenceControllerTest {
|
||||
private static final String TAG = "BluetoothStackLogPreferenceControllerTest";
|
||||
|
||||
|
||||
@@ -217,6 +217,7 @@ public class SimStatusDialogControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417520")
|
||||
public void initialize_updateServiceStateWithPowerOff_shouldUpdateTextAndResetSignalStrength() {
|
||||
when(mServiceState.getState()).thenReturn(ServiceState.STATE_POWER_OFF);
|
||||
|
||||
@@ -229,6 +230,7 @@ public class SimStatusDialogControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417520")
|
||||
public void initialize_updateVoiceDataOutOfService_shouldUpdateSettingAndResetSignalStrength() {
|
||||
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
|
||||
when(mServiceState.getDataRegistrationState()).thenReturn(
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.android.settings.R;
|
||||
import com.android.settingslib.applications.StorageStatsSource;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
@@ -172,6 +173,7 @@ public class StorageAsyncLoaderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417819")
|
||||
public void testRemovedPackageDoesNotCrash() throws Exception {
|
||||
ApplicationInfo info = new ApplicationInfo();
|
||||
info.packageName = PACKAGE_NAME_1;
|
||||
|
||||
@@ -30,6 +30,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -49,6 +50,7 @@ public class ScreenResolutionControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417619")
|
||||
public void getAvailabilityStatus_hasFhdAndQhdModes_returnAvailable() {
|
||||
Display.Mode modeA = new Display.Mode(0, mHighWidth, 0, 0);
|
||||
Display.Mode modeB = new Display.Mode(0, mFullWidth, 0, 0);
|
||||
@@ -76,6 +78,7 @@ public class ScreenResolutionControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417619")
|
||||
public void updateState_FullResolution_shouldSetSummaryToFullResolution() {
|
||||
int width = mFullWidth;
|
||||
doReturn(width).when(mController).getDisplayWidth();
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.text.format.DateUtils;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -32,6 +33,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@Ignore("b/337418011")
|
||||
public class AppInfoTest {
|
||||
|
||||
private static final String PACKAGE_NAME = "com.android.app";
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.android.settings.homepage.contextualcards.ContextualCardLookupTable.C
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -31,6 +32,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@Ignore("b/337417898")
|
||||
public class ContextualCardLookupTableTest {
|
||||
|
||||
private static final int UNSUPPORTED_CARD_TYPE = -99999;
|
||||
|
||||
@@ -34,6 +34,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.android.settings.widget.TickButtonPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -92,6 +93,7 @@ public class TermsOfAddressFeminineControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339543490")
|
||||
public void displayPreference_setGrammaticalGenderIsFeminine_FeminineIsSelected() {
|
||||
TickButtonPreference selectedPreference =
|
||||
(TickButtonPreference) mPreferenceScreen.getPreference(2);
|
||||
|
||||
@@ -34,6 +34,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.android.settings.widget.TickButtonPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -92,6 +93,7 @@ public class TermsOfAddressMasculineControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339543490")
|
||||
public void displayPreference_setGrammaticalGenderIsMasculine_MasculineIsSelected() {
|
||||
TickButtonPreference selectedPreference =
|
||||
(TickButtonPreference) mPreferenceScreen.getPreference(3);
|
||||
|
||||
@@ -34,6 +34,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.android.settings.widget.TickButtonPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -92,6 +93,7 @@ public class TermsOfAddressNeutralControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339543490")
|
||||
public void displayPreference_setGrammaticalGenderIsNotSpecified_NeutralIsSelected() {
|
||||
TickButtonPreference selectedPreference =
|
||||
(TickButtonPreference) mPreferenceScreen.getPreference(4);
|
||||
|
||||
@@ -34,6 +34,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.android.settings.widget.TickButtonPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -92,6 +93,7 @@ public class TermsOfAddressNotSpecifiedControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339543490")
|
||||
public void displayPreference_setGrammaticalGenderIsNotSpecified_NotSpecifiedIsSelected() {
|
||||
TickButtonPreference selectedPreference =
|
||||
(TickButtonPreference) mPreferenceScreen.getPreference(1);
|
||||
|
||||
@@ -572,6 +572,7 @@ public class SubscriptionUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339149463")
|
||||
public void isSimHardwareVisible_configAsVisible_returnTrue() {
|
||||
when(mResources.getBoolean(R.bool.config_show_sim_info))
|
||||
.thenReturn(true);
|
||||
|
||||
@@ -41,6 +41,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
@@ -753,6 +754,7 @@ public class UiccSlotUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417975")
|
||||
public void onReceiveSimCardStateChangeReceiver_receiveAction_timerCountDown() {
|
||||
CountDownLatch latch = spy(new CountDownLatch(1));
|
||||
UiccSlotUtil.SimCardStateChangeReceiver receive =
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.android.internal.telephony.OperatorInfo
|
||||
import com.android.settings.network.telephony.CellInfoUtil.getNetworkTitle
|
||||
import com.android.settings.network.telephony.CellInfoUtil.getOperatorNumeric
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
@@ -96,6 +97,7 @@ class CellInfoUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417936")
|
||||
fun convertOperatorInfoToCellInfo() {
|
||||
val operatorInfo = OperatorInfo(LONG, SHORT, "12301")
|
||||
|
||||
@@ -108,6 +110,7 @@ class CellInfoUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417222")
|
||||
fun cellInfoListToString() {
|
||||
val cellInfoList =
|
||||
listOf(
|
||||
|
||||
@@ -60,6 +60,7 @@ import com.android.settings.network.telephony.TelephonyConstants.TelephonyManage
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
@@ -346,6 +347,7 @@ public class EnabledNetworkModePreferenceControllerTest {
|
||||
|
||||
@UiThreadTest
|
||||
@Test
|
||||
@Ignore("b/337418033")
|
||||
public void updateState_updateByNetworkMode() {
|
||||
mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA);
|
||||
|
||||
@@ -377,6 +379,7 @@ public class EnabledNetworkModePreferenceControllerTest {
|
||||
|
||||
@UiThreadTest
|
||||
@Test
|
||||
@Ignore("b/337418033")
|
||||
public void onPreferenceChange_updateSuccess() {
|
||||
mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
|
||||
doReturn(true).when(mTelephonyManager).setPreferredNetworkTypeBitmask(
|
||||
@@ -393,6 +396,7 @@ public class EnabledNetworkModePreferenceControllerTest {
|
||||
|
||||
@UiThreadTest
|
||||
@Test
|
||||
@Ignore("b/337418033")
|
||||
public void onPreferenceChange_updateFail() {
|
||||
mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
|
||||
doReturn(false).when(mTelephonyManager).setPreferredNetworkTypeBitmask(
|
||||
@@ -408,6 +412,7 @@ public class EnabledNetworkModePreferenceControllerTest {
|
||||
|
||||
@UiThreadTest
|
||||
@Test
|
||||
@Ignore("b/337418033")
|
||||
public void preferredNetworkModeNotification_preferenceUpdates() {
|
||||
|
||||
final PreferenceManager preferenceManager = new PreferenceManager(mContext);
|
||||
|
||||
@@ -48,6 +48,7 @@ import com.android.settings.network.ims.MockWfcQueryImsState;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
@@ -176,6 +177,7 @@ public class NetworkProviderWifiCallingGroupTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417499")
|
||||
public void
|
||||
shouldShowWifiCallingForSub_wifiCallingEnabledWithActivityHandleIntent_returnTrue() {
|
||||
buildPhoneAccountConfigureIntent(true);
|
||||
|
||||
@@ -38,6 +38,7 @@ import com.android.settings.network.CarrierConfigCache;
|
||||
import com.android.settingslib.RestrictedSwitchPreference;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
@@ -180,6 +181,7 @@ public class NrAdvancedCallingPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339542743")
|
||||
public void updateState_configOn_prefChecked() {
|
||||
doReturn(TelephonyManager.ENABLE_VONR_SUCCESS).when(
|
||||
mTelephonyManager).setVoNrEnabled(anyBoolean());
|
||||
|
||||
@@ -38,6 +38,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
@@ -99,6 +100,7 @@ public class CdmaSystemSelectPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417544")
|
||||
public void updateState_stateHome_displayHome() {
|
||||
doReturn(TelephonyManager.CDMA_ROAMING_MODE_HOME).when(
|
||||
mTelephonyManager).getCdmaRoamingMode();
|
||||
@@ -110,6 +112,7 @@ public class CdmaSystemSelectPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417897")
|
||||
public void updateState_LteGSMWcdma_disabled() {
|
||||
doReturn(TelephonyManager.CDMA_ROAMING_MODE_HOME).when(
|
||||
mTelephonyManager).getCdmaRoamingMode();
|
||||
@@ -123,6 +126,7 @@ public class CdmaSystemSelectPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/337417917")
|
||||
public void updateState_stateOther_resetToDefault() {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.CDMA_ROAMING_MODE,
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.safetycenter.SafetyCenterManagerWrapper;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
@@ -58,6 +59,7 @@ public class PrivacyDashboardActivityTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("b/339544085")
|
||||
public void onCreate_whenSafetyCenterEnabled_redirectsToSafetyCenter() throws Exception {
|
||||
startActivityUsingIntent(android.provider.Settings.ACTION_PRIVACY_SETTINGS);
|
||||
when(mSafetyCenterManagerWrapper.isEnabled(any(Context.class))).thenReturn(true);
|
||||
|
||||
Reference in New Issue
Block a user