diff options
| author | 2011-02-24 19:37:00 -0800 | |
|---|---|---|
| committer | 2011-02-24 19:37:00 -0800 | |
| commit | 50fc0e5c1bafb458ae9cd8cca6a3732828e821df (patch) | |
| tree | c6a931f4f8f4239888bf8c1633b0f0f9afd8f23c | |
| parent | 7547a8be941cff4794a276e98752bfcfb2e805d1 (diff) | |
| parent | a0f8bc51aff98c2e23e73069e447f63397471a0a (diff) | |
Merge "Remove default constructors from static utility classes."
| -rw-r--r-- | api/12.xml | 48 | ||||
| -rw-r--r-- | api/current.xml | 48 | ||||
| -rw-r--r-- | core/java/android/util/Config.java | 5 | ||||
| -rw-r--r-- | core/java/android/util/DebugUtils.java | 4 | ||||
| -rw-r--r-- | core/java/android/util/EventLog.java | 2 | ||||
| -rw-r--r-- | core/java/android/util/StateSet.java | 15 | ||||
| -rw-r--r-- | core/java/android/util/TimeUtils.java | 29 | ||||
| -rw-r--r-- | core/java/android/util/Xml.java | 9 |
8 files changed, 36 insertions, 124 deletions
diff --git a/api/12.xml b/api/12.xml index 6c6ede1ee41f..7835c7f9e4a3 100644 --- a/api/12.xml +++ b/api/12.xml @@ -201551,14 +201551,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="Config" - type="android.util.Config" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <field name="DEBUG" type="boolean" transient="false" @@ -201621,14 +201613,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="DebugUtils" - type="android.util.DebugUtils" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="isObjectSelected" return="boolean" abstract="false" @@ -201817,14 +201801,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="EventLog" - type="android.util.EventLog" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="getTagCode" return="int" abstract="false" @@ -204105,14 +204081,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="StateSet" - type="android.util.StateSet" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="dump" return="java.lang.String" abstract="false" @@ -204258,14 +204226,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="TimeUtils" - type="android.util.TimeUtils" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="getTimeZone" return="java.util.TimeZone" abstract="false" @@ -205066,14 +205026,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="Xml" - type="android.util.Xml" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="asAttributeSet" return="android.util.AttributeSet" abstract="false" diff --git a/api/current.xml b/api/current.xml index bf388b13436f..5ceca12a424f 100644 --- a/api/current.xml +++ b/api/current.xml @@ -204927,14 +204927,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="Config" - type="android.util.Config" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <field name="DEBUG" type="boolean" transient="false" @@ -204997,14 +204989,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="DebugUtils" - type="android.util.DebugUtils" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="isObjectSelected" return="boolean" abstract="false" @@ -205193,14 +205177,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="EventLog" - type="android.util.EventLog" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="getTagCode" return="int" abstract="false" @@ -207694,14 +207670,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="StateSet" - type="android.util.StateSet" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="dump" return="java.lang.String" abstract="false" @@ -207847,14 +207815,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="TimeUtils" - type="android.util.TimeUtils" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="getTimeZone" return="java.util.TimeZone" abstract="false" @@ -208655,14 +208615,6 @@ deprecated="not deprecated" visibility="public" > -<constructor name="Xml" - type="android.util.Xml" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</constructor> <method name="asAttributeSet" return="android.util.AttributeSet" abstract="false" diff --git a/core/java/android/util/Config.java b/core/java/android/util/Config.java index 924b49de9e7e..becb88214859 100644 --- a/core/java/android/util/Config.java +++ b/core/java/android/util/Config.java @@ -21,8 +21,9 @@ package android.util; * on release vs. debug build. * {@more} */ -public final class Config -{ +public final class Config { + /** @hide */ public Config() {} + /** * If this is a debug build, this field will be true. */ diff --git a/core/java/android/util/DebugUtils.java b/core/java/android/util/DebugUtils.java index 65fc35c8947e..7e3c85546e72 100644 --- a/core/java/android/util/DebugUtils.java +++ b/core/java/android/util/DebugUtils.java @@ -20,9 +20,11 @@ import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; /** - * <p>Various utilities for debugging and logging.</p> + * <p>Various utilities for debugging and logging.</p> */ public class DebugUtils { + /** @hide */ public DebugUtils() {} + /** * <p>Filters objects against the <code>ANDROID_OBJECT_FILTER</code> * environment variable. This environment variable can filter objects diff --git a/core/java/android/util/EventLog.java b/core/java/android/util/EventLog.java index b596d321334e..29c0ba2f3008 100644 --- a/core/java/android/util/EventLog.java +++ b/core/java/android/util/EventLog.java @@ -42,6 +42,8 @@ import java.util.regex.Pattern; * event-log-tags file defines the payload contents for each type code. */ public class EventLog { + /** @hide */ public EventLog() {} + private static final String TAG = "EventLog"; private static final String TAGS_FILE = "/system/etc/event-log-tags"; diff --git a/core/java/android/util/StateSet.java b/core/java/android/util/StateSet.java index 21d8e454663e..2623638d781b 100644 --- a/core/java/android/util/StateSet.java +++ b/core/java/android/util/StateSet.java @@ -36,13 +36,14 @@ import com.android.internal.R; */ public class StateSet { + /** @hide */ public StateSet() {} public static final int[] WILD_CARD = new int[0]; public static final int[] NOTHING = new int[] { 0 }; /** * Return whether the stateSetOrSpec is matched by all StateSets. - * + * * @param stateSetOrSpec a state set or state spec. */ public static boolean isWildCard(int[] stateSetOrSpec) { @@ -51,7 +52,7 @@ public class StateSet { /** * Return whether the stateSet matches the desired stateSpec. - * + * * @param stateSpec an array of required (if positive) or * prohibited (if negative) {@link android.view.View} states. * @param stateSet an array of {@link android.view.View} states @@ -111,7 +112,7 @@ public class StateSet { /** * Return whether the state matches the desired stateSpec. - * + * * @param stateSpec an array of required (if positive) or * prohibited (if negative) {@link android.view.View} states. * @param state a {@link android.view.View} state @@ -148,13 +149,13 @@ public class StateSet { System.arraycopy(states, 0, trimmedStates, 0, newSize); return trimmedStates; } - + public static String dump(int[] states) { StringBuilder sb = new StringBuilder(); - + int count = states.length; for (int i = 0; i < count; i++) { - + switch (states[i]) { case R.attr.state_window_focused: sb.append("W "); @@ -173,7 +174,7 @@ public class StateSet { break; } } - + return sb.toString(); } } diff --git a/core/java/android/util/TimeUtils.java b/core/java/android/util/TimeUtils.java index 85ce5e1e55d0..d7b0dc14bddc 100644 --- a/core/java/android/util/TimeUtils.java +++ b/core/java/android/util/TimeUtils.java @@ -34,6 +34,7 @@ import com.android.internal.util.XmlUtils; * A class containing utility methods related to time zones. */ public class TimeUtils { + /** @hide */ public TimeUtils() {} private static final String TAG = "TimeUtils"; /** @@ -116,14 +117,14 @@ public class TimeUtils { * in use. The format of the string is dependent on the underlying time zone * database implementation, but will typically contain the year in which the database * was updated plus a letter from a to z indicating changes made within that year. - * + * * <p>Time zone database updates should be expected to occur periodically due to * political and legal changes that cannot be anticipated in advance. Therefore, * when computing the UTC time for a future event, applications should be aware that * the results may differ following a time zone database update. This method allows * applications to detect that a database change has occurred, and to recalculate any * cached times accordingly. - * + * * <p>The time zone database may be assumed to change only when the device runtime * is restarted. Therefore, it is not necessary to re-query the database version * during the lifetime of an activity. @@ -134,14 +135,14 @@ public class TimeUtils { /** @hide Field length that can hold 999 days of time */ public static final int HUNDRED_DAY_FIELD_LEN = 19; - + private static final int SECONDS_PER_MINUTE = 60; private static final int SECONDS_PER_HOUR = 60 * 60; private static final int SECONDS_PER_DAY = 24 * 60 * 60; private static final Object sFormatSync = new Object(); private static char[] sFormatStr = new char[HUNDRED_DAY_FIELD_LEN+5]; - + static private int accumField(int amt, int suffix, boolean always, int zeropad) { if (amt > 99 || (always && zeropad >= 3)) { return 3+suffix; @@ -154,7 +155,7 @@ public class TimeUtils { } return 0; } - + static private int printField(char[] formatStr, int amt, char suffix, int pos, boolean always, int zeropad) { if (always || amt > 0) { @@ -178,14 +179,14 @@ public class TimeUtils { } return pos; } - + private static int formatDurationLocked(long duration, int fieldLen) { if (sFormatStr.length < fieldLen) { sFormatStr = new char[fieldLen]; } - + char[] formatStr = sFormatStr; - + if (duration == 0) { int pos = 0; fieldLen -= 1; @@ -195,7 +196,7 @@ public class TimeUtils { formatStr[pos] = '0'; return pos+1; } - + char prefix; if (duration > 0) { prefix = '+'; @@ -222,7 +223,7 @@ public class TimeUtils { } int pos = 0; - + if (fieldLen != 0) { int myLen = accumField(days, 1, false, 0); myLen += accumField(hours, 1, myLen > 0, 2); @@ -235,10 +236,10 @@ public class TimeUtils { myLen++; } } - + formatStr[pos] = prefix; pos++; - + int start = pos; boolean zeropad = fieldLen != 0; pos = printField(formatStr, days, 'd', pos, false, 0); @@ -249,7 +250,7 @@ public class TimeUtils { formatStr[pos] = 's'; return pos + 1; } - + /** @hide Just for debugging; not internationalized. */ public static void formatDuration(long duration, StringBuilder builder) { synchronized (sFormatSync) { @@ -270,7 +271,7 @@ public class TimeUtils { public static void formatDuration(long duration, PrintWriter pw) { formatDuration(duration, pw, 0); } - + /** @hide Just for debugging; not internationalized. */ public static void formatDuration(long time, long now, PrintWriter pw) { if (time == 0) { diff --git a/core/java/android/util/Xml.java b/core/java/android/util/Xml.java index 873a2180da32..b0c33e5fca61 100644 --- a/core/java/android/util/Xml.java +++ b/core/java/android/util/Xml.java @@ -38,6 +38,7 @@ import org.apache.harmony.xml.ExpatReader; * XML utility methods. */ public class Xml { + /** @hide */ public Xml() {} /** * {@link org.xmlpull.v1.XmlPullParser} "relaxed" feature name. @@ -156,21 +157,21 @@ public class Xml { } throw new UnsupportedEncodingException(encodingName); } - + /** * Return an AttributeSet interface for use with the given XmlPullParser. * If the given parser itself implements AttributeSet, that implementation * is simply returned. Otherwise a wrapper class is * instantiated on top of the XmlPullParser, as a proxy for retrieving its * attributes, and returned to you. - * + * * @param parser The existing parser for which you would like an * AttributeSet. - * + * * @return An AttributeSet you can use to retrieve the * attribute values at each of the tags as the parser moves * through its XML document. - * + * * @see AttributeSet */ public static AttributeSet asAttributeSet(XmlPullParser parser) { |