Loading core/java/android/content/res/Configuration.java +10 −0 Original line number Diff line number Diff line Loading @@ -1195,6 +1195,16 @@ public final class Configuration implements Parcelable, Comparable<Configuration default: sb.append(" layoutLong="); sb.append(screenLayout&SCREENLAYOUT_LONG_MASK); break; } switch ((screenLayout & SCREENLAYOUT_ROUND_MASK)) { case SCREENLAYOUT_ROUND_UNDEFINED: sb.append(" ?round"); break; case SCREENLAYOUT_ROUND_NO: /* not-round is not interesting to print */ break; case SCREENLAYOUT_ROUND_YES: sb.append(" round"); break; default: sb.append(" layoutRound="); sb.append(screenLayout & SCREENLAYOUT_ROUND_MASK); break; } if ((screenLayout & SCREENLAYOUT_COMPAT_NEEDED) != 0) { sb.append(" compactNeeded"); } switch ((colorMode &COLOR_MODE_HDR_MASK)) { case COLOR_MODE_HDR_UNDEFINED: sb.append(" ?ldr"); break; // most likely not HDR case COLOR_MODE_HDR_NO: /* ldr is not interesting to print */ break; Loading core/tests/coretests/src/android/view/RoundedCornersTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class RoundedCornersTest { @Before public void setUp() { MockitoAnnotations.initMocks(this); mConfiguration = Configuration.EMPTY; mConfiguration = new Configuration(); } final RoundedCorners mRoundedCorners = new RoundedCorners( Loading core/tests/coretests/src/android/window/ConfigurationDispatcherTest.kt +22 −8 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.content.res.Configuration.ORIENTATION_PORTRAIT import android.platform.test.annotations.Presubmit import android.view.Display.DEFAULT_DISPLAY import androidx.test.filters.SmallTest import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized Loading Loading @@ -52,7 +52,14 @@ class ConfigurationDispatcherTest(private val shouldReportPrivateChanges: Boolea // Verify public config field change receiver.windowToken.onConfigurationChangedInner(receiver, config, DEFAULT_DISPLAY, true) assertThat(receiver.receivedConfig).isEqualTo(config) assertWithMessage( "expected: $config, but was ${receiver.receivedConfig}. " + "The diff is " + Configuration.configurationDiffToString( receiver.receivedConfig.diff(config) ) ) .that(receiver.receivedConfig).isEqualTo(config) // Clear the config value receiver.receivedConfig.unset() Loading @@ -62,13 +69,20 @@ class ConfigurationDispatcherTest(private val shouldReportPrivateChanges: Boolea receiver.windowToken.onConfigurationChangedInner(receiver, config, DEFAULT_DISPLAY, true) assertThat(receiver.receivedConfig).isEqualTo( if (shouldReportPrivateChanges) { val expectedConfig = if (shouldReportPrivateChanges) { config } else { Configuration.EMPTY } assertWithMessage( "expected: $expectedConfig, but was ${receiver.receivedConfig}. " + "The diff is " + Configuration.configurationDiffToString( receiver.receivedConfig.diff(expectedConfig) ) ) .that(receiver.receivedConfig).isEqualTo(expectedConfig) } /** Loading Loading
core/java/android/content/res/Configuration.java +10 −0 Original line number Diff line number Diff line Loading @@ -1195,6 +1195,16 @@ public final class Configuration implements Parcelable, Comparable<Configuration default: sb.append(" layoutLong="); sb.append(screenLayout&SCREENLAYOUT_LONG_MASK); break; } switch ((screenLayout & SCREENLAYOUT_ROUND_MASK)) { case SCREENLAYOUT_ROUND_UNDEFINED: sb.append(" ?round"); break; case SCREENLAYOUT_ROUND_NO: /* not-round is not interesting to print */ break; case SCREENLAYOUT_ROUND_YES: sb.append(" round"); break; default: sb.append(" layoutRound="); sb.append(screenLayout & SCREENLAYOUT_ROUND_MASK); break; } if ((screenLayout & SCREENLAYOUT_COMPAT_NEEDED) != 0) { sb.append(" compactNeeded"); } switch ((colorMode &COLOR_MODE_HDR_MASK)) { case COLOR_MODE_HDR_UNDEFINED: sb.append(" ?ldr"); break; // most likely not HDR case COLOR_MODE_HDR_NO: /* ldr is not interesting to print */ break; Loading
core/tests/coretests/src/android/view/RoundedCornersTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class RoundedCornersTest { @Before public void setUp() { MockitoAnnotations.initMocks(this); mConfiguration = Configuration.EMPTY; mConfiguration = new Configuration(); } final RoundedCorners mRoundedCorners = new RoundedCorners( Loading
core/tests/coretests/src/android/window/ConfigurationDispatcherTest.kt +22 −8 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.content.res.Configuration.ORIENTATION_PORTRAIT import android.platform.test.annotations.Presubmit import android.view.Display.DEFAULT_DISPLAY import androidx.test.filters.SmallTest import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized Loading Loading @@ -52,7 +52,14 @@ class ConfigurationDispatcherTest(private val shouldReportPrivateChanges: Boolea // Verify public config field change receiver.windowToken.onConfigurationChangedInner(receiver, config, DEFAULT_DISPLAY, true) assertThat(receiver.receivedConfig).isEqualTo(config) assertWithMessage( "expected: $config, but was ${receiver.receivedConfig}. " + "The diff is " + Configuration.configurationDiffToString( receiver.receivedConfig.diff(config) ) ) .that(receiver.receivedConfig).isEqualTo(config) // Clear the config value receiver.receivedConfig.unset() Loading @@ -62,13 +69,20 @@ class ConfigurationDispatcherTest(private val shouldReportPrivateChanges: Boolea receiver.windowToken.onConfigurationChangedInner(receiver, config, DEFAULT_DISPLAY, true) assertThat(receiver.receivedConfig).isEqualTo( if (shouldReportPrivateChanges) { val expectedConfig = if (shouldReportPrivateChanges) { config } else { Configuration.EMPTY } assertWithMessage( "expected: $expectedConfig, but was ${receiver.receivedConfig}. " + "The diff is " + Configuration.configurationDiffToString( receiver.receivedConfig.diff(expectedConfig) ) ) .that(receiver.receivedConfig).isEqualTo(expectedConfig) } /** Loading