Search in sources :

Example 11 with ArraySet

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;
        }
    }
}
Also used : ArraySet(android.util.ArraySet) ViewGroup(android.view.ViewGroup) ViewParent(android.view.ViewParent) ImageView(android.widget.ImageView) TransformableView(com.android.systemui.statusbar.TransformableView) TextView(android.widget.TextView) View(android.view.View) NotificationHeaderView(android.view.NotificationHeaderView) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 12 with ArraySet

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;
}
Also used : ArraySet(android.util.ArraySet) ArrayMap(android.util.ArrayMap)

Example 13 with ArraySet

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);
}
Also used : ArraySet(android.util.ArraySet) SSLContext(javax.net.ssl.SSLContext) Pair(android.util.Pair)

Example 14 with ArraySet

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);
}
Also used : ArraySet(android.util.ArraySet) SSLContext(javax.net.ssl.SSLContext) Pair(android.util.Pair)

Example 15 with ArraySet

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);
}
Also used : ArraySet(android.util.ArraySet) SSLContext(javax.net.ssl.SSLContext) Pair(android.util.Pair)

Aggregations

ArraySet (android.util.ArraySet)431 PublicKey (java.security.PublicKey)94 ComponentName (android.content.ComponentName)73 ArrayMap (android.util.ArrayMap)73 ArrayList (java.util.ArrayList)66 Pair (android.util.Pair)47 File (java.io.File)33 SSLContext (javax.net.ssl.SSLContext)32 Intent (android.content.Intent)30 RemoteException (android.os.RemoteException)29 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)28 ResolveInfo (android.content.pm.ResolveInfo)25 Point (android.graphics.Point)24 IOException (java.io.IOException)23 UserInfo (android.content.pm.UserInfo)21 X509Certificate (java.security.cert.X509Certificate)20 ContentResolver (android.content.ContentResolver)16 PackageManager (android.content.pm.PackageManager)15 NetworkPolicyManager.uidRulesToString (android.net.NetworkPolicyManager.uidRulesToString)15 SparseArray (android.util.SparseArray)15