From d4a4729c0cac582a2dcec7c8cfb316b81885a0f0 Mon Sep 17 00:00:00 2001 From: Tom Taylor Date: Mon, 21 Dec 2009 13:59:18 -0800 Subject: Update imports to android-common Several files were moved to android-common. Update all the references to import those files from the new location. --- core/java/android/app/AliasActivity.java | 2 +- core/java/android/app/ApplicationContext.java | 2 +- core/java/android/content/Intent.java | 92 +-- core/java/android/content/IntentFilter.java | 2 +- core/java/android/content/SyncStorageEngine.java | 2 +- core/java/android/content/pm/PackageParser.java | 2 +- .../content/pm/RegisteredServicesCache.java | 2 +- core/java/android/content/res/Resources.java | 2 +- core/java/android/content/res/StringBlock.java | 2 +- core/java/android/content/res/TypedArray.java | 2 +- core/java/android/content/res/XmlBlock.java | 2 +- .../android/net/NetworkConnectivityListener.java | 220 ------ core/java/android/text/AutoText.java | 2 +- core/java/android/text/Html.java | 2 +- core/java/android/util/TimeUtils.java | 2 +- core/java/android/util/XmlPullAttributes.java | 2 +- .../android/internal/database/ArrayListCursor.java | 171 ----- .../java/com/android/internal/os/PowerProfile.java | 2 +- .../android/internal/util/FastXmlSerializer.java | 365 ---------- core/java/com/android/internal/util/XmlUtils.java | 796 --------------------- .../android/providers/settings/DatabaseHelper.java | 2 +- preloaded-classes | 10 +- .../java/com/android/server/AppWidgetService.java | 2 +- .../java/com/android/server/KeyInputQueue.java | 2 +- .../com/android/server/PackageManagerService.java | 4 +- .../android/server/WallpaperManagerService.java | 2 +- .../android/internal/telephony/IccProvider.java | 2 +- .../internal/telephony/cdma/EriManager.java | 2 +- .../internal/telephony/gsm/SpnOverride.java | 2 +- .../internal/telephony/gsm/VoiceMailConstants.java | 2 +- .../com/android/unit_tests/CursorWindowTest.java | 2 +- .../src/com/android/unit_tests/SafeSaxTest.java | 2 +- .../android/widget/SimpleCursorAdapterTest.java | 2 +- .../src/com/android/layoutlib/bridge/Bridge.java | 2 +- .../android/layoutlib/bridge/BridgeTypedArray.java | 2 +- 35 files changed, 81 insertions(+), 1633 deletions(-) delete mode 100644 core/java/android/net/NetworkConnectivityListener.java delete mode 100644 core/java/com/android/internal/database/ArrayListCursor.java delete mode 100644 core/java/com/android/internal/util/FastXmlSerializer.java delete mode 100644 core/java/com/android/internal/util/XmlUtils.java diff --git a/core/java/android/app/AliasActivity.java b/core/java/android/app/AliasActivity.java index 4f91e020ce38..7527a5b19d5b 100644 --- a/core/java/android/app/AliasActivity.java +++ b/core/java/android/app/AliasActivity.java @@ -26,7 +26,7 @@ import android.content.res.XmlResourceParser; import android.os.Bundle; import android.util.AttributeSet; import android.util.Xml; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; import java.io.IOException; diff --git a/core/java/android/app/ApplicationContext.java b/core/java/android/app/ApplicationContext.java index 1e04abf32f98..de370d240bf9 100644 --- a/core/java/android/app/ApplicationContext.java +++ b/core/java/android/app/ApplicationContext.java @@ -17,7 +17,7 @@ package android.app; import com.android.internal.policy.PolicyManager; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; import com.google.android.collect.Maps; import org.xmlpull.v1.XmlPullParserException; diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index d78475984987..ec1252a688b5 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -34,7 +34,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; import android.util.Log; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; import java.io.IOException; import java.io.Serializable; @@ -1130,7 +1130,7 @@ public class Intent implements Parcelable { */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_POWER_USAGE_SUMMARY = "android.intent.action.POWER_USAGE_SUMMARY"; - + /** * Activity Action: Setup wizard to launch after a platform update. This * activity should have a string meta-data field associated with it, @@ -1144,7 +1144,7 @@ public class Intent implements Parcelable { */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_UPGRADE_SETUP = "android.intent.action.UPGRADE_SETUP"; - + /** * A string associated with a {@link #ACTION_UPGRADE_SETUP} activity * describing the last run version of the platform that was setup. @@ -1158,7 +1158,7 @@ public class Intent implements Parcelable { /** * Broadcast Action: Sent after the screen turns off. - * + * *

This is a protected intent that can only be sent * by the system. */ @@ -1166,7 +1166,7 @@ public class Intent implements Parcelable { public static final String ACTION_SCREEN_OFF = "android.intent.action.SCREEN_OFF"; /** * Broadcast Action: Sent after the screen turns on. - * + * *

This is a protected intent that can only be sent * by the system. */ @@ -1176,7 +1176,7 @@ public class Intent implements Parcelable { /** * Broadcast Action: Sent when the user is present after device wakes up (e.g when the * keyguard is gone). - * + * *

This is a protected intent that can only be sent * by the system. */ @@ -1189,7 +1189,7 @@ public class Intent implements Parcelable { * in manifests, only by exlicitly registering for it with * {@link Context#registerReceiver(BroadcastReceiver, IntentFilter) * Context.registerReceiver()}. - * + * *

This is a protected intent that can only be sent * by the system. */ @@ -1210,7 +1210,7 @@ public class Intent implements Parcelable { *

- * + * *

This is a protected intent that can only be sent * by the system. */ @@ -1238,7 +1238,7 @@ public class Intent implements Parcelable { * such as installing alarms. You must hold the * {@link android.Manifest.permission#RECEIVE_BOOT_COMPLETED} permission * in order to receive this broadcast. - * + * *

This is a protected intent that can only be sent * by the system. */ @@ -1254,7 +1254,7 @@ public class Intent implements Parcelable { * Broadcast Action: Trigger the download and eventual installation * of a package. *

Input: {@link #getData} is the URI of the package file to download. - * + * *

This is a protected intent that can only be sent * by the system. */ @@ -1270,7 +1270,7 @@ public class Intent implements Parcelable { *

  • {@link #EXTRA_REPLACING} is set to true if this is following * an {@link #ACTION_PACKAGE_REMOVED} broadcast for the same package. * - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1284,7 +1284,7 @@ public class Intent implements Parcelable { *

    - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1302,7 +1302,7 @@ public class Intent implements Parcelable { *

  • {@link #EXTRA_REPLACING} is set to true if this will be followed * by an {@link #ACTION_PACKAGE_ADDED} broadcast for the same package. * - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1319,7 +1319,7 @@ public class Intent implements Parcelable { *

  • {@link #EXTRA_DONT_KILL_APP} containing boolean field to override the * default action of restarting the application. * - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1335,7 +1335,7 @@ public class Intent implements Parcelable { *

    - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1350,7 +1350,7 @@ public class Intent implements Parcelable { *

    - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1359,7 +1359,7 @@ public class Intent implements Parcelable { /** * Broadcast Action: A user ID has been removed from the system. The user * ID number is stored in the extra data under {@link #EXTRA_UID}. - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1380,13 +1380,13 @@ public class Intent implements Parcelable { * application to make sure it sees the new changes. Some system code that * can not be restarted will need to watch for this action and handle it * appropriately. - * + * *

    * You can not receive this through components declared * in manifests, only by explicitly registering for it with * {@link Context#registerReceiver(BroadcastReceiver, IntentFilter) * Context.registerReceiver()}. - * + * *

    This is a protected intent that can only be sent * by the system. * @@ -1396,7 +1396,7 @@ public class Intent implements Parcelable { public static final String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED"; /** * Broadcast Action: The current device's locale has changed. - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1417,7 +1417,7 @@ public class Intent implements Parcelable { * and {@link #ACTION_POWER_DISCONNECTED} for distinct battery-related * broadcasts that are sent and can be received through manifest * receivers. - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1426,7 +1426,7 @@ public class Intent implements Parcelable { /** * Broadcast Action: Indicates low battery condition on the device. * This broadcast corresponds to the "Low battery warning" system dialog. - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1436,7 +1436,7 @@ public class Intent implements Parcelable { * Broadcast Action: Indicates the battery is now okay after being low. * This will be sent after {@link #ACTION_BATTERY_LOW} once the battery has * gone back up to an okay state. - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1448,7 +1448,7 @@ public class Intent implements Parcelable { * Unlike ACTION_BATTERY_CHANGED, applications will be woken for this and so do not have to * stay active to receive this notification. This action can be used to implement actions * that wait until power is available to trigger. - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1460,7 +1460,7 @@ public class Intent implements Parcelable { * Unlike ACTION_BATTERY_CHANGED, applications will be woken for this and so do not have to * stay active to receive this notification. This action can be used to implement actions * that wait until power is available to trigger. - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1473,7 +1473,7 @@ public class Intent implements Parcelable { * off, not sleeping). Once the broadcast is complete, the final shutdown * will proceed and all unsaved data lost. Apps will not normally need * to handle this, since the foreground activity will be paused as well. - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1493,7 +1493,7 @@ public class Intent implements Parcelable { /** * Broadcast Action: A sticky broadcast that indicates low memory * condition on the device - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1501,7 +1501,7 @@ public class Intent implements Parcelable { public static final String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW"; /** * Broadcast Action: Indicates low memory condition on the device no longer exists - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1668,7 +1668,7 @@ public class Intent implements Parcelable { * then cell radio and possibly other radios such as bluetooth or WiFi may have also been * turned off

  • * - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1750,7 +1750,7 @@ public class Intent implements Parcelable { *

    You must hold the * {@link android.Manifest.permission#PROCESS_OUTGOING_CALLS} * permission to receive this Intent.

    - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -1761,7 +1761,7 @@ public class Intent implements Parcelable { /** * Broadcast Action: Have the device reboot. This is only for use by * system code. - * + * *

    This is a protected intent that can only be sent * by the system. */ @@ -2112,7 +2112,7 @@ public class Intent implements Parcelable { * indicate that the dock should take over the home key when it is active. */ public static final String METADATA_DOCK_HOME = "android.dock_home"; - + /** * Used as a parcelable extra field in {@link #ACTION_APP_ERROR}, containing * the bug report. @@ -2406,7 +2406,7 @@ public class Intent implements Parcelable { * the new broadcast (and receivers associated with it) will replace the * existing one in the pending broadcast list, remaining at the same * position in the list. - * + * *

    This flag is most typically used with sticky broadcasts, which * only care about delivering the most recent values of the broadcast * to their receivers. @@ -2440,7 +2440,7 @@ public class Intent implements Parcelable { public static final int IMMUTABLE_FLAGS = FLAG_GRANT_READ_URI_PERMISSION | FLAG_GRANT_WRITE_URI_PERMISSION; - + // --------------------------------------------------------------------- // --------------------------------------------------------------------- // toUri() and parseUri() options. @@ -2454,7 +2454,7 @@ public class Intent implements Parcelable { * VIEW action for that raw URI. */ public static final int URI_INTENT_SCHEME = 1<<0; - + // --------------------------------------------------------------------- private String mAction; @@ -2613,7 +2613,7 @@ public class Intent implements Parcelable { public static Intent getIntent(String uri) throws URISyntaxException { return parseUri(uri, 0); } - + /** * Create an intent from a URI. This URI may encode the action, * category, and other intent fields, if it was returned by @@ -2632,7 +2632,7 @@ public class Intent implements Parcelable { * @throws URISyntaxException Throws URISyntaxError if the basic URI syntax * it bad (as parsed by the Uri class) or the Intent data within the * URI is invalid. - * + * * @see #toUri */ public static Intent parseUri(String uri, int flags) throws URISyntaxException { @@ -2650,7 +2650,7 @@ public class Intent implements Parcelable { return intent; } } - + // simple case i = uri.lastIndexOf("#"); if (i == -1) return new Intent(ACTION_VIEW, Uri.parse(uri)); @@ -2742,7 +2742,7 @@ public class Intent implements Parcelable { data = scheme + ':' + data; } } - + if (data.length() > 0) { try { intent.mData = Uri.parse(data); @@ -2751,7 +2751,7 @@ public class Intent implements Parcelable { } } } - + return intent; } catch (IndexOutOfBoundsException e) { @@ -2902,7 +2902,7 @@ public class Intent implements Parcelable { } else { intent.mData = Uri.parse(uri); } - + if (intent.mAction == null) { // By default, if no action is specified, then use VIEW. intent.mAction = ACTION_VIEW; @@ -5127,13 +5127,13 @@ public class Intent implements Parcelable { * used with {@link Uri#parse Uri.parse(String)}. The URI contains the * Intent's data as the base URI, with an additional fragment describing * the action, categories, type, flags, package, component, and extras. - * + * *

    You can convert the returned string back to an Intent with * {@link #getIntent}. - * + * * @param flags Additional operating flags. Either 0 or * {@link #URI_INTENT_SCHEME}. - * + * * @return Returns a URI encoding URI string describing the entire contents * of the Intent. */ @@ -5157,13 +5157,13 @@ public class Intent implements Parcelable { data = data.substring(i+1); break; } - + // No scheme. break; } } uri.append(data); - + } else if ((flags&URI_INTENT_SCHEME) != 0) { uri.append("intent:"); } diff --git a/core/java/android/content/IntentFilter.java b/core/java/android/content/IntentFilter.java index 365f26983a33..023c024941a7 100644 --- a/core/java/android/content/IntentFilter.java +++ b/core/java/android/content/IntentFilter.java @@ -34,7 +34,7 @@ import android.util.AndroidException; import android.util.Config; import android.util.Log; import android.util.Printer; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; /** * Structured description of Intent values to be matched. An IntentFilter can diff --git a/core/java/android/content/SyncStorageEngine.java b/core/java/android/content/SyncStorageEngine.java index be7090999bc1..d1fdfafa9afd 100644 --- a/core/java/android/content/SyncStorageEngine.java +++ b/core/java/android/content/SyncStorageEngine.java @@ -18,7 +18,7 @@ package android.content; import com.android.internal.os.AtomicFile; import com.android.internal.util.ArrayUtils; -import com.android.internal.util.FastXmlSerializer; +import com.android.common.FastXmlSerializer; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 3f8c71ee1daa..0754cbfe081e 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -35,7 +35,7 @@ import android.util.Config; import android.util.DisplayMetrics; import android.util.Log; import android.util.TypedValue; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; import java.io.File; import java.io.IOException; diff --git a/core/java/android/content/pm/RegisteredServicesCache.java b/core/java/android/content/pm/RegisteredServicesCache.java index b39a67de5f8b..b819fa07e0b9 100644 --- a/core/java/android/content/pm/RegisteredServicesCache.java +++ b/core/java/android/content/pm/RegisteredServicesCache.java @@ -43,7 +43,7 @@ import java.io.IOException; import java.io.FileInputStream; import com.android.internal.os.AtomicFile; -import com.android.internal.util.FastXmlSerializer; +import com.android.common.FastXmlSerializer; import com.google.android.collect.Maps; import com.google.android.collect.Lists; diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 1c0ed3671d37..e4fc259921a0 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -17,7 +17,7 @@ package android.content.res; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; diff --git a/core/java/android/content/res/StringBlock.java b/core/java/android/content/res/StringBlock.java index 8fb82be33880..2411177327c2 100644 --- a/core/java/android/content/res/StringBlock.java +++ b/core/java/android/content/res/StringBlock.java @@ -24,7 +24,7 @@ import android.util.SparseArray; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Typeface; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; /** * Conveniences for retrieving data out of a compiled string resource. diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java index 016ee7f4c7df..8f0003b71db8 100644 --- a/core/java/android/content/res/TypedArray.java +++ b/core/java/android/content/res/TypedArray.java @@ -5,7 +5,7 @@ import android.util.AttributeSet; import android.util.DisplayMetrics; import android.util.Log; import android.util.TypedValue; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; import java.util.Arrays; diff --git a/core/java/android/content/res/XmlBlock.java b/core/java/android/content/res/XmlBlock.java index 6336678e0675..f80023252248 100644 --- a/core/java/android/content/res/XmlBlock.java +++ b/core/java/android/content/res/XmlBlock.java @@ -17,7 +17,7 @@ package android.content.res; import android.util.TypedValue; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; import org.xmlpull.v1.XmlPullParserException; diff --git a/core/java/android/net/NetworkConnectivityListener.java b/core/java/android/net/NetworkConnectivityListener.java deleted file mode 100644 index 858fc779563b..000000000000 --- a/core/java/android/net/NetworkConnectivityListener.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.os.Handler; -import android.os.Message; -import android.util.Log; - -import java.util.HashMap; -import java.util.Iterator; - -/** - * A wrapper for a broadcast receiver that provides network connectivity - * state information, independent of network type (mobile, Wi-Fi, etc.). - * {@hide} - */ -public class NetworkConnectivityListener { - private static final String TAG = "NetworkConnectivityListener"; - private static final boolean DBG = false; - - private Context mContext; - private HashMap mHandlers = new HashMap(); - private State mState; - private boolean mListening; - private String mReason; - private boolean mIsFailover; - - /** Network connectivity information */ - private NetworkInfo mNetworkInfo; - - /** - * In case of a Disconnect, the connectivity manager may have - * already established, or may be attempting to establish, connectivity - * with another network. If so, {@code mOtherNetworkInfo} will be non-null. - */ - private NetworkInfo mOtherNetworkInfo; - - private ConnectivityBroadcastReceiver mReceiver; - - private class ConnectivityBroadcastReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - - if (!action.equals(ConnectivityManager.CONNECTIVITY_ACTION) || - mListening == false) { - Log.w(TAG, "onReceived() called with " + mState.toString() + " and " + intent); - return; - } - - boolean noConnectivity = - intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false); - - if (noConnectivity) { - mState = State.NOT_CONNECTED; - } else { - mState = State.CONNECTED; - } - - mNetworkInfo = (NetworkInfo) - intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO); - mOtherNetworkInfo = (NetworkInfo) - intent.getParcelableExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO); - - mReason = intent.getStringExtra(ConnectivityManager.EXTRA_REASON); - mIsFailover = - intent.getBooleanExtra(ConnectivityManager.EXTRA_IS_FAILOVER, false); - - if (DBG) { - Log.d(TAG, "onReceive(): mNetworkInfo=" + mNetworkInfo + " mOtherNetworkInfo = " - + (mOtherNetworkInfo == null ? "[none]" : mOtherNetworkInfo + - " noConn=" + noConnectivity) + " mState=" + mState.toString()); - } - - // Notifiy any handlers. - Iterator it = mHandlers.keySet().iterator(); - while (it.hasNext()) { - Handler target = it.next(); - Message message = Message.obtain(target, mHandlers.get(target)); - target.sendMessage(message); - } - } - }; - - public enum State { - UNKNOWN, - - /** This state is returned if there is connectivity to any network **/ - CONNECTED, - /** - * This state is returned if there is no connectivity to any network. This is set - * to true under two circumstances: - *