Snap for 9133445 from b85726f975 to udc-release

Change-Id: I4a49e84e556d646ffa7a0af444290f9cc277eb4f
This commit is contained in:
Android Build Coastguard Worker
2022-10-04 01:26:15 +00:00
3 changed files with 27 additions and 0 deletions

View File

@@ -3013,6 +3013,7 @@
android:taskAffinity="com.android.settings.FallbackHome"
android:exported="true"
android:theme="@style/FallbackHome"
android:permission="android.permission.DEVICE_POWER"
android:configChanges="keyboardHidden">
<intent-filter android:priority="-1000">
<action android:name="android.intent.action.MAIN" />

View File

@@ -27,6 +27,7 @@
android:key="encryption_and_credentials_encryption_status"
android:title="@string/encrypt_title"
android:summary="@string/summary_placeholder"
android:selectable="false"
settings:controller="com.android.settings.security.EncryptionStatusPreferenceController"/>
</PreferenceCategory>

View File

@@ -20,8 +20,12 @@ import static com.google.common.truth.Truth.assertThat;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.os.Bundle;
import android.os.UserManager;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import org.junit.Before;
@@ -32,6 +36,7 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.shadows.ShadowApplication;
import org.robolectric.shadows.androidx.fragment.FragmentController;
@RunWith(RobolectricTestRunner.class)
public class EncryptionAndCredentialTest {
@@ -58,4 +63,24 @@ public class EncryptionAndCredentialTest {
assertThat(fragment.getMetricsCategory()).isEqualTo(MetricsEvent.ENCRYPTION_AND_CREDENTIAL);
}
@Test
public void isSelectable_encryptionPreferenceStatus_isNotSelectable() {
final PreferenceFragmentCompat fragment =
FragmentController.of(new TestFragment(), new Bundle())
.create()
.start()
.resume()
.get();
final Preference preference =
fragment.findPreference("encryption_and_credentials_encryption_status");
assertThat(preference.isSelectable()).isFalse();
}
public static class TestFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(com.android.settings.R.xml.encryption_and_credential);
}
}
}