use of android.util.ArraySet in project platform_frameworks_base by android.
the class TransformState method setClippingDeactivated.
public static void setClippingDeactivated(final View transformedView, boolean deactivated) {
if (!(transformedView.getParent() instanceof ViewGroup)) {
return;
}
ViewGroup view = (ViewGroup) transformedView.getParent();
while (true) {
ArraySet<View> clipSet = (ArraySet<View>) view.getTag(CLIP_CLIPPING_SET);
if (clipSet == null) {
clipSet = new ArraySet<>();
view.setTag(CLIP_CLIPPING_SET, clipSet);
}
Boolean clipChildren = (Boolean) view.getTag(CLIP_CHILDREN_TAG);
if (clipChildren == null) {
clipChildren = view.getClipChildren();
view.setTag(CLIP_CHILDREN_TAG, clipChildren);
}
Boolean clipToPadding = (Boolean) view.getTag(CLIP_TO_PADDING);
if (clipToPadding == null) {
clipToPadding = view.getClipToPadding();
view.setTag(CLIP_TO_PADDING, clipToPadding);
}
ExpandableNotificationRow row = view instanceof ExpandableNotificationRow ? (ExpandableNotificationRow) view : null;
if (!deactivated) {
clipSet.remove(transformedView);
if (clipSet.isEmpty()) {
view.setClipChildren(clipChildren);
view.setClipToPadding(clipToPadding);
view.setTag(CLIP_CLIPPING_SET, null);
if (row != null) {
row.setClipToActualHeight(true);
}
}
} else {
clipSet.add(transformedView);
view.setClipChildren(false);
view.setClipToPadding(false);
if (row != null && row.isChildInGroup()) {
// We still want to clip to the parent's height
row.setClipToActualHeight(false);
}
}
if (row != null && !row.isChildInGroup()) {
return;
}
final ViewParent parent = view.getParent();
if (parent instanceof ViewGroup) {
view = (ViewGroup) parent;
} else {
return;
}
}
}
use of android.util.ArraySet in project platform_frameworks_base by android.
the class FullBackup method getBackupSchemeForTest.
public static BackupScheme getBackupSchemeForTest(Context context) {
BackupScheme testing = new BackupScheme(context);
testing.mExcludes = new ArraySet();
testing.mIncludes = new ArrayMap();
return testing;
}
use of android.util.ArraySet in project platform_frameworks_base by android.
the class NetworkSecurityConfigTests method testEmptyConfig.
public void testEmptyConfig() throws Exception {
ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
ConfigSource testSource = new TestConfigSource(domainMap, getEmptyConfig());
SSLContext context = TestUtils.getSSLContext(testSource);
TestUtils.assertConnectionFails(context, "android.com", 443);
}
use of android.util.ArraySet in project platform_frameworks_base by android.
the class NetworkSecurityConfigTests method testSubdomainIncluded.
public void testSubdomainIncluded() throws Exception {
// First try connecting to a subdomain of a domain entry that includes subdomains.
ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
domainMap.add(new Pair<Domain, NetworkSecurityConfig>(new Domain("android.com", true), getSystemStoreConfig()));
SSLContext context = TestUtils.getSSLContext(new TestConfigSource(domainMap, getEmptyConfig()));
TestUtils.assertConnectionSucceeds(context, "developer.android.com", 443);
// Now try without including subdomains.
domainMap = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
domainMap.add(new Pair<Domain, NetworkSecurityConfig>(new Domain("android.com", false), getSystemStoreConfig()));
context = TestUtils.getSSLContext(new TestConfigSource(domainMap, getEmptyConfig()));
TestUtils.assertConnectionFails(context, "developer.android.com", 443);
}
use of android.util.ArraySet in project platform_frameworks_base by android.
the class NetworkSecurityConfigTests method testOverridePins.
public void testOverridePins() throws Exception {
// Use a bad pin + granting the system CA store the ability to override pins.
ArraySet<Pin> pins = new ArraySet<Pin>();
pins.add(new Pin("SHA-256", new byte[0]));
NetworkSecurityConfig domain = new NetworkSecurityConfig.Builder().setPinSet(new PinSet(pins, Long.MAX_VALUE)).addCertificatesEntryRef(new CertificatesEntryRef(SystemCertificateSource.getInstance(), true)).build();
ArraySet<Pair<Domain, NetworkSecurityConfig>> domainMap = new ArraySet<Pair<Domain, NetworkSecurityConfig>>();
domainMap.add(new Pair<Domain, NetworkSecurityConfig>(new Domain("android.com", true), domain));
SSLContext context = TestUtils.getSSLContext(new TestConfigSource(domainMap, getEmptyConfig()));
TestUtils.assertConnectionSucceeds(context, "android.com", 443);
}
Aggregations