From a0f8bc51aff98c2e23e73069e447f63397471a0a Mon Sep 17 00:00:00 2001
From: Jesse Wilson
Various utilities for debugging and logging.
*/ public class DebugUtils { + /** @hide */ public DebugUtils() {} + /** *Filters objects against the ANDROID_OBJECT_FILTER
* 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.
- *
+ *
*
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. - * + * *
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) { -- cgit v1.2.3-59-g8ed1b