diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/Activity.java | 22 | ||||
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 6 | ||||
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 2 | ||||
| -rw-r--r-- | core/java/android/content/Intent.java | 16 | ||||
| -rw-r--r-- | core/java/android/content/pm/ActivityInfo.java | 39 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageParser.java | 31 | ||||
| -rw-r--r-- | core/java/android/net/ConnectivityManager.java | 14 | ||||
| -rw-r--r-- | core/java/android/net/IConnectivityManager.aidl | 8 | ||||
| -rw-r--r-- | core/java/android/net/LinkProperties.java | 12 | ||||
| -rw-r--r-- | core/java/android/net/Proxy.java | 34 | ||||
| -rw-r--r-- | core/java/android/net/ProxyInfo.aidl (renamed from core/java/android/net/ProxyProperties.aidl) | 2 | ||||
| -rw-r--r-- | core/java/android/net/ProxyInfo.java (renamed from core/java/android/net/ProxyProperties.java) | 176 | ||||
| -rw-r--r-- | core/java/android/view/View.java | 11 | ||||
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 1 |
14 files changed, 263 insertions, 111 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index af3a92c..4df486a 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -29,6 +29,7 @@ import com.android.internal.policy.PolicyManager; import android.annotation.IntDef; import android.annotation.Nullable; +import android.app.admin.DevicePolicyManager; import android.content.ComponentCallbacks2; import android.content.ComponentName; import android.content.ContentResolver; @@ -5689,7 +5690,16 @@ public class Activity extends ContextThemeWrapper } } - /** @hide */ + /** + * Put this Activity in a mode where the user is locked to the + * current task. + * + * This will prevent the user from launching other apps, going to settings, + * or reaching the home screen. + * + * Lock task mode will only start if the activity has been whitelisted by the + * Device Owner through {@link DevicePolicyManager#setLockTaskComponents}. + */ public void startLockTask() { try { ActivityManagerNative.getDefault().startLockTaskMode(mToken); @@ -5697,7 +5707,15 @@ public class Activity extends ContextThemeWrapper } } - /** @hide */ + /** + * Allow the user to switch away from the current task. + * + * Called to end the mode started by {@link Activity#startLockTask}. This + * can only be called by activities that have successfully called + * startLockTask previously. + * + * This will allow the user to exit this app and move onto other activities. + */ public void stopLockTask() { try { ActivityManagerNative.getDefault().stopLockTaskMode(); diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 3b2ff7f..b606088 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -46,7 +46,7 @@ import android.graphics.Canvas; import android.hardware.display.DisplayManagerGlobal; import android.net.IConnectivityManager; import android.net.Proxy; -import android.net.ProxyProperties; +import android.net.ProxyInfo; import android.opengl.GLUtils; import android.os.AsyncTask; import android.os.Binder; @@ -4294,8 +4294,8 @@ public final class ActivityThread { // crash if we can't get it. IConnectivityManager service = IConnectivityManager.Stub.asInterface(b); try { - ProxyProperties proxyProperties = service.getProxy(); - Proxy.setHttpProxySystemProperty(proxyProperties); + ProxyInfo proxyInfo = service.getProxy(); + Proxy.setHttpProxySystemProperty(proxyInfo); } catch (RemoteException e) {} } diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index b24b932..209c536 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -2069,7 +2069,7 @@ public class DevicePolicyManager { * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param intent An intent matching the app(s) to be installed. All apps that resolve for this * intent will be re-enabled in the current profile. - * @returns int The number of activities that matched the intent and were installed. + * @return int The number of activities that matched the intent and were installed. */ public int enableSystemApp(ComponentName admin, Intent intent) { if (mService != null) { diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index ae5437b..3cfc56c 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -3736,7 +3736,8 @@ public class Intent implements Parcelable, Cloneable { * * <p>When set, the activity specified by this Intent will launch into a * separate task rooted at that activity. The activity launched must be - * defined with {@link android.R.attr#launchMode} "standard" or "singleTop". + * defined with {@link android.R.attr#launchMode} <code>standard</code> + * or <code>singleTop</code>. * * <p>If FLAG_ACTIVITY_NEW_DOCUMENT is used without * {@link #FLAG_ACTIVITY_MULTIPLE_TASK} then the activity manager will @@ -3751,6 +3752,8 @@ public class Intent implements Parcelable, Cloneable { * always create a new task. Thus the same document may be made to appear * more than one time in Recents. * + * <p>This is equivalent to the attribute {@link android.R.attr#documentLaunchMode}. + * * @see #FLAG_ACTIVITY_MULTIPLE_TASK */ public static final int FLAG_ACTIVITY_NEW_DOCUMENT = @@ -3815,6 +3818,15 @@ public class Intent implements Parcelable, Cloneable { */ public static final int FLAG_ACTIVITY_TASK_ON_HOME = 0X00004000; /** + * If set and the new activity is the root of a new task, then the task + * will remain in the list of recently launched tasks only until all of + * the activities in it are finished. + * + * <p>This is equivalent to the attribute + * {@link android.R.styleable#AndroidManifestActivity_autoRemoveFromRecents}. + */ + public static final int FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS = 0x00002000; + /** * If set, when sending a broadcast only registered receivers will be * called -- no BroadcastReceiver components will be launched. */ @@ -4019,7 +4031,7 @@ public class Intent implements Parcelable, Cloneable { /** * Create an intent for a specific component with a specified action and data. - * This is equivalent using {@link #Intent(String, android.net.Uri)} to + * This is equivalent to using {@link #Intent(String, android.net.Uri)} to * construct the Intent and then calling {@link #setClass} to set its * class. * diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index c53e545..c2fe3a2 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -67,7 +67,37 @@ public class ActivityInfo extends ComponentInfo * {@link #LAUNCH_SINGLE_INSTANCE}. */ public int launchMode; - + + /** + * Constant corresponding to <code>none</code> in + * the {@link android.R.attr#documentLaunchMode} attribute. + */ + public static final int DOCUMENT_LAUNCH_NONE = 0; + /** + * Constant corresponding to <code>intoExisting</code> in + * the {@link android.R.attr#documentLaunchMode} attribute. + */ + public static final int DOCUMENT_LAUNCH_INTO_EXISTING = 1; + /** + * Constant corresponding to <code>always</code> in + * the {@link android.R.attr#documentLaunchMode} attribute. + */ + public static final int DOCUMENT_LAUNCH_ALWAYS = 2; + /** + * The document launch mode style requested by the activity. From the + * {@link android.R.attr#documentLaunchMode} attribute, one of + * {@link #DOCUMENT_LAUNCH_NONE}, {@link #DOCUMENT_LAUNCH_INTO_EXISTING}, + * {@link #DOCUMENT_LAUNCH_ALWAYS}. + * + * <p>Modes DOCUMENT_LAUNCH_ALWAYS + * and DOCUMENT_LAUNCH_INTO_EXISTING are equivalent to {@link + * android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT + * Intent.FLAG_ACTIVITY_NEW_DOCUMENT} with and without {@link + * android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK + * Intent.FLAG_ACTIVITY_MULTIPLE_TASK} respectively. + */ + public int documentLaunchMode; + /** * Optional name of a permission required to be able to access this * Activity. From the "permission" attribute. @@ -192,10 +222,15 @@ public class ActivityInfo extends ComponentInfo * Bit in {@link #flags} indicating that this activity is to be persisted across * reboots for display in the Recents list. * {@link android.R.attr#persistable} - * @hide */ public static final int FLAG_PERSISTABLE = 0x1000; /** + * Bit in {@link #flags} indicating that tasks started with this activity are to be + * removed from the recent list of tasks when the last activity in the task is finished. + * {@link android.R.attr#autoRemoveFromRecents} + */ + public static final int FLAG_AUTO_REMOVE_FROM_RECENTS = 0x2000; + /** * @hide Bit in {@link #flags}: If set, this component will only be seen * by the primary user. Only works with broadcast receivers. Set from the * android.R.attr#primaryUserOnly attribute. diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 080b37b..d80ab7b 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -2462,17 +2462,6 @@ public class PackageParser { a.info.flags |= ActivityInfo.FLAG_IMMERSIVE; } - if (sa.getBoolean( - com.android.internal.R.styleable.AndroidManifestActivity_persistable, false)) { - a.info.flags |= ActivityInfo.FLAG_PERSISTABLE; - } - - if (sa.getBoolean( - com.android.internal.R.styleable.AndroidManifestActivity_allowEmbedded, - false)) { - a.info.flags |= ActivityInfo.FLAG_ALLOW_EMBEDDED; - } - if (!receiver) { if (sa.getBoolean( com.android.internal.R.styleable.AndroidManifestActivity_hardwareAccelerated, @@ -2483,6 +2472,9 @@ public class PackageParser { a.info.launchMode = sa.getInt( com.android.internal.R.styleable.AndroidManifestActivity_launchMode, ActivityInfo.LAUNCH_MULTIPLE); + a.info.documentLaunchMode = sa.getInt( + com.android.internal.R.styleable.AndroidManifestActivity_documentLaunchMode, + ActivityInfo.DOCUMENT_LAUNCH_NONE); a.info.screenOrientation = sa.getInt( com.android.internal.R.styleable.AndroidManifestActivity_screenOrientation, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); @@ -2492,6 +2484,23 @@ public class PackageParser { a.info.softInputMode = sa.getInt( com.android.internal.R.styleable.AndroidManifestActivity_windowSoftInputMode, 0); + + if (sa.getBoolean( + com.android.internal.R.styleable.AndroidManifestActivity_persistable, false)) { + a.info.flags |= ActivityInfo.FLAG_PERSISTABLE; + } + + if (sa.getBoolean( + com.android.internal.R.styleable.AndroidManifestActivity_allowEmbedded, + false)) { + a.info.flags |= ActivityInfo.FLAG_ALLOW_EMBEDDED; + } + + if (sa.getBoolean( + com.android.internal.R.styleable.AndroidManifestActivity_autoRemoveFromRecents, + false)) { + a.info.flags |= ActivityInfo.FLAG_AUTO_REMOVE_FROM_RECENTS; + } } else { a.info.launchMode = ActivityInfo.LAUNCH_MULTIPLE; a.info.configChanges = 0; diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 3da00b1..25708ea 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -1307,14 +1307,13 @@ public class ConnectivityManager { * doing something unusual like general internal filtering this may be useful. On * a private network where the proxy is not accessible, you may break HTTP using this. * - * @param p The a {@link ProxyProperties} object defining the new global + * @param p The a {@link ProxyInfo} object defining the new global * HTTP proxy. A {@code null} value will clear the global HTTP proxy. * * <p>This method requires the call to hold the permission * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}. - * {@hide} */ - public void setGlobalProxy(ProxyProperties p) { + public void setGlobalProxy(ProxyInfo p) { try { mService.setGlobalProxy(p); } catch (RemoteException e) { @@ -1324,14 +1323,13 @@ public class ConnectivityManager { /** * Retrieve any network-independent global HTTP proxy. * - * @return {@link ProxyProperties} for the current global HTTP proxy or {@code null} + * @return {@link ProxyInfo} for the current global HTTP proxy or {@code null} * if no global HTTP proxy is set. * * <p>This method requires the call to hold the permission * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}. - * {@hide} */ - public ProxyProperties getGlobalProxy() { + public ProxyInfo getGlobalProxy() { try { return mService.getGlobalProxy(); } catch (RemoteException e) { @@ -1343,14 +1341,14 @@ public class ConnectivityManager { * Get the HTTP proxy settings for the current default network. Note that * if a global proxy is set, it will override any per-network setting. * - * @return the {@link ProxyProperties} for the current HTTP proxy, or {@code null} if no + * @return the {@link ProxyInfo} for the current HTTP proxy, or {@code null} if no * HTTP proxy is active. * * <p>This method requires the call to hold the permission * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}. * {@hide} */ - public ProxyProperties getProxy() { + public ProxyInfo getProxy() { try { return mService.getProxy(); } catch (RemoteException e) { diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index 381a817..d53a856 100644 --- a/core/java/android/net/IConnectivityManager.aidl +++ b/core/java/android/net/IConnectivityManager.aidl @@ -21,7 +21,7 @@ import android.net.LinkProperties; import android.net.NetworkInfo; import android.net.NetworkQuotaInfo; import android.net.NetworkState; -import android.net.ProxyProperties; +import android.net.ProxyInfo; import android.os.IBinder; import android.os.Messenger; import android.os.ParcelFileDescriptor; @@ -107,11 +107,11 @@ interface IConnectivityManager void reportInetCondition(int networkType, int percentage); - ProxyProperties getGlobalProxy(); + ProxyInfo getGlobalProxy(); - void setGlobalProxy(in ProxyProperties p); + void setGlobalProxy(in ProxyInfo p); - ProxyProperties getProxy(); + ProxyInfo getProxy(); void setDataDependency(int networkType, boolean met); diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java index 4dfd3d9..2dcc544 100644 --- a/core/java/android/net/LinkProperties.java +++ b/core/java/android/net/LinkProperties.java @@ -16,7 +16,7 @@ package android.net; -import android.net.ProxyProperties; +import android.net.ProxyInfo; import android.os.Parcelable; import android.os.Parcel; import android.text.TextUtils; @@ -65,7 +65,7 @@ public class LinkProperties implements Parcelable { private ArrayList<InetAddress> mDnses = new ArrayList<InetAddress>(); private String mDomains; private ArrayList<RouteInfo> mRoutes = new ArrayList<RouteInfo>(); - private ProxyProperties mHttpProxy; + private ProxyInfo mHttpProxy; private int mMtu; // Stores the properties of links that are "stacked" above this link. @@ -101,7 +101,7 @@ public class LinkProperties implements Parcelable { mDomains = source.getDomains(); for (RouteInfo r : source.getRoutes()) mRoutes.add(r); mHttpProxy = (source.getHttpProxy() == null) ? - null : new ProxyProperties(source.getHttpProxy()); + null : new ProxyInfo(source.getHttpProxy()); for (LinkProperties l: source.mStackedLinks.values()) { addStackedLink(l); } @@ -295,10 +295,10 @@ public class LinkProperties implements Parcelable { return routes; } - public void setHttpProxy(ProxyProperties proxy) { + public void setHttpProxy(ProxyInfo proxy) { mHttpProxy = proxy; } - public ProxyProperties getHttpProxy() { + public ProxyInfo getHttpProxy() { return mHttpProxy; } @@ -720,7 +720,7 @@ public class LinkProperties implements Parcelable { netProp.addRoute((RouteInfo)in.readParcelable(null)); } if (in.readByte() == 1) { - netProp.setHttpProxy((ProxyProperties)in.readParcelable(null)); + netProp.setHttpProxy((ProxyInfo)in.readParcelable(null)); } ArrayList<LinkProperties> stackedLinks = new ArrayList<LinkProperties>(); in.readList(stackedLinks, LinkProperties.class.getClassLoader()); diff --git a/core/java/android/net/Proxy.java b/core/java/android/net/Proxy.java index bea8d1c..8f41e85 100644 --- a/core/java/android/net/Proxy.java +++ b/core/java/android/net/Proxy.java @@ -19,6 +19,7 @@ package android.net; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.content.Context; +import android.net.ProxyInfo; import android.text.TextUtils; import android.util.Log; @@ -63,8 +64,11 @@ public final class Proxy { */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String PROXY_CHANGE_ACTION = "android.intent.action.PROXY_CHANGE"; - /** {@hide} **/ - public static final String EXTRA_PROXY_INFO = "proxy"; + /** + * Intent extra included with {@link #PROXY_CHANGE_ACTION} intents. + * It describes the new proxy being used (as a {@link ProxyInfo} object). + */ + public static final String EXTRA_PROXY_INFO = "android.intent.extra.PROXY_INFO"; /** @hide */ public static final int PROXY_VALID = 0; @@ -114,24 +118,14 @@ public final class Proxy { */ public static final java.net.Proxy getProxy(Context ctx, String url) { String host = ""; - if (url != null) { + if ((url != null) && !isLocalHost(host)) { URI uri = URI.create(url); - host = uri.getHost(); - } + ProxySelector proxySelector = ProxySelector.getDefault(); - if (!isLocalHost(host)) { - if (sConnectivityManager == null) { - sConnectivityManager = (ConnectivityManager)ctx.getSystemService( - Context.CONNECTIVITY_SERVICE); - } - if (sConnectivityManager == null) return java.net.Proxy.NO_PROXY; - - ProxyProperties proxyProperties = sConnectivityManager.getProxy(); + List<java.net.Proxy> proxyList = proxySelector.select(uri); - if (proxyProperties != null) { - if (!proxyProperties.isExcluded(host)) { - return proxyProperties.makeProxy(); - } + if (proxyList.size() > 0) { + return proxyList.get(0); } } return java.net.Proxy.NO_PROXY; @@ -275,7 +269,7 @@ public final class Proxy { } /** @hide */ - public static final void setHttpProxySystemProperty(ProxyProperties p) { + public static final void setHttpProxySystemProperty(ProxyInfo p) { String host = null; String port = null; String exclList = null; @@ -283,8 +277,8 @@ public final class Proxy { if (p != null) { host = p.getHost(); port = Integer.toString(p.getPort()); - exclList = p.getExclusionList(); - pacFileUrl = p.getPacFileUrl(); + exclList = p.getExclusionListAsString(); + pacFileUrl = p.getPacFileUrl().toString(); } setHttpProxySystemProperty(host, port, exclList, pacFileUrl); } diff --git a/core/java/android/net/ProxyProperties.aidl b/core/java/android/net/ProxyInfo.aidl index 02ea15d..2c91960 100644 --- a/core/java/android/net/ProxyProperties.aidl +++ b/core/java/android/net/ProxyInfo.aidl @@ -17,5 +17,5 @@ package android.net; -parcelable ProxyProperties; +parcelable ProxyInfo; diff --git a/core/java/android/net/ProxyProperties.java b/core/java/android/net/ProxyInfo.java index 50f45e8..b40941f 100644 --- a/core/java/android/net/ProxyProperties.java +++ b/core/java/android/net/ProxyInfo.java @@ -21,14 +21,23 @@ import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; +import org.apache.http.client.HttpClient; + import java.net.InetSocketAddress; +import java.net.URLConnection; +import java.util.List; import java.util.Locale; /** - * A container class for the http proxy info - * @hide + * Describes a proxy configuration. + * + * Proxy configurations are already integrated within the Apache HTTP stack. + * So {@link URLConnection} and {@link HttpClient} will use them automatically. + * + * Other HTTP stacks will need to obtain the proxy info from + * {@link Proxy#PROXY_CHANGE_ACTION} broadcast as the extra {@link Proxy#EXTRA_PROXY_INFO}. */ -public class ProxyProperties implements Parcelable { +public class ProxyInfo implements Parcelable { private String mHost; private int mPort; @@ -36,32 +45,82 @@ public class ProxyProperties implements Parcelable { private String[] mParsedExclusionList; private String mPacFileUrl; + /** + *@hide + */ public static final String LOCAL_EXCL_LIST = ""; + /** + *@hide + */ public static final int LOCAL_PORT = -1; + /** + *@hide + */ public static final String LOCAL_HOST = "localhost"; - public ProxyProperties(String host, int port, String exclList) { + /** + * Constructs a {@link ProxyInfo} object that points at a Direct proxy + * on the specified host and port. + */ + public static ProxyInfo buildDirectProxy(String host, int port) { + return new ProxyInfo(host, port, null); + } + + /** + * Constructs a {@link ProxyInfo} object that points at a Direct proxy + * on the specified host and port. + * + * The proxy will not be used to access any host in exclusion list, exclList. + * + * @param exclList Hosts to exclude using the proxy on connections for. These + * hosts can use wildcards such as *.example.com. + */ + public static ProxyInfo buildDirectProxy(String host, int port, List<String> exclList) { + String[] array = exclList.toArray(new String[exclList.size()]); + return new ProxyInfo(host, port, TextUtils.join(",", array), array); + } + + /** + * Construct a {@link ProxyInfo} that will download and run the PAC script + * at the specified URL. + */ + public static ProxyInfo buildPacProxy(Uri pacUri) { + return new ProxyInfo(pacUri.toString()); + } + + /** + * Create a ProxyProperties that points at a HTTP Proxy. + * @hide + */ + public ProxyInfo(String host, int port, String exclList) { mHost = host; mPort = port; setExclusionList(exclList); } - public ProxyProperties(String pacFileUrl) { + /** + * Create a ProxyProperties that points at a PAC URL. + * @hide + */ + public ProxyInfo(String pacFileUrl) { mHost = LOCAL_HOST; mPort = LOCAL_PORT; setExclusionList(LOCAL_EXCL_LIST); mPacFileUrl = pacFileUrl; } - // Only used in PacManager after Local Proxy is bound. - public ProxyProperties(String pacFileUrl, int localProxyPort) { + /** + * Only used in PacManager after Local Proxy is bound. + * @hide + */ + public ProxyInfo(String pacFileUrl, int localProxyPort) { mHost = LOCAL_HOST; mPort = localProxyPort; setExclusionList(LOCAL_EXCL_LIST); mPacFileUrl = pacFileUrl; } - private ProxyProperties(String host, int port, String exclList, String[] parsedExclList) { + private ProxyInfo(String host, int port, String exclList, String[] parsedExclList) { mHost = host; mPort = port; mExclusionList = exclList; @@ -70,16 +129,22 @@ public class ProxyProperties implements Parcelable { } // copy constructor instead of clone - public ProxyProperties(ProxyProperties source) { + /** + * @hide + */ + public ProxyInfo(ProxyInfo source) { if (source != null) { mHost = source.getHost(); mPort = source.getPort(); - mPacFileUrl = source.getPacFileUrl(); - mExclusionList = source.getExclusionList(); + mPacFileUrl = source.mPacFileUrl; + mExclusionList = source.getExclusionListAsString(); mParsedExclusionList = source.mParsedExclusionList; } } + /** + * @hide + */ public InetSocketAddress getSocketAddress() { InetSocketAddress inetSocketAddress = null; try { @@ -88,20 +153,46 @@ public class ProxyProperties implements Parcelable { return inetSocketAddress; } - public String getPacFileUrl() { - return mPacFileUrl; + /** + * Returns the URL of the current PAC script or null if there is + * no PAC script. + */ + public Uri getPacFileUrl() { + if (TextUtils.isEmpty(mPacFileUrl)) { + return null; + } + return Uri.parse(mPacFileUrl); } + /** + * When configured to use a Direct Proxy this returns the host + * of the proxy. + */ public String getHost() { return mHost; } + /** + * When configured to use a Direct Proxy this returns the port + * of the proxy + */ public int getPort() { return mPort; } - // comma separated - public String getExclusionList() { + /** + * When configured to use a Direct Proxy this returns the list + * of hosts for which the proxy is ignored. + */ + public String[] getExclusionList() { + return mParsedExclusionList; + } + + /** + * comma separated + * @hide + */ + public String getExclusionListAsString() { return mExclusionList; } @@ -111,33 +202,13 @@ public class ProxyProperties implements Parcelable { if (mExclusionList == null) { mParsedExclusionList = new String[0]; } else { - String splitExclusionList[] = exclusionList.toLowerCase(Locale.ROOT).split(","); - mParsedExclusionList = new String[splitExclusionList.length * 2]; - for (int i = 0; i < splitExclusionList.length; i++) { - String s = splitExclusionList[i].trim(); - if (s.startsWith(".")) s = s.substring(1); - mParsedExclusionList[i*2] = s; - mParsedExclusionList[(i*2)+1] = "." + s; - } + mParsedExclusionList = exclusionList.toLowerCase(Locale.ROOT).split(","); } } - public boolean isExcluded(String url) { - if (TextUtils.isEmpty(url) || mParsedExclusionList == null || - mParsedExclusionList.length == 0) return false; - - Uri u = Uri.parse(url); - String urlDomain = u.getHost(); - if (urlDomain == null) return false; - for (int i = 0; i< mParsedExclusionList.length; i+=2) { - if (urlDomain.equals(mParsedExclusionList[i]) || - urlDomain.endsWith(mParsedExclusionList[i+1])) { - return true; - } - } - return false; - } - + /** + * @hide + */ public boolean isValid() { if (!TextUtils.isEmpty(mPacFileUrl)) return true; return Proxy.PROXY_VALID == Proxy.validate(mHost == null ? "" : mHost, @@ -145,6 +216,9 @@ public class ProxyProperties implements Parcelable { mExclusionList == null ? "" : mExclusionList); } + /** + * @hide + */ public java.net.Proxy makeProxy() { java.net.Proxy proxy = java.net.Proxy.NO_PROXY; if (mHost != null) { @@ -179,17 +253,17 @@ public class ProxyProperties implements Parcelable { @Override public boolean equals(Object o) { - if (!(o instanceof ProxyProperties)) return false; - ProxyProperties p = (ProxyProperties)o; + if (!(o instanceof ProxyInfo)) return false; + ProxyInfo p = (ProxyInfo)o; // If PAC URL is present in either then they must be equal. // Other parameters will only be for fall back. if (!TextUtils.isEmpty(mPacFileUrl)) { return mPacFileUrl.equals(p.getPacFileUrl()) && mPort == p.mPort; } - if (!TextUtils.isEmpty(p.getPacFileUrl())) { + if (!TextUtils.isEmpty(p.mPacFileUrl)) { return false; } - if (mExclusionList != null && !mExclusionList.equals(p.getExclusionList())) return false; + if (mExclusionList != null && !mExclusionList.equals(p.getExclusionListAsString())) return false; if (mHost != null && p.getHost() != null && mHost.equals(p.getHost()) == false) { return false; } @@ -245,15 +319,15 @@ public class ProxyProperties implements Parcelable { * Implement the Parcelable interface. * @hide */ - public static final Creator<ProxyProperties> CREATOR = - new Creator<ProxyProperties>() { - public ProxyProperties createFromParcel(Parcel in) { + public static final Creator<ProxyInfo> CREATOR = + new Creator<ProxyInfo>() { + public ProxyInfo createFromParcel(Parcel in) { String host = null; int port = 0; if (in.readByte() != 0) { String url = in.readString(); int localPort = in.readInt(); - return new ProxyProperties(url, localPort); + return new ProxyInfo(url, localPort); } if (in.readByte() != 0) { host = in.readString(); @@ -261,13 +335,13 @@ public class ProxyProperties implements Parcelable { } String exclList = in.readString(); String[] parsedExclList = in.readStringArray(); - ProxyProperties proxyProperties = - new ProxyProperties(host, port, exclList, parsedExclList); + ProxyInfo proxyProperties = + new ProxyInfo(host, port, exclList, parsedExclList); return proxyProperties; } - public ProxyProperties[] newArray(int size) { - return new ProxyProperties[size]; + public ProxyInfo[] newArray(int size) { + return new ProxyInfo[size]; } }; } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 69840c4..d8fcfc5 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -9766,6 +9766,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, invalidateViewProperty(false, true); invalidateParentIfNeededAndWasQuickRejected(); + notifySubtreeAccessibilityStateChangedIfNeeded(); } } @@ -9809,6 +9810,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, invalidateViewProperty(false, true); invalidateParentIfNeededAndWasQuickRejected(); + notifySubtreeAccessibilityStateChangedIfNeeded(); } } @@ -9852,6 +9854,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, invalidateViewProperty(false, true); invalidateParentIfNeededAndWasQuickRejected(); + notifySubtreeAccessibilityStateChangedIfNeeded(); } } @@ -9887,6 +9890,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, invalidateViewProperty(false, true); invalidateParentIfNeededAndWasQuickRejected(); + notifySubtreeAccessibilityStateChangedIfNeeded(); } } @@ -9922,6 +9926,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, invalidateViewProperty(false, true); invalidateParentIfNeededAndWasQuickRejected(); + notifySubtreeAccessibilityStateChangedIfNeeded(); } } @@ -10083,6 +10088,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags &= ~PFLAG_ALPHA_SET; invalidateViewProperty(true, false); mRenderNode.setAlpha(getFinalAlpha()); + notifyViewAccessibilityStateChangedIfNeeded( + AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED); } } } @@ -10513,6 +10520,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, invalidateViewProperty(false, true); invalidateParentIfNeededAndWasQuickRejected(); + notifySubtreeAccessibilityStateChangedIfNeeded(); } } @@ -10661,6 +10669,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } else { mRenderNode.setOutline(null); } + notifySubtreeAccessibilityStateChangedIfNeeded(); } } @@ -10815,6 +10824,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } invalidateParentIfNeeded(); } + notifySubtreeAccessibilityStateChangedIfNeeded(); } } @@ -10861,6 +10871,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } invalidateParentIfNeeded(); } + notifySubtreeAccessibilityStateChangedIfNeeded(); } } diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 43bc0b6..4309366 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -4638,6 +4638,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (invalidate) { invalidateViewProperty(false, false); } + notifySubtreeAccessibilityStateChangedIfNeeded(); } /** |
