summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt58
-rw-r--r--core/java/android/app/Notification.java23
-rw-r--r--core/java/android/content/SyncResult.java2
-rw-r--r--core/java/android/net/ConnectivityManager.java15
-rw-r--r--core/java/android/os/BatteryStats.java105
-rw-r--r--core/java/android/view/AccessibilityInteractionController.java4
-rw-r--r--core/java/android/view/View.java164
-rw-r--r--core/java/android/view/ViewGroup.java38
-rw-r--r--core/java/android/view/ViewParent.java9
-rw-r--r--core/java/android/view/ViewRootImpl.java41
-rw-r--r--core/java/android/view/accessibility/AccessibilityEvent.java46
-rw-r--r--core/java/android/view/accessibility/AccessibilityInteractionClient.java18
-rw-r--r--core/java/android/view/accessibility/AccessibilityNodeInfo.java100
-rw-r--r--core/java/android/view/accessibility/AccessibilityNodeInfoCache.java114
-rw-r--r--core/java/android/view/accessibility/AccessibilityRecord.java2
-rw-r--r--core/java/android/widget/AdapterView.java4
-rw-r--r--core/java/android/widget/CheckedTextView.java2
-rw-r--r--core/java/android/widget/CompoundButton.java2
-rw-r--r--core/java/android/widget/TextView.java12
-rw-r--r--core/java/com/android/internal/app/IBatteryStats.aidl1
-rw-r--r--core/java/com/android/internal/os/BatteryStatsImpl.java511
-rw-r--r--core/jni/android/graphics/BitmapFactory.cpp148
-rw-r--r--docs/html/_redirects.yaml15
-rw-r--r--docs/html/design/media/devices_displays_density.pngbin8236 -> 11719 bytes
-rw-r--r--docs/html/design/media/devices_displays_density@2x.pngbin0 -> 40816 bytes
-rw-r--r--docs/html/design/style/devices-displays.jd2
-rw-r--r--docs/html/design/style/iconography.jd190
-rw-r--r--docs/html/design/style/metrics-grids.jd24
-rw-r--r--graphics/java/android/graphics/BitmapFactory.java149
-rw-r--r--packages/SystemUI/assets/fonts/AndroidClock.ttfbin2480 -> 0 bytes
-rw-r--r--packages/SystemUI/assets/fonts/AndroidClock2.ttfbin2408 -> 0 bytes
-rw-r--r--packages/SystemUI/proguard.flags7
-rw-r--r--packages/SystemUI/res/layout/universe.xml39
-rw-r--r--packages/SystemUI/res/values-af/strings.xml1
-rw-r--r--packages/SystemUI/res/values-am/strings.xml1
-rw-r--r--packages/SystemUI/res/values-ar/strings.xml1
-rw-r--r--packages/SystemUI/res/values-be/strings.xml1
-rw-r--r--packages/SystemUI/res/values-bg/strings.xml1
-rw-r--r--packages/SystemUI/res/values-ca/strings.xml1
-rw-r--r--packages/SystemUI/res/values-cs/strings.xml1
-rw-r--r--packages/SystemUI/res/values-da/strings.xml1
-rw-r--r--packages/SystemUI/res/values-de/strings.xml1
-rw-r--r--packages/SystemUI/res/values-el/strings.xml1
-rw-r--r--packages/SystemUI/res/values-en-rGB/strings.xml1
-rw-r--r--packages/SystemUI/res/values-es-rUS/strings.xml1
-rw-r--r--packages/SystemUI/res/values-es/strings.xml1
-rw-r--r--packages/SystemUI/res/values-et/strings.xml1
-rw-r--r--packages/SystemUI/res/values-fa/strings.xml1
-rw-r--r--packages/SystemUI/res/values-fi/strings.xml1
-rw-r--r--packages/SystemUI/res/values-fr/strings.xml1
-rw-r--r--packages/SystemUI/res/values-hi/strings.xml1
-rw-r--r--packages/SystemUI/res/values-hr/strings.xml1
-rw-r--r--packages/SystemUI/res/values-hu/strings.xml1
-rw-r--r--packages/SystemUI/res/values-in/strings.xml1
-rw-r--r--packages/SystemUI/res/values-it/strings.xml1
-rw-r--r--packages/SystemUI/res/values-iw/strings.xml1
-rw-r--r--packages/SystemUI/res/values-ja/strings.xml1
-rw-r--r--packages/SystemUI/res/values-ko/strings.xml1
-rw-r--r--packages/SystemUI/res/values-lt/strings.xml1
-rw-r--r--packages/SystemUI/res/values-lv/strings.xml1
-rw-r--r--packages/SystemUI/res/values-ms/strings.xml1
-rw-r--r--packages/SystemUI/res/values-nb/strings.xml1
-rw-r--r--packages/SystemUI/res/values-nl/strings.xml1
-rw-r--r--packages/SystemUI/res/values-pl/strings.xml1
-rw-r--r--packages/SystemUI/res/values-pt-rPT/strings.xml1
-rw-r--r--packages/SystemUI/res/values-pt/strings.xml1
-rw-r--r--packages/SystemUI/res/values-rm/strings.xml2
-rw-r--r--packages/SystemUI/res/values-ro/strings.xml1
-rw-r--r--packages/SystemUI/res/values-ru/strings.xml1
-rw-r--r--packages/SystemUI/res/values-sk/strings.xml1
-rw-r--r--packages/SystemUI/res/values-sl/strings.xml1
-rw-r--r--packages/SystemUI/res/values-sr/strings.xml1
-rw-r--r--packages/SystemUI/res/values-sv/strings.xml1
-rw-r--r--packages/SystemUI/res/values-sw/strings.xml1
-rw-r--r--packages/SystemUI/res/values-th/strings.xml1
-rw-r--r--packages/SystemUI/res/values-tl/strings.xml1
-rw-r--r--packages/SystemUI/res/values-tr/strings.xml1
-rw-r--r--packages/SystemUI/res/values-uk/strings.xml1
-rw-r--r--packages/SystemUI/res/values-vi/strings.xml1
-rw-r--r--packages/SystemUI/res/values-zh-rCN/strings.xml1
-rw-r--r--packages/SystemUI/res/values-zh-rTW/strings.xml1
-rw-r--r--packages/SystemUI/res/values-zu/strings.xml1
-rw-r--r--packages/SystemUI/res/values/strings.xml3
-rw-r--r--packages/SystemUI/src/com/android/systemui/BootReceiver.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/ExpandHelper.java64
-rw-r--r--packages/SystemUI/src/com/android/systemui/SearchPanelView.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/SystemUIService.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/UniverseBackground.java458
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java16
-rw-r--r--packages/SystemUI/src/com/android/systemui/net/NetworkOverLimitActivity.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/power/PowerUI.java28
-rw-r--r--packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/settings/SettingsUI.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java71
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/DoNotDisturb.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/CarrierLabel.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/IconMerger.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java22
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java83
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/TrackingPatternView.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/DeadZone.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/DoNotDisturbController.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/EventHole.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/FixedSizeDrawable.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java32
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/CompatModePanel.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationLinearLayout.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java70
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java10
-rw-r--r--services/java/com/android/server/NetworkManagementService.java10
-rw-r--r--services/java/com/android/server/am/BatteryStatsService.java9
134 files changed, 1436 insertions, 1532 deletions
diff --git a/api/current.txt b/api/current.txt
index e538ab26910d..87891b51e984 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -3845,6 +3845,23 @@ package android.app {
field public static final int DEFAULT_LIGHTS = 4; // 0x4
field public static final int DEFAULT_SOUND = 1; // 0x1
field public static final int DEFAULT_VIBRATE = 2; // 0x2
+ field public static final java.lang.String EXTRA_INFO_TEXT = "android.infoText";
+ field public static final java.lang.String EXTRA_LARGE_ICON = "android.largeIcon";
+ field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big";
+ field public static final java.lang.String EXTRA_PEOPLE = "android.people";
+ field public static final java.lang.String EXTRA_PICTURE = "android.picture";
+ field public static final java.lang.String EXTRA_PROGRESS = "android.progress";
+ field public static final java.lang.String EXTRA_PROGRESS_INDETERMINATE = "android.progressIndeterminate";
+ field public static final java.lang.String EXTRA_PROGRESS_MAX = "android.progressMax";
+ field public static final java.lang.String EXTRA_SHOW_CHRONOMETER = "android.showChronometer";
+ field public static final java.lang.String EXTRA_SHOW_WHEN = "android.showWhen";
+ field public static final java.lang.String EXTRA_SMALL_ICON = "android.icon";
+ field public static final java.lang.String EXTRA_SUB_TEXT = "android.subText";
+ field public static final java.lang.String EXTRA_SUMMARY_TEXT = "android.summaryText";
+ field public static final java.lang.String EXTRA_TEXT = "android.text";
+ field public static final java.lang.String EXTRA_TEXT_LINES = "android.textLines";
+ field public static final java.lang.String EXTRA_TITLE = "android.title";
+ field public static final java.lang.String EXTRA_TITLE_BIG = "android.title.big";
field public static final int FLAG_AUTO_CANCEL = 16; // 0x10
field public static final int FLAG_FOREGROUND_SERVICE = 64; // 0x40
field public static final deprecated int FLAG_HIGH_PRIORITY = 128; // 0x80
@@ -3859,12 +3876,14 @@ package android.app {
field public static final int PRIORITY_MAX = 2; // 0x2
field public static final int PRIORITY_MIN = -2; // 0xfffffffe
field public static final int STREAM_DEFAULT = -1; // 0xffffffff
+ field public android.app.Notification.Action[] actions;
field public int audioStreamType;
field public android.widget.RemoteViews bigContentView;
field public android.app.PendingIntent contentIntent;
field public android.widget.RemoteViews contentView;
field public int defaults;
field public android.app.PendingIntent deleteIntent;
+ field public android.os.Bundle extras;
field public int flags;
field public android.app.PendingIntent fullScreenIntent;
field public int icon;
@@ -3882,6 +3901,18 @@ package android.app {
field public long when;
}
+ public static class Notification.Action implements android.os.Parcelable {
+ ctor public Notification.Action();
+ ctor public Notification.Action(int, java.lang.CharSequence, android.app.PendingIntent);
+ method public android.app.Notification.Action clone();
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator CREATOR;
+ field public android.app.PendingIntent actionIntent;
+ field public int icon;
+ field public java.lang.CharSequence title;
+ }
+
public static class Notification.BigPictureStyle extends android.app.Notification.Style {
ctor public Notification.BigPictureStyle();
ctor public Notification.BigPictureStyle(android.app.Notification.Builder);
@@ -3914,6 +3945,7 @@ package android.app {
method public android.app.Notification.Builder setContentTitle(java.lang.CharSequence);
method public android.app.Notification.Builder setDefaults(int);
method public android.app.Notification.Builder setDeleteIntent(android.app.PendingIntent);
+ method public android.app.Notification.Builder setExtras(android.os.Bundle);
method public android.app.Notification.Builder setFullScreenIntent(android.app.PendingIntent, boolean);
method public android.app.Notification.Builder setLargeIcon(android.graphics.Bitmap);
method public android.app.Notification.Builder setLights(int, int, int);
@@ -27282,6 +27314,7 @@ package android.view.accessibility {
method public int describeContents();
method public static java.lang.String eventTypeToString(int);
method public int getAction();
+ method public int getContentChangeType();
method public long getEventTime();
method public int getEventType();
method public int getMovementGranularity();
@@ -27293,11 +27326,14 @@ package android.view.accessibility {
method public static android.view.accessibility.AccessibilityEvent obtain(android.view.accessibility.AccessibilityEvent);
method public static android.view.accessibility.AccessibilityEvent obtain();
method public void setAction(int);
+ method public void setContentChangeType(int);
method public void setEventTime(long);
method public void setEventType(int);
method public void setMovementGranularity(int);
method public void setPackageName(java.lang.CharSequence);
method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CONTENT_CHANGE_TYPE_NODE = 1; // 0x1
+ field public static final int CONTENT_CHANGE_TYPE_SUBTREE = 0; // 0x0
field public static final android.os.Parcelable.Creator CREATOR;
field public static final int INVALID_POSITION = -1; // 0xffffffff
field public static final deprecated int MAX_TEXT_LENGTH = 500; // 0x1f4
@@ -27359,10 +27395,12 @@ package android.view.accessibility {
method public int getActions();
method public void getBoundsInParent(android.graphics.Rect);
method public void getBoundsInScreen(android.graphics.Rect);
+ method public android.os.Bundle getBundle();
method public android.view.accessibility.AccessibilityNodeInfo getChild(int);
method public int getChildCount();
method public java.lang.CharSequence getClassName();
method public java.lang.CharSequence getContentDescription();
+ method public int getInputType();
method public android.view.accessibility.AccessibilityNodeInfo getLabelFor();
method public android.view.accessibility.AccessibilityNodeInfo getLabeledBy();
method public int getMovementGranularities();
@@ -27406,6 +27444,7 @@ package android.view.accessibility {
method public void setEnabled(boolean);
method public void setFocusable(boolean);
method public void setFocused(boolean);
+ method public void setInputType(int);
method public void setLabelFor(android.view.View);
method public void setLabelFor(android.view.View, int);
method public void setLabeledBy(android.view.View);
@@ -33159,7 +33198,7 @@ package java.lang {
method protected final void setSigners(java.lang.Class<?>, java.lang.Object[]);
}
- public class ClassNotFoundException extends java.lang.Exception {
+ public class ClassNotFoundException extends java.lang.ReflectiveOperationException {
ctor public ClassNotFoundException();
ctor public ClassNotFoundException(java.lang.String);
ctor public ClassNotFoundException(java.lang.String, java.lang.Throwable);
@@ -33301,7 +33340,7 @@ package java.lang {
ctor public IllegalAccessError(java.lang.String);
}
- public class IllegalAccessException extends java.lang.Exception {
+ public class IllegalAccessException extends java.lang.ReflectiveOperationException {
ctor public IllegalAccessException();
ctor public IllegalAccessException(java.lang.String);
}
@@ -33350,7 +33389,7 @@ package java.lang {
ctor public InstantiationError(java.lang.String);
}
- public class InstantiationException extends java.lang.Exception {
+ public class InstantiationException extends java.lang.ReflectiveOperationException {
ctor public InstantiationException();
ctor public InstantiationException(java.lang.String);
}
@@ -33527,7 +33566,7 @@ package java.lang {
ctor public NoSuchFieldError(java.lang.String);
}
- public class NoSuchFieldException extends java.lang.Exception {
+ public class NoSuchFieldException extends java.lang.ReflectiveOperationException {
ctor public NoSuchFieldException();
ctor public NoSuchFieldException(java.lang.String);
}
@@ -33537,7 +33576,7 @@ package java.lang {
ctor public NoSuchMethodError(java.lang.String);
}
- public class NoSuchMethodException extends java.lang.Exception {
+ public class NoSuchMethodException extends java.lang.ReflectiveOperationException {
ctor public NoSuchMethodException();
ctor public NoSuchMethodException(java.lang.String);
}
@@ -33632,6 +33671,13 @@ package java.lang {
method public abstract int read(java.nio.CharBuffer) throws java.io.IOException;
}
+ public class ReflectiveOperationException extends java.lang.Exception {
+ ctor public ReflectiveOperationException();
+ ctor public ReflectiveOperationException(java.lang.String);
+ ctor public ReflectiveOperationException(java.lang.Throwable);
+ ctor public ReflectiveOperationException(java.lang.String, java.lang.Throwable);
+ }
+
public abstract interface Runnable {
method public abstract void run();
}
@@ -34398,7 +34444,7 @@ package java.lang.reflect {
method public abstract java.lang.Object invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) throws java.lang.Throwable;
}
- public class InvocationTargetException extends java.lang.Exception {
+ public class InvocationTargetException extends java.lang.ReflectiveOperationException {
ctor protected InvocationTargetException();
ctor public InvocationTargetException(java.lang.Throwable);
ctor public InvocationTargetException(java.lang.Throwable, java.lang.String);
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index fb28ae3d6e45..7a0f3769e5da 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -432,51 +432,32 @@ public class Notification implements Parcelable
/**
* Additional semantic data to be carried around with this Notification.
- * @hide
*/
public Bundle extras = new Bundle();
// extras keys for Builder inputs
- /** @hide */
public static final String EXTRA_TITLE = "android.title";
- /** @hide */
public static final String EXTRA_TITLE_BIG = EXTRA_TITLE + ".big";
- /** @hide */
public static final String EXTRA_TEXT = "android.text";
- /** @hide */
public static final String EXTRA_SUB_TEXT = "android.subText";
- /** @hide */
public static final String EXTRA_INFO_TEXT = "android.infoText";
- /** @hide */
public static final String EXTRA_SUMMARY_TEXT = "android.summaryText";
- /** @hide */
public static final String EXTRA_SMALL_ICON = "android.icon";
- /** @hide */
public static final String EXTRA_LARGE_ICON = "android.largeIcon";
- /** @hide */
public static final String EXTRA_LARGE_ICON_BIG = EXTRA_LARGE_ICON + ".big";
- /** @hide */
public static final String EXTRA_PROGRESS = "android.progress";
- /** @hide */
public static final String EXTRA_PROGRESS_MAX = "android.progressMax";
- /** @hide */
public static final String EXTRA_PROGRESS_INDETERMINATE = "android.progressIndeterminate";
- /** @hide */
public static final String EXTRA_SHOW_CHRONOMETER = "android.showChronometer";
- /** @hide */
public static final String EXTRA_SHOW_WHEN = "android.showWhen";
- /** @hide from BigPictureStyle */
public static final String EXTRA_PICTURE = "android.picture";
- /** @hide from InboxStyle */
public static final String EXTRA_TEXT_LINES = "android.textLines";
// extras keys for other interesting pieces of information
- /** @hide */
public static final String EXTRA_PEOPLE = "android.people";
/**
* Structure to encapsulate an "action", including title and icon, that can be attached to a Notification.
- * @hide
*/
public static class Action implements Parcelable {
public int icon;
@@ -530,9 +511,6 @@ public class Notification implements Parcelable
};
}
- /**
- * @hide
- */
public Action[] actions;
/**
@@ -1450,7 +1428,6 @@ public class Notification implements Parcelable
* called.
*
* @see Notification#extras
- * @hide
*/
public Builder setExtras(Bundle bag) {
mExtras = bag;
diff --git a/core/java/android/content/SyncResult.java b/core/java/android/content/SyncResult.java
index 8b0afbd6d666..6cb0d02ee094 100644
--- a/core/java/android/content/SyncResult.java
+++ b/core/java/android/content/SyncResult.java
@@ -56,7 +56,7 @@ public final class SyncResult implements Parcelable {
/**
* Used to indicate that the SyncAdapter experienced a hard error due to an error it
- * received from interacting with the storage later. The SyncManager will record that
+ * received from interacting with the storage layer. The SyncManager will record that
* the sync request failed and it will not reschedule the request.
*/
public boolean databaseError;
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 78bf9afcbb40..ffcc2974cd0d 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -464,6 +464,21 @@ public class ConnectivityManager {
}
/**
+ * Checks if the given network type is backed by a Wi-Fi radio.
+ *
+ * @hide
+ */
+ public static boolean isNetworkTypeWifi(int networkType) {
+ switch (networkType) {
+ case TYPE_WIFI:
+ case TYPE_WIFI_P2P:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
* Specifies the preferred network type. When the device has more
* than one type available the preferred network type will be used.
* Note that this made sense when we only had 2 network types,
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index d0f75116a131..32bbfbd3c609 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -130,7 +130,7 @@ public abstract class BatteryStats implements Parcelable {
/**
* Bump the version on this if the checkin format changes.
*/
- private static final int BATTERY_STATS_CHECKIN_VERSION = 6;
+ private static final int BATTERY_STATS_CHECKIN_VERSION = 7;
private static final long BYTES_PER_KB = 1024;
private static final long BYTES_PER_MB = 1048576; // 1024^2
@@ -259,17 +259,7 @@ public abstract class BatteryStats implements Parcelable {
* {@hide}
*/
public abstract int getUid();
-
- /**
- * {@hide}
- */
- public abstract long getTcpBytesReceived(int which);
-
- /**
- * {@hide}
- */
- public abstract long getTcpBytesSent(int which);
-
+
public abstract void noteWifiRunningLocked();
public abstract void noteWifiStoppedLocked();
public abstract void noteFullWifiLockAcquiredLocked();
@@ -304,11 +294,14 @@ public abstract class BatteryStats implements Parcelable {
};
public static final int NUM_USER_ACTIVITY_TYPES = 3;
-
+
public abstract void noteUserActivityLocked(int type);
public abstract boolean hasUserActivity();
public abstract int getUserActivityCount(int type, int which);
-
+
+ public abstract boolean hasNetworkActivity();
+ public abstract long getNetworkActivityCount(int type, int which);
+
public static abstract class Sensor {
/*
* FIXME: it's not correct to use this magic value because it
@@ -929,6 +922,15 @@ public abstract class BatteryStats implements Parcelable {
*/
public abstract long getBluetoothOnTime(long batteryRealtime, int which);
+ public static final int NETWORK_MOBILE_RX_BYTES = 0;
+ public static final int NETWORK_MOBILE_TX_BYTES = 1;
+ public static final int NETWORK_WIFI_RX_BYTES = 2;
+ public static final int NETWORK_WIFI_TX_BYTES = 3;
+
+ public static final int NUM_NETWORK_ACTIVITY_TYPES = NETWORK_WIFI_TX_BYTES + 1;
+
+ public abstract long getNetworkActivityCount(int type, int which);
+
/**
* Return whether we are currently running on battery.
*/
@@ -1246,16 +1248,20 @@ public abstract class BatteryStats implements Parcelable {
totalRealtime / 1000, totalUptime / 1000);
// Calculate total network and wakelock times across all uids.
- long rxTotal = 0;
- long txTotal = 0;
+ long mobileRxTotal = 0;
+ long mobileTxTotal = 0;
+ long wifiRxTotal = 0;
+ long wifiTxTotal = 0;
long fullWakeLockTimeTotal = 0;
long partialWakeLockTimeTotal = 0;
for (int iu = 0; iu < NU; iu++) {
Uid u = uidStats.valueAt(iu);
- rxTotal += u.getTcpBytesReceived(which);
- txTotal += u.getTcpBytesSent(which);
-
+ mobileRxTotal += u.getNetworkActivityCount(NETWORK_MOBILE_RX_BYTES, which);
+ mobileTxTotal += u.getNetworkActivityCount(NETWORK_MOBILE_TX_BYTES, which);
+ wifiRxTotal += u.getNetworkActivityCount(NETWORK_WIFI_RX_BYTES, which);
+ wifiTxTotal += u.getNetworkActivityCount(NETWORK_WIFI_TX_BYTES, which);
+
Map<String, ? extends BatteryStats.Uid.Wakelock> wakelocks = u.getWakelockStats();
if (wakelocks.size() > 0) {
for (Map.Entry<String, ? extends BatteryStats.Uid.Wakelock> ent
@@ -1279,7 +1285,8 @@ public abstract class BatteryStats implements Parcelable {
// Dump misc stats
dumpLine(pw, 0 /* uid */, category, MISC_DATA,
screenOnTime / 1000, phoneOnTime / 1000, wifiOnTime / 1000,
- wifiRunningTime / 1000, bluetoothOnTime / 1000, rxTotal, txTotal,
+ wifiRunningTime / 1000, bluetoothOnTime / 1000,
+ mobileRxTotal, mobileTxTotal, wifiRxTotal, wifiTxTotal,
fullWakeLockTimeTotal, partialWakeLockTimeTotal,
getInputEventCount(which));
@@ -1350,14 +1357,18 @@ public abstract class BatteryStats implements Parcelable {
}
Uid u = uidStats.valueAt(iu);
// Dump Network stats per uid, if any
- long rx = u.getTcpBytesReceived(which);
- long tx = u.getTcpBytesSent(which);
+ long mobileRx = u.getNetworkActivityCount(NETWORK_MOBILE_RX_BYTES, which);
+ long mobileTx = u.getNetworkActivityCount(NETWORK_MOBILE_TX_BYTES, which);
+ long wifiRx = u.getNetworkActivityCount(NETWORK_WIFI_RX_BYTES, which);
+ long wifiTx = u.getNetworkActivityCount(NETWORK_WIFI_TX_BYTES, which);
long fullWifiLockOnTime = u.getFullWifiLockTime(batteryRealtime, which);
long wifiScanTime = u.getWifiScanTime(batteryRealtime, which);
long uidWifiRunningTime = u.getWifiRunningTime(batteryRealtime, which);
-
- if (rx > 0 || tx > 0) dumpLine(pw, uid, category, NETWORK_DATA, rx, tx);
-
+
+ if (mobileRx > 0 || mobileTx > 0 || wifiRx > 0 || wifiTx > 0) {
+ dumpLine(pw, uid, category, NETWORK_DATA, mobileRx, mobileTx, wifiRx, wifiTx);
+ }
+
if (fullWifiLockOnTime != 0 || wifiScanTime != 0
|| uidWifiRunningTime != 0) {
dumpLine(pw, uid, category, WIFI_DATA,
@@ -1569,8 +1580,10 @@ public abstract class BatteryStats implements Parcelable {
pw.println(sb.toString());
// Calculate total network and wakelock times across all uids.
- long rxTotal = 0;
- long txTotal = 0;
+ long mobileRxTotal = 0;
+ long mobileTxTotal = 0;
+ long wifiRxTotal = 0;
+ long wifiTxTotal = 0;
long fullWakeLockTimeTotalMicros = 0;
long partialWakeLockTimeTotalMicros = 0;
@@ -1623,9 +1636,11 @@ public abstract class BatteryStats implements Parcelable {
for (int iu = 0; iu < NU; iu++) {
Uid u = uidStats.valueAt(iu);
- rxTotal += u.getTcpBytesReceived(which);
- txTotal += u.getTcpBytesSent(which);
-
+ mobileRxTotal += u.getNetworkActivityCount(NETWORK_MOBILE_RX_BYTES, which);
+ mobileTxTotal += u.getNetworkActivityCount(NETWORK_MOBILE_TX_BYTES, which);
+ wifiRxTotal += u.getNetworkActivityCount(NETWORK_WIFI_RX_BYTES, which);
+ wifiTxTotal += u.getNetworkActivityCount(NETWORK_WIFI_TX_BYTES, which);
+
Map<String, ? extends BatteryStats.Uid.Wakelock> wakelocks = u.getWakelockStats();
if (wakelocks.size() > 0) {
for (Map.Entry<String, ? extends BatteryStats.Uid.Wakelock> ent
@@ -1658,8 +1673,11 @@ public abstract class BatteryStats implements Parcelable {
}
pw.print(prefix);
- pw.print(" Total received: "); pw.print(formatBytesLocked(rxTotal));
- pw.print(", Total sent: "); pw.println(formatBytesLocked(txTotal));
+ pw.print(" Mobile total received: "); pw.print(formatBytesLocked(mobileRxTotal));
+ pw.print(", Total sent: "); pw.println(formatBytesLocked(mobileTxTotal));
+ pw.print(prefix);
+ pw.print(" Wi-Fi total received: "); pw.print(formatBytesLocked(wifiRxTotal));
+ pw.print(", Total sent: "); pw.println(formatBytesLocked(wifiTxTotal));
sb.setLength(0);
sb.append(prefix);
sb.append(" Total full wakelock time: "); formatTimeMs(sb,
@@ -1801,18 +1819,25 @@ public abstract class BatteryStats implements Parcelable {
pw.println(prefix + " #" + uid + ":");
boolean uidActivity = false;
- long tcpReceived = u.getTcpBytesReceived(which);
- long tcpSent = u.getTcpBytesSent(which);
+ long mobileRxBytes = u.getNetworkActivityCount(NETWORK_MOBILE_RX_BYTES, which);
+ long mobileTxBytes = u.getNetworkActivityCount(NETWORK_MOBILE_TX_BYTES, which);
+ long wifiRxBytes = u.getNetworkActivityCount(NETWORK_WIFI_RX_BYTES, which);
+ long wifiTxBytes = u.getNetworkActivityCount(NETWORK_WIFI_TX_BYTES, which);
long fullWifiLockOnTime = u.getFullWifiLockTime(batteryRealtime, which);
long wifiScanTime = u.getWifiScanTime(batteryRealtime, which);
long uidWifiRunningTime = u.getWifiRunningTime(batteryRealtime, which);
-
- if (tcpReceived != 0 || tcpSent != 0) {
- pw.print(prefix); pw.print(" Network: ");
- pw.print(formatBytesLocked(tcpReceived)); pw.print(" received, ");
- pw.print(formatBytesLocked(tcpSent)); pw.println(" sent");
+
+ if (mobileRxBytes > 0 || mobileTxBytes > 0) {
+ pw.print(prefix); pw.print(" Mobile network: ");
+ pw.print(formatBytesLocked(mobileRxBytes)); pw.print(" received, ");
+ pw.print(formatBytesLocked(mobileTxBytes)); pw.println(" sent");
}
-
+ if (wifiRxBytes > 0 || wifiTxBytes > 0) {
+ pw.print(prefix); pw.print(" Wi-Fi network: ");
+ pw.print(formatBytesLocked(wifiRxBytes)); pw.print(" received, ");
+ pw.print(formatBytesLocked(wifiTxBytes)); pw.println(" sent");
+ }
+
if (u.hasUserActivity()) {
boolean hasData = false;
for (int i=0; i<Uid.NUM_USER_ACTIVITY_TYPES; i++) {
diff --git a/core/java/android/view/AccessibilityInteractionController.java b/core/java/android/view/AccessibilityInteractionController.java
index 2d6453e67b5d..e835a9708169 100644
--- a/core/java/android/view/AccessibilityInteractionController.java
+++ b/core/java/android/view/AccessibilityInteractionController.java
@@ -406,6 +406,10 @@ final class AccessibilityInteractionController {
if (host == null || !ViewRootImpl.isViewDescendantOf(host, root)) {
break;
}
+ // The focused view not shown, we failed.
+ if (!isShown(host)) {
+ break;
+ }
// If the host has a provider ask this provider to search for the
// focus instead fetching all provider nodes to do the search here.
AccessibilityNodeProvider provider = host.getAccessibilityNodeProvider();
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 970d041fb324..55a8f747b5b2 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1564,6 +1564,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
private int mAccessibilityCursorPosition = ACCESSIBILITY_CURSOR_POSITION_UNDEFINED;
+ SendViewStateChangedAccessibilityEvent mSendViewStateChangedAccessibilityEvent;
+
/**
* The view's tag.
* {@hide}
@@ -2136,13 +2138,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* Flag indicating whether a view has accessibility focus.
*/
- static final int PFLAG2_ACCESSIBILITY_FOCUSED = 0x00000040 << PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_SHIFT;
+ static final int PFLAG2_ACCESSIBILITY_FOCUSED = 0x04000000;
/**
- * Flag indicating whether a view state for accessibility has changed.
+ * Flag whether the accessibility state of the subtree rooted at this view changed.
*/
- static final int PFLAG2_ACCESSIBILITY_STATE_CHANGED = 0x00000080
- << PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_SHIFT;
+ static final int PFLAG2_SUBTREE_ACCESSIBILITY_STATE_CHANGED = 0x08000000;
/**
* Flag indicating whether a view failed the quickReject() check in draw(). This condition
@@ -4454,10 +4455,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
onFocusChanged(true, direction, previouslyFocusedRect);
refreshDrawableState();
-
- if (AccessibilityManager.getInstance(mContext).isEnabled()) {
- notifyAccessibilityStateChanged();
- }
}
}
@@ -4561,10 +4558,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (!rootViewRequestFocus()) {
notifyGlobalFocusCleared(this);
}
-
- if (AccessibilityManager.getInstance(mContext).isEnabled()) {
- notifyAccessibilityStateChanged();
- }
}
}
@@ -4593,10 +4586,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
onFocusChanged(false, 0, null);
refreshDrawableState();
-
- if (AccessibilityManager.getInstance(mContext).isEnabled()) {
- notifyAccessibilityStateChanged();
- }
}
}
@@ -4647,9 +4636,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
if (gainFocus) {
- if (AccessibilityManager.getInstance(mContext).isEnabled()) {
- sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
- }
+ sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
+ } else {
+ notifyViewAccessibilityStateChangedIfNeeded();
}
InputMethodManager imm = InputMethodManager.peekInstance();
@@ -4706,6 +4695,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @see AccessibilityDelegate
*/
public void sendAccessibilityEvent(int eventType) {
+ // Excluded views do not send accessibility events.
+ if (!includeForAccessibility()) {
+ return;
+ }
if (mAccessibilityDelegate != null) {
mAccessibilityDelegate.sendAccessibilityEvent(this, eventType);
} else {
@@ -5364,9 +5357,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
mContentDescription = contentDescription;
final boolean nonEmptyDesc = contentDescription != null && contentDescription.length() > 0;
if (nonEmptyDesc && getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
- setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
+ setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
+ notifySubtreeAccessibilityStateChangedIfNeeded();
+ } else {
+ notifyViewAccessibilityStateChangedIfNeeded();
}
- notifyAccessibilityStateChanged();
}
/**
@@ -6646,7 +6641,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
invalidate();
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
- notifyAccessibilityStateChanged();
return true;
}
return false;
@@ -6709,7 +6703,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
mPrivateFlags2 &= ~PFLAG2_ACCESSIBILITY_FOCUSED;
invalidate();
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
- notifyAccessibilityStateChanged();
}
}
@@ -6883,11 +6876,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @see #IMPORTANT_FOR_ACCESSIBILITY_AUTO
*/
public void setImportantForAccessibility(int mode) {
+ final boolean oldIncludeForAccessibility = includeForAccessibility();
if (mode != getImportantForAccessibility()) {
mPrivateFlags2 &= ~PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_MASK;
mPrivateFlags2 |= (mode << PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_SHIFT)
& PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_MASK;
- notifyAccessibilityStateChanged();
+ if (oldIncludeForAccessibility != includeForAccessibility()) {
+ notifySubtreeAccessibilityStateChangedIfNeeded();
+ } else {
+ notifyViewAccessibilityStateChangedIfNeeded();
+ }
}
}
@@ -6994,25 +6992,44 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
- * Notifies accessibility services that some view's important for
- * accessibility state has changed. Note that such notifications
- * are made at most once every
+ * Notifies that the accessibility state of this view changed. The change
+ * is local to this view and does not represent structural changes such
+ * as children and parent. For example, the view became focusable. The
+ * notification is at at most once every
* {@link ViewConfiguration#getSendRecurringAccessibilityEventsInterval()}
- * to avoid unnecessary load to the system. Also once a view has
- * made a notifucation this method is a NOP until the notification has
- * been sent to clients.
+ * to avoid unnecessary load to the system. Also once a view has a pending
+ * notifucation this method is a NOP until the notification has been sent.
*
* @hide
+ */
+ public void notifyViewAccessibilityStateChangedIfNeeded() {
+ if (!AccessibilityManager.getInstance(mContext).isEnabled()) {
+ return;
+ }
+ if (mSendViewStateChangedAccessibilityEvent == null) {
+ mSendViewStateChangedAccessibilityEvent =
+ new SendViewStateChangedAccessibilityEvent();
+ }
+ mSendViewStateChangedAccessibilityEvent.runOrPost();
+ }
+
+ /**
+ * Notifies that the accessibility state of this view changed. The change
+ * is *not* local to this view and does represent structural changes such
+ * as children and parent. For example, the view size changed. The
+ * notification is at at most once every
+ * {@link ViewConfiguration#getSendRecurringAccessibilityEventsInterval()}
+ * to avoid unnecessary load to the system. Also once a view has a pending
+ * notifucation this method is a NOP until the notification has been sent.
*
- * TODO: Makse sure this method is called for any view state change
- * that is interesting for accessilility purposes.
+ * @hide
*/
- public void notifyAccessibilityStateChanged() {
+ private void notifySubtreeAccessibilityStateChangedIfNeeded() {
if (!AccessibilityManager.getInstance(mContext).isEnabled()) {
return;
}
- if ((mPrivateFlags2 & PFLAG2_ACCESSIBILITY_STATE_CHANGED) == 0) {
- mPrivateFlags2 |= PFLAG2_ACCESSIBILITY_STATE_CHANGED;
+ if ((mPrivateFlags2 & PFLAG2_SUBTREE_ACCESSIBILITY_STATE_CHANGED) == 0) {
+ mPrivateFlags2 |= PFLAG2_SUBTREE_ACCESSIBILITY_STATE_CHANGED;
if (mParent != null) {
mParent.childAccessibilityStateChanged(this);
}
@@ -7020,13 +7037,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
- * Reset the state indicating the this view has requested clients
- * interested in its accessibility state to be notified.
- *
- * @hide
+ * Reset the flag indicating the accessibility state of the subtree rooted
+ * at this view changed.
*/
- public void resetAccessibilityStateChanged() {
- mPrivateFlags2 &= ~PFLAG2_ACCESSIBILITY_STATE_CHANGED;
+ void resetSubtreeAccessibilityStateChanged() {
+ mPrivateFlags2 &= ~PFLAG2_SUBTREE_ACCESSIBILITY_STATE_CHANGED;
}
/**
@@ -7139,7 +7154,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|| getAccessibilitySelectionEnd() != end)
&& (start == end)) {
setAccessibilitySelection(start, end);
- notifyAccessibilityStateChanged();
+ notifyViewAccessibilityStateChangedIfNeeded();
return true;
}
} break;
@@ -8560,6 +8575,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @param mask Constant indicating the bit range that should be changed
*/
void setFlags(int flags, int mask) {
+ final boolean accessibilityEnabled =
+ AccessibilityManager.getInstance(mContext).isEnabled();
+ final boolean oldIncludeForAccessibility = accessibilityEnabled
+ ? includeForAccessibility() : false;
+
int old = mViewFlags;
mViewFlags = (mViewFlags & ~mask) | (flags & mask);
@@ -8584,9 +8604,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
if (mParent != null) mParent.focusableViewAvailable(this);
}
- if (AccessibilityManager.getInstance(mContext).isEnabled()) {
- notifyAccessibilityStateChanged();
- }
}
final int newVisibility = flags & VISIBILITY_MASK;
@@ -8707,10 +8724,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
}
- if (AccessibilityManager.getInstance(mContext).isEnabled()
- && ((changed & FOCUSABLE) != 0 || (changed & CLICKABLE) != 0
- || (changed & LONG_CLICKABLE) != 0 || (changed & ENABLED) != 0)) {
- notifyAccessibilityStateChanged();
+ if (accessibilityEnabled) {
+ if ((changed & FOCUSABLE_MASK) != 0 || (changed & VISIBILITY_MASK) != 0
+ || (changed & CLICKABLE) != 0 || (changed & LONG_CLICKABLE) != 0) {
+ if (oldIncludeForAccessibility != includeForAccessibility()) {
+ notifySubtreeAccessibilityStateChangedIfNeeded();
+ } else {
+ notifyViewAccessibilityStateChangedIfNeeded();
+ }
+ }
+ if ((changed & ENABLED_MASK) != 0) {
+ notifyViewAccessibilityStateChangedIfNeeded();
+ }
}
}
@@ -11757,6 +11782,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
jumpDrawablesToCurrentState();
clearAccessibilityFocus();
+ resetSubtreeAccessibilityStateChanged();
+
if (isFocused()) {
InputMethodManager imm = InputMethodManager.peekInstance();
imm.focusIn(this);
@@ -12052,8 +12079,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
mCurrentAnimation = null;
mCurrentScene = null;
-
- resetAccessibilityStateChanged();
}
private void cleanupDraw() {
@@ -14438,6 +14463,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
mPrivateFlags |= drawn;
mBackgroundSizeChanged = true;
+
+ notifySubtreeAccessibilityStateChangedIfNeeded();
}
return changed;
}
@@ -15202,9 +15229,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
invalidate(true);
refreshDrawableState();
dispatchSetSelected(selected);
- if (AccessibilityManager.getInstance(mContext).isEnabled()) {
- notifyAccessibilityStateChanged();
- }
+ notifyViewAccessibilityStateChangedIfNeeded();
}
}
@@ -18819,6 +18844,37 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
}
+ private class SendViewStateChangedAccessibilityEvent implements Runnable {
+ private boolean mPosted;
+ private long mLastEventTimeMillis;
+
+ public void run() {
+ mPosted = false;
+ mLastEventTimeMillis = SystemClock.uptimeMillis();
+ if (AccessibilityManager.getInstance(mContext).isEnabled()) {
+ AccessibilityEvent event = AccessibilityEvent.obtain();
+ event.setEventType(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
+ event.setContentChangeType(AccessibilityEvent.CONTENT_CHANGE_TYPE_NODE);
+ sendAccessibilityEventUnchecked(event);
+ }
+ }
+
+ public void runOrPost() {
+ if (mPosted) {
+ return;
+ }
+ final long timeSinceLastMillis = SystemClock.uptimeMillis() - mLastEventTimeMillis;
+ final long minEventIntevalMillis =
+ ViewConfiguration.getSendRecurringAccessibilityEventsInterval();
+ if (timeSinceLastMillis >= minEventIntevalMillis) {
+ run();
+ } else {
+ postDelayed(this, minEventIntevalMillis - timeSinceLastMillis);
+ mPosted = true;
+ }
+ }
+ }
+
/**
* Dump all private flags in readable format, useful for documentation and
* sanity checking.
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 119ba729ad18..caed4a27d495 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -1698,16 +1698,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
/**
- * @hide
- */
- @Override
- public void childAccessibilityStateChanged(View child) {
- if (mParent != null) {
- mParent.childAccessibilityStateChanged(child);
- }
- }
-
- /**
* Implement this method to intercept hover events before they are handled
* by child views.
* <p>
@@ -2534,13 +2524,19 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* @hide
*/
@Override
- public void resetAccessibilityStateChanged() {
- super.resetAccessibilityStateChanged();
+ public void childAccessibilityStateChanged(View root) {
+ if (mParent != null) {
+ mParent.childAccessibilityStateChanged(root);
+ }
+ }
+
+ @Override
+ void resetSubtreeAccessibilityStateChanged() {
+ super.resetSubtreeAccessibilityStateChanged();
View[] children = mChildren;
final int childCount = mChildrenCount;
for (int i = 0; i < childCount; i++) {
- View child = children[i];
- child.resetAccessibilityStateChanged();
+ children[i].resetSubtreeAccessibilityStateChanged();
}
}
@@ -3466,7 +3462,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
private void clearCachedLayoutMode() {
- if (!getBooleanFlag(FLAG_LAYOUT_MODE_WAS_EXPLICITLY_SET)) {
+ if (!hasBooleanFlag(FLAG_LAYOUT_MODE_WAS_EXPLICITLY_SET)) {
mLayoutMode = LAYOUT_MODE_UNDEFINED;
}
}
@@ -3597,6 +3593,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (child.hasTransientState()) {
childHasTransientStateChanged(child, true);
}
+
+ if (child.isImportantForAccessibility() && child.getVisibility() != View.GONE) {
+ childAccessibilityStateChanged(child);
+ }
}
private void addInArray(View child, int index) {
@@ -3836,6 +3836,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
onViewRemoved(view);
+
+ if (view.isImportantForAccessibility() && view.getVisibility() != View.GONE) {
+ childAccessibilityStateChanged(view);
+ }
}
/**
@@ -4786,7 +4790,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
setBooleanFlag(FLAG_USE_CHILD_DRAWING_ORDER, enabled);
}
- private boolean getBooleanFlag(int flag) {
+ private boolean hasBooleanFlag(int flag) {
return (mGroupFlags & flag) == flag;
}
@@ -4854,7 +4858,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
void invalidateInheritedLayoutMode(int layoutModeOfRoot) {
if (mLayoutMode == LAYOUT_MODE_UNDEFINED ||
mLayoutMode == layoutModeOfRoot ||
- getBooleanFlag(FLAG_LAYOUT_MODE_WAS_EXPLICITLY_SET)) {
+ hasBooleanFlag(FLAG_LAYOUT_MODE_WAS_EXPLICITLY_SET)) {
return;
}
setLayoutMode(LAYOUT_MODE_UNDEFINED, false);
diff --git a/core/java/android/view/ViewParent.java b/core/java/android/view/ViewParent.java
index d79aa7efad4d..2ebc1a19ed54 100644
--- a/core/java/android/view/ViewParent.java
+++ b/core/java/android/view/ViewParent.java
@@ -292,13 +292,14 @@ public interface ViewParent {
public ViewParent getParentForAccessibility();
/**
- * A child notifies its parent that its state for accessibility has changed.
- * That is some of the child properties reported to accessibility services has
- * changed, hence the interested services have to be notified for the new state.
+ * A child notifies its parent that the accessibility state of a subtree rooted
+ * at a given node changed. That is the structure of the subtree is different.
+ *
+ * @param The root of the changed subtree.
*
* @hide
*/
- public void childAccessibilityStateChanged(View child);
+ public void childAccessibilityStateChanged(View root);
/**
* Tells if this view parent can resolve the layout direction.
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 62e0d3dada03..a5f92de09294 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1728,10 +1728,6 @@ public final class ViewRootImpl implements ViewParent,
if (triggerGlobalLayoutListener) {
attachInfo.mRecomputeGlobalAttributes = false;
attachInfo.mTreeObserver.dispatchOnGlobalLayout();
-
- if (AccessibilityManager.getInstance(host.mContext).isEnabled()) {
- postSendWindowContentChangedCallback(mView);
- }
}
if (computesInternalInsets) {
@@ -5713,15 +5709,7 @@ public final class ViewRootImpl implements ViewParent,
mSendWindowContentChangedAccessibilityEvent =
new SendWindowContentChangedAccessibilityEvent();
}
- View oldSource = mSendWindowContentChangedAccessibilityEvent.mSource;
- if (oldSource == null) {
- mSendWindowContentChangedAccessibilityEvent.mSource = source;
- mHandler.postDelayed(mSendWindowContentChangedAccessibilityEvent,
- ViewConfiguration.getSendRecurringAccessibilityEventsInterval());
- } else {
- mSendWindowContentChangedAccessibilityEvent.mSource =
- getCommonPredecessor(oldSource, source);
- }
+ mSendWindowContentChangedAccessibilityEvent.runOrPost(source);
}
/**
@@ -6405,12 +6393,33 @@ public final class ViewRootImpl implements ViewParent,
private class SendWindowContentChangedAccessibilityEvent implements Runnable {
public View mSource;
+ public long mLastEventTimeMillis;
public void run() {
+ mLastEventTimeMillis = SystemClock.uptimeMillis();
+ if (AccessibilityManager.getInstance(mContext).isEnabled()) {
+ AccessibilityEvent event = AccessibilityEvent.obtain();
+ event.setEventType(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
+ event.setContentChangeType(AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE);
+ mSource.sendAccessibilityEventUnchecked(event);
+ }
+ mSource.resetSubtreeAccessibilityStateChanged();
+ mSource = null;
+ }
+
+ public void runOrPost(View source) {
if (mSource != null) {
- mSource.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
- mSource.resetAccessibilityStateChanged();
- mSource = null;
+ mSource = getCommonPredecessor(mSource, source);
+ return;
+ }
+ mSource = source;
+ final long timeSinceLastMillis = SystemClock.uptimeMillis() - mLastEventTimeMillis;
+ final long minEventIntevalMillis =
+ ViewConfiguration.getSendRecurringAccessibilityEventsInterval();
+ if (timeSinceLastMillis >= minEventIntevalMillis) {
+ run();
+ } else {
+ mSource.postDelayed(this, minEventIntevalMillis - timeSinceLastMillis);
}
}
}
diff --git a/core/java/android/view/accessibility/AccessibilityEvent.java b/core/java/android/view/accessibility/AccessibilityEvent.java
index dbeca1f9bab1..82c8163b3923 100644
--- a/core/java/android/view/accessibility/AccessibilityEvent.java
+++ b/core/java/android/view/accessibility/AccessibilityEvent.java
@@ -326,6 +326,7 @@ import java.util.List;
* <em>Properties:</em></br>
* <ul>
* <li>{@link #getEventType()} - The type of the event.</li>
+ * <li>{@link #getContentChangeType()} - The type of content change.</li>
* <li>{@link #getSource()} - The source info (for registered clients).</li>
* <li>{@link #getClassName()} - The class name of the source.</li>
* <li>{@link #getPackageName()} - The package name of the source.</li>
@@ -661,6 +662,18 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
public static final int TYPE_TOUCH_INTERACTION_END = 0x00200000;
/**
+ * Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event:
+ * The subtree rooted at the source node changed.
+ */
+ public static final int CONTENT_CHANGE_TYPE_SUBTREE = 0;
+
+ /**
+ * Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event:
+ * Only the source node changed.
+ */
+ public static final int CONTENT_CHANGE_TYPE_NODE = 1;
+
+ /**
* Mask for {@link AccessibilityEvent} all types.
*
* @see #TYPE_VIEW_CLICKED
@@ -695,6 +708,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
private long mEventTime;
int mMovementGranularity;
int mAction;
+ int mContentChangeType;
private final ArrayList<AccessibilityRecord> mRecords = new ArrayList<AccessibilityRecord>();
@@ -714,6 +728,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
mEventType = event.mEventType;
mMovementGranularity = event.mMovementGranularity;
mAction = event.mAction;
+ mContentChangeType = event.mContentChangeType;
mEventTime = event.mEventTime;
mPackageName = event.mPackageName;
}
@@ -777,6 +792,33 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
}
/**
+ * Gets the type of node tree change signaled by an
+ * {@link #TYPE_WINDOW_CONTENT_CHANGED} event.
+ *
+ * @see #CONTENT_CHANGE_TYPE_NODE
+ * @see #CONTENT_CHANGE_TYPE_SUBTREE
+ *
+ * @return The change type.
+ */
+ public int getContentChangeType() {
+ return mContentChangeType;
+ }
+
+ /**
+ * Sets the type of node tree change signaled by an
+ * {@link #TYPE_WINDOW_CONTENT_CHANGED} event.
+ *
+ * @see #CONTENT_CHANGE_TYPE_NODE
+ * @see #CONTENT_CHANGE_TYPE_SUBTREE
+ *
+ * @param changeType The change type.
+ */
+ public void setContentChangeType(int changeType) {
+ enforceNotSealed();
+ mContentChangeType = changeType;
+ }
+
+ /**
* Sets the event type.
*
* @param eventType The event type.
@@ -943,6 +985,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
mEventType = 0;
mMovementGranularity = 0;
mAction = 0;
+ mContentChangeType = 0;
mPackageName = null;
mEventTime = 0;
while (!mRecords.isEmpty()) {
@@ -961,6 +1004,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
mEventType = parcel.readInt();
mMovementGranularity = parcel.readInt();
mAction = parcel.readInt();
+ mContentChangeType = parcel.readInt();
mPackageName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
mEventTime = parcel.readLong();
mConnectionId = parcel.readInt();
@@ -1013,6 +1057,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
parcel.writeInt(mEventType);
parcel.writeInt(mMovementGranularity);
parcel.writeInt(mAction);
+ parcel.writeInt(mContentChangeType);
TextUtils.writeToParcel(mPackageName, parcel, 0);
parcel.writeLong(mEventTime);
parcel.writeInt(mConnectionId);
@@ -1074,6 +1119,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
builder.append(super.toString());
if (DEBUG) {
builder.append("\n");
+ builder.append("; ContentChangeType: ").append(mContentChangeType);
builder.append("; sourceWindowId: ").append(mSourceWindowId);
builder.append("; mSourceNodeId: ").append(mSourceNodeId);
for (int i = 0; i < mRecords.size(); i++) {
diff --git a/core/java/android/view/accessibility/AccessibilityInteractionClient.java b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
index 84d7e720b31f..139df3e57af0 100644
--- a/core/java/android/view/accessibility/AccessibilityInteractionClient.java
+++ b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
@@ -163,7 +163,7 @@ public final class AccessibilityInteractionClient
public AccessibilityNodeInfo getRootInActiveWindow(int connectionId) {
return findAccessibilityNodeInfoByAccessibilityId(connectionId,
AccessibilityNodeInfo.ACTIVE_WINDOW_ID, AccessibilityNodeInfo.ROOT_NODE_ID,
- AccessibilityNodeInfo.FLAG_PREFETCH_DESCENDANTS);
+ false, AccessibilityNodeInfo.FLAG_PREFETCH_DESCENDANTS);
}
/**
@@ -177,18 +177,22 @@ public final class AccessibilityInteractionClient
* where to start the search. Use
* {@link android.view.accessibility.AccessibilityNodeInfo#ROOT_NODE_ID}
* to start from the root.
+ * @param bypassCache Whether to bypass the cache while looking for the node.
* @param prefetchFlags flags to guide prefetching.
* @return An {@link AccessibilityNodeInfo} if found, null otherwise.
*/
public AccessibilityNodeInfo findAccessibilityNodeInfoByAccessibilityId(int connectionId,
- int accessibilityWindowId, long accessibilityNodeId, int prefetchFlags) {
+ int accessibilityWindowId, long accessibilityNodeId, boolean bypassCache,
+ int prefetchFlags) {
try {
IAccessibilityServiceConnection connection = getConnection(connectionId);
if (connection != null) {
- AccessibilityNodeInfo cachedInfo = sAccessibilityNodeInfoCache.get(
- accessibilityNodeId);
- if (cachedInfo != null) {
- return cachedInfo;
+ if (!bypassCache) {
+ AccessibilityNodeInfo cachedInfo = sAccessibilityNodeInfoCache.get(
+ accessibilityNodeId);
+ if (cachedInfo != null) {
+ return cachedInfo;
+ }
}
final int interactionId = mInteractionIdCounter.getAndIncrement();
final boolean success = connection.findAccessibilityNodeInfoByAccessibilityId(
@@ -350,7 +354,7 @@ public final class AccessibilityInteractionClient
}
} catch (RemoteException re) {
if (DEBUG) {
- Log.w(LOG_TAG, "Error while calling remote findAccessibilityFocus", re);
+ Log.w(LOG_TAG, "Error while calling remote findFocus", re);
}
}
return null;
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index d9c9b69bfced..750e0226f2fe 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -21,6 +21,7 @@ import android.graphics.Rect;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
+import android.text.InputType;
import android.util.Pools.SynchronizedPool;
import android.util.SparseLongArray;
import android.view.View;
@@ -482,6 +483,9 @@ public class AccessibilityNodeInfo implements Parcelable {
private int mTextSelectionStart = UNDEFINED;
private int mTextSelectionEnd = UNDEFINED;
+ private int mInputType = InputType.TYPE_NULL;
+
+ private Bundle mBundle;
private int mConnectionId = UNDEFINED;
@@ -594,16 +598,20 @@ public class AccessibilityNodeInfo implements Parcelable {
* since it represents a view that is no longer in the view tree and should
* be recycled.
* </p>
+ *
+ * @param bypassCache Whether to bypass the cache.
* @return Whether the refresh succeeded.
+ *
+ * @hide
*/
- public boolean refresh() {
+ public boolean refresh(boolean bypassCache) {
enforceSealed();
if (!canPerformRequestOverConnection(mSourceNodeId)) {
return false;
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
AccessibilityNodeInfo refreshedInfo = client.findAccessibilityNodeInfoByAccessibilityId(
- mConnectionId, mWindowId, mSourceNodeId, 0);
+ mConnectionId, mWindowId, mSourceNodeId, bypassCache, 0);
if (refreshedInfo == null) {
return false;
}
@@ -613,6 +621,19 @@ public class AccessibilityNodeInfo implements Parcelable {
}
/**
+ * Refreshes this info with the latest state of the view it represents.
+ * <p>
+ * <strong>Note:</strong> If this method returns false this info is obsolete
+ * since it represents a view that is no longer in the view tree and should
+ * be recycled.
+ * </p>
+ * @return Whether the refresh succeeded.
+ */
+ public boolean refresh() {
+ return refresh(false);
+ }
+
+ /**
* @return The ids of the children.
*
* @hide
@@ -652,7 +673,7 @@ public class AccessibilityNodeInfo implements Parcelable {
final long childId = mChildNodeIds.get(index);
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.findAccessibilityNodeInfoByAccessibilityId(mConnectionId, mWindowId,
- childId, FLAG_PREFETCH_DESCENDANTS);
+ childId, false, FLAG_PREFETCH_DESCENDANTS);
}
/**
@@ -878,7 +899,7 @@ public class AccessibilityNodeInfo implements Parcelable {
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.findAccessibilityNodeInfoByAccessibilityId(mConnectionId,
- mWindowId, mParentNodeId, FLAG_PREFETCH_DESCENDANTS | FLAG_PREFETCH_SIBLINGS);
+ mWindowId, mParentNodeId, false, FLAG_PREFETCH_DESCENDANTS | FLAG_PREFETCH_SIBLINGS);
}
/**
@@ -1470,7 +1491,7 @@ public class AccessibilityNodeInfo implements Parcelable {
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.findAccessibilityNodeInfoByAccessibilityId(mConnectionId,
- mWindowId, mLabelForId, FLAG_PREFETCH_DESCENDANTS | FLAG_PREFETCH_SIBLINGS);
+ mWindowId, mLabelForId, false, FLAG_PREFETCH_DESCENDANTS | FLAG_PREFETCH_SIBLINGS);
}
/**
@@ -1527,7 +1548,7 @@ public class AccessibilityNodeInfo implements Parcelable {
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.findAccessibilityNodeInfoByAccessibilityId(mConnectionId,
- mWindowId, mLabeledById, FLAG_PREFETCH_DESCENDANTS | FLAG_PREFETCH_SIBLINGS);
+ mWindowId, mLabeledById, false, FLAG_PREFETCH_DESCENDANTS | FLAG_PREFETCH_SIBLINGS);
}
/**
@@ -1600,6 +1621,52 @@ public class AccessibilityNodeInfo implements Parcelable {
}
/**
+ * Gets the input type of the source as defined by {@link InputType}.
+ *
+ * @return The input type.
+ */
+ public int getInputType() {
+ return mInputType;
+ }
+
+ /**
+ * Sets the input type of the source as defined by {@link InputType}.
+ * <p>
+ * <strong>Note:</strong> Cannot be called from an
+ * {@link android.accessibilityservice.AccessibilityService}.
+ * This class is made immutable before being delivered to an
+ * AccessibilityService.
+ * </p>
+ *
+ * @param inputType The input type.
+ *
+ * @throws IllegalStateException If called from an AccessibilityService.
+ */
+ public void setInputType(int inputType) {
+ mInputType = inputType;
+ }
+
+ /**
+ * Gets an optional bundle with additional data. The bundle
+ * is lazily created and never <code>null</code>.
+ * <p>
+ * <strong>Note:</strong> It is recommended to use the package
+ * name of your application as a prefix for the keys to avoid
+ * collisions which may confuse an accessibility service if the
+ * same key has different meaning when emitted from different
+ * applications.
+ * </p>
+ *
+ * @return The bundle.
+ */
+ public Bundle getBundle() {
+ if (mBundle == null) {
+ mBundle = new Bundle();
+ }
+ return mBundle;
+ }
+
+ /**
* Gets the value of a boolean property.
*
* @param property The property.
@@ -1845,6 +1912,14 @@ public class AccessibilityNodeInfo implements Parcelable {
parcel.writeInt(mTextSelectionStart);
parcel.writeInt(mTextSelectionEnd);
+ parcel.writeInt(mInputType);
+
+ if (mBundle != null) {
+ parcel.writeInt(1);
+ parcel.writeBundle(mBundle);
+ } else {
+ parcel.writeInt(0);
+ }
// Since instances of this class are fetched via synchronous i.e. blocking
// calls in IPCs we always recycle as soon as the instance is marshaled.
@@ -1880,6 +1955,10 @@ public class AccessibilityNodeInfo implements Parcelable {
}
mTextSelectionStart = other.mTextSelectionStart;
mTextSelectionEnd = other.mTextSelectionEnd;
+ mInputType = other.mInputType;
+ if (other.mBundle != null && !other.mBundle.isEmpty()) {
+ getBundle().putAll(other.mBundle);
+ }
}
/**
@@ -1927,6 +2006,11 @@ public class AccessibilityNodeInfo implements Parcelable {
mTextSelectionStart = parcel.readInt();
mTextSelectionEnd = parcel.readInt();
+ mInputType = parcel.readInt();
+
+ if (parcel.readInt() == 1) {
+ getBundle().putAll(parcel.readBundle());
+ }
}
/**
@@ -1953,6 +2037,10 @@ public class AccessibilityNodeInfo implements Parcelable {
mActions = 0;
mTextSelectionStart = UNDEFINED;
mTextSelectionEnd = UNDEFINED;
+ mInputType = InputType.TYPE_NULL;
+ if (mBundle != null) {
+ mBundle.clear();
+ }
}
/**
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java b/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java
index 28518aab8ab9..dded74cd9918 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfoCache.java
@@ -39,9 +39,9 @@ public class AccessibilityNodeInfoCache {
private static final boolean ENABLED = true;
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = true;
- private static final boolean CHECK_INTEGRITY = true;
+ private static final boolean CHECK_INTEGRITY_IF_DEBUGGABLE_BUILD = true;
private final Object mLock = new Object();
@@ -67,16 +67,12 @@ public class AccessibilityNodeInfoCache {
if (ENABLED) {
final int eventType = event.getEventType();
switch (eventType) {
- case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED: {
- // New window so we clear the cache.
- mWindowId = event.getWindowId();
- clear();
- } break;
+ case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER:
case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT: {
final int windowId = event.getWindowId();
+ // If a new window, we clear the cache.
if (mWindowId != windowId) {
- // New window so we clear the cache.
mWindowId = windowId;
clear();
}
@@ -87,34 +83,48 @@ public class AccessibilityNodeInfoCache {
case AccessibilityEvent.TYPE_VIEW_SELECTED:
case AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED:
case AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED: {
- // Since we prefetch the descendants of a node we
- // just remove the entire subtree since when the node
- // is fetched we will gets its descendant anyway.
- synchronized (mLock) {
- final long sourceId = event.getSourceNodeId();
- clearSubTreeLocked(sourceId);
- if (eventType == AccessibilityEvent.TYPE_VIEW_FOCUSED) {
- clearSubtreeWithOldInputFocusLocked(sourceId);
- }
- if (eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) {
- clearSubtreeWithOldAccessibilityFocusLocked(sourceId);
- }
- }
+ refreshCachedNode(event.getSourceNodeId());
} break;
- case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:
case AccessibilityEvent.TYPE_VIEW_SCROLLED: {
+ clearSubTreeLocked(event.getSourceNodeId());
+ } break;
+ case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED: {
synchronized (mLock) {
- final long accessibilityNodeId = event.getSourceNodeId();
- clearSubTreeLocked(accessibilityNodeId);
+ final long sourceId = event.getSourceNodeId();
+ if (event.getContentChangeType()
+ == AccessibilityEvent.CONTENT_CHANGE_TYPE_NODE) {
+ refreshCachedNode(sourceId);
+ } else {
+ clearSubTreeLocked(sourceId);
+ }
}
} break;
}
- if (Build.IS_DEBUGGABLE && CHECK_INTEGRITY) {
+ if (Build.IS_DEBUGGABLE && CHECK_INTEGRITY_IF_DEBUGGABLE_BUILD) {
checkIntegrity();
}
}
}
+ private void refreshCachedNode(long sourceId) {
+ if (DEBUG) {
+ Log.i(LOG_TAG, "Refresing cached node.");
+ }
+ synchronized (mLock) {
+ AccessibilityNodeInfo cachedInfo = mCacheImpl.get(sourceId);
+ // If the source is not in the cache - nothing to do.
+ if (cachedInfo == null) {
+ return;
+ }
+ // The node changed so we will just refresh it right now.
+ if (cachedInfo.refresh(false)) {
+ return;
+ }
+ // Weird, we could not refresh. Just evict the entire sub-tree.
+ clearSubTreeLocked(sourceId);
+ }
+ }
+
/**
* Gets a cached {@link AccessibilityNodeInfo} given its accessibility node id.
*
@@ -131,7 +141,7 @@ public class AccessibilityNodeInfoCache {
info = AccessibilityNodeInfo.obtain(info);
}
if (DEBUG) {
- Log.i(LOG_TAG, "get(" + accessibilityNodeId + ") = " + info);
+// Log.i(LOG_TAG, "get(" + accessibilityNodeId + ") = " + info);
}
return info;
}
@@ -149,7 +159,7 @@ public class AccessibilityNodeInfoCache {
if (ENABLED) {
synchronized(mLock) {
if (DEBUG) {
- Log.i(LOG_TAG, "add(" + info + ")");
+// Log.i(LOG_TAG, "add(" + info + ")");
}
final long sourceId = info.getSourceNodeId();
@@ -212,6 +222,13 @@ public class AccessibilityNodeInfoCache {
* @param rootNodeId The root id.
*/
private void clearSubTreeLocked(long rootNodeId) {
+ if (DEBUG) {
+ Log.i(LOG_TAG, "Clearing cached subtree.");
+ }
+ clearSubTreeRecursiveLocked(rootNodeId);
+ }
+
+ private void clearSubTreeRecursiveLocked(long rootNodeId) {
AccessibilityNodeInfo current = mCacheImpl.get(rootNodeId);
if (current == null) {
return;
@@ -221,41 +238,7 @@ public class AccessibilityNodeInfoCache {
final int childCount = childNodeIds.size();
for (int i = 0; i < childCount; i++) {
final long childNodeId = childNodeIds.valueAt(i);
- clearSubTreeLocked(childNodeId);
- }
- }
-
- /**
- * We are enforcing the invariant for a single input focus.
- *
- * @param currentInputFocusId The current input focused node.
- */
- private void clearSubtreeWithOldInputFocusLocked(long currentInputFocusId) {
- final int cacheSize = mCacheImpl.size();
- for (int i = 0; i < cacheSize; i++) {
- AccessibilityNodeInfo info = mCacheImpl.valueAt(i);
- final long infoSourceId = info.getSourceNodeId();
- if (infoSourceId != currentInputFocusId && info.isFocused()) {
- clearSubTreeLocked(infoSourceId);
- return;
- }
- }
- }
-
- /**
- * We are enforcing the invariant for a single accessibility focus.
- *
- * @param currentAccessibilityFocusId The current input focused node.
- */
- private void clearSubtreeWithOldAccessibilityFocusLocked(long currentAccessibilityFocusId) {
- final int cacheSize = mCacheImpl.size();
- for (int i = 0; i < cacheSize; i++) {
- AccessibilityNodeInfo info = mCacheImpl.valueAt(i);
- final long infoSourceId = info.getSourceNodeId();
- if (infoSourceId != currentAccessibilityFocusId && info.isAccessibilityFocused()) {
- clearSubTreeLocked(infoSourceId);
- return;
- }
+ clearSubTreeRecursiveLocked(childNodeId);
}
}
@@ -327,16 +310,17 @@ public class AccessibilityNodeInfoCache {
}
// Check for disconnected nodes or ones from another window.
- final int cacheSize = mCacheImpl.size();
- for (int i = 0; i < cacheSize; i++) {
+ for (int i = 0; i < mCacheImpl.size(); i++) {
AccessibilityNodeInfo info = mCacheImpl.valueAt(i);
if (!seen.contains(info)) {
if (info.getWindowId() == windowId) {
- Log.e(LOG_TAG, "Disconneced node: ");
+ Log.e(LOG_TAG, "Disconneced node: " + info);
} else {
Log.e(LOG_TAG, "Node from: " + info.getWindowId() + " not from:"
+ windowId + " " + info);
}
+ mCacheImpl.removeAt(i);
+ i--;
}
}
}
diff --git a/core/java/android/view/accessibility/AccessibilityRecord.java b/core/java/android/view/accessibility/AccessibilityRecord.java
index 7147c57c8b0d..3fcd2189066f 100644
--- a/core/java/android/view/accessibility/AccessibilityRecord.java
+++ b/core/java/android/view/accessibility/AccessibilityRecord.java
@@ -164,7 +164,7 @@ public class AccessibilityRecord {
}
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
return client.findAccessibilityNodeInfoByAccessibilityId(mConnectionId, mSourceWindowId,
- mSourceNodeId, GET_SOURCE_PREFETCH_FLAGS);
+ mSourceNodeId, false, GET_SOURCE_PREFETCH_FLAGS);
}
/**
diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java
index 502de314051b..4a2df58c5415 100644
--- a/core/java/android/widget/AdapterView.java
+++ b/core/java/android/widget/AdapterView.java
@@ -31,7 +31,6 @@ import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
-import android.view.accessibility.AccessibilityNodeProvider;
/**
* An AdapterView is a view whose children are determined by an {@link Adapter}.
@@ -1034,8 +1033,7 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup {
checkSelectionChanged();
}
- //TODO: Hmm, we do not know the old state so this is sub-optimal
- notifyAccessibilityStateChanged();
+ childAccessibilityStateChanged(this);
}
void checkSelectionChanged() {
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index de8b80d45ec6..f1c3139f094b 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -93,7 +93,7 @@ public class CheckedTextView extends TextView implements Checkable {
if (mChecked != checked) {
mChecked = checked;
refreshDrawableState();
- notifyAccessibilityStateChanged();
+ notifyViewAccessibilityStateChangedIfNeeded();
}
}
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index 452ad1bd3e6f..c4406ac66d69 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -114,7 +114,7 @@ public abstract class CompoundButton extends Button implements Checkable {
if (mChecked != checked) {
mChecked = checked;
refreshDrawableState();
- notifyAccessibilityStateChanged();
+ notifyViewAccessibilityStateChangedIfNeeded();
// Avoid infinite recursions if setChecked() is called from a listener
if (mBroadcasting) {
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 12d0c49aca3b..71baa9004680 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -1721,7 +1721,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
setText(mText);
if (hasPasswordTransformationMethod()) {
- notifyAccessibilityStateChanged();
+ notifyViewAccessibilityStateChangedIfNeeded();
}
}
@@ -7318,7 +7318,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
*/
protected void onSelectionChanged(int selStart, int selEnd) {
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED);
- notifyAccessibilityStateChanged();
}
/**
@@ -8131,6 +8130,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
info.setEditable(true);
}
+ if (mEditor != null) {
+ info.setInputType(mEditor.mInputType);
+ }
+
if (!TextUtils.isEmpty(mText)) {
info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY);
info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY);
@@ -8163,7 +8166,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
case AccessibilityNodeInfo.ACTION_COPY: {
if (isFocused() && canCopy()) {
if (onTextContextMenuItem(ID_COPY)) {
- notifyAccessibilityStateChanged();
return true;
}
}
@@ -8171,7 +8173,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
case AccessibilityNodeInfo.ACTION_PASTE: {
if (isFocused() && canPaste()) {
if (onTextContextMenuItem(ID_PASTE)) {
- notifyAccessibilityStateChanged();
return true;
}
}
@@ -8179,7 +8180,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
case AccessibilityNodeInfo.ACTION_CUT: {
if (isFocused() && canCut()) {
if (onTextContextMenuItem(ID_CUT)) {
- notifyAccessibilityStateChanged();
return true;
}
}
@@ -8198,7 +8198,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
// No arguments clears the selection.
if (start == end && end == -1) {
Selection.removeSelection((Spannable) text);
- notifyAccessibilityStateChanged();
return true;
}
if (start >= 0 && start <= end && end <= text.length()) {
@@ -8207,7 +8206,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
if (mEditor != null) {
mEditor.startSelectionActionMode();
}
- notifyAccessibilityStateChanged();
return true;
}
}
diff --git a/core/java/com/android/internal/app/IBatteryStats.aidl b/core/java/com/android/internal/app/IBatteryStats.aidl
index 823e19f21100..525517c00eb5 100644
--- a/core/java/com/android/internal/app/IBatteryStats.aidl
+++ b/core/java/com/android/internal/app/IBatteryStats.aidl
@@ -71,6 +71,7 @@ interface IBatteryStats {
void noteWifiMulticastEnabledFromSource(in WorkSource ws);
void noteWifiMulticastDisabledFromSource(in WorkSource ws);
void noteNetworkInterfaceType(String iface, int type);
+ void noteNetworkStatsEnabled();
void setBatteryState(int status, int health, int plugType, int level, int temp, int volt);
long getAwakeTimeBattery();
long getAwakeTimePlugged();
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 601d3ac4bb71..38a8c19801f9 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -16,7 +16,6 @@
package com.android.internal.os;
-import static android.text.format.DateUtils.SECOND_IN_MILLIS;
import static com.android.server.NetworkManagementSocketTagger.PROP_QTAGUID_ENABLED;
import android.bluetooth.BluetoothDevice;
@@ -46,6 +45,7 @@ import android.util.Slog;
import android.util.SparseArray;
import android.util.TimeUtils;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.net.NetworkStatsFactory;
import com.android.internal.util.JournaledFile;
import com.google.android.collect.Sets;
@@ -83,7 +83,7 @@ public final class BatteryStatsImpl extends BatteryStats {
private static final int MAGIC = 0xBA757475; // 'BATSTATS'
// Current on-disk Parcel version
- private static final int VERSION = 65 + (USE_OLD_HISTORY ? 1000 : 0);
+ private static final int VERSION = 66 + (USE_OLD_HISTORY ? 1000 : 0);
// Maximum number of items we will record in the history.
private static final int MAX_HISTORY_ITEMS = 2000;
@@ -231,6 +231,9 @@ public final class BatteryStatsImpl extends BatteryStats {
final StopwatchTimer[] mPhoneDataConnectionsTimer =
new StopwatchTimer[NUM_DATA_CONNECTION_TYPES];
+ final LongSamplingCounter[] mNetworkActivityCounters =
+ new LongSamplingCounter[NUM_NETWORK_ACTIVITY_TYPES];
+
boolean mWifiOn;
StopwatchTimer mWifiOnTimer;
int mWifiOnUid = -1;
@@ -275,12 +278,6 @@ public final class BatteryStatsImpl extends BatteryStats {
long mLastWriteTime = 0; // Milliseconds
- // Mobile data transferred while on battery
- private long[] mMobileDataTx = new long[4];
- private long[] mMobileDataRx = new long[4];
- private long[] mTotalDataTx = new long[4];
- private long[] mTotalDataRx = new long[4];
-
private long mRadioDataUptime;
private long mRadioDataStart;
@@ -337,9 +334,12 @@ public final class BatteryStatsImpl extends BatteryStats {
private HashMap<String, Integer> mUidCache = new HashMap<String, Integer>();
private final NetworkStatsFactory mNetworkStatsFactory = new NetworkStatsFactory();
+ private NetworkStats mLastSnapshot;
- /** Network ifaces that {@link ConnectivityManager} has claimed as mobile. */
+ @GuardedBy("this")
private HashSet<String> mMobileIfaces = Sets.newHashSet();
+ @GuardedBy("this")
+ private HashSet<String> mWifiIfaces = Sets.newHashSet();
// For debugging
public BatteryStatsImpl() {
@@ -466,7 +466,6 @@ public final class BatteryStatsImpl extends BatteryStats {
}
public static class SamplingCounter extends Counter {
-
SamplingCounter(ArrayList<Unpluggable> unpluggables, Parcel in) {
super(unpluggables, in);
}
@@ -480,6 +479,93 @@ public final class BatteryStatsImpl extends BatteryStats {
}
}
+ public static class LongSamplingCounter implements Unpluggable {
+ final ArrayList<Unpluggable> mUnpluggables;
+ long mCount;
+ long mLoadedCount;
+ long mLastCount;
+ long mUnpluggedCount;
+ long mPluggedCount;
+
+ LongSamplingCounter(ArrayList<Unpluggable> unpluggables, Parcel in) {
+ mUnpluggables = unpluggables;
+ mPluggedCount = in.readLong();
+ mCount = mPluggedCount;
+ mLoadedCount = in.readLong();
+ mLastCount = 0;
+ mUnpluggedCount = in.readLong();
+ unpluggables.add(this);
+ }
+
+ LongSamplingCounter(ArrayList<Unpluggable> unpluggables) {
+ mUnpluggables = unpluggables;
+ unpluggables.add(this);
+ }
+
+ public void writeToParcel(Parcel out) {
+ out.writeLong(mCount);
+ out.writeLong(mLoadedCount);
+ out.writeLong(mUnpluggedCount);
+ }
+
+ @Override
+ public void unplug(long elapsedRealtime, long batteryUptime, long batteryRealtime) {
+ mUnpluggedCount = mPluggedCount;
+ mCount = mPluggedCount;
+ }
+
+ @Override
+ public void plug(long elapsedRealtime, long batteryUptime, long batteryRealtime) {
+ mPluggedCount = mCount;
+ }
+
+ public long getCountLocked(int which) {
+ long val;
+ if (which == STATS_LAST) {
+ val = mLastCount;
+ } else {
+ val = mCount;
+ if (which == STATS_SINCE_UNPLUGGED) {
+ val -= mUnpluggedCount;
+ } else if (which != STATS_SINCE_CHARGED) {
+ val -= mLoadedCount;
+ }
+ }
+
+ return val;
+ }
+
+ void addCountLocked(long count) {
+ mCount += count;
+ }
+
+ /**
+ * Clear state of this counter.
+ */
+ void reset(boolean detachIfReset) {
+ mCount = 0;
+ mLoadedCount = mLastCount = mPluggedCount = mUnpluggedCount = 0;
+ if (detachIfReset) {
+ detach();
+ }
+ }
+
+ void detach() {
+ mUnpluggables.remove(this);
+ }
+
+ void writeSummaryFromParcelLocked(Parcel out) {
+ out.writeLong(mCount);
+ }
+
+ void readSummaryFromParcelLocked(Parcel in) {
+ mLoadedCount = in.readLong();
+ mCount = mLoadedCount;
+ mLastCount = 0;
+ mUnpluggedCount = mPluggedCount = mLoadedCount;
+ }
+ }
+
/**
* State for keeping track of timing information.
*/
@@ -1316,15 +1402,6 @@ public final class BatteryStatsImpl extends BatteryStats {
return kwlt;
}
- private void doDataPlug(long[] dataTransfer, long currentBytes) {
- dataTransfer[STATS_LAST] = dataTransfer[STATS_SINCE_UNPLUGGED];
- dataTransfer[STATS_SINCE_UNPLUGGED] = -1;
- }
-
- private void doDataUnplug(long[] dataTransfer, long currentBytes) {
- dataTransfer[STATS_SINCE_UNPLUGGED] = currentBytes;
- }
-
/**
* Radio uptime in microseconds when transferring data. This value is very approximate.
* @return
@@ -1571,34 +1648,10 @@ public final class BatteryStatsImpl extends BatteryStats {
}
public void doUnplugLocked(long elapsedRealtime, long batteryUptime, long batteryRealtime) {
- NetworkStats.Entry entry = null;
-
- // Track UID data usage
- final NetworkStats uidStats = getNetworkStatsDetailGroupedByUid();
- final int size = uidStats.size();
- for (int i = 0; i < size; i++) {
- entry = uidStats.getValues(i, entry);
-
- final Uid u = getUidStatsLocked(entry.uid);
- u.mStartedTcpBytesReceived = entry.rxBytes;
- u.mStartedTcpBytesSent = entry.txBytes;
- u.mTcpBytesReceivedAtLastUnplug = u.mCurrentTcpBytesReceived;
- u.mTcpBytesSentAtLastUnplug = u.mCurrentTcpBytesSent;
- }
-
for (int i = mUnpluggables.size() - 1; i >= 0; i--) {
mUnpluggables.get(i).unplug(elapsedRealtime, batteryUptime, batteryRealtime);
}
- // Track both mobile and total overall data
- final NetworkStats ifaceStats = getNetworkStatsSummary();
- entry = ifaceStats.getTotal(entry, mMobileIfaces);
- doDataUnplug(mMobileDataRx, entry.rxBytes);
- doDataUnplug(mMobileDataTx, entry.txBytes);
- entry = ifaceStats.getTotal(entry);
- doDataUnplug(mTotalDataRx, entry.rxBytes);
- doDataUnplug(mTotalDataTx, entry.txBytes);
-
// Track radio awake time
mRadioDataStart = getCurrentRadioDataUptime();
mRadioDataUptime = 0;
@@ -1609,32 +1662,10 @@ public final class BatteryStatsImpl extends BatteryStats {
}
public void doPlugLocked(long elapsedRealtime, long batteryUptime, long batteryRealtime) {
- NetworkStats.Entry entry = null;
-
- for (int iu = mUidStats.size() - 1; iu >= 0; iu--) {
- Uid u = mUidStats.valueAt(iu);
- if (u.mStartedTcpBytesReceived >= 0) {
- u.mCurrentTcpBytesReceived = u.computeCurrentTcpBytesReceived();
- u.mStartedTcpBytesReceived = -1;
- }
- if (u.mStartedTcpBytesSent >= 0) {
- u.mCurrentTcpBytesSent = u.computeCurrentTcpBytesSent();
- u.mStartedTcpBytesSent = -1;
- }
- }
for (int i = mUnpluggables.size() - 1; i >= 0; i--) {
mUnpluggables.get(i).plug(elapsedRealtime, batteryUptime, batteryRealtime);
}
- // Track both mobile and total overall data
- final NetworkStats ifaceStats = getNetworkStatsSummary();
- entry = ifaceStats.getTotal(entry, mMobileIfaces);
- doDataPlug(mMobileDataRx, entry.rxBytes);
- doDataPlug(mMobileDataTx, entry.txBytes);
- entry = ifaceStats.getTotal(entry);
- doDataPlug(mTotalDataRx, entry.rxBytes);
- doDataPlug(mTotalDataTx, entry.txBytes);
-
// Track radio awake time
mRadioDataUptime = getRadioDataUptime();
mRadioDataStart = -1;
@@ -2441,6 +2472,18 @@ public final class BatteryStatsImpl extends BatteryStats {
} else {
mMobileIfaces.remove(iface);
}
+ if (ConnectivityManager.isNetworkTypeWifi(networkType)) {
+ mWifiIfaces.add(iface);
+ } else {
+ mWifiIfaces.remove(iface);
+ }
+ }
+
+ public void noteNetworkStatsEnabledLocked() {
+ // During device boot, qtaguid isn't enabled until after the inital
+ // loading of battery stats. Now that they're enabled, take our initial
+ // snapshot for future delta calculation.
+ updateNetworkActivityLocked();
}
@Override public long getScreenOnTime(long batteryRealtime, int which) {
@@ -2499,6 +2542,15 @@ public final class BatteryStatsImpl extends BatteryStats {
return mBluetoothOnTimer.getTotalTimeLocked(batteryRealtime, which);
}
+ @Override
+ public long getNetworkActivityCount(int type, int which) {
+ if (type >= 0 && type < mNetworkActivityCounters.length) {
+ return mNetworkActivityCounters[type].getCountLocked(which);
+ } else {
+ return 0;
+ }
+ }
+
@Override public boolean getIsOnBattery() {
return mOnBattery;
}
@@ -2513,17 +2565,6 @@ public final class BatteryStatsImpl extends BatteryStats {
public final class Uid extends BatteryStats.Uid {
final int mUid;
- long mLoadedTcpBytesReceived;
- long mLoadedTcpBytesSent;
- long mCurrentTcpBytesReceived;
- long mCurrentTcpBytesSent;
- long mTcpBytesReceivedAtLastUnplug;
- long mTcpBytesSentAtLastUnplug;
-
- // These are not saved/restored when parcelling, since we want
- // to return from the parcel with a snapshot of the state.
- long mStartedTcpBytesReceived = -1;
- long mStartedTcpBytesSent = -1;
boolean mWifiRunning;
StopwatchTimer mWifiRunningTimer;
@@ -2549,6 +2590,8 @@ public final class BatteryStatsImpl extends BatteryStats {
Counter[] mUserActivityCounters;
+ LongSamplingCounter[] mNetworkActivityCounters;
+
/**
* The statistics we have collected for this uid's wake locks.
*/
@@ -2612,43 +2655,6 @@ public final class BatteryStatsImpl extends BatteryStats {
}
@Override
- public long getTcpBytesReceived(int which) {
- if (which == STATS_LAST) {
- return mLoadedTcpBytesReceived;
- } else {
- long current = computeCurrentTcpBytesReceived();
- if (which == STATS_SINCE_UNPLUGGED) {
- current -= mTcpBytesReceivedAtLastUnplug;
- } else if (which == STATS_SINCE_CHARGED) {
- current += mLoadedTcpBytesReceived;
- }
- return current;
- }
- }
-
- public long computeCurrentTcpBytesReceived() {
- final long uidRxBytes = getNetworkStatsDetailGroupedByUid().getTotal(
- null, mUid).rxBytes;
- return mCurrentTcpBytesReceived + (mStartedTcpBytesReceived >= 0
- ? (uidRxBytes - mStartedTcpBytesReceived) : 0);
- }
-
- @Override
- public long getTcpBytesSent(int which) {
- if (which == STATS_LAST) {
- return mLoadedTcpBytesSent;
- } else {
- long current = computeCurrentTcpBytesSent();
- if (which == STATS_SINCE_UNPLUGGED) {
- current -= mTcpBytesSentAtLastUnplug;
- } else if (which == STATS_SINCE_CHARGED) {
- current += mLoadedTcpBytesSent;
- }
- return current;
- }
- }
-
- @Override
public void noteWifiRunningLocked() {
if (!mWifiRunning) {
mWifiRunning = true;
@@ -2911,11 +2917,38 @@ public final class BatteryStatsImpl extends BatteryStats {
}
}
- public long computeCurrentTcpBytesSent() {
- final long uidTxBytes = getNetworkStatsDetailGroupedByUid().getTotal(
- null, mUid).txBytes;
- return mCurrentTcpBytesSent + (mStartedTcpBytesSent >= 0
- ? (uidTxBytes - mStartedTcpBytesSent) : 0);
+ void noteNetworkActivityLocked(int type, long delta) {
+ if (mNetworkActivityCounters == null) {
+ initNetworkActivityLocked();
+ }
+ if (type >= 0 && type < NUM_NETWORK_ACTIVITY_TYPES) {
+ mNetworkActivityCounters[type].addCountLocked(delta);
+ } else {
+ Slog.w(TAG, "Unknown network activity type " + type + " was specified.",
+ new Throwable());
+ }
+ }
+
+ @Override
+ public boolean hasNetworkActivity() {
+ return mNetworkActivityCounters != null;
+ }
+
+ @Override
+ public long getNetworkActivityCount(int type, int which) {
+ if (mNetworkActivityCounters != null && type >= 0
+ && type < mNetworkActivityCounters.length) {
+ return mNetworkActivityCounters[type].getCountLocked(which);
+ } else {
+ return 0;
+ }
+ }
+
+ void initNetworkActivityLocked() {
+ mNetworkActivityCounters = new LongSamplingCounter[NUM_NETWORK_ACTIVITY_TYPES];
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i] = new LongSamplingCounter(mUnpluggables);
+ }
}
/**
@@ -2961,15 +2994,18 @@ public final class BatteryStatsImpl extends BatteryStats {
}
}
- mLoadedTcpBytesReceived = mLoadedTcpBytesSent = 0;
- mCurrentTcpBytesReceived = mCurrentTcpBytesSent = 0;
-
if (mUserActivityCounters != null) {
for (int i=0; i<NUM_USER_ACTIVITY_TYPES; i++) {
mUserActivityCounters[i].reset(false);
}
}
+ if (mNetworkActivityCounters != null) {
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i].reset(false);
+ }
+ }
+
if (mWakelockStats.size() > 0) {
Iterator<Map.Entry<String, Wakelock>> it = mWakelockStats.entrySet().iterator();
while (it.hasNext()) {
@@ -3060,6 +3096,11 @@ public final class BatteryStatsImpl extends BatteryStats {
mUserActivityCounters[i].detach();
}
}
+ if (mNetworkActivityCounters != null) {
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i].detach();
+ }
+ }
}
return !active;
@@ -3094,12 +3135,6 @@ public final class BatteryStatsImpl extends BatteryStats {
pkg.writeToParcelLocked(out);
}
- out.writeLong(mLoadedTcpBytesReceived);
- out.writeLong(mLoadedTcpBytesSent);
- out.writeLong(computeCurrentTcpBytesReceived());
- out.writeLong(computeCurrentTcpBytesSent());
- out.writeLong(mTcpBytesReceivedAtLastUnplug);
- out.writeLong(mTcpBytesSentAtLastUnplug);
if (mWifiRunningTimer != null) {
out.writeInt(1);
mWifiRunningTimer.writeToParcel(out, batteryRealtime);
@@ -3156,6 +3191,14 @@ public final class BatteryStatsImpl extends BatteryStats {
} else {
out.writeInt(0);
}
+ if (mNetworkActivityCounters != null) {
+ out.writeInt(1);
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i].writeToParcel(out);
+ }
+ } else {
+ out.writeInt(0);
+ }
}
void readFromParcelLocked(ArrayList<Unpluggable> unpluggables, Parcel in) {
@@ -3198,12 +3241,6 @@ public final class BatteryStatsImpl extends BatteryStats {
mPackageStats.put(packageName, pkg);
}
- mLoadedTcpBytesReceived = in.readLong();
- mLoadedTcpBytesSent = in.readLong();
- mCurrentTcpBytesReceived = in.readLong();
- mCurrentTcpBytesSent = in.readLong();
- mTcpBytesReceivedAtLastUnplug = in.readLong();
- mTcpBytesSentAtLastUnplug = in.readLong();
mWifiRunning = false;
if (in.readInt() != 0) {
mWifiRunningTimer = new StopwatchTimer(Uid.this, WIFI_RUNNING,
@@ -3266,6 +3303,14 @@ public final class BatteryStatsImpl extends BatteryStats {
} else {
mUserActivityCounters = null;
}
+ if (in.readInt() != 0) {
+ mNetworkActivityCounters = new LongSamplingCounter[NUM_NETWORK_ACTIVITY_TYPES];
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i] = new LongSamplingCounter(mUnpluggables, in);
+ }
+ } else {
+ mNetworkActivityCounters = null;
+ }
}
/**
@@ -4340,6 +4385,9 @@ public final class BatteryStatsImpl extends BatteryStats {
for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
mPhoneDataConnectionsTimer[i] = new StopwatchTimer(null, -300-i, null, mUnpluggables);
}
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i] = new LongSamplingCounter(mUnpluggables);
+ }
mWifiOnTimer = new StopwatchTimer(null, -3, null, mUnpluggables);
mGlobalWifiRunningTimer = new StopwatchTimer(null, -4, null, mUnpluggables);
mBluetoothOnTimer = new StopwatchTimer(null, -5, null, mUnpluggables);
@@ -4515,6 +4563,9 @@ public final class BatteryStatsImpl extends BatteryStats {
for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
mPhoneDataConnectionsTimer[i].reset(this, false);
}
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i].reset(false);
+ }
mWifiOnTimer.reset(this, false);
mGlobalWifiRunningTimer.reset(this, false);
mBluetoothOnTimer.reset(this, false);
@@ -4590,6 +4641,7 @@ public final class BatteryStatsImpl extends BatteryStats {
mDischargeStartLevel = level;
}
updateKernelWakelocksLocked();
+ updateNetworkActivityLocked();
mHistoryCur.batteryLevel = (byte)level;
mHistoryCur.states &= ~HistoryItem.STATE_BATTERY_PLUGGED_FLAG;
if (DEBUG_HISTORY) Slog.v(TAG, "Battery unplugged to: "
@@ -4612,6 +4664,7 @@ public final class BatteryStatsImpl extends BatteryStats {
doUnplugLocked(realtime, mUnpluggedBatteryUptime, mUnpluggedBatteryRealtime);
} else {
updateKernelWakelocksLocked();
+ updateNetworkActivityLocked();
mHistoryCur.batteryLevel = (byte)level;
mHistoryCur.states |= HistoryItem.STATE_BATTERY_PLUGGED_FLAG;
if (DEBUG_HISTORY) Slog.v(TAG, "Battery plugged to: "
@@ -4744,6 +4797,52 @@ public final class BatteryStatsImpl extends BatteryStats {
}
}
+ private void updateNetworkActivityLocked() {
+ if (!SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) return;
+
+ final NetworkStats snapshot;
+ try {
+ snapshot = mNetworkStatsFactory.readNetworkStatsDetail();
+ } catch (IOException e) {
+ Log.wtf(TAG, "Failed to read network stats", e);
+ return;
+ }
+
+ if (mLastSnapshot == null) {
+ mLastSnapshot = snapshot;
+ return;
+ }
+
+ final NetworkStats delta = snapshot.subtract(mLastSnapshot);
+ mLastSnapshot = snapshot;
+
+ NetworkStats.Entry entry = null;
+ final int size = delta.size();
+ for (int i = 0; i < size; i++) {
+ entry = delta.getValues(i, entry);
+
+ if (entry.rxBytes == 0 || entry.txBytes == 0) continue;
+ if (entry.tag != NetworkStats.TAG_NONE) continue;
+
+ final Uid u = getUidStatsLocked(entry.uid);
+
+ if (mMobileIfaces.contains(entry.iface)) {
+ u.noteNetworkActivityLocked(NETWORK_MOBILE_RX_BYTES, entry.rxBytes);
+ u.noteNetworkActivityLocked(NETWORK_MOBILE_TX_BYTES, entry.txBytes);
+
+ mNetworkActivityCounters[NETWORK_MOBILE_RX_BYTES].addCountLocked(entry.rxBytes);
+ mNetworkActivityCounters[NETWORK_MOBILE_TX_BYTES].addCountLocked(entry.txBytes);
+
+ } else if (mWifiIfaces.contains(entry.iface)) {
+ u.noteNetworkActivityLocked(NETWORK_WIFI_RX_BYTES, entry.rxBytes);
+ u.noteNetworkActivityLocked(NETWORK_WIFI_TX_BYTES, entry.txBytes);
+
+ mNetworkActivityCounters[NETWORK_WIFI_RX_BYTES].addCountLocked(entry.rxBytes);
+ mNetworkActivityCounters[NETWORK_WIFI_TX_BYTES].addCountLocked(entry.txBytes);
+ }
+ }
+ }
+
public long getAwakeTimeBattery() {
return computeBatteryUptime(getBatteryUptimeLocked(), STATS_CURRENT);
}
@@ -4834,47 +4933,6 @@ public final class BatteryStatsImpl extends BatteryStats {
return getBatteryRealtimeLocked(curTime);
}
- private long getTcpBytes(long current, long[] dataBytes, int which) {
- if (which == STATS_LAST) {
- return dataBytes[STATS_LAST];
- } else {
- if (which == STATS_SINCE_UNPLUGGED) {
- if (dataBytes[STATS_SINCE_UNPLUGGED] < 0) {
- return dataBytes[STATS_LAST];
- } else {
- return current - dataBytes[STATS_SINCE_UNPLUGGED];
- }
- } else if (which == STATS_SINCE_CHARGED) {
- return (current - dataBytes[STATS_CURRENT]) + dataBytes[STATS_SINCE_CHARGED];
- }
- return current - dataBytes[STATS_CURRENT];
- }
- }
-
- /** Only STATS_UNPLUGGED works properly */
- public long getMobileTcpBytesSent(int which) {
- final long mobileTxBytes = getNetworkStatsSummary().getTotal(null, mMobileIfaces).txBytes;
- return getTcpBytes(mobileTxBytes, mMobileDataTx, which);
- }
-
- /** Only STATS_UNPLUGGED works properly */
- public long getMobileTcpBytesReceived(int which) {
- final long mobileRxBytes = getNetworkStatsSummary().getTotal(null, mMobileIfaces).rxBytes;
- return getTcpBytes(mobileRxBytes, mMobileDataRx, which);
- }
-
- /** Only STATS_UNPLUGGED works properly */
- public long getTotalTcpBytesSent(int which) {
- final long totalTxBytes = getNetworkStatsSummary().getTotal(null).txBytes;
- return getTcpBytes(totalTxBytes, mTotalDataTx, which);
- }
-
- /** Only STATS_UNPLUGGED works properly */
- public long getTotalTcpBytesReceived(int which) {
- final long totalRxBytes = getNetworkStatsSummary().getTotal(null).rxBytes;
- return getTcpBytes(totalRxBytes, mTotalDataRx, which);
- }
-
@Override
public int getDischargeStartLevel() {
synchronized(this) {
@@ -5354,6 +5412,9 @@ public final class BatteryStatsImpl extends BatteryStats {
for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
mPhoneDataConnectionsTimer[i].readSummaryFromParcelLocked(in);
}
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i].readSummaryFromParcelLocked(in);
+ }
mWifiOn = false;
mWifiOnTimer.readSummaryFromParcelLocked(in);
mGlobalWifiRunning = false;
@@ -5425,6 +5486,15 @@ public final class BatteryStatsImpl extends BatteryStats {
}
}
+ if (in.readInt() != 0) {
+ if (u.mNetworkActivityCounters == null) {
+ u.initNetworkActivityLocked();
+ }
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ u.mNetworkActivityCounters[i].readSummaryFromParcelLocked(in);
+ }
+ }
+
int NW = in.readInt();
if (NW > 100) {
Slog.w(TAG, "File corrupt: too many wake locks " + NW);
@@ -5507,9 +5577,6 @@ public final class BatteryStatsImpl extends BatteryStats {
s.mLaunches = s.mLoadedLaunches = in.readInt();
}
}
-
- u.mLoadedTcpBytesReceived = in.readLong();
- u.mLoadedTcpBytesSent = in.readLong();
}
}
@@ -5522,6 +5589,7 @@ public final class BatteryStatsImpl extends BatteryStats {
public void writeSummaryToParcel(Parcel out) {
// Need to update with current kernel wake lock counts.
updateKernelWakelocksLocked();
+ updateNetworkActivityLocked();
final long NOW_SYS = SystemClock.uptimeMillis() * 1000;
final long NOWREAL_SYS = SystemClock.elapsedRealtime() * 1000;
@@ -5557,6 +5625,9 @@ public final class BatteryStatsImpl extends BatteryStats {
for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
mPhoneDataConnectionsTimer[i].writeSummaryFromParcelLocked(out, NOWREAL);
}
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i].writeSummaryFromParcelLocked(out);
+ }
mWifiOnTimer.writeSummaryFromParcelLocked(out, NOWREAL);
mGlobalWifiRunningTimer.writeSummaryFromParcelLocked(out, NOWREAL);
mBluetoothOnTimer.writeSummaryFromParcelLocked(out, NOWREAL);
@@ -5638,6 +5709,15 @@ public final class BatteryStatsImpl extends BatteryStats {
}
}
+ if (u.mNetworkActivityCounters == null) {
+ out.writeInt(0);
+ } else {
+ out.writeInt(1);
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ u.mNetworkActivityCounters[i].writeSummaryFromParcelLocked(out);
+ }
+ }
+
int NW = u.mWakelockStats.size();
out.writeInt(NW);
if (NW > 0) {
@@ -5730,9 +5810,6 @@ public final class BatteryStatsImpl extends BatteryStats {
}
}
}
-
- out.writeLong(u.getTcpBytesReceived(STATS_SINCE_CHARGED));
- out.writeLong(u.getTcpBytesSent(STATS_SINCE_CHARGED));
}
}
@@ -5771,6 +5848,9 @@ public final class BatteryStatsImpl extends BatteryStats {
mPhoneDataConnectionsTimer[i] = new StopwatchTimer(null, -300-i,
null, mUnpluggables, in);
}
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i] = new LongSamplingCounter(mUnpluggables, in);
+ }
mWifiOn = false;
mWifiOnTimer = new StopwatchTimer(null, -2, null, mUnpluggables, in);
mGlobalWifiRunning = false;
@@ -5801,15 +5881,6 @@ public final class BatteryStatsImpl extends BatteryStats {
mDischargeAmountScreenOffSinceCharge = in.readInt();
mLastWriteTime = in.readLong();
- mMobileDataRx[STATS_LAST] = in.readLong();
- mMobileDataRx[STATS_SINCE_UNPLUGGED] = -1;
- mMobileDataTx[STATS_LAST] = in.readLong();
- mMobileDataTx[STATS_SINCE_UNPLUGGED] = -1;
- mTotalDataRx[STATS_LAST] = in.readLong();
- mTotalDataRx[STATS_SINCE_UNPLUGGED] = -1;
- mTotalDataTx[STATS_LAST] = in.readLong();
- mTotalDataTx[STATS_SINCE_UNPLUGGED] = -1;
-
mRadioDataUptime = in.readLong();
mRadioDataStart = -1;
@@ -5859,6 +5930,7 @@ public final class BatteryStatsImpl extends BatteryStats {
void writeToParcelLocked(Parcel out, boolean inclUids, int flags) {
// Need to update with current kernel wake lock counts.
updateKernelWakelocksLocked();
+ updateNetworkActivityLocked();
final long uSecUptime = SystemClock.uptimeMillis() * 1000;
final long uSecRealtime = SystemClock.elapsedRealtime() * 1000;
@@ -5885,6 +5957,9 @@ public final class BatteryStatsImpl extends BatteryStats {
for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
mPhoneDataConnectionsTimer[i].writeToParcel(out, batteryRealtime);
}
+ for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
+ mNetworkActivityCounters[i].writeToParcel(out);
+ }
mWifiOnTimer.writeToParcel(out, batteryRealtime);
mGlobalWifiRunningTimer.writeToParcel(out, batteryRealtime);
mBluetoothOnTimer.writeToParcel(out, batteryRealtime);
@@ -5909,11 +5984,6 @@ public final class BatteryStatsImpl extends BatteryStats {
out.writeInt(mDischargeAmountScreenOffSinceCharge);
out.writeLong(mLastWriteTime);
- out.writeLong(getMobileTcpBytesReceived(STATS_SINCE_UNPLUGGED));
- out.writeLong(getMobileTcpBytesSent(STATS_SINCE_UNPLUGGED));
- out.writeLong(getTotalTcpBytesReceived(STATS_SINCE_UNPLUGGED));
- out.writeLong(getTotalTcpBytesSent(STATS_SINCE_UNPLUGGED));
-
// Write radio uptime for data
out.writeLong(getRadioDataUptime());
@@ -5965,6 +6035,7 @@ public final class BatteryStatsImpl extends BatteryStats {
public void prepareForDumpLocked() {
// Need to retrieve current kernel wake lock stats before printing.
updateKernelWakelocksLocked();
+ updateNetworkActivityLocked();
}
public void dumpLocked(PrintWriter pw, boolean isUnpluggedOnly) {
@@ -5996,59 +6067,7 @@ public final class BatteryStatsImpl extends BatteryStats {
mGlobalWifiRunningTimer.logState(pr, " ");
pr.println("*** Bluetooth timer:");
mBluetoothOnTimer.logState(pr, " ");
- pr.println("*** Mobile ifaces:");
- pr.println(mMobileIfaces.toString());
}
super.dumpLocked(pw, isUnpluggedOnly);
}
-
- private NetworkStats mNetworkSummaryCache;
- private NetworkStats mNetworkDetailCache;
-
- private NetworkStats getNetworkStatsSummary() {
- // NOTE: calls from BatteryStatsService already hold this lock
- synchronized (this) {
- if (mNetworkSummaryCache == null
- || mNetworkSummaryCache.getElapsedRealtimeAge() > SECOND_IN_MILLIS) {
- mNetworkSummaryCache = null;
-
- if (SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) {
- try {
- mNetworkSummaryCache = mNetworkStatsFactory.readNetworkStatsSummaryDev();
- } catch (IOException e) {
- Log.wtf(TAG, "problem reading network stats", e);
- }
- }
-
- if (mNetworkSummaryCache == null) {
- mNetworkSummaryCache = new NetworkStats(SystemClock.elapsedRealtime(), 0);
- }
- }
- return mNetworkSummaryCache;
- }
- }
-
- private NetworkStats getNetworkStatsDetailGroupedByUid() {
- // NOTE: calls from BatteryStatsService already hold this lock
- synchronized (this) {
- if (mNetworkDetailCache == null
- || mNetworkDetailCache.getElapsedRealtimeAge() > SECOND_IN_MILLIS) {
- mNetworkDetailCache = null;
-
- if (SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) {
- try {
- mNetworkDetailCache = mNetworkStatsFactory
- .readNetworkStatsDetail().groupedByUid();
- } catch (IOException e) {
- Log.wtf(TAG, "problem reading network stats", e);
- }
- }
-
- if (mNetworkDetailCache == null) {
- mNetworkDetailCache = new NetworkStats(SystemClock.elapsedRealtime(), 0);
- }
- }
- return mNetworkDetailCache;
- }
- }
}
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index 38dee1b9be68..a7a9266bf53c 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -29,6 +29,10 @@ jfieldID gOptions_ditherFieldID;
jfieldID gOptions_purgeableFieldID;
jfieldID gOptions_shareableFieldID;
jfieldID gOptions_preferQualityOverSpeedFieldID;
+jfieldID gOptions_scaledFieldID;
+jfieldID gOptions_densityFieldID;
+jfieldID gOptions_screenDensityFieldID;
+jfieldID gOptions_targetDensityFieldID;
jfieldID gOptions_widthFieldID;
jfieldID gOptions_heightFieldID;
jfieldID gOptions_mimeFieldID;
@@ -152,10 +156,47 @@ static SkPixelRef* installPixelRef(SkBitmap* bitmap, SkStream* stream,
return pr;
}
+static SkBitmap::Config configForScaledOutput(SkBitmap::Config config) {
+ switch (config) {
+ case SkBitmap::kNo_Config:
+ case SkBitmap::kIndex8_Config:
+ case SkBitmap::kRLE_Index8_Config:
+ return SkBitmap::kARGB_8888_Config;
+ default:
+ break;
+ }
+ return config;
+}
+
+class ScaleCheckingAllocator : public SkBitmap::HeapAllocator {
+public:
+ ScaleCheckingAllocator(float scale, int size)
+ : mScale(scale), mSize(size) {
+ }
+
+ virtual bool allocPixelRef(SkBitmap* bitmap, SkColorTable* ctable) {
+ // accounts for scale in final allocation, using eventual size and config
+ const int bytesPerPixel = SkBitmap::ComputeBytesPerPixel(
+ configForScaledOutput(bitmap->getConfig()));
+ const int requestedSize = bytesPerPixel *
+ int(bitmap->width() * mScale + 0.5f) *
+ int(bitmap->height() * mScale + 0.5f);
+ if (requestedSize > mSize) {
+ ALOGW("bitmap for alloc reuse (%d bytes) can't fit scaled bitmap (%d bytes)",
+ mSize, requestedSize);
+ return false;
+ }
+ return SkBitmap::HeapAllocator::allocPixelRef(bitmap, ctable);
+ }
+private:
+ const float mScale;
+ const int mSize;
+};
+
class RecyclingPixelAllocator : public SkBitmap::Allocator {
public:
RecyclingPixelAllocator(SkPixelRef* pixelRef, unsigned int size)
- : mPixelRef(pixelRef), mSize(size) {
+ : mPixelRef(pixelRef), mSize(size) {
SkSafeRef(mPixelRef);
}
@@ -165,8 +206,8 @@ public:
virtual bool allocPixelRef(SkBitmap* bitmap, SkColorTable* ctable) {
if (!bitmap->getSize64().is32() || bitmap->getSize() > mSize) {
- ALOGW("bitmap marked for reuse (%d bytes) too small to contain new bitmap (%d bytes)",
- bitmap->getSize(), mSize);
+ ALOGW("bitmap marked for reuse (%d bytes) can't fit new bitmap (%d bytes)",
+ mSize, bitmap->getSize());
return false;
}
bitmap->setPixelRef(mPixelRef);
@@ -183,8 +224,7 @@ private:
// i.e. dynamically allocated, since its lifetime may exceed the current stack
// frame.
static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
- jobject options, bool allowPurgeable, bool forcePurgeable = false,
- bool applyScale = false, float scale = 1.0f) {
+ jobject options, bool allowPurgeable, bool forcePurgeable = false) {
int sampleSize = 1;
@@ -193,9 +233,8 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
bool doDither = true;
bool isMutable = false;
- bool willScale = applyScale && scale != 1.0f;
- bool isPurgeable = !willScale &&
- (forcePurgeable || (allowPurgeable && optionsPurgeable(env, options)));
+ float scale = 1.0f;
+ bool isPurgeable = forcePurgeable || (allowPurgeable && optionsPurgeable(env, options));
bool preferQualityOverSpeed = false;
jobject javaBitmap = NULL;
@@ -218,13 +257,20 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
preferQualityOverSpeed = env->GetBooleanField(options,
gOptions_preferQualityOverSpeedFieldID);
javaBitmap = env->GetObjectField(options, gOptions_bitmapFieldID);
- }
- // TODO: allow scaling with reuse, ideally avoiding decode in not-enough-space condition
- if (willScale && javaBitmap != NULL) {
- return nullObjectReturn("Cannot pre-scale a reused bitmap");
+ if (env->GetBooleanField(options, gOptions_scaledFieldID)) {
+ const int density = env->GetIntField(options, gOptions_densityFieldID);
+ const int targetDensity = env->GetIntField(options, gOptions_targetDensityFieldID);
+ const int screenDensity = env->GetIntField(options, gOptions_screenDensityFieldID);
+ if (density != 0 && targetDensity != 0 && density != screenDensity) {
+ scale = (float) targetDensity / density;
+ }
+ }
}
+ const bool willScale = scale != 1.0f;
+ isPurgeable &= !willScale;
+
SkImageDecoder* decoder = SkImageDecoder::Factory(stream);
if (decoder == NULL) {
return nullObjectReturn("SkImageDecoder::Factory returned null");
@@ -254,16 +300,6 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
NinePatchPeeker peeker(decoder);
decoder->setPeeker(&peeker);
- JavaPixelAllocator javaAllocator(env);
- RecyclingPixelAllocator recyclingAllocator(outputBitmap->pixelRef(), existingBufferSize);
-
- // allocator to be used for final allocation associated with output
- SkBitmap::Allocator* allocator = (javaBitmap != NULL) ?
- (SkBitmap::Allocator*)&recyclingAllocator : (SkBitmap::Allocator*)&javaAllocator;
-
- if (!isPurgeable && !willScale) {
- decoder->setAllocator(allocator);
- }
AutoDecoderCancel adc(options, decoder);
@@ -276,6 +312,22 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
SkImageDecoder::Mode decodeMode = isPurgeable ? SkImageDecoder::kDecodeBounds_Mode : mode;
+
+ JavaPixelAllocator javaAllocator(env);
+ RecyclingPixelAllocator recyclingAllocator(outputBitmap->pixelRef(), existingBufferSize);
+ ScaleCheckingAllocator scaleCheckingAllocator(scale, existingBufferSize);
+ SkBitmap::Allocator* outputAllocator = (javaBitmap != NULL) ?
+ (SkBitmap::Allocator*)&recyclingAllocator : (SkBitmap::Allocator*)&javaAllocator;
+ if (decodeMode != SkImageDecoder::kDecodeBounds_Mode) {
+ if (!willScale) {
+ decoder->setAllocator(outputAllocator);
+ } else if (javaBitmap != NULL) {
+ // check for eventual scaled bounds at allocation time, so we don't decode the bitmap
+ // only to find the scaled result too large to fit in the allocation
+ decoder->setAllocator(&scaleCheckingAllocator);
+ }
+ }
+
SkBitmap decodingBitmap;
if (!decoder->decode(stream, &decodingBitmap, prefConfig, decodeMode)) {
return nullObjectReturn("decoder->decode returned false");
@@ -353,20 +405,11 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
const float sx = scaledWidth / float(decodingBitmap.width());
const float sy = scaledHeight / float(decodingBitmap.height());
- SkBitmap::Config config = decodingBitmap.config();
- switch (config) {
- case SkBitmap::kNo_Config:
- case SkBitmap::kIndex8_Config:
- case SkBitmap::kRLE_Index8_Config:
- config = SkBitmap::kARGB_8888_Config;
- break;
- default:
- break;
- }
-
+ // TODO: avoid copying when scaled size equals decodingBitmap size
+ SkBitmap::Config config = configForScaledOutput(decodingBitmap.config());
outputBitmap->setConfig(config, scaledWidth, scaledHeight);
outputBitmap->setIsOpaque(decodingBitmap.isOpaque());
- if (!outputBitmap->allocPixels(allocator, NULL)) {
+ if (!outputBitmap->allocPixels(outputAllocator, NULL)) {
return nullObjectReturn("allocation failed for scaled bitmap");
}
outputBitmap->eraseColor(0);
@@ -422,26 +465,20 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
isMutable, ninePatchChunk, layoutBounds, -1);
}
-static jobject nativeDecodeStreamScaled(JNIEnv* env, jobject clazz, jobject is, jbyteArray storage,
- jobject padding, jobject options, jboolean applyScale, jfloat scale) {
+static jobject nativeDecodeStream(JNIEnv* env, jobject clazz, jobject is, jbyteArray storage,
+ jobject padding, jobject options) {
jobject bitmap = NULL;
SkStream* stream = CreateJavaInputStreamAdaptor(env, is, storage, 0);
if (stream) {
// for now we don't allow purgeable with java inputstreams
- bitmap = doDecode(env, stream, padding, options, false, false, applyScale, scale);
+ bitmap = doDecode(env, stream, padding, options, false, false);
stream->unref();
}
return bitmap;
}
-static jobject nativeDecodeStream(JNIEnv* env, jobject clazz, jobject is, jbyteArray storage,
- jobject padding, jobject options) {
-
- return nativeDecodeStreamScaled(env, clazz, is, storage, padding, options, false, 1.0f);
-}
-
static ssize_t getFDSize(int fd) {
off64_t curr = ::lseek64(fd, 0, SEEK_CUR);
if (curr < 0) {
@@ -516,8 +553,8 @@ static SkStream* copyAssetToStream(Asset* asset) {
return stream;
}
-static jobject nativeDecodeAssetScaled(JNIEnv* env, jobject clazz, jint native_asset,
- jobject padding, jobject options, jboolean applyScale, jfloat scale) {
+static jobject nativeDecodeAsset(JNIEnv* env, jobject clazz, jint native_asset,
+ jobject padding, jobject options) {
SkStream* stream;
Asset* asset = reinterpret_cast<Asset*>(native_asset);
@@ -535,13 +572,7 @@ static jobject nativeDecodeAssetScaled(JNIEnv* env, jobject clazz, jint native_a
stream = new AssetStreamAdaptor(asset);
}
SkAutoUnref aur(stream);
- return doDecode(env, stream, padding, options, true, forcePurgeable, applyScale, scale);
-}
-
-static jobject nativeDecodeAsset(JNIEnv* env, jobject clazz, jint native_asset,
- jobject padding, jobject options) {
-
- return nativeDecodeAssetScaled(env, clazz, native_asset, padding, options, false, 1.0f);
+ return doDecode(env, stream, padding, options, true, forcePurgeable);
}
static jobject nativeDecodeByteArray(JNIEnv* env, jobject, jbyteArray byteArray,
@@ -575,10 +606,6 @@ static JNINativeMethod gMethods[] = {
"(Ljava/io/InputStream;[BLandroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
(void*)nativeDecodeStream
},
- { "nativeDecodeStream",
- "(Ljava/io/InputStream;[BLandroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;ZF)Landroid/graphics/Bitmap;",
- (void*)nativeDecodeStreamScaled
- },
{ "nativeDecodeFileDescriptor",
"(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
@@ -590,11 +617,6 @@ static JNINativeMethod gMethods[] = {
(void*)nativeDecodeAsset
},
- { "nativeDecodeAsset",
- "(ILandroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;ZF)Landroid/graphics/Bitmap;",
- (void*)nativeDecodeAssetScaled
- },
-
{ "nativeDecodeByteArray",
"([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
(void*)nativeDecodeByteArray
@@ -637,6 +659,10 @@ int register_android_graphics_BitmapFactory(JNIEnv* env) {
gOptions_shareableFieldID = getFieldIDCheck(env, options_class, "inInputShareable", "Z");
gOptions_preferQualityOverSpeedFieldID = getFieldIDCheck(env, options_class,
"inPreferQualityOverSpeed", "Z");
+ gOptions_scaledFieldID = getFieldIDCheck(env, options_class, "inScaled", "Z");
+ gOptions_densityFieldID = getFieldIDCheck(env, options_class, "inDensity", "I");
+ gOptions_screenDensityFieldID = getFieldIDCheck(env, options_class, "inScreenDensity", "I");
+ gOptions_targetDensityFieldID = getFieldIDCheck(env, options_class, "inTargetDensity", "I");
gOptions_widthFieldID = getFieldIDCheck(env, options_class, "outWidth", "I");
gOptions_heightFieldID = getFieldIDCheck(env, options_class, "outHeight", "I");
gOptions_mimeFieldID = getFieldIDCheck(env, options_class, "outMimeType", "Ljava/lang/String;");
diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml
index a1473508be79..27cedcb82ea7 100644
--- a/docs/html/_redirects.yaml
+++ b/docs/html/_redirects.yaml
@@ -219,6 +219,21 @@ redirects:
- from: /guide/tutorials/...
to: /resources/tutorials/...
+# move ui docs to design
+
+- from: /guide/practices/ui_guidelines/index.html
+ to: /design/index.html
+
+- from: /guide/practices/ui_guidelines/icon_design.*
+ to: /design/style/iconography.html
+
+- from: /guide/practices/ui_guidelines/activity_task_design.html
+ to: /design/patterns/app-structure.html
+
+- from: /guide/practices/ui_guidelines/menu_design.html
+ to: /design/patterns/actionbar.html
+
+
# ------------------- RESOURCES -------------------
- from: /resources/dashboard/...
diff --git a/docs/html/design/media/devices_displays_density.png b/docs/html/design/media/devices_displays_density.png
index 7ddad31efdad..4e3cbf66201d 100644
--- a/docs/html/design/media/devices_displays_density.png
+++ b/docs/html/design/media/devices_displays_density.png
Binary files differ
diff --git a/docs/html/design/media/devices_displays_density@2x.png b/docs/html/design/media/devices_displays_density@2x.png
new file mode 100644
index 000000000000..79a46b08c9d1
--- /dev/null
+++ b/docs/html/design/media/devices_displays_density@2x.png
Binary files differ
diff --git a/docs/html/design/style/devices-displays.jd b/docs/html/design/style/devices-displays.jd
index 18550d9ff0b6..a8f9d6f4e9bd 100644
--- a/docs/html/design/style/devices-displays.jd
+++ b/docs/html/design/style/devices-displays.jd
@@ -32,7 +32,7 @@ ensure that your app looks great on any device.</p>
</div>
</div>
- <img src="{@docRoot}design/media/devices_displays_density.png">
+ <img src="{@docRoot}design/media/devices_displays_density@2x.png" alt="" height="160" />
<h4>Strategies</h4>
<p>So where do you begin when designing for multiple screens? One approach is to work in the base
diff --git a/docs/html/design/style/iconography.jd b/docs/html/design/style/iconography.jd
index 1475e5cee771..0d2cdbb57926 100644
--- a/docs/html/design/style/iconography.jd
+++ b/docs/html/design/style/iconography.jd
@@ -4,9 +4,37 @@ page.tags="icons"
<img src="{@docRoot}design/media/iconography_overview.png">
+
<p>An icon is a graphic that takes up a small portion of screen real estate and provides a quick,
intuitive representation of an action, a status, or an app.</p>
+<p>When you design icons for your app, it's important to keep in mind that your
+app may be installed on a variety of devices that offer a range of
+pixel densities, as mentioned in
+<a href="{@docRoot}design/style/devices-displays.html">Devices
+and Displays</a>. But you can make your icons look great on all devices
+by providing each icon in multiple sizes. When your app runs, Android checks the characteristics of
+the device screen and loads the appropriate density-specific assets for your app. </p>
+
+<p>Because you will deliver each icon in multiple sizes to support different densities,
+the design guidelines below
+refer to the icon dimensions in <acronym title="density-independent pixels">dp</acronym>
+units, which are based on the pixel dimensions of a medium-density (MDPI) screen.</p>
+
+<img src="{@docRoot}design/media/devices_displays_density@2x.png" alt="" height="160" />
+
+<p>So, to create an icon for different densities, you should follow the <strong>2:3:4:6 scaling
+ratio</strong> between the four primary densities (medium, high, x-high, and xx-high,
+respectively). For example, consider that the size for a launcher icon is specified to be
+48x48 dp. This means the baseline (MDPI) asset is 48x48 px, and the
+high density (HDPI) asset should be 1.5x the baseline at 72x72 px, and the x-high
+density (XHDPI) asset should be 2x the baseline at 96x96 px, and so on.</p>
+
+<p class="note"><strong>Note:</strong> Android also supports low-density (LDPI) screens,
+but you normally don't need to create custom assets at this size because Android
+effectively down-scales your HDPI assets by 1/2 to match the expected size.</p>
+
+
<h2 id="launcher">Launcher</h2>
@@ -338,3 +366,165 @@ whenever a new notification is available.</p>
</div>
<!-- 2 free columns -->
</div>
+
+
+
+
+
+
+
+
+
+
+<h2 id="DesignTips">Design Tips</h2>
+
+<p>Here are some tips you might find useful as you create icons or other
+drawable assets for your application. These tips assume you are using
+Adobe&reg; Photoshop&reg; or a similar raster and vector image-editing program.</p>
+
+
+
+
+<h3>Use vector shapes where possible</h3>
+
+<p>Many image-editing programs such as Adobe&reg; Photoshop&reg; allow you to use a
+combination of vector shapes and raster layers and effects. When possible,
+use vector shapes so that if the need arises, assets can be scaled up without
+loss of detail and edge crispness.</p>
+
+<p>Using vectors also makes it easy to align edges and corners to pixel
+boundaries at smaller resolutions.</li>
+
+
+
+<h3>Start with large artboards</h3>
+
+<p>Because you will need to create assets for different screen densities,
+it is best to start your icon
+designs on large artboards with dimensions that are multiples of the target icon
+sizes. For example, launcher icons are 48, 72, 96, or 144 pixels wide,
+depending on screen density (mdpi, hdpi, xhdpi, and xxhdpi, respectively). If you
+initially draw launcher icons on an 864x864 artboard, it will be easier and
+cleaner to adjust the icons when you scale the artboard down to the target
+sizes for final asset creation.</p>
+
+
+
+<h3>When scaling, redraw bitmap layers as needed</h3>
+
+<p>If you scaled an image up from a bitmap layer, rather than from a vector
+layer, those layers will need to be redrawn manually to appear crisp at higher
+densities. For example if a 60x60 circle was painted as a bitmap for
+mdpi it will need to be repainted as a 90x90 circle for hdpi.</p>
+
+
+
+<h3>Use common naming conventions for icon assets</h3>
+
+<p>Try to name files so that related assets will group together inside a
+directory when they are sorted alphabetically. In particular, it helps to use a
+common prefix for each icon type. For example:</p>
+
+<table>
+<tr>
+<th>Asset Type</th>
+<th>Prefix</th>
+<th>Example</th>
+</tr>
+<tr>
+<td>Icons</td>
+<td><code>ic_</code></td>
+<td><code>ic_star.png</code></td>
+</tr>
+<tr>
+<td>Launcher icons</td>
+<td><code>ic_launcher</code></td>
+<td><code>ic_launcher_calendar.png</code></td>
+</tr>
+<tr>
+<td>Menu icons and Action Bar icons</td>
+<td><code>ic_menu</code></td>
+<td><code>ic_menu_archive.png</code></td>
+</tr>
+<tr>
+<td>Status bar icons</td>
+<td><code>ic_stat_notify</code></td>
+<td><code>ic_stat_notify_msg.png</code></td>
+</tr>
+<tr>
+<td>Tab icons</td>
+<td><code>ic_tab</code></td>
+<td><code>ic_tab_recent.png</code></td>
+</tr>
+<tr>
+<td>Dialog icons</td>
+<td><code>ic_dialog</code></td>
+<td><code>ic_dialog_info.png</code></td>
+</tr>
+</table>
+
+<p>Note that you are not required to use a shared prefix of any
+type&mdash;doing so is for your convenience only.</p>
+
+
+<h3>Set up a working space that organizes files by density</h3>
+
+<p>Supporting multiple screen densities means you must create multiple versions
+of the same icon. To help keep the multiple copies of files safe and easier to
+find, we recommend creating a directory structure in your working space that
+organizes asset files based on the target density. For example:</p>
+
+<pre>
+art/...
+ mdpi/...
+ _pre_production/...
+ <em>working_file</em>.psd
+ <em>finished_asset</em>.png
+ hdpi/...
+ _pre_production/...
+ <em>working_file</em>.psd
+ <em>finished_asset</em>.png
+ xhdpi/...
+ _pre_production/...
+ <em>working_file</em>.psd
+ <em>finished_asset</em>.png</pre>
+ xxhdpi/...
+ _pre_production/...
+ <em>working_file</em>.psd
+ <em>finished_asset</em>.png</pre>
+
+<p>Because the structure in your working space is similar to that of the application, you
+can quickly determine which assets should be copied to each
+resources directory. Separating assets by density also helps you detect any
+variances in filenames across densities, which is important because
+corresponding assets for different densities must share the same filename.</p>
+
+<p>For comparison, here's the resources directory structure of a typical
+application: </p>
+
+<pre>res/...
+ drawable-ldpi/...
+ <em>finished_asset</em>.png
+ drawable-mdpi/...
+ <em>finished_asset</em>.png
+ drawable-hdpi/...
+ <em>finished_asset</em>.png
+ drawable-xhdpi/...
+ <em>finished_asset</em>.png
+</pre>
+
+<p>For more information about how to save resources in the application project,
+see <a href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a>.
+</p>
+
+
+<h3>Remove unnecessary metadata from final assets</h3>
+
+<p>Although the Android SDK tools will automatically compress PNGs when packaging
+application resources into the application binary, a good practice is to remove
+unnecessary headers and metadata from your PNG assets. Tools such as <a
+href="http://optipng.sourceforge.net/">OptiPNG</a> or <a
+href="http://pmt.sourceforge.net/pngcrush/">Pngcrush</a> can ensure that this
+metadata is removed and that your image asset file sizes are optimized.</p>
+
+
diff --git a/docs/html/design/style/metrics-grids.jd b/docs/html/design/style/metrics-grids.jd
index 3116ff6d3cca..0a99a2f5d2ca 100644
--- a/docs/html/design/style/metrics-grids.jd
+++ b/docs/html/design/style/metrics-grids.jd
@@ -4,15 +4,28 @@ page.tags="layout","screens"
<p>Devices vary not only in physical size, but also in screen density (<acronym title="Dots per
inch">DPI</acronym>). To simplify the way you design for multiple screens, think of each device as
-falling into a particular size bucket and density bucket. The size buckets are <em>handset</em> (smaller than
-600<acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi
-screen.">dp</acronym>) and <em>tablet</em> (larger than or equal 600dp). The density buckets are <acronym
+falling into a particular size bucket and density bucket:</p>
+<ul>
+ <li>The size buckets are <em>handset</em> (smaller than
+600<acronym title="Density-independent pixels: One dp is one pixel on a 160 dpi (mdpi)
+screen.">dp</acronym>) and <em>tablet</em> (larger than or equal 600dp).</li>
+ <li>The density buckets are <acronym
title="Low density (120 dpi)">LDPI</acronym>, <acronym title="Medium density (160
-dpi)">MDPI</acronym>, <acronym title="High density (240 dpi)">HDPI</acronym>, and <acronym title
-="Extra-high density (320 dpi)">XHDPI</acronym>. Optimize your application's UI by designing
+dpi)">MDPI</acronym>, <acronym title="High density (240 dpi)">HDPI</acronym>, <acronym title
+="Extra-high density (320 dpi)">XHDPI</acronym>, and <acronym title
+="Extra-extra!-high density (480 dpi)">XXHDPI</acronym>.</li>
+</ul>
+
+<p>Optimize your application's UI by designing
alternative layouts for some of the different size buckets, and provide alternative bitmap images
for different density buckets.</p>
+<p>Because it's important that you design and implement your layouts for multiple densities,
+the guidelines below and throught the documentation
+refer to layout dimensions with <acronym title="Density-independent pixels: One dp is one pixel
+on a 160 dpi (mdpi) screen.">dp</acronym> measurements instead of pixels.</p>
+
+
<div class="layout-content-row">
<div class="layout-content-col span-8">
@@ -30,6 +43,7 @@ Screen Sizes and Densities Device Dashboard</a>.</p>
</div>
</div>
+
<h2 id="48dp-rhythm">48dp Rhythm</h2>
<p>Touchable UI components are generally laid out along 48dp units.</p>
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java
index b89d0425353d..deccac1aa01a 100644
--- a/graphics/java/android/graphics/BitmapFactory.java
+++ b/graphics/java/android/graphics/BitmapFactory.java
@@ -50,29 +50,30 @@ public class BitmapFactory {
* reuse this bitmap when loading content. If the decode operation cannot
* use this bitmap, the decode method will return <code>null</code> and
* will throw an IllegalArgumentException. The current implementation
- * necessitates that the reused bitmap be mutable and of a size that is
- * equal to or larger than the source content. The source content must be
- * in jpeg or png format (whether as a resource or as a stream). The
- * {@link android.graphics.Bitmap.Config configuration} of the reused
- * bitmap will override the setting of {@link #inPreferredConfig}, if set.
- * The reused bitmap will continue to remain mutable even when decoding a
+ * necessitates that the reused bitmap be mutable, and the resulting
+ * reused bitmap will continue to remain mutable even when decoding a
* resource which would normally result in an immutable bitmap.
*
- * <p>As of {@link android.os.Build.VERSION_CODES#KEY_LIME_PIE}, the reused
- * bitmap can be used to decode any other bitmaps as long as the resulting
+ * <p>As of {@link android.os.Build.VERSION_CODES#KEY_LIME_PIE}, any mutable
+ * bitmap can be reused to decode any other bitmaps as long as the resulting
* {@link Bitmap#getByteCount() byte count} of the decoded bitmap is less
* than or equal to the {@link Bitmap#getAllocationByteCount() allocated byte count}
* of the reused bitmap. This can be because the intrinsic size is smaller,
- * or the sampled size is smaller. Prior to
- * {@link android.os.Build.VERSION_CODES#KEY_LIME_PIE}, only equal sized
- * bitmaps are supported, with {@link #inSampleSize} set to 1.
+ * or the size after density / sampled size scaling is smaller.
+ *
+ * <p>Prior to {@link android.os.Build.VERSION_CODES#KEY_LIME_PIE} additional
+ * constraints apply: The image being decoded (whether as a resource or
+ * as a stream) must be in jpeg or png format. Only equal sized bitmaps
+ * are supported, with {@link #inSampleSize} set to 1. Additionally, the
+ * {@link android.graphics.Bitmap.Config configuration} of the reused
+ * bitmap will override the setting of {@link #inPreferredConfig}, if set.
*
* <p>You should still always use the returned Bitmap of the decode
* method and not assume that reusing the bitmap worked, due to the
* constraints outlined above and failure situations that can occur.
* Checking whether the return value matches the value of the inBitmap
- * set in the Options structure is a way to see if the bitmap was reused,
- * but in all cases you should use the returned Bitmap to make sure
+ * set in the Options structure will indicate if the bitmap was reused,
+ * but in all cases you should use the Bitmap returned by the decoding function to ensure
* that you are using the bitmap that was used as the decode destination.</p>
*/
public Bitmap inBitmap;
@@ -440,6 +441,7 @@ public class BitmapFactory {
if (bm == null && opts != null && opts.inBitmap != null) {
throw new IllegalArgumentException("Problem decoding into existing bitmap");
}
+ setDensityFromOptions(bm, opts);
return bm;
}
@@ -457,6 +459,31 @@ public class BitmapFactory {
}
/**
+ * Set the newly decoded bitmap's density based on the Options.
+ */
+ private static void setDensityFromOptions(Bitmap outputBitmap, Options opts) {
+ if (outputBitmap == null || opts == null) return;
+
+ final int density = opts.inDensity;
+ if (density != 0) {
+ outputBitmap.setDensity(density);
+ final int targetDensity = opts.inTargetDensity;
+ if (targetDensity == 0 || density == targetDensity || density == opts.inScreenDensity) {
+ return;
+ }
+
+ byte[] np = outputBitmap.getNinePatchChunk();
+ final boolean isNinePatch = np != null && NinePatch.isNinePatchChunk(np);
+ if (opts.inScaled || isNinePatch) {
+ outputBitmap.setDensity(targetDensity);
+ }
+ } else if (opts.inBitmap != null) {
+ // bitmap was reused, ensure density is reset
+ outputBitmap.setDensity(Bitmap.getDefaultDensity());
+ }
+ }
+
+ /**
* Decode an input stream into a bitmap. If the input stream is null, or
* cannot be used to decode a bitmap, the function returns null.
* The stream's position will be where ever it was after the encoded data
@@ -497,25 +524,7 @@ public class BitmapFactory {
if (is instanceof AssetManager.AssetInputStream) {
final int asset = ((AssetManager.AssetInputStream) is).getAssetInt();
-
- if (opts == null || (opts.inScaled && opts.inBitmap == null)) {
- float scale = 1.0f;
- int targetDensity = 0;
- if (opts != null) {
- final int density = opts.inDensity;
- targetDensity = opts.inTargetDensity;
- if (density != 0 && targetDensity != 0) {
- scale = targetDensity / (float) density;
- }
- }
-
- bm = nativeDecodeAsset(asset, outPadding, opts, true, scale);
- if (bm != null && targetDensity != 0) bm.setDensity(targetDensity);
-
- finish = false;
- } else {
- bm = nativeDecodeAsset(asset, outPadding, opts);
- }
+ bm = nativeDecodeAsset(asset, outPadding, opts);
} else {
// pass some temp storage down to the native code. 1024 is made up,
// but should be large enough to avoid too many small calls back
@@ -523,82 +532,18 @@ public class BitmapFactory {
// to mark(...) above.
byte [] tempStorage = null;
if (opts != null) tempStorage = opts.inTempStorage;
- if (tempStorage == null) tempStorage = new byte[16 * 1024];
-
- if (opts == null || (opts.inScaled && opts.inBitmap == null)) {
- float scale = 1.0f;
- int targetDensity = 0;
- if (opts != null) {
- final int density = opts.inDensity;
- targetDensity = opts.inTargetDensity;
- if (density != 0 && targetDensity != 0) {
- scale = targetDensity / (float) density;
- }
- }
-
- bm = nativeDecodeStream(is, tempStorage, outPadding, opts, true, scale);
- if (bm != null && targetDensity != 0) bm.setDensity(targetDensity);
-
- finish = false;
- } else {
- bm = nativeDecodeStream(is, tempStorage, outPadding, opts);
- }
+ if (tempStorage == null) tempStorage = new byte[DECODE_BUFFER_SIZE];
+ bm = nativeDecodeStream(is, tempStorage, outPadding, opts);
}
if (bm == null && opts != null && opts.inBitmap != null) {
throw new IllegalArgumentException("Problem decoding into existing bitmap");
}
- return finish ? finishDecode(bm, outPadding, opts) : bm;
- }
-
- // TODO: remove this path, implement any needed functionality in native decode
- private static Bitmap finishDecode(Bitmap bm, Rect outPadding, Options opts) {
- if (bm == null || opts == null) {
- return bm;
- }
-
- final int density = opts.inDensity;
- if (density == 0) {
- return bm;
- }
-
- bm.setDensity(density);
- final int targetDensity = opts.inTargetDensity;
- if (targetDensity == 0 || density == targetDensity || density == opts.inScreenDensity) {
- return bm;
- }
- byte[] np = bm.getNinePatchChunk();
- int[] lb = bm.getLayoutBounds();
- final boolean isNinePatch = np != null && NinePatch.isNinePatchChunk(np);
- if (opts.inScaled || isNinePatch) {
- float scale = targetDensity / (float) density;
- if (scale != 1.0f) {
- final Bitmap oldBitmap = bm;
- bm = Bitmap.createScaledBitmap(oldBitmap,
- Math.max(1, (int) (bm.getWidth() * scale + 0.5f)),
- Math.max(1, (int) (bm.getHeight() * scale + 0.5f)), true);
- if (bm != oldBitmap) oldBitmap.recycle();
-
- if (isNinePatch) {
- np = nativeScaleNinePatch(np, scale, outPadding);
- bm.setNinePatchChunk(np);
- }
- if (lb != null) {
- int[] newLb = new int[lb.length];
- for (int i=0; i<lb.length; i++) {
- newLb[i] = (int)((lb[i]*scale)+.5f);
- }
- bm.setLayoutBounds(newLb);
- }
- }
-
- bm.setDensity(targetDensity);
- }
-
+ setDensityFromOptions(bm, opts);
return bm;
}
-
+
/**
* Decode an input stream into a bitmap. If the input stream is null, or
* cannot be used to decode a bitmap, the function returns null.
@@ -633,7 +578,7 @@ public class BitmapFactory {
if (bm == null && opts != null && opts.inBitmap != null) {
throw new IllegalArgumentException("Problem decoding into existing bitmap");
}
- return finishDecode(bm, outPadding, opts);
+ return bm;
} else {
FileInputStream fis = new FileInputStream(fd);
try {
@@ -660,8 +605,6 @@ public class BitmapFactory {
private static native Bitmap nativeDecodeStream(InputStream is, byte[] storage,
Rect padding, Options opts);
- private static native Bitmap nativeDecodeStream(InputStream is, byte[] storage,
- Rect padding, Options opts, boolean applyScale, float scale);
private static native Bitmap nativeDecodeFileDescriptor(FileDescriptor fd,
Rect padding, Options opts);
private static native Bitmap nativeDecodeAsset(int asset, Rect padding, Options opts);
diff --git a/packages/SystemUI/assets/fonts/AndroidClock.ttf b/packages/SystemUI/assets/fonts/AndroidClock.ttf
deleted file mode 100644
index 7b550eeda2d8..000000000000
--- a/packages/SystemUI/assets/fonts/AndroidClock.ttf
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/assets/fonts/AndroidClock2.ttf b/packages/SystemUI/assets/fonts/AndroidClock2.ttf
deleted file mode 100644
index a95d5482840c..000000000000
--- a/packages/SystemUI/assets/fonts/AndroidClock2.ttf
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/proguard.flags b/packages/SystemUI/proguard.flags
index c886eea1fb64..ab45d99dc857 100644
--- a/packages/SystemUI/proguard.flags
+++ b/packages/SystemUI/proguard.flags
@@ -1,10 +1,3 @@
--keep class com.android.systemui.statusbar.tablet.TabletStatusBarService {
- public void notificationIconsClicked(android.view.View);
- public void systemInfoClicked(android.view.View);
- public void recentButtonClicked(android.view.View);
- public void toggleLightsOut(android.view.View);
-}
-
-keep class com.android.systemui.statusbar.policy.KeyButtonView {
public float getDrawingAlpha();
public float getGlowAlpha();
diff --git a/packages/SystemUI/res/layout/universe.xml b/packages/SystemUI/res/layout/universe.xml
deleted file mode 100644
index 390c46764c34..000000000000
--- a/packages/SystemUI/res/layout/universe.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 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.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent" android:layout_height="match_parent">
- <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:layout_centerHorizontal="true" android:layout_alignParentTop="true"
- android:src="@drawable/bugdroid" android:scaleType="center" />
-
- <Button android:id="@+id/close"
- android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:layout_alignParentTop="true" android:layout_alignParentEnd="true"
- android:text="@string/close_universe" />
-
- <TextView android:id="@+id/title"
- android:layout_width="match_parent" android:layout_height="wrap_content"
- android:layout_below="@id/close" android:layout_centerHorizontal="true"
- android:paddingBottom="16dp"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:gravity="center" />
-
- <ImageView android:id="@+id/bottom"
- android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:layout_below="@id/title" android:layout_centerHorizontal="true"
- android:layout_marginTop="16dp" />
-</RelativeLayout>
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index 0ca5f9826eed..3cc52f359743 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Ligging deur GPS gestel"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Verwyder alle kennisgewings."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Programinligting"</string>
- <string name="close_universe" msgid="3736513750241754348">"Maak toe"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Kennisgewings af"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Tik hier om kennisgewings weer aan te skakel."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Die skerm sal outomaties draai."</string>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index 4308ec3cc7e8..326f478e238d 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"በ GPS የተዘጋጀ ሥፍራ"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"ሁሉንም ማሳወቂያዎች አጽዳ"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"የመተግበሪያ መረጃ"</string>
- <string name="close_universe" msgid="3736513750241754348">"ዝጋ"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"ማሳወቂያዎች ጠፍተዋል"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"ማስታወቅያዎችን መልሶ ለማብራት እዚህ ጋር መታ አድርግ።"</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"ማያ ገጽ በራስ ሰር ይዞራል።"</string>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index 1f0c75717bfd..6609e37a3d56 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"تم تعيين الموقع بواسطة GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"محو جميع الإشعارات."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"معلومات التطبيق"</string>
- <string name="close_universe" msgid="3736513750241754348">"إغلاق"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"التنبيهات معطّلة"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"انقر هنا لإعادة تشغيل الإشعارات."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"سيتم تدوير الشاشة تلقائيًا."</string>
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index b45ddb6624d3..5367d0346feb 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Месца задана праз GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Выдалiць усе апавяшчэннi."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Інфармацыя пра прыкладанне"</string>
- <string name="close_universe" msgid="3736513750241754348">"Закрыць"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Паведамленні адключаны"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Націсніце тут, каб зноў уключыць апавяшчэнні."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Экран паварочваецца аўтаматычна."</string>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index c161fbd834fa..06321af5a465 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Местоположението е зададено от GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Изчистване на всички известия."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Информация за приложението"</string>
- <string name="close_universe" msgid="3736513750241754348">"Затваряне"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Известията са изключени"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Докоснете тук, за да включите отново известията."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Екранът ще се завърта автоматично."</string>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 5cf131df69bf..0801f69cabef 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"S\'ha establert la ubicació per GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Esborra totes les notificacions."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informació de l\'aplicació"</string>
- <string name="close_universe" msgid="3736513750241754348">"Tanca"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Notificacions desactivades"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Pica aquí per tornar a activar les notificacions."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"La pantalla girarà automàticament."</string>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index 0f03db1142e6..ca7cac038f40 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Poloha nastavena pomocí systému GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Vymazat všechna oznámení."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informace o aplikaci"</string>
- <string name="close_universe" msgid="3736513750241754348">"Zavřít"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Oznámení jsou vypnuta"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Chcete-li oznámení znovu zapnout, klepněte sem."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Obrazovka se automaticky otočí."</string>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index b6a92a6100be..a37a8f642ef3 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Placeringen er angivet ved hjælp af GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Ryd alle meddelelser."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Oplysninger om appen"</string>
- <string name="close_universe" msgid="3736513750241754348">"Luk"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Underretninger slået fra"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Tryk her for at slå underretninger til igen."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Skærmen roterer automatisk."</string>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 3a3c4515d805..a6104ba39b31 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Standort durch GPS festgelegt"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Alle Benachrichtigungen löschen"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"App-Details"</string>
- <string name="close_universe" msgid="3736513750241754348">"Schließen"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Benachrichtigungen aus"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Tippen Sie hier, um die Benachrichtigungen wieder zu aktivieren."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Bildschirm wird automatisch gedreht."</string>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index befd927287f3..9c6a513b4c33 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Ρύθμιση τοποθεσίας με GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Εκκαθάριση όλων των ειδοποιήσεων."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Πληροφορίες εφαρμογής"</string>
- <string name="close_universe" msgid="3736513750241754348">"Κλείσιμο"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Ειδοποιήσεις ανενεργές"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Πατήστε εδώ για να ενεργοποιήσετε ξανά τις ειδοποιήσεις."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Θα γίνεται αυτόματη περιστροφή της οθόνης."</string>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 1427c87c7e22..6ef894d688a8 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Location set by GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Clear all notifications."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"App info"</string>
- <string name="close_universe" msgid="3736513750241754348">"Close"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Notifications off"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Tap here to turn notifications back on."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Screen will rotate automatically."</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 21c6e7505086..3b36e135ab12 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"La ubicación se estableció por GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Eliminar todas las notificaciones"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Información de la aplicación"</string>
- <string name="close_universe" msgid="3736513750241754348">"Cerrar"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Notificaciones desactivadas"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Toca aquí para volver a activar las notificaciones."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"La pantalla girará automáticamente."</string>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index b2cb95271a6c..acef755779a6 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Ubicación definida por GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Borrar todas las notificaciones"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Información de la aplicación"</string>
- <string name="close_universe" msgid="3736513750241754348">"Cerrar"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Notificaciones desactivadas"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Toca aquí para volver a activar las notificaciones."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"La pantalla girará automáticamente."</string>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index e2324b56e296..f09164061ee0 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"GPS-i määratud asukoht"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Kustuta kõik teatised."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Rakenduse teave"</string>
- <string name="close_universe" msgid="3736513750241754348">"Sule"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Teatised väljas"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Teatiste uuesti sisselülitamiseks puudutage siin."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Ekraani pööramine toimub automaatselt."</string>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index a3eb06bb9cc0..5abcc056f569 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"مکان تنظیم شده توسط GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"پاک کردن تمام اعلان‌ها"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"اطلاعات برنامه"</string>
- <string name="close_universe" msgid="3736513750241754348">"بستن"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"اعلان‌ها خاموش"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"برای روشن کردن مجدد اعلان‌ها، اینجا را ضربه بزنید."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"صفحه به صورت خودکار می‌چرخد."</string>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index c9759708a134..26a355e5bc39 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Sijainti määritetty GPS:n avulla"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Tyhjennä kaikki ilmoitukset."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Sovelluksen tiedot"</string>
- <string name="close_universe" msgid="3736513750241754348">"Sulje"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Ilmoitukset pois käytöstä"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Ota ilmoitukset uudelleen käyttöön napauttamalla tätä."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Ruutu kääntyy automaattisesti."</string>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index 3b7f798ccd53..4fd43d6e0915 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Position définie par GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Supprimer toutes les notifications"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informations sur l\'application"</string>
- <string name="close_universe" msgid="3736513750241754348">"Fermer"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Notifications désactivées"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Appuyez ici pour réactiver les notifications."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"L\'écran pivote automatiquement."</string>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 05fffc364f51..ed9654f16202 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"GPS द्वारा सेट किया गया स्‍थान"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"सभी सूचनाएं साफ़ करें."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"एप्‍लिकेशन जानकारी"</string>
- <string name="close_universe" msgid="3736513750241754348">"बंद करें"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"सूचनाएं बंद"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"सूचनाओं को पुन: चालू करने के लिए यहां टैप करें."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"स्‍क्रीन स्‍वचालित रूप से घूमेगी."</string>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index 0f7f92fa636d..777c048cb39a 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Lokaciju utvrdio GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Brisanje svih obavijesti."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informacije o aplikaciji"</string>
- <string name="close_universe" msgid="3736513750241754348">"Zatvori"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Obavijesti isključene"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Dotaknite ovdje da biste ponovo uključili obavijesti."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Zaslon će se automatski zakrenuti."</string>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index 82b3ddd85e37..b3540249caa2 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"A GPS beállította a helyet"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Minden értesítés törlése"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Alkalmazásinformáció"</string>
- <string name="close_universe" msgid="3736513750241754348">"Bezárás"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Értesítések kikapcsolva"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Itt érintse meg az értesítések bekapcsolásához."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"A képernyő automatikusan forogni fog."</string>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index d9597da1839e..68d37961a0c1 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Lokasi yang disetel oleh GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Menghapus semua pemberitahuan."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Info aplikasi"</string>
- <string name="close_universe" msgid="3736513750241754348">"Tutup"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Pemberitahuan mati"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Ketuk di sini untuk menyalakan pemberitahuan lagi."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Layar akan diputar secara otomatis."</string>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 6ef9a8e13922..398650e9d8d5 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Posizione stabilita dal GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Cancella tutte le notifiche."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informazioni applicazione"</string>
- <string name="close_universe" msgid="3736513750241754348">"Chiudi"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Notifiche disattivate"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Tocca qui per riattivare le notifiche."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Lo schermo ruoterà automaticamente."</string>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index 8a3f15508c7f..96f8a4a7c450 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"מיקום מוגדר על ידי GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"נקה את כל ההתראות."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"פרטי יישום"</string>
- <string name="close_universe" msgid="3736513750241754348">"סגור"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"מצב התראות כבוי"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"הקש כאן כדי להפעיל מחדש את ההתראות."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"המסך יסתובב באופן אוטומטי."</string>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index 95f24fdd29d3..eff450d1e65a 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"GPSにより現在地が設定されました"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"通知をすべて消去。"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"アプリ情報"</string>
- <string name="close_universe" msgid="3736513750241754348">"閉じる"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"通知OFF"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"通知を再度ONにするにはここをタップします。"</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"画面は自動的に回転します。"</string>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index dc82a01a467d..0bcc626aca21 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"GPS에서 위치 설정"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"모든 알림 지우기"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"앱 정보"</string>
- <string name="close_universe" msgid="3736513750241754348">"닫기"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"알림 사용 안함"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"알림을 다시 사용하려면 여기를 터치하세요."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"화면이 자동으로 회전됩니다."</string>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index b2c5d2c1ccb5..03de3c53a323 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"GPS nustatyta vieta"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Išvalyti visus pranešimus."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Programos informacija"</string>
- <string name="close_universe" msgid="3736513750241754348">"Uždaryti"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Pranešimai išjungti"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Jei norite vėl įjungti pranešimus, palieskite čia."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Ekranas bus sukamas automatiškai."</string>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index 41d1158f795c..2f4e9c290d7f 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"GPS iestatītā atrašanās vieta"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Notīrīt visus paziņojumus"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informācija par lietotni"</string>
- <string name="close_universe" msgid="3736513750241754348">"Aizvērt"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Paziņojumi ir izslēgti"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Pieskarieties šeit, lai atkal ieslēgtu paziņojumus."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Ekrāns tiks pagriezts automātiski."</string>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index cabd7b55ad2e..1e4f98ea8e83 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Lokasi ditetapkan oleh GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Padamkan semua pemberitahuan."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Maklumat apl"</string>
- <string name="close_universe" msgid="3736513750241754348">"Tutup"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Pemberitahuan dimatikan"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Ketik di sini untuk menghidupkan kembali pemberitahuan."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Skrin akan berputar secara automatik."</string>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index 31953c30b924..e0df440ab9b2 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Posisjon angitt av GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Fjern alle varslinger."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Info om app"</string>
- <string name="close_universe" msgid="3736513750241754348">"Lukk"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Varsler er deaktivert"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Trykk her for å aktivere varsler på nytt."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Skjermen roterer automatisk."</string>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index 6661bfa9d351..9457da2e4cc6 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Locatie bepaald met GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Alle meldingen wissen."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"App-info"</string>
- <string name="close_universe" msgid="3736513750241754348">"Sluiten"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Meldingen uit"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Tik hier om meldingen weer in te schakelen."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Scherm wordt automatisch geroteerd."</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index c97372d5ad76..947bd4ee6988 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Lokalizacja z GPSa"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Usuń wszystkie powiadomienia."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"O aplikacji"</string>
- <string name="close_universe" msgid="3736513750241754348">"Zamknij"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Powiadomienia wyłączone"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Kliknij tutaj, by przywrócić powiadomienia."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Ekran zostanie obrócony automatycznie."</string>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index eba6c18d45ee..f54034d40c82 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Localização definida por GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Limpar todas as notificações."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informações da aplicação"</string>
- <string name="close_universe" msgid="3736513750241754348">"Fechar"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Notificações desativadas"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Toque aqui para voltar a ativar as notificações."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"O ecrã será rodado automaticamente."</string>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index 93b0e2dc9f8a..4ee6554fe5df 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Local definido por GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Limpar todas as notificações."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informações do aplicativo"</string>
- <string name="close_universe" msgid="3736513750241754348">"Fechar"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Notificações desativadas"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Toque aqui para ativar as notificações novamente."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"A tela girará automaticamente."</string>
diff --git a/packages/SystemUI/res/values-rm/strings.xml b/packages/SystemUI/res/values-rm/strings.xml
index 948b95917736..1265b64ba682 100644
--- a/packages/SystemUI/res/values-rm/strings.xml
+++ b/packages/SystemUI/res/values-rm/strings.xml
@@ -304,8 +304,6 @@
<skip />
<!-- no translation found for status_bar_notification_inspect_item_title (1163547729015390250) -->
<skip />
- <!-- no translation found for close_universe (3736513750241754348) -->
- <skip />
<!-- no translation found for notifications_off_title (8936620513608443224) -->
<skip />
<!-- no translation found for notifications_off_text (2529001315769385273) -->
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index 7faa2e4869ff..97d81e82cdea 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Locaţie setată prin GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Ștergeţi toate notificările."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informaţii despre aplicaţie"</string>
- <string name="close_universe" msgid="3736513750241754348">"Închideţi"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Notificările sunt dezactivate"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Apăsaţi aici pentru a reactiva notificările."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Ecranul se va roti în mod automat."</string>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index 2ca195ac2f63..b26ef9d3ea96 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Координаты по GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Удалить все уведомления"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"О приложении"</string>
- <string name="close_universe" msgid="3736513750241754348">"Закрыть"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Уведомления отключены"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Нажмите здесь, чтобы снова включить уведомления."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Экран будет поворачиваться автоматически."</string>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index e5e1d58ec524..92ff8c9ccbb8 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Poloha nastavená pomocou GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Vymazať všetky upozornenia."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Informácie o aplikácii"</string>
- <string name="close_universe" msgid="3736513750241754348">"Zavrieť"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Upozornenia sú vypnuté"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Klepnutím sem upozornenia znova povolíte."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Obrazovka sa automaticky otočí."</string>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index 5a0f46afcb9e..4c36308b9abd 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Lokacija nastavljena z GPS-om"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Izbriši vsa obvestila."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Podatki o aplikaciji"</string>
- <string name="close_universe" msgid="3736513750241754348">"Zapri"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Obvestila so izklopljena"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Dotaknite se tukaj, da ponovno vklopite obvestila."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Zaslon se bo samodejno zasukal."</string>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index 6a209d05e9ec..00a92a9656fc 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Локацију је подесио GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Обриши сва обавештења."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Информације о апликацији"</string>
- <string name="close_universe" msgid="3736513750241754348">"Затвори"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Обавештења су искључена"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Додирните овде да бисте поново укључили обавештења."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Екран ће се аутоматски ротирати."</string>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index b1c1cf645a2a..38689e4efe21 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Platsen har identifierats av GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Ta bort alla meddelanden."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Info om appen"</string>
- <string name="close_universe" msgid="3736513750241754348">"Stäng"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Meddelanden inaktiverade"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Knacka lätt här om du vill aktivera meddelanden igen."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Skärmen roteras automatiskt."</string>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 2c8100d67903..ee6fabc68bd8 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -165,7 +165,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Mahali pamewekwa na GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Futa arifa zote."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Taarifa ya programu"</string>
- <string name="close_universe" msgid="3736513750241754348">"Funga"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Arifa zimelemazwa"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Gonga hapa ili kuwezesha tena arifa."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Skrini itazunguka kiotomatiki."</string>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index f36e07f8e1bb..e7f93ede9066 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"ตำแหน่งที่กำหนดโดย GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"ล้างการแจ้งเตือนทั้งหมด"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"ข้อมูลแอป"</string>
- <string name="close_universe" msgid="3736513750241754348">"ปิด"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"การแจ้งเตือนปิดอยู่"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"แตะที่นี่เพื่อเปิดการแจ้งเตือนอีกครั้ง"</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"หน้าจอจะหมุนโดยอัตโนมัติ"</string>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index 68b7896adc82..4579b4321078 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Lokasyong itinatakda ng GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"I-clear ang lahat ng notification."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Impormasyon ng app"</string>
- <string name="close_universe" msgid="3736513750241754348">"Isara"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Naka-off ang mga notification"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Tumapik dito upang muling i-on ang mga notification."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Awtomatikong iikot ang screen."</string>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index 0017a9e76194..9bccbb903a45 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Konum GPS ile belirlendi"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Tüm bildirimleri temizle"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Uygulama bilgileri"</string>
- <string name="close_universe" msgid="3736513750241754348">"Kapat"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Bildirimler kapalı"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Bildirimleri tekrar açmak için buraya hafifçe vurun."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Ekran otomatik olarak dönecektir."</string>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index a9b0fe7dfe32..1df9c28bae62 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Місцезнаходження встановлено за допомогою GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Очистити всі сповіщення."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Інформація про програму"</string>
- <string name="close_universe" msgid="3736513750241754348">"Закрити"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Сповіщення вимкнено"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Торкніться тут, щоб знову ввімкнути сповіщення."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Екран обертатиметься автоматично."</string>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 38f6036184f8..f37fa47162e4 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Vị trí đặt bởi GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Xóa tất cả thông báo."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Thông tin về ứng dụng"</string>
- <string name="close_universe" msgid="3736513750241754348">"Đóng"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Tắt thông báo"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Chạm vào đây để bật lại thông báo."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Màn hình sẽ xoay tự động."</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 18814c7cc4e0..57c93cc6e46f 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"已通过 GPS 确定位置"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"清除所有通知。"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"应用信息"</string>
- <string name="close_universe" msgid="3736513750241754348">"关闭"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"通知功能已停用"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"点按此处可重新启用通知功能。"</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"屏幕会自动旋转。"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index af3e4693a0d7..d57e82e1c739 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -169,7 +169,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"GPS 已定位"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"清除所有通知。"</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"應用程式資訊"</string>
- <string name="close_universe" msgid="3736513750241754348">"關閉"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"關閉通知"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"輕按這裡即可重新開啟通知。"</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"螢幕會自動旋轉。"</string>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index af790a3b86ed..710225d043ea 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -167,7 +167,6 @@
<string name="gps_notification_found_text" msgid="4619274244146446464">"Indawo ihlelwe i-GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Susa zonke izaziso."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"Ulwazi lohlelo lokusebenza"</string>
- <string name="close_universe" msgid="3736513750241754348">"Vala"</string>
<string name="notifications_off_title" msgid="8936620513608443224">"Izaziso zivaliwe"</string>
<string name="notifications_off_text" msgid="2529001315769385273">"Thepha lapha ukuvula futhi izaziso."</string>
<string name="accessibility_rotation_lock_off" msgid="4062780228931590069">"Isikrini sizophenduka ngokuzenzakalela."</string>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index d003a097cf8c..5e232f3ddfc8 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -433,9 +433,6 @@
application -->
<string name="status_bar_notification_inspect_item_title">App info</string>
- <!-- [CHAR LIMIT=NONE] -->
- <string name="close_universe">Close</string>
-
<!-- Title for the pseudo-notification shown when notifications are disabled (do-not-disturb
mode) -->
<string name="notifications_off_title">Notifications off</string>
diff --git a/packages/SystemUI/src/com/android/systemui/BootReceiver.java b/packages/SystemUI/src/com/android/systemui/BootReceiver.java
index d3ce30dcf4f0..8e24eebd10cc 100644
--- a/packages/SystemUI/src/com/android/systemui/BootReceiver.java
+++ b/packages/SystemUI/src/com/android/systemui/BootReceiver.java
@@ -21,7 +21,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
-import android.util.Slog;
+import android.util.Log;
/**
* Performs a number of miscellaneous, non-system-critical actions
@@ -40,7 +40,7 @@ public class BootReceiver extends BroadcastReceiver {
context.startService(loadavg);
}
} catch (Exception e) {
- Slog.e(TAG, "Can't start load average service", e);
+ Log.e(TAG, "Can't start load average service", e);
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
index edfaf493ce4e..0019c1b394b6 100644
--- a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
@@ -23,7 +23,7 @@ import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.os.Vibrator;
-import android.util.Slog;
+import android.util.Log;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
@@ -113,7 +113,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
= new ScaleGestureDetector.SimpleOnScaleGestureListener() {
@Override
public boolean onScaleBegin(ScaleGestureDetector detector) {
- if (DEBUG_SCALE) Slog.v(TAG, "onscalebegin()");
+ if (DEBUG_SCALE) Log.v(TAG, "onscalebegin()");
float focusX = detector.getFocusX();
float focusY = detector.getFocusY();
@@ -126,7 +126,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
@Override
public boolean onScale(ScaleGestureDetector detector) {
- if (DEBUG_SCALE) Slog.v(TAG, "onscale() on " + mCurrView);
+ if (DEBUG_SCALE) Log.v(TAG, "onscale() on " + mCurrView);
return true;
}
@@ -143,7 +143,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
mView = v;
}
public void setHeight(float h) {
- if (DEBUG_SCALE) Slog.v(TAG, "SetHeight: setting to " + h);
+ if (DEBUG_SCALE) Log.v(TAG, "SetHeight: setting to " + h);
ViewGroup.LayoutParams lp = mView.getLayoutParams();
lp.height = (int)h;
mView.setLayoutParams(lp);
@@ -158,7 +158,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
}
public int getNaturalHeight(int maximum) {
ViewGroup.LayoutParams lp = mView.getLayoutParams();
- if (DEBUG_SCALE) Slog.v(TAG, "Inspecting a child of type: " +
+ if (DEBUG_SCALE) Log.v(TAG, "Inspecting a child of type: " +
mView.getClass().getName());
int oldHeight = lp.height;
lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
@@ -230,7 +230,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
}
private void updateExpansion() {
- if (DEBUG_SCALE) Slog.v(TAG, "updateExpansion()");
+ if (DEBUG_SCALE) Log.v(TAG, "updateExpansion()");
// are we scaling or dragging?
float span = mSGD.getCurrentSpan() - mInitialTouchSpan;
span *= USE_SPAN ? 1f : 0f;
@@ -270,10 +270,10 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
}
private boolean isInside(View v, float x, float y) {
- if (DEBUG) Slog.d(TAG, "isinside (" + x + ", " + y + ")");
+ if (DEBUG) Log.d(TAG, "isinside (" + x + ", " + y + ")");
if (v == null) {
- if (DEBUG) Slog.d(TAG, "isinside null subject");
+ if (DEBUG) Log.d(TAG, "isinside null subject");
return false;
}
if (mEventSource != null) {
@@ -281,14 +281,14 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
mEventSource.getLocationOnScreen(location);
x += location[0];
y += location[1];
- if (DEBUG) Slog.d(TAG, " to global (" + x + ", " + y + ")");
+ if (DEBUG) Log.d(TAG, " to global (" + x + ", " + y + ")");
}
int[] location = new int[2];
v.getLocationOnScreen(location);
x -= location[0];
y -= location[1];
- if (DEBUG) Slog.d(TAG, " to local (" + x + ", " + y + ")");
- if (DEBUG) Slog.d(TAG, " inside (" + v.getWidth() + ", " + v.getHeight() + ")");
+ if (DEBUG) Log.d(TAG, " to local (" + x + ", " + y + ")");
+ if (DEBUG) Log.d(TAG, " inside (" + v.getWidth() + ", " + v.getHeight() + ")");
boolean inside = (x > 0f && y > 0f && x < v.getWidth() & y < v.getHeight());
return inside;
}
@@ -307,10 +307,10 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
private float calculateGlow(float target, float actual) {
// glow if overscale
- if (DEBUG_GLOW) Slog.d(TAG, "target: " + target + " actual: " + actual);
+ if (DEBUG_GLOW) Log.d(TAG, "target: " + target + " actual: " + actual);
float stretch = Math.abs((target - actual) / mMaximumStretch);
float strength = 1f / (1f + (float) Math.pow(Math.E, -1 * ((8f * stretch) - 5f)));
- if (DEBUG_GLOW) Slog.d(TAG, "stretch: " + stretch + " strength: " + strength);
+ if (DEBUG_GLOW) Log.d(TAG, "stretch: " + stretch + " strength: " + strength);
return (GLOW_BASE + strength * (1f - GLOW_BASE));
}
@@ -348,7 +348,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
final int action = ev.getAction();
- if (DEBUG_SCALE) Slog.d(TAG, "intercept: act=" + MotionEvent.actionToString(action) +
+ if (DEBUG_SCALE) Log.d(TAG, "intercept: act=" + MotionEvent.actionToString(action) +
" expanding=" + mExpanding +
(0 != (mExpansionStyle & BLINDS) ? " (blinds)" : "") +
(0 != (mExpansionStyle & PULL) ? " (pull)" : "") +
@@ -362,7 +362,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
mInitialTouchSpan = mSGD.getCurrentSpan();
mLastFocusY = mInitialTouchFocusY;
mLastSpanY = mInitialTouchSpan;
- if (DEBUG_SCALE) Slog.d(TAG, "set initial span: " + mInitialTouchSpan);
+ if (DEBUG_SCALE) Log.d(TAG, "set initial span: " + mInitialTouchSpan);
if (mExpanding) {
return true;
@@ -376,7 +376,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
xspan > mPullGestureMinXSpan &&
xspan > mSGD.getCurrentSpanY())) {
// detect a vertical pulling gesture with fingers somewhat separated
- if (DEBUG_SCALE) Slog.v(TAG, "got pull gesture (xspan=" + xspan + "px)");
+ if (DEBUG_SCALE) Log.v(TAG, "got pull gesture (xspan=" + xspan + "px)");
final View underFocus = findView(x, y);
if (underFocus != null) {
@@ -393,7 +393,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
if (mWatchingForPull) {
final int yDiff = y - mLastMotionY;
if (yDiff > mTouchSlop) {
- if (DEBUG) Slog.v(TAG, "got venetian gesture (dy=" + yDiff + "px)");
+ if (DEBUG) Log.v(TAG, "got venetian gesture (dy=" + yDiff + "px)");
mLastMotionY = y;
final View underFocus = findView(x, y);
if (underFocus != null) {
@@ -413,7 +413,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
- if (DEBUG) Slog.d(TAG, "up/cancel");
+ if (DEBUG) Log.d(TAG, "up/cancel");
finishExpanding(false);
clearView();
break;
@@ -425,7 +425,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
@Override
public boolean onTouchEvent(MotionEvent ev) {
final int action = ev.getActionMasked();
- if (DEBUG_SCALE) Slog.d(TAG, "touch: act=" + MotionEvent.actionToString(action) +
+ if (DEBUG_SCALE) Log.d(TAG, "touch: act=" + MotionEvent.actionToString(action) +
" expanding=" + mExpanding +
(0 != (mExpansionStyle & BLINDS) ? " (blinds)" : "") +
(0 != (mExpansionStyle & PULL) ? " (pull)" : "") +
@@ -484,14 +484,14 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
case MotionEvent.ACTION_POINTER_UP:
case MotionEvent.ACTION_POINTER_DOWN:
- if (DEBUG) Slog.d(TAG, "pointer change");
+ if (DEBUG) Log.d(TAG, "pointer change");
mInitialTouchY += mSGD.getFocusY() - mLastFocusY;
mInitialTouchSpan += mSGD.getCurrentSpan() - mLastSpanY;
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
- if (DEBUG) Slog.d(TAG, "up/cancel");
+ if (DEBUG) Log.d(TAG, "up/cancel");
finishExpanding(false);
clearView();
break;
@@ -505,20 +505,20 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
return;
}
mExpanding = true;
- if (DEBUG) Slog.d(TAG, "scale type " + expandType + " beginning on view: " + v);
+ if (DEBUG) Log.d(TAG, "scale type " + expandType + " beginning on view: " + v);
mCallback.setUserLockedChild(v, true);
setView(v);
setGlow(GLOW_BASE);
mScaler.setView(v);
mOldHeight = mScaler.getHeight();
if (mCallback.canChildBeExpanded(v)) {
- if (DEBUG) Slog.d(TAG, "working on an expandable child");
+ if (DEBUG) Log.d(TAG, "working on an expandable child");
mNaturalHeight = mScaler.getNaturalHeight(mLargeSize);
} else {
- if (DEBUG) Slog.d(TAG, "working on a non-expandable child");
+ if (DEBUG) Log.d(TAG, "working on a non-expandable child");
mNaturalHeight = mOldHeight;
}
- if (DEBUG) Slog.d(TAG, "got mOldHeight: " + mOldHeight +
+ if (DEBUG) Log.d(TAG, "got mOldHeight: " + mOldHeight +
" mNaturalHeight: " + mNaturalHeight);
v.getParent().requestDisallowInterceptTouchEvent(true);
}
@@ -526,7 +526,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
private void finishExpanding(boolean force) {
if (!mExpanding) return;
- if (DEBUG) Slog.d(TAG, "scale in finishing on view: " + mCurrView);
+ if (DEBUG) Log.d(TAG, "scale in finishing on view: " + mCurrView);
float currentHeight = mScaler.getHeight();
float targetHeight = mSmallSize;
@@ -552,11 +552,11 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
mExpanding = false;
mExpansionStyle = NONE;
- if (DEBUG) Slog.d(TAG, "wasClosed is: " + wasClosed);
- if (DEBUG) Slog.d(TAG, "currentHeight is: " + currentHeight);
- if (DEBUG) Slog.d(TAG, "mSmallSize is: " + mSmallSize);
- if (DEBUG) Slog.d(TAG, "targetHeight is: " + targetHeight);
- if (DEBUG) Slog.d(TAG, "scale was finished on view: " + mCurrView);
+ if (DEBUG) Log.d(TAG, "wasClosed is: " + wasClosed);
+ if (DEBUG) Log.d(TAG, "currentHeight is: " + currentHeight);
+ if (DEBUG) Log.d(TAG, "mSmallSize is: " + mSmallSize);
+ if (DEBUG) Log.d(TAG, "targetHeight is: " + targetHeight);
+ if (DEBUG) Log.d(TAG, "scale was finished on view: " + mCurrView);
}
private void clearView() {
@@ -575,7 +575,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
String debugLog = "Looking for glows: " +
(mCurrViewTopGlow != null ? "found top " : "didn't find top") +
(mCurrViewBottomGlow != null ? "found bottom " : "didn't find bottom");
- Slog.v(TAG, debugLog);
+ Log.v(TAG, debugLog);
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
index 1f29990f890a..ab11748ae225 100644
--- a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
@@ -32,7 +32,7 @@ import android.os.Vibrator;
import android.provider.Settings;
import android.util.AttributeSet;
import android.util.EventLog;
-import android.util.Slog;
+import android.util.Log;
import android.view.IWindowManager;
import android.view.MotionEvent;
import android.view.View;
@@ -120,7 +120,7 @@ public class SearchPanelView extends FrameLayout implements
mContext.startActivityAsUser(intent, opts.toBundle(),
new UserHandle(UserHandle.USER_CURRENT));
} catch (ActivityNotFoundException e) {
- Slog.w(TAG, "Activity not found for " + intent.getAction());
+ Log.w(TAG, "Activity not found for " + intent.getAction());
onAnimationStarted();
}
}
@@ -186,7 +186,7 @@ public class SearchPanelView extends FrameLayout implements
if (component == null || !mGlowPadView.replaceTargetDrawablesIfPresent(component,
ASSIST_ICON_METADATA_NAME,
com.android.internal.R.drawable.ic_action_assist_generic)) {
- if (DEBUG) Slog.v(TAG, "Couldn't grab icon for component " + component);
+ if (DEBUG) Log.v(TAG, "Couldn't grab icon for component " + component);
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIService.java b/packages/SystemUI/src/com/android/systemui/SystemUIService.java
index e1aed82295b0..ebd7fa875303 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIService.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIService.java
@@ -24,7 +24,7 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.os.IBinder;
import android.os.RemoteException;
-import android.util.Slog;
+import android.util.Log;
import android.view.IWindowManager;
import android.view.WindowManagerGlobal;
@@ -70,14 +70,14 @@ public class SystemUIService extends Service {
? R.string.config_systemBarComponent
: R.string.config_statusBarComponent;
} catch (RemoteException e) {
- Slog.w(TAG, "Failing checking whether status bar can hide", e);
+ Log.w(TAG, "Failing checking whether status bar can hide", e);
}
final int N = SERVICES.length;
mServices = new SystemUI[N];
for (int i=0; i<N; i++) {
Class cl = chooseClass(SERVICES[i]);
- Slog.d(TAG, "loading: " + cl);
+ Log.d(TAG, "loading: " + cl);
try {
mServices[i] = (SystemUI)cl.newInstance();
} catch (IllegalAccessException ex) {
@@ -86,7 +86,7 @@ public class SystemUIService extends Service {
throw new RuntimeException(ex);
}
mServices[i].mContext = this;
- Slog.d(TAG, "running: " + mServices[i]);
+ Log.d(TAG, "running: " + mServices[i]);
mServices[i].start();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/UniverseBackground.java b/packages/SystemUI/src/com/android/systemui/UniverseBackground.java
deleted file mode 100644
index f859880707cc..000000000000
--- a/packages/SystemUI/src/com/android/systemui/UniverseBackground.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * Copyright (C) 2012 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 com.android.systemui;
-
-import android.app.ActivityManager;
-import android.content.Context;
-import android.content.res.Configuration;
-import android.content.res.Resources;
-import android.graphics.Matrix;
-import android.graphics.PixelFormat;
-import android.os.RemoteException;
-import android.util.Log;
-import android.util.Slog;
-import android.view.Choreographer;
-import android.view.Display;
-import android.view.IWindowSession;
-import android.view.MotionEvent;
-import android.view.VelocityTracker;
-import android.view.View;
-import android.view.ViewRootImpl;
-import android.view.WindowManager;
-import android.view.WindowManagerGlobal;
-import android.view.animation.Transformation;
-import android.widget.FrameLayout;
-
-public class UniverseBackground extends FrameLayout {
- static final String TAG = "UniverseBackground";
- static final boolean SPEW = false;
- static final boolean CHATTY = false;
-
- final IWindowSession mSession;
- final View mContent;
- final View mBottomAnchor;
-
- final Runnable mAnimationCallback = new Runnable() {
- @Override
- public void run() {
- doAnimation(mChoreographer.getFrameTimeNanos());
- }
- };
-
- // fling gesture tuning parameters, scaled to display density
- private float mSelfExpandVelocityPx; // classic value: 2000px/s
- private float mSelfCollapseVelocityPx; // classic value: 2000px/s (will be negated to collapse "up")
- private float mFlingExpandMinVelocityPx; // classic value: 200px/s
- private float mFlingCollapseMinVelocityPx; // classic value: 200px/s
- private float mCollapseMinDisplayFraction; // classic value: 0.08 (25px/min(320px,480px) on G1)
- private float mExpandMinDisplayFraction; // classic value: 0.5 (drag open halfway to expand)
- private float mFlingGestureMaxXVelocityPx; // classic value: 150px/s
-
- private float mExpandAccelPx; // classic value: 2000px/s/s
- private float mCollapseAccelPx; // classic value: 2000px/s/s (will be negated to collapse "up")
-
- static final int STATE_CLOSED = 0;
- static final int STATE_OPENING = 1;
- static final int STATE_OPEN = 2;
- private int mState = STATE_CLOSED;
-
- private float mDragStartX, mDragStartY;
- private float mAverageX, mAverageY;
-
- // position
- private int[] mPositionTmp = new int[2];
- private boolean mExpanded;
- private boolean mExpandedVisible;
-
- private boolean mTracking;
- private VelocityTracker mVelocityTracker;
-
- private Choreographer mChoreographer;
- private boolean mAnimating;
- private boolean mClosing; // only valid when mAnimating; indicates the initial acceleration
- private float mAnimY;
- private float mAnimVel;
- private float mAnimAccel;
- private long mAnimLastTimeNanos;
- private boolean mAnimatingReveal = false;
-
- private int mYDelta = 0;
- private Transformation mUniverseTransform = new Transformation();
- private final float[] mTmpFloats = new float[9];
-
- public UniverseBackground(Context context) {
- super(context);
- setBackgroundColor(0xff000000);
- mSession = WindowManagerGlobal.getWindowSession();
- mContent = View.inflate(context, R.layout.universe, null);
- addView(mContent);
- mContent.findViewById(R.id.close).setOnClickListener(new View.OnClickListener() {
- @Override public void onClick(View v) {
- animateCollapse();
- }
- });
- mBottomAnchor = mContent.findViewById(R.id.bottom);
- mChoreographer = Choreographer.getInstance();
- loadDimens();
- }
-
- @Override
- protected void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- loadDimens();
- }
-
- private void loadDimens() {
- final Resources res = getContext().getResources();
- mSelfExpandVelocityPx = res.getDimension(R.dimen.self_expand_velocity);
- mSelfCollapseVelocityPx = res.getDimension(R.dimen.self_collapse_velocity);
- mFlingExpandMinVelocityPx = res.getDimension(R.dimen.fling_expand_min_velocity);
- mFlingCollapseMinVelocityPx = res.getDimension(R.dimen.fling_collapse_min_velocity);
-
- mCollapseMinDisplayFraction = res.getFraction(R.dimen.collapse_min_display_fraction, 1, 1);
- mExpandMinDisplayFraction = res.getFraction(R.dimen.expand_min_display_fraction, 1, 1);
-
- mExpandAccelPx = res.getDimension(R.dimen.expand_accel);
- mCollapseAccelPx = res.getDimension(R.dimen.collapse_accel);
-
- mFlingGestureMaxXVelocityPx = res.getDimension(R.dimen.fling_gesture_max_x_velocity);
- }
-
- private void computeAveragePos(MotionEvent event) {
- final int num = event.getPointerCount();
- float x = 0, y = 0;
- for (int i=0; i<num; i++) {
- x += event.getX(i);
- y += event.getY(i);
- }
- mAverageX = x / num;
- mAverageY = y / num;
- }
-
- private void sendUniverseTransform() {
- if (getWindowToken() != null) {
- mUniverseTransform.getMatrix().getValues(mTmpFloats);
- try {
- mSession.setUniverseTransform(getWindowToken(), mUniverseTransform.getAlpha(),
- mTmpFloats[Matrix.MTRANS_X], mTmpFloats[Matrix.MTRANS_Y],
- mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
- mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
- } catch (RemoteException e) {
- }
- }
- }
-
- public WindowManager.LayoutParams getLayoutParams() {
- WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
- LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT,
- WindowManager.LayoutParams.TYPE_UNIVERSE_BACKGROUND,
- 0
- | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
- | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
- | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
- PixelFormat.OPAQUE);
- // this will allow the window to run in an overlay on devices that support this
- if (ActivityManager.isHighEndGfx()) {
- lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
- }
- lp.setTitle("UniverseBackground");
- lp.windowAnimations = 0;
- return lp;
- }
-
- private int getExpandedViewMaxHeight() {
- return mBottomAnchor.getTop();
- }
-
- public void animateCollapse() {
- animateCollapse(1.0f);
- }
-
- public void animateCollapse(float velocityMultiplier) {
- if (SPEW) {
- Slog.d(TAG, "animateCollapse(): mExpanded=" + mExpanded
- + " mExpandedVisible=" + mExpandedVisible
- + " mExpanded=" + mExpanded
- + " mAnimating=" + mAnimating
- + " mAnimY=" + mAnimY
- + " mAnimVel=" + mAnimVel);
- }
-
- mState = STATE_CLOSED;
- if (!mExpandedVisible) {
- return;
- }
-
- int y;
- if (mAnimating) {
- y = (int)mAnimY;
- } else {
- y = getExpandedViewMaxHeight()-1;
- }
- // Let the fling think that we're open so it goes in the right direction
- // and doesn't try to re-open the windowshade.
- mExpanded = true;
- prepareTracking(y, false);
- performFling(y, -mSelfCollapseVelocityPx*velocityMultiplier, true);
- }
-
- private void updateUniverseScale() {
- if (mYDelta > 0) {
- int w = getWidth();
- int h = getHeight();
- float scale = (h-mYDelta+.5f) / (float)h;
- mUniverseTransform.getMatrix().setScale(scale, scale, w/2, h);
- if (CHATTY) Log.i(TAG, "w=" + w + " h=" + h + " scale=" + scale
- + ": " + mUniverseTransform);
- sendUniverseTransform();
- if (getVisibility() != VISIBLE) {
- setVisibility(VISIBLE);
- }
- } else {
- if (CHATTY) Log.i(TAG, "mYDelta=" + mYDelta);
- mUniverseTransform.clear();
- sendUniverseTransform();
- if (getVisibility() == VISIBLE) {
- setVisibility(GONE);
- }
- }
- }
-
- void resetLastAnimTime() {
- mAnimLastTimeNanos = System.nanoTime();
- if (SPEW) {
- Throwable t = new Throwable();
- t.fillInStackTrace();
- Slog.d(TAG, "resetting last anim time=" + mAnimLastTimeNanos, t);
- }
- }
-
- void doAnimation(long frameTimeNanos) {
- if (mAnimating) {
- if (SPEW) Slog.d(TAG, "doAnimation dt=" + (frameTimeNanos - mAnimLastTimeNanos));
- if (SPEW) Slog.d(TAG, "doAnimation before mAnimY=" + mAnimY);
- incrementAnim(frameTimeNanos);
- if (SPEW) {
- Slog.d(TAG, "doAnimation after mAnimY=" + mAnimY);
- }
-
- if (mAnimY >= getExpandedViewMaxHeight()-1 && !mClosing) {
- if (SPEW) Slog.d(TAG, "Animation completed to expanded state.");
- mAnimating = false;
- mYDelta = getExpandedViewMaxHeight();
- updateUniverseScale();
- mExpanded = true;
- mState = STATE_OPEN;
- return;
- }
-
- if (mAnimY <= 0 && mClosing) {
- if (SPEW) Slog.d(TAG, "Animation completed to collapsed state.");
- mAnimating = false;
- mYDelta = 0;
- updateUniverseScale();
- mExpanded = false;
- mState = STATE_CLOSED;
- return;
- }
-
- mYDelta = (int)mAnimY;
- updateUniverseScale();
- mChoreographer.postCallback(Choreographer.CALLBACK_ANIMATION,
- mAnimationCallback, null);
- }
- }
-
- void stopTracking() {
- mTracking = false;
- mVelocityTracker.recycle();
- mVelocityTracker = null;
- }
-
- void incrementAnim(long frameTimeNanos) {
- final long deltaNanos = Math.max(frameTimeNanos - mAnimLastTimeNanos, 0);
- final float t = deltaNanos * 0.000000001f; // ns -> s
- final float y = mAnimY;
- final float v = mAnimVel; // px/s
- final float a = mAnimAccel; // px/s/s
- mAnimY = y + (v*t) + (0.5f*a*t*t); // px
- mAnimVel = v + (a*t); // px/s
- mAnimLastTimeNanos = frameTimeNanos; // ns
- //Slog.d(TAG, "y=" + y + " v=" + v + " a=" + a + " t=" + t + " mAnimY=" + mAnimY
- // + " mAnimAccel=" + mAnimAccel);
- }
-
- void prepareTracking(int y, boolean opening) {
- if (CHATTY) {
- Slog.d(TAG, "panel: beginning to track the user's touch, y=" + y + " opening=" + opening);
- }
-
- mTracking = true;
- mVelocityTracker = VelocityTracker.obtain();
- if (opening) {
- mAnimAccel = mExpandAccelPx;
- mAnimVel = mFlingExpandMinVelocityPx;
- mAnimY = y;
- mAnimating = true;
- mAnimatingReveal = true;
- resetLastAnimTime();
- mExpandedVisible = true;
- }
- if (mAnimating) {
- mAnimating = false;
- mChoreographer.removeCallbacks(Choreographer.CALLBACK_ANIMATION,
- mAnimationCallback, null);
- }
- }
-
- void performFling(int y, float vel, boolean always) {
- if (CHATTY) {
- Slog.d(TAG, "panel: will fling, y=" + y + " vel=" + vel);
- }
-
- mAnimatingReveal = false;
-
- mAnimY = y;
- mAnimVel = vel;
-
- //Slog.d(TAG, "starting with mAnimY=" + mAnimY + " mAnimVel=" + mAnimVel);
-
- if (mExpanded) {
- if (!always && (
- vel > mFlingCollapseMinVelocityPx
- || (y > (getExpandedViewMaxHeight()*(1f-mCollapseMinDisplayFraction)) &&
- vel > -mFlingExpandMinVelocityPx))) {
- // We are expanded, but they didn't move sufficiently to cause
- // us to retract. Animate back to the expanded position.
- mAnimAccel = mExpandAccelPx;
- if (vel < 0) {
- mAnimVel = 0;
- }
- }
- else {
- // We are expanded and are now going to animate away.
- mAnimAccel = -mCollapseAccelPx;
- if (vel > 0) {
- mAnimVel = 0;
- }
- }
- } else {
- if (always || (
- vel > mFlingExpandMinVelocityPx
- || (y > (getExpandedViewMaxHeight()*(1f-mExpandMinDisplayFraction)) &&
- vel > -mFlingCollapseMinVelocityPx))) {
- // We are collapsed, and they moved enough to allow us to
- // expand. Animate in the notifications.
- mAnimAccel = mExpandAccelPx;
- if (vel < 0) {
- mAnimVel = 0;
- }
- }
- else {
- // We are collapsed, but they didn't move sufficiently to cause
- // us to retract. Animate back to the collapsed position.
- mAnimAccel = -mCollapseAccelPx;
- if (vel > 0) {
- mAnimVel = 0;
- }
- }
- }
- //Slog.d(TAG, "mAnimY=" + mAnimY + " mAnimVel=" + mAnimVel
- // + " mAnimAccel=" + mAnimAccel);
-
- resetLastAnimTime();
- mAnimating = true;
- mClosing = mAnimAccel < 0;
- mChoreographer.removeCallbacks(Choreographer.CALLBACK_ANIMATION,
- mAnimationCallback, null);
- mChoreographer.postCallback(Choreographer.CALLBACK_ANIMATION,
- mAnimationCallback, null);
-
- stopTracking();
- }
-
- private void trackMovement(MotionEvent event) {
- mVelocityTracker.addMovement(event);
- }
-
- public boolean consumeEvent(MotionEvent event) {
- if (mState == STATE_CLOSED) {
- if (event.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) {
- // Second finger down, time to start opening!
- computeAveragePos(event);
- mDragStartX = mAverageX;
- mDragStartY = mAverageY;
- mYDelta = 0;
- mUniverseTransform.clear();
- sendUniverseTransform();
- setVisibility(VISIBLE);
- mState = STATE_OPENING;
- prepareTracking((int)mDragStartY, true);
- mVelocityTracker.clear();
- trackMovement(event);
- return true;
- }
- return false;
- }
-
- if (mState == STATE_OPENING) {
- if (event.getActionMasked() == MotionEvent.ACTION_UP
- || event.getActionMasked() == MotionEvent.ACTION_CANCEL) {
- mVelocityTracker.computeCurrentVelocity(1000);
- computeAveragePos(event);
-
- float yVel = mVelocityTracker.getYVelocity();
- boolean negative = yVel < 0;
-
- float xVel = mVelocityTracker.getXVelocity();
- if (xVel < 0) {
- xVel = -xVel;
- }
- if (xVel > mFlingGestureMaxXVelocityPx) {
- xVel = mFlingGestureMaxXVelocityPx; // limit how much we care about the x axis
- }
-
- float vel = (float)Math.hypot(yVel, xVel);
- if (negative) {
- vel = -vel;
- }
-
- if (CHATTY) {
- Slog.d(TAG, String.format("gesture: vraw=(%f,%f) vnorm=(%f,%f) vlinear=%f",
- mVelocityTracker.getXVelocity(),
- mVelocityTracker.getYVelocity(),
- xVel, yVel,
- vel));
- }
-
- performFling((int)mAverageY, vel, false);
- mState = STATE_OPEN;
- return true;
- }
-
- computeAveragePos(event);
- mYDelta = (int)(mAverageY - mDragStartY);
- if (mYDelta > getExpandedViewMaxHeight()) {
- mYDelta = getExpandedViewMaxHeight();
- }
- updateUniverseScale();
- return true;
- }
-
- return false;
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java b/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java
index 728c913408ad..5b4bb2c8b57c 100644
--- a/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java
+++ b/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java
@@ -28,7 +28,7 @@ import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
-import android.util.Slog;
+import android.util.Log;
import com.android.systemui.SystemUI;
@@ -60,7 +60,7 @@ public class RingtonePlayer extends SystemUI {
try {
mAudioService.setRingtonePlayer(mCallback);
} catch (RemoteException e) {
- Slog.e(TAG, "Problem registering RingtonePlayer: " + e);
+ Log.e(TAG, "Problem registering RingtonePlayer: " + e);
}
}
@@ -81,7 +81,7 @@ public class RingtonePlayer extends SystemUI {
@Override
public void binderDied() {
- if (LOGD) Slog.d(TAG, "binderDied() token=" + mToken);
+ if (LOGD) Log.d(TAG, "binderDied() token=" + mToken);
synchronized (mClients) {
mClients.remove(mToken);
}
@@ -93,7 +93,7 @@ public class RingtonePlayer extends SystemUI {
@Override
public void play(IBinder token, Uri uri, int streamType) throws RemoteException {
if (LOGD) {
- Slog.d(TAG, "play(token=" + token + ", uri=" + uri + ", uid="
+ Log.d(TAG, "play(token=" + token + ", uri=" + uri + ", uid="
+ Binder.getCallingUid() + ")");
}
Client client;
@@ -111,7 +111,7 @@ public class RingtonePlayer extends SystemUI {
@Override
public void stop(IBinder token) {
- if (LOGD) Slog.d(TAG, "stop(token=" + token + ")");
+ if (LOGD) Log.d(TAG, "stop(token=" + token + ")");
Client client;
synchronized (mClients) {
client = mClients.remove(token);
@@ -124,7 +124,7 @@ public class RingtonePlayer extends SystemUI {
@Override
public boolean isPlaying(IBinder token) {
- if (LOGD) Slog.d(TAG, "isPlaying(token=" + token + ")");
+ if (LOGD) Log.d(TAG, "isPlaying(token=" + token + ")");
Client client;
synchronized (mClients) {
client = mClients.get(token);
@@ -138,7 +138,7 @@ public class RingtonePlayer extends SystemUI {
@Override
public void playAsync(Uri uri, UserHandle user, boolean looping, int streamType) {
- if (LOGD) Slog.d(TAG, "playAsync(uri=" + uri + ", user=" + user + ")");
+ if (LOGD) Log.d(TAG, "playAsync(uri=" + uri + ", user=" + user + ")");
if (Binder.getCallingUid() != Process.SYSTEM_UID) {
throw new SecurityException("Async playback only available from system UID.");
}
@@ -148,7 +148,7 @@ public class RingtonePlayer extends SystemUI {
@Override
public void stopAsync() {
- if (LOGD) Slog.d(TAG, "stopAsync()");
+ if (LOGD) Log.d(TAG, "stopAsync()");
if (Binder.getCallingUid() != Process.SYSTEM_UID) {
throw new SecurityException("Async playback only available from system UID.");
}
diff --git a/packages/SystemUI/src/com/android/systemui/net/NetworkOverLimitActivity.java b/packages/SystemUI/src/com/android/systemui/net/NetworkOverLimitActivity.java
index 888b76e4553d..1ac82951a0e9 100644
--- a/packages/SystemUI/src/com/android/systemui/net/NetworkOverLimitActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/net/NetworkOverLimitActivity.java
@@ -32,7 +32,7 @@ import android.net.NetworkTemplate;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.util.Slog;
+import android.util.Log;
import android.view.WindowManager;
import com.android.systemui.R;
@@ -79,7 +79,7 @@ public class NetworkOverLimitActivity extends Activity {
try {
policyService.snoozeLimit(template);
} catch (RemoteException e) {
- Slog.w(TAG, "problem snoozing network policy", e);
+ Log.w(TAG, "problem snoozing network policy", e);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
index ccb711adbe2c..0d26c5713da5 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
@@ -35,7 +35,7 @@ import android.media.AudioManager;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.provider.Settings;
-import android.util.Slog;
+import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
@@ -126,19 +126,19 @@ public class PowerUI extends SystemUI {
int bucket = findBatteryLevelBucket(mBatteryLevel);
if (DEBUG) {
- Slog.d(TAG, "buckets ....." + mLowBatteryAlertCloseLevel
+ Log.d(TAG, "buckets ....." + mLowBatteryAlertCloseLevel
+ " .. " + mLowBatteryReminderLevels[0]
+ " .. " + mLowBatteryReminderLevels[1]);
- Slog.d(TAG, "level " + oldBatteryLevel + " --> " + mBatteryLevel);
- Slog.d(TAG, "status " + oldBatteryStatus + " --> " + mBatteryStatus);
- Slog.d(TAG, "plugType " + oldPlugType + " --> " + mPlugType);
- Slog.d(TAG, "invalidCharger " + oldInvalidCharger + " --> " + mInvalidCharger);
- Slog.d(TAG, "bucket " + oldBucket + " --> " + bucket);
- Slog.d(TAG, "plugged " + oldPlugged + " --> " + plugged);
+ Log.d(TAG, "level " + oldBatteryLevel + " --> " + mBatteryLevel);
+ Log.d(TAG, "status " + oldBatteryStatus + " --> " + mBatteryStatus);
+ Log.d(TAG, "plugType " + oldPlugType + " --> " + mPlugType);
+ Log.d(TAG, "invalidCharger " + oldInvalidCharger + " --> " + mInvalidCharger);
+ Log.d(TAG, "bucket " + oldBucket + " --> " + bucket);
+ Log.d(TAG, "plugged " + oldPlugged + " --> " + plugged);
}
if (oldInvalidCharger == 0 && mInvalidCharger != 0) {
- Slog.d(TAG, "showing invalid charger warning");
+ Log.d(TAG, "showing invalid charger warning");
showInvalidChargerDialog();
return;
} else if (oldInvalidCharger != 0 && mInvalidCharger == 0) {
@@ -164,20 +164,20 @@ public class PowerUI extends SystemUI {
showLowBatteryWarning();
}
} else {
- Slog.w(TAG, "unknown intent: " + intent);
+ Log.w(TAG, "unknown intent: " + intent);
}
}
};
void dismissLowBatteryWarning() {
if (mLowBatteryDialog != null) {
- Slog.i(TAG, "closing low battery warning: level=" + mBatteryLevel);
+ Log.i(TAG, "closing low battery warning: level=" + mBatteryLevel);
mLowBatteryDialog.dismiss();
}
}
void showLowBatteryWarning() {
- Slog.i(TAG,
+ Log.i(TAG,
((mBatteryLevelTextView == null) ? "showing" : "updating")
+ " low battery warning: level=" + mBatteryLevel
+ " [" + findBatteryLevelBucket(mBatteryLevel) + "]");
@@ -234,7 +234,7 @@ public class PowerUI extends SystemUI {
void playLowBatterySound() {
if (DEBUG) {
- Slog.i(TAG, "playing low battery sound. WOMP-WOMP!");
+ Log.i(TAG, "playing low battery sound. WOMP-WOMP!");
}
final ContentResolver cr = mContext.getContentResolver();
@@ -261,7 +261,7 @@ public class PowerUI extends SystemUI {
}
void showInvalidChargerDialog() {
- Slog.d(TAG, "showing invalid charger dialog");
+ Log.d(TAG, "showing invalid charger dialog");
dismissLowBatteryWarning();
diff --git a/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java
index fdeead1f0290..f5471e583e71 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java
@@ -30,7 +30,6 @@ import android.os.ServiceManager;
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
-import android.util.Slog;
import android.view.IWindowManager;
import android.widget.CompoundButton;
import android.widget.ImageView;
diff --git a/packages/SystemUI/src/com/android/systemui/settings/SettingsUI.java b/packages/SystemUI/src/com/android/systemui/settings/SettingsUI.java
index 1075a73c79ad..3ab2d9be43c2 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/SettingsUI.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/SettingsUI.java
@@ -26,7 +26,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.os.Handler;
import android.os.UserHandle;
-import android.util.Slog;
+import android.util.Log;
import com.android.systemui.SystemUI;
@@ -42,7 +42,7 @@ public class SettingsUI extends SystemUI {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_SHOW_BRIGHTNESS_DIALOG)) {
- if (DEBUG) Slog.d(TAG, "showing brightness dialog");
+ if (DEBUG) Log.d(TAG, "showing brightness dialog");
if (mBrightnessDialog == null) {
mBrightnessDialog = new BrightnessDialog(mContext);
@@ -59,7 +59,7 @@ public class SettingsUI extends SystemUI {
}
} else {
- Slog.w(TAG, "unknown intent: " + intent);
+ Log.w(TAG, "unknown intent: " + intent);
}
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java b/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java
index c7c361c4b4a7..e0aefcaa5bb5 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java
@@ -21,7 +21,6 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
-import android.util.Slog;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ProgressBar;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java b/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java
index 78226c5f24d4..9839fe9e6f4d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java
@@ -20,7 +20,6 @@ import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
-import android.util.Slog;
import android.view.View;
import android.widget.ImageView;
import android.widget.RemoteViews.RemoteView;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index af7293627127..c96d9c9c5245 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -62,7 +62,6 @@ import android.provider.Settings;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
-import android.util.Slog;
import android.view.Display;
import android.view.IWindowManager;
import android.view.LayoutInflater;
@@ -168,7 +167,7 @@ public abstract class BaseStatusBar extends SystemUI implements
@Override
public boolean onClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) {
if (DEBUG) {
- Slog.v(TAG, "Notification click handler invoked for intent: " + pendingIntent);
+ Log.v(TAG, "Notification click handler invoked for intent: " + pendingIntent);
}
final boolean isActivity = pendingIntent.isActivity();
if (isActivity) {
@@ -259,7 +258,7 @@ public abstract class BaseStatusBar extends SystemUI implements
}
if (DEBUG) {
- Slog.d(TAG, String.format(
+ Log.d(TAG, String.format(
"init: icons=%d disabled=0x%08x lights=0x%08x menu=0x%08x imeButton=0x%08x",
iconList.size(),
switches[0],
@@ -279,7 +278,7 @@ public abstract class BaseStatusBar extends SystemUI implements
String action = intent.getAction();
if (Intent.ACTION_USER_SWITCHED.equals(action)) {
mCurrentUserId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1);
- if (true) Slog.v(TAG, "userId " + mCurrentUserId + " is in the house");
+ if (true) Log.v(TAG, "userId " + mCurrentUserId + " is in the house");
userSwitched(mCurrentUserId);
}
}}, filter);
@@ -295,7 +294,7 @@ public abstract class BaseStatusBar extends SystemUI implements
final int thisUserId = mCurrentUserId;
final int notificationUserId = n.getUserId();
if (DEBUG && MULTIUSER_DEBUG) {
- Slog.v(TAG, String.format("%s: current userid: %d, notification userid: %d",
+ Log.v(TAG, String.format("%s: current userid: %d, notification userid: %d",
n, thisUserId, notificationUserId));
}
return notificationUserId == UserHandle.USER_ALL
@@ -348,7 +347,7 @@ public abstract class BaseStatusBar extends SystemUI implements
ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(sbn.getPackageName(), 0);
version = info.targetSdkVersion;
} catch (NameNotFoundException ex) {
- Slog.e(TAG, "Failed looking up ApplicationInfo for " + sbn.getPackageName(), ex);
+ Log.e(TAG, "Failed looking up ApplicationInfo for " + sbn.getPackageName(), ex);
}
if (version > 0 && version < Build.VERSION_CODES.GINGERBREAD) {
content.setBackgroundResource(R.drawable.notification_row_legacy_bg);
@@ -643,7 +642,7 @@ public abstract class BaseStatusBar extends SystemUI implements
};
protected void preloadRecentTasksList() {
- if (DEBUG) Slog.d(TAG, "preloading recents");
+ if (DEBUG) Log.d(TAG, "preloading recents");
Intent intent = new Intent(RecentsActivity.PRELOAD_INTENT);
intent.setClassName("com.android.systemui",
"com.android.systemui.recent.RecentsPreloadReceiver");
@@ -653,7 +652,7 @@ public abstract class BaseStatusBar extends SystemUI implements
}
protected void cancelPreloadingRecentTasksList() {
- if (DEBUG) Slog.d(TAG, "cancel preloading recents");
+ if (DEBUG) Log.d(TAG, "cancel preloading recents");
Intent intent = new Intent(RecentsActivity.CANCEL_PRELOAD_INTENT);
intent.setClassName("com.android.systemui",
"com.android.systemui.recent.RecentsPreloadReceiver");
@@ -667,11 +666,11 @@ public abstract class BaseStatusBar extends SystemUI implements
Intent intent;
switch (m.what) {
case MSG_TOGGLE_RECENTS_PANEL:
- if (DEBUG) Slog.d(TAG, "toggle recents panel");
+ if (DEBUG) Log.d(TAG, "toggle recents panel");
toggleRecentsActivity();
break;
case MSG_CLOSE_RECENTS_PANEL:
- if (DEBUG) Slog.d(TAG, "closing recents panel");
+ if (DEBUG) Log.d(TAG, "closing recents panel");
intent = new Intent(RecentsActivity.CLOSE_RECENTS_INTENT);
intent.setPackage("com.android.systemui");
mContext.sendBroadcastAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
@@ -683,13 +682,13 @@ public abstract class BaseStatusBar extends SystemUI implements
cancelPreloadingRecentTasksList();
break;
case MSG_OPEN_SEARCH_PANEL:
- if (DEBUG) Slog.d(TAG, "opening search panel");
+ if (DEBUG) Log.d(TAG, "opening search panel");
if (mSearchPanelView != null && mSearchPanelView.isAssistantAvailable()) {
mSearchPanelView.show(true, true);
}
break;
case MSG_CLOSE_SEARCH_PANEL:
- if (DEBUG) Slog.d(TAG, "closing search panel");
+ if (DEBUG) Log.d(TAG, "closing search panel");
if (mSearchPanelView != null && mSearchPanelView.isShowing()) {
mSearchPanelView.show(false, true);
}
@@ -776,7 +775,7 @@ public abstract class BaseStatusBar extends SystemUI implements
}
catch (RuntimeException e) {
final String ident = sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId());
- Slog.e(TAG, "couldn't inflate view for notification " + ident, e);
+ Log.e(TAG, "couldn't inflate view for notification " + ident, e);
return false;
}
@@ -855,7 +854,7 @@ public abstract class BaseStatusBar extends SystemUI implements
mIntent.send(mContext, 0, overlay);
} catch (PendingIntent.CanceledException e) {
// the stack trace isn't very helpful here. Just log the exception message.
- Slog.w(TAG, "Sending contentIntent failed: " + e);
+ Log.w(TAG, "Sending contentIntent failed: " + e);
}
KeyguardManager kgm =
@@ -913,7 +912,7 @@ public abstract class BaseStatusBar extends SystemUI implements
protected StatusBarNotification removeNotificationViews(IBinder key) {
NotificationData.Entry entry = mNotificationData.remove(key);
if (entry == null) {
- Slog.w(TAG, "removeNotification for unknown key: " + key);
+ Log.w(TAG, "removeNotification for unknown key: " + key);
return null;
}
// Remove the expanded view.
@@ -928,7 +927,7 @@ public abstract class BaseStatusBar extends SystemUI implements
protected StatusBarIconView addNotificationViews(IBinder key,
StatusBarNotification notification) {
if (DEBUG) {
- Slog.d(TAG, "addNotificationViews(key=" + key + ", notification=" + notification);
+ Log.d(TAG, "addNotificationViews(key=" + key + ", notification=" + notification);
}
// Construct the icon.
final StatusBarIconView iconView = new StatusBarIconView(mContext,
@@ -957,7 +956,7 @@ public abstract class BaseStatusBar extends SystemUI implements
// Add the expanded view and icon.
int pos = mNotificationData.add(entry);
if (DEBUG) {
- Slog.d(TAG, "addNotificationViews: added at " + pos);
+ Log.d(TAG, "addNotificationViews: added at " + pos);
}
updateExpansionStates();
updateNotificationIcons();
@@ -970,10 +969,10 @@ public abstract class BaseStatusBar extends SystemUI implements
mContext.getResources().getDimensionPixelSize(R.dimen.notification_row_min_height);
ViewGroup.LayoutParams lp = entry.row.getLayoutParams();
if (entry.expandable() && expand) {
- if (DEBUG) Slog.d(TAG, "setting expanded row height to WRAP_CONTENT");
+ if (DEBUG) Log.d(TAG, "setting expanded row height to WRAP_CONTENT");
lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
} else {
- if (DEBUG) Slog.d(TAG, "setting collapsed row height to " + rowHeight);
+ if (DEBUG) Log.d(TAG, "setting collapsed row height to " + rowHeight);
lp.height = rowHeight;
}
entry.row.setLayoutParams(lp);
@@ -986,18 +985,18 @@ public abstract class BaseStatusBar extends SystemUI implements
NotificationData.Entry entry = mNotificationData.get(i);
if (!entry.userLocked()) {
if (i == (N-1)) {
- if (DEBUG) Slog.d(TAG, "expanding top notification at " + i);
+ if (DEBUG) Log.d(TAG, "expanding top notification at " + i);
expandView(entry, true);
} else {
if (!entry.userExpanded()) {
- if (DEBUG) Slog.d(TAG, "collapsing notification at " + i);
+ if (DEBUG) Log.d(TAG, "collapsing notification at " + i);
expandView(entry, false);
} else {
- if (DEBUG) Slog.d(TAG, "ignoring user-modified notification at " + i);
+ if (DEBUG) Log.d(TAG, "ignoring user-modified notification at " + i);
}
}
} else {
- if (DEBUG) Slog.d(TAG, "ignoring notification being held by user at " + i);
+ if (DEBUG) Log.d(TAG, "ignoring notification being held by user at " + i);
}
}
}
@@ -1015,11 +1014,11 @@ public abstract class BaseStatusBar extends SystemUI implements
}
public void updateNotification(IBinder key, StatusBarNotification notification) {
- if (DEBUG) Slog.d(TAG, "updateNotification(" + key + " -> " + notification + ")");
+ if (DEBUG) Log.d(TAG, "updateNotification(" + key + " -> " + notification + ")");
final NotificationData.Entry oldEntry = mNotificationData.findByKey(key);
if (oldEntry == null) {
- Slog.w(TAG, "updateNotification for unknown key: " + key);
+ Log.w(TAG, "updateNotification for unknown key: " + key);
return;
}
@@ -1032,13 +1031,13 @@ public abstract class BaseStatusBar extends SystemUI implements
final RemoteViews bigContentView = notification.getNotification().bigContentView;
if (DEBUG) {
- Slog.d(TAG, "old notification: when=" + oldNotification.getNotification().when
+ Log.d(TAG, "old notification: when=" + oldNotification.getNotification().when
+ " ongoing=" + oldNotification.isOngoing()
+ " expanded=" + oldEntry.expanded
+ " contentView=" + oldContentView
+ " bigContentView=" + oldBigContentView
+ " rowParent=" + oldEntry.row.getParent());
- Slog.d(TAG, "new notification: when=" + notification.getNotification().when
+ Log.d(TAG, "new notification: when=" + notification.getNotification().when
+ " ongoing=" + oldNotification.isOngoing()
+ " contentView=" + contentView
+ " bigContentView=" + bigContentView);
@@ -1071,7 +1070,7 @@ public abstract class BaseStatusBar extends SystemUI implements
oldEntry.notification.getNotification().tickerText);
boolean isTopAnyway = isTopNotification(rowParent, oldEntry);
if (contentsUnchanged && bigContentsUnchanged && (orderUnchanged || isTopAnyway)) {
- if (DEBUG) Slog.d(TAG, "reusing notification for key: " + key);
+ if (DEBUG) Log.d(TAG, "reusing notification for key: " + key);
oldEntry.notification = notification;
try {
// Reapply the RemoteViews
@@ -1102,15 +1101,15 @@ public abstract class BaseStatusBar extends SystemUI implements
}
catch (RuntimeException e) {
// It failed to add cleanly. Log, and remove the view from the panel.
- Slog.w(TAG, "Couldn't reapply views for package " + contentView.getPackage(), e);
+ Log.w(TAG, "Couldn't reapply views for package " + contentView.getPackage(), e);
removeNotificationViews(key);
addNotificationViews(key, notification);
}
} else {
- if (DEBUG) Slog.d(TAG, "not reusing notification for key: " + key);
- if (DEBUG) Slog.d(TAG, "contents was " + (contentsUnchanged ? "unchanged" : "changed"));
- if (DEBUG) Slog.d(TAG, "order was " + (orderUnchanged ? "unchanged" : "changed"));
- if (DEBUG) Slog.d(TAG, "notification is " + (isTopAnyway ? "top" : "not top"));
+ if (DEBUG) Log.d(TAG, "not reusing notification for key: " + key);
+ if (DEBUG) Log.d(TAG, "contents was " + (contentsUnchanged ? "unchanged" : "changed"));
+ if (DEBUG) Log.d(TAG, "order was " + (orderUnchanged ? "unchanged" : "changed"));
+ if (DEBUG) Log.d(TAG, "notification is " + (isTopAnyway ? "top" : "not top"));
final boolean wasExpanded = oldEntry.userExpanded();
removeNotificationViews(key);
addNotificationViews(key, notification);
@@ -1127,7 +1126,7 @@ public abstract class BaseStatusBar extends SystemUI implements
// Is this for you?
boolean isForCurrentUser = notificationIsForCurrentUser(notification);
- if (DEBUG) Slog.d(TAG, "notification is " + (isForCurrentUser ? "" : "not ") + "for you");
+ if (DEBUG) Log.d(TAG, "notification is " + (isForCurrentUser ? "" : "not ") + "for you");
// Restart the ticker if it's still running
if (updateTicker && isForCurrentUser) {
@@ -1141,11 +1140,11 @@ public abstract class BaseStatusBar extends SystemUI implements
// See if we need to update the intruder.
if (ENABLE_INTRUDERS && oldNotification == mCurrentlyIntrudingNotification) {
- if (DEBUG) Slog.d(TAG, "updating the current intruder:" + notification);
+ if (DEBUG) Log.d(TAG, "updating the current intruder:" + notification);
// XXX: this is a hack for Alarms. The real implementation will need to *update*
// the intruder.
if (notification.getNotification().fullScreenIntent == null) { // TODO(dsandler): consistent logic with add()
- if (DEBUG) Slog.d(TAG, "no longer intrudes!");
+ if (DEBUG) Log.d(TAG, "no longer intrudes!");
mHandler.sendEmptyMessage(MSG_HIDE_INTRUDER);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DoNotDisturb.java b/packages/SystemUI/src/com/android/systemui/statusbar/DoNotDisturb.java
index 9e44e71a17e6..ce67abee37b7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/DoNotDisturb.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/DoNotDisturb.java
@@ -22,7 +22,6 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.util.Slog;
import com.android.systemui.statusbar.policy.Prefs;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java b/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java
index 889e0a13a82b..378061fb6aaf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/GestureRecorder.java
@@ -27,7 +27,7 @@ import java.util.LinkedList;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
-import android.util.Slog;
+import android.util.Log;
import android.view.MotionEvent;
/**
@@ -101,7 +101,7 @@ public class GestureRecorder {
mDownTime = ev.getDownTime();
} else {
if (mDownTime != ev.getDownTime()) {
- Slog.w(TAG, "Assertion failure in GestureRecorder: event downTime ("
+ Log.w(TAG, "Assertion failure in GestureRecorder: event downTime ("
+ev.getDownTime()+") does not match gesture downTime ("+mDownTime+")");
}
}
@@ -237,10 +237,10 @@ public class GestureRecorder {
mGestures.add(mCurrentGesture);
}
if (DEBUG) {
- Slog.v(TAG, String.format("Wrote %d complete gestures to %s", mLastSaveLen, mLogfile));
+ Log.v(TAG, String.format("Wrote %d complete gestures to %s", mLastSaveLen, mLogfile));
}
} catch (IOException e) {
- Slog.e(TAG, String.format("Couldn't write gestures to %s", mLogfile), e);
+ Log.e(TAG, String.format("Couldn't write gestures to %s", mLogfile), e);
mLastSaveLen = -1;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index 46916f717544..de7f1895d31c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -18,7 +18,7 @@ package com.android.systemui.statusbar;
import android.content.Context;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
@@ -64,7 +64,7 @@ public class SignalClusterView
}
public void setNetworkController(NetworkController nc) {
- if (DEBUG) Slog.d(TAG, "NetworkController=" + nc);
+ if (DEBUG) Log.d(TAG, "NetworkController=" + nc);
mNC = nc;
}
@@ -185,7 +185,7 @@ public class SignalClusterView
mWifiGroup.setVisibility(View.GONE);
}
- if (DEBUG) Slog.d(TAG,
+ if (DEBUG) Log.d(TAG,
String.format("wifi: %s sig=%d act=%d",
(mWifiVisible ? "VISIBLE" : "GONE"),
mWifiStrengthId, mWifiActivityId));
@@ -214,7 +214,7 @@ public class SignalClusterView
mSpacer.setVisibility(View.GONE);
}
- if (DEBUG) Slog.d(TAG,
+ if (DEBUG) Log.d(TAG,
String.format("mobile: %s sig=%d act=%d typ=%d",
(mMobileVisible ? "VISIBLE" : "GONE"),
mMobileStrengthId, mMobileActivityId, mMobileTypeId));
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 39d56a42869a..54c5e2a436b3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -27,7 +27,6 @@ import android.graphics.Rect;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.AttributeSet;
-import android.util.Slog;
import android.util.Log;
import android.view.ViewDebug;
import android.view.accessibility.AccessibilityEvent;
@@ -151,7 +150,7 @@ public class StatusBarIconView extends AnimatedImageView {
private boolean updateDrawable(boolean withClear) {
Drawable drawable = getIcon(mIcon);
if (drawable == null) {
- Slog.w(TAG, "No icon for slot " + mSlot);
+ Log.w(TAG, "No icon for slot " + mSlot);
return false;
}
if (withClear) {
@@ -185,7 +184,7 @@ public class StatusBarIconView extends AnimatedImageView {
r = context.getPackageManager()
.getResourcesForApplicationAsUser(icon.iconPackage, userId);
} catch (PackageManager.NameNotFoundException ex) {
- Slog.e(TAG, "Icon package not found: " + icon.iconPackage);
+ Log.e(TAG, "Icon package not found: " + icon.iconPackage);
return null;
}
} else {
@@ -199,7 +198,7 @@ public class StatusBarIconView extends AnimatedImageView {
try {
return r.getDrawable(icon.iconId);
} catch (RuntimeException e) {
- Slog.w(TAG, "Icon not found in "
+ Log.w(TAG, "Icon not found in "
+ (icon.iconPackage != null ? icon.iconId : "<system>")
+ ": " + Integer.toHexString(icon.iconId));
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CarrierLabel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CarrierLabel.java
index 66494e459482..5fa81265cc63 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CarrierLabel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CarrierLabel.java
@@ -22,7 +22,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.text.TextUtils;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.View;
import android.widget.TextView;
@@ -90,7 +90,7 @@ public class CarrierLabel extends TextView {
void updateNetworkName(boolean showSpn, String spn, boolean showPlmn, String plmn) {
if (false) {
- Slog.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn
+ Log.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn
+ " showPlmn=" + showPlmn + " plmn=" + plmn);
}
final String str;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/IconMerger.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/IconMerger.java
index 0640282422d9..eae4b7a89abb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/IconMerger.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/IconMerger.java
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone;
import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
-import android.util.Slog;
import android.view.View;
import android.widget.LinearLayout;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index fd36da6a8112..f5867ab53292 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -29,7 +29,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.ServiceManager;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.animation.AccelerateInterpolator;
import android.view.Display;
import android.view.MotionEvent;
@@ -95,7 +95,7 @@ public class NavigationBarView extends LinearLayout {
final int vh = mCurrentView.getHeight();
if (h != vh || w != vw) {
- Slog.w(TAG, String.format(
+ Log.w(TAG, String.format(
"*** Invalid layout in navigation bar (%s this=%dx%d cur=%dx%d)",
how, w, h, vw, vh));
if (WORKAROUND_INVALID_LAYOUT) {
@@ -318,7 +318,7 @@ public class NavigationBarView extends LinearLayout {
mLowProfile = lightsOut;
- if (DEBUG) Slog.d(TAG, "setting lights " + (lightsOut?"out":"on"));
+ if (DEBUG) Log.d(TAG, "setting lights " + (lightsOut?"out":"on"));
final View navButtons = mCurrentView.findViewById(R.id.nav_buttons);
final View lowLights = mCurrentView.findViewById(R.id.lights_out);
@@ -361,7 +361,7 @@ public class NavigationBarView extends LinearLayout {
if (hide == mHidden) return;
mHidden = hide;
- Slog.d(TAG,
+ Log.d(TAG,
(hide ? "HIDING" : "SHOWING") + " navigation bar");
// bring up the lights no matter what
@@ -402,7 +402,7 @@ public class NavigationBarView extends LinearLayout {
setMenuVisibility(mShowMenu, true /* force */);
if (DEBUG) {
- Slog.d(TAG, "reorient(): rot=" + mDisplay.getRotation());
+ Log.d(TAG, "reorient(): rot=" + mDisplay.getRotation());
}
setNavigationIconHints(mNavigationIconHints, true);
@@ -416,13 +416,13 @@ public class NavigationBarView extends LinearLayout {
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- if (DEBUG) Slog.d(TAG, String.format(
+ if (DEBUG) Log.d(TAG, String.format(
"onSizeChanged: (%dx%d) old: (%dx%d)", w, h, oldw, oldh));
final boolean newVertical = w > 0 && h > w;
if (newVertical != mVertical) {
mVertical = newVertical;
- //Slog.v(TAG, String.format("onSizeChanged: h=%d, w=%d, vert=%s", h, w, mVertical?"y":"n"));
+ //Log.v(TAG, String.format("onSizeChanged: h=%d, w=%d, vert=%s", h, w, mVertical?"y":"n"));
reorient();
}
@@ -433,7 +433,7 @@ public class NavigationBarView extends LinearLayout {
/*
@Override
protected void onLayout (boolean changed, int left, int top, int right, int bottom) {
- if (DEBUG) Slog.d(TAG, String.format(
+ if (DEBUG) Log.d(TAG, String.format(
"onLayout: %s (%d,%d,%d,%d)",
changed?"changed":"notchanged", left, top, right, bottom));
super.onLayout(changed, left, top, right, bottom);
@@ -443,7 +443,7 @@ public class NavigationBarView extends LinearLayout {
// fails, any touch on the display will fix the layout.
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (DEBUG) Slog.d(TAG, "onInterceptTouchEvent: " + ev.toString());
+ if (DEBUG) Log.d(TAG, "onInterceptTouchEvent: " + ev.toString());
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
postCheckForInvalidLayout("touch");
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index f33dc20607bd..6be6d4d43a19 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -22,7 +22,6 @@ import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.EventLog;
-import android.util.Slog;
import android.view.MotionEvent;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
index 565a3f23bbdf..91e1aa0a987b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
@@ -20,7 +20,7 @@ import java.util.ArrayList;
import android.content.Context;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
@@ -30,7 +30,7 @@ public class PanelBar extends FrameLayout {
public static final String TAG = PanelBar.class.getSimpleName();
public static final void LOG(String fmt, Object... args) {
if (!DEBUG) return;
- Slog.v(TAG, String.format(fmt, args));
+ Log.v(TAG, String.format(fmt, args));
}
public static final int STATE_CLOSED = 0;
@@ -66,7 +66,7 @@ public class PanelBar extends FrameLayout {
public void setPanelHolder(PanelHolder ph) {
if (ph == null) {
- Slog.e(TAG, "setPanelHolder: null PanelHolder", new Throwable());
+ Log.e(TAG, "setPanelHolder: null PanelHolder", new Throwable());
return;
}
ph.setBar(this);
@@ -98,7 +98,7 @@ public class PanelBar extends FrameLayout {
// Allow subclasses to implement enable/disable semantics
if (!panelsEnabled()) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
- Slog.v(TAG, String.format("onTouch: all panels disabled, ignoring touch at (%d,%d)",
+ Log.v(TAG, String.format("onTouch: all panels disabled, ignoring touch at (%d,%d)",
(int) event.getX(), (int) event.getY()));
}
return false;
@@ -109,7 +109,7 @@ public class PanelBar extends FrameLayout {
final PanelView panel = selectPanelForTouch(event);
if (panel == null) {
// panel is not there, so we'll eat the gesture
- Slog.v(TAG, String.format("onTouch: no panel for touch at (%d,%d)",
+ Log.v(TAG, String.format("onTouch: no panel for touch at (%d,%d)",
(int) event.getX(), (int) event.getY()));
mTouchingPanel = null;
return true;
@@ -119,7 +119,7 @@ public class PanelBar extends FrameLayout {
(enabled ? "" : " (disabled)"));
if (!enabled) {
// panel is disabled, so we'll eat the gesture
- Slog.v(TAG, String.format(
+ Log.v(TAG, String.format(
"onTouch: panel (%s) is disabled, ignoring touch at (%d,%d)",
panel, (int) event.getX(), (int) event.getY()));
mTouchingPanel = null;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index e351429aa0e4..70cb94a2a0a0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -27,7 +27,7 @@ import android.animation.TimeAnimator.TimeListener;
import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
@@ -42,7 +42,7 @@ public class PanelView extends FrameLayout {
public final void LOG(String fmt, Object... args) {
if (!DEBUG) return;
- Slog.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args));
+ Log.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args));
}
public static final boolean BRAKES = false;
@@ -112,7 +112,7 @@ public class PanelView extends FrameLayout {
}
public void computeCurrentVelocity(long timebase) {
if (FlingTracker.DEBUG) {
- Slog.v("FlingTracker", "computing velocities for " + mEventBuf.size() + " events");
+ Log.v("FlingTracker", "computing velocities for " + mEventBuf.size() + " events");
}
mVX = mVY = 0;
MotionEventCopy last = null;
@@ -127,7 +127,7 @@ public class PanelView extends FrameLayout {
final float dx = (event.x - last.x);
final float dy = (event.y - last.y);
if (FlingTracker.DEBUG) {
- Slog.v("FlingTracker", String.format(" [%d] dx=%.1f dy=%.1f dt=%.0f vx=%.1f vy=%.1f",
+ Log.v("FlingTracker", String.format(" [%d] dx=%.1f dy=%.1f dt=%.0f vx=%.1f vy=%.1f",
i,
dx, dy, dt,
(dx/dt),
@@ -147,7 +147,7 @@ public class PanelView extends FrameLayout {
mVY /= totalweight;
} else {
if (DEBUG_NAN) {
- Slog.v("FlingTracker", "computeCurrentVelocity warning: totalweight=0",
+ Log.v("FlingTracker", "computeCurrentVelocity warning: totalweight=0",
new Throwable());
}
// so as not to contaminate the velocities with NaN
@@ -155,13 +155,13 @@ public class PanelView extends FrameLayout {
}
if (FlingTracker.DEBUG) {
- Slog.v("FlingTracker", "computed: vx=" + mVX + " vy=" + mVY);
+ Log.v("FlingTracker", "computed: vx=" + mVX + " vy=" + mVY);
}
}
public float getXVelocity() {
if (Float.isNaN(mVX)) {
if (DEBUG_NAN) {
- Slog.v("FlingTracker", "warning: vx=NaN");
+ Log.v("FlingTracker", "warning: vx=NaN");
}
mVX = 0;
}
@@ -170,7 +170,7 @@ public class PanelView extends FrameLayout {
public float getYVelocity() {
if (Float.isNaN(mVY)) {
if (DEBUG_NAN) {
- Slog.v("FlingTracker", "warning: vx=NaN");
+ Log.v("FlingTracker", "warning: vx=NaN");
}
mVY = 0;
}
@@ -307,7 +307,7 @@ public class PanelView extends FrameLayout {
post(mStopAnimator);
}
} else {
- Slog.v(TAG, "animationTick called with dtms=" + dtms + "; nothing to do (h="
+ Log.v(TAG, "animationTick called with dtms=" + dtms + "; nothing to do (h="
+ mExpandedHeight + " v=" + mVel + ")");
}
}
@@ -547,7 +547,7 @@ public class PanelView extends FrameLayout {
if (Float.isNaN(h)) {
// If a NaN gets in here, it will freeze the Animators.
if (DEBUG_NAN) {
- Slog.v(TAG, "setExpandedHeightInternal: warning: h=NaN, using 0 instead",
+ Log.v(TAG, "setExpandedHeightInternal: warning: h=NaN, using 0 instead",
new Throwable());
}
h = 0;
@@ -586,7 +586,7 @@ public class PanelView extends FrameLayout {
if (Float.isNaN(frac)) {
// If a NaN gets in here, it will freeze the Animators.
if (DEBUG_NAN) {
- Slog.v(TAG, "setExpandedFraction: frac=NaN, using 0 instead",
+ Log.v(TAG, "setExpandedFraction: frac=NaN, using 0 instead",
new Throwable());
}
frac = 0;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 978b36ba9b3c..97c7b98ab929 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -55,7 +55,6 @@ import android.service.dreams.IDreamManager;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.Log;
-import android.util.Slog;
import android.view.Display;
import android.view.Gravity;
import android.view.MotionEvent;
@@ -280,7 +279,7 @@ public class PhoneStatusBar extends BaseStatusBar {
public void onAnimationEnd(Animator animation) {
// double-check to avoid races
if (mStatusBarContents.getAlpha() == 0) {
- if (DEBUG) Slog.d(TAG, "makeIconsInvisible");
+ if (DEBUG) Log.d(TAG, "makeIconsInvisible");
mStatusBarContents.setVisibility(View.INVISIBLE);
}
}
@@ -296,7 +295,7 @@ public class PhoneStatusBar extends BaseStatusBar {
Settings.Secure.USER_SETUP_COMPLETE,
0 /*default */,
mCurrentUserId);
- if (MULTIUSER_DEBUG) Slog.d(TAG, String.format("User setup changed: " +
+ if (MULTIUSER_DEBUG) Log.d(TAG, String.format("User setup changed: " +
"selfChange=%s userSetup=%s mUserSetup=%s",
selfChange, userSetup, mUserSetup));
if (mSettingsButton != null && mHasFlipSettings) {
@@ -439,7 +438,7 @@ public class PhoneStatusBar extends BaseStatusBar {
try {
boolean showNav = mWindowManagerService.hasNavigationBar();
- if (DEBUG) Slog.v(TAG, "hasNavigationBar=" + showNav);
+ if (DEBUG) Log.v(TAG, "hasNavigationBar=" + showNav);
if (showNav) {
mNavigationBarView =
(NavigationBarView) View.inflate(context, R.layout.navigation_bar, null);
@@ -566,7 +565,7 @@ public class PhoneStatusBar extends BaseStatusBar {
mCarrierLabel = (TextView)mStatusBarWindow.findViewById(R.id.carrier_label);
mShowCarrierInPanel = (mCarrierLabel != null);
- if (DEBUG) Slog.v(TAG, "carrierlabel=" + mCarrierLabel + " show=" + mShowCarrierInPanel);
+ if (DEBUG) Log.v(TAG, "carrierlabel=" + mCarrierLabel + " show=" + mShowCarrierInPanel);
if (mShowCarrierInPanel) {
mCarrierLabel.setVisibility(mCarrierLabelVisible ? View.VISIBLE : View.INVISIBLE);
@@ -818,7 +817,7 @@ public class PhoneStatusBar extends BaseStatusBar {
// For small-screen devices (read: phones) that lack hardware navigation buttons
private void addNavigationBar() {
- if (DEBUG) Slog.v(TAG, "addNavigationBar: about to add " + mNavigationBarView);
+ if (DEBUG) Log.v(TAG, "addNavigationBar: about to add " + mNavigationBarView);
if (mNavigationBarView == null) return;
prepareNavigationBarView();
@@ -897,7 +896,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) {
- if (SPEW) Slog.d(TAG, "addIcon slot=" + slot + " index=" + index + " viewIndex=" + viewIndex
+ if (SPEW) Log.d(TAG, "addIcon slot=" + slot + " index=" + index + " viewIndex=" + viewIndex
+ " icon=" + icon);
StatusBarIconView view = new StatusBarIconView(mContext, slot, null);
view.set(icon);
@@ -906,19 +905,19 @@ public class PhoneStatusBar extends BaseStatusBar {
public void updateIcon(String slot, int index, int viewIndex,
StatusBarIcon old, StatusBarIcon icon) {
- if (SPEW) Slog.d(TAG, "updateIcon slot=" + slot + " index=" + index + " viewIndex=" + viewIndex
+ if (SPEW) Log.d(TAG, "updateIcon slot=" + slot + " index=" + index + " viewIndex=" + viewIndex
+ " old=" + old + " icon=" + icon);
StatusBarIconView view = (StatusBarIconView)mStatusIcons.getChildAt(viewIndex);
view.set(icon);
}
public void removeIcon(String slot, int index, int viewIndex) {
- if (SPEW) Slog.d(TAG, "removeIcon slot=" + slot + " index=" + index + " viewIndex=" + viewIndex);
+ if (SPEW) Log.d(TAG, "removeIcon slot=" + slot + " index=" + index + " viewIndex=" + viewIndex);
mStatusIcons.removeViewAt(viewIndex);
}
public void addNotification(IBinder key, StatusBarNotification notification) {
- if (DEBUG) Slog.d(TAG, "addNotification score=" + notification.getScore());
+ if (DEBUG) Log.d(TAG, "addNotification score=" + notification.getScore());
StatusBarIconView iconView = addNotificationViews(key, notification);
if (iconView == null) return;
@@ -926,7 +925,7 @@ public class PhoneStatusBar extends BaseStatusBar {
try {
immersive = ActivityManagerNative.getDefault().isTopActivityImmersive();
if (DEBUG) {
- Slog.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive"));
+ Log.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive"));
}
} catch (RemoteException ex) {
}
@@ -936,12 +935,12 @@ public class PhoneStatusBar extends BaseStatusBar {
if (ENABLE_INTRUDERS && (
// TODO(dsandler): Only if the screen is on
notification.notification.intruderView != null)) {
- Slog.d(TAG, "Presenting high-priority notification");
+ Log.d(TAG, "Presenting high-priority notification");
// special new transient ticker mode
// 1. Populate mIntruderAlertView
if (notification.notification.intruderView == null) {
- Slog.e(TAG, notification.notification.toString() + " wanted to intrude but intruderView was null");
+ Log.e(TAG, notification.notification.toString() + " wanted to intrude but intruderView was null");
return;
}
@@ -973,7 +972,7 @@ public class PhoneStatusBar extends BaseStatusBar {
awakenDreams();
// not immersive & a full-screen alert should be shown
- if (DEBUG) Slog.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent");
+ if (DEBUG) Log.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent");
try {
notification.getNotification().fullScreenIntent.send();
} catch (PendingIntent.CanceledException e) {
@@ -994,7 +993,7 @@ public class PhoneStatusBar extends BaseStatusBar {
public void removeNotification(IBinder key) {
StatusBarNotification old = removeNotificationViews(key);
- if (SPEW) Slog.d(TAG, "removeNotification key=" + key + " old=" + old);
+ if (SPEW) Log.d(TAG, "removeNotification key=" + key + " old=" + old);
if (old != null) {
// Cancel the ticker if it's still running
@@ -1099,7 +1098,7 @@ public class PhoneStatusBar extends BaseStatusBar {
int N = mNotificationData.size();
if (DEBUG) {
- Slog.d(TAG, "refreshing icons: " + N + " notifications, mNotificationIcons=" + mNotificationIcons);
+ Log.d(TAG, "refreshing icons: " + N + " notifications, mNotificationIcons=" + mNotificationIcons);
}
ArrayList<View> toShow = new ArrayList<View>();
@@ -1139,7 +1138,7 @@ public class PhoneStatusBar extends BaseStatusBar {
// The idea here is to only show the carrier label when there is enough room to see it,
// i.e. when there aren't enough notifications to fill the panel.
if (DEBUG) {
- Slog.d(TAG, String.format("pileh=%d scrollh=%d carrierh=%d",
+ Log.d(TAG, String.format("pileh=%d scrollh=%d carrierh=%d",
mPile.getHeight(), mScrollView.getHeight(), mCarrierLabelHeight));
}
@@ -1152,7 +1151,7 @@ public class PhoneStatusBar extends BaseStatusBar {
if (force || mCarrierLabelVisible != makeVisible) {
mCarrierLabelVisible = makeVisible;
if (DEBUG) {
- Slog.d(TAG, "making carrier label " + (makeVisible?"visible":"invisible"));
+ Log.d(TAG, "making carrier label " + (makeVisible?"visible":"invisible"));
}
mCarrierLabel.animate().cancel();
if (makeVisible) {
@@ -1183,7 +1182,7 @@ public class PhoneStatusBar extends BaseStatusBar {
final boolean clearable = any && mNotificationData.hasClearableItems();
if (DEBUG) {
- Slog.d(TAG, "setAreThereNotifications: N=" + mNotificationData.size()
+ Log.d(TAG, "setAreThereNotifications: N=" + mNotificationData.size()
+ " any=" + any + " clearable=" + clearable);
}
@@ -1260,7 +1259,7 @@ public class PhoneStatusBar extends BaseStatusBar {
mDisabled = state;
if (DEBUG) {
- Slog.d(TAG, String.format("disable: 0x%08x -> 0x%08x (diff: 0x%08x)",
+ Log.d(TAG, String.format("disable: 0x%08x -> 0x%08x (diff: 0x%08x)",
old, state, diff));
}
@@ -1287,7 +1286,7 @@ public class PhoneStatusBar extends BaseStatusBar {
flagdbg.append(((state & StatusBarManager.DISABLE_SEARCH) != 0) ? "SEARCH" : "search");
flagdbg.append(((diff & StatusBarManager.DISABLE_SEARCH) != 0) ? "* " : " ");
flagdbg.append(">");
- Slog.d(TAG, flagdbg.toString());
+ Log.d(TAG, flagdbg.toString());
if ((diff & StatusBarManager.DISABLE_SYSTEM_INFO) != 0) {
mSystemIconArea.animate().cancel();
@@ -1410,7 +1409,7 @@ public class PhoneStatusBar extends BaseStatusBar {
};
void makeExpandedVisible(boolean revealAfterDraw) {
- if (SPEW) Slog.d(TAG, "Make expanded visible: expanded visible=" + mExpandedVisible);
+ if (SPEW) Log.d(TAG, "Make expanded visible: expanded visible=" + mExpandedVisible);
if (mExpandedVisible) {
return;
}
@@ -1449,7 +1448,7 @@ public class PhoneStatusBar extends BaseStatusBar {
public void animateCollapsePanels(int flags) {
if (SPEW) {
- Slog.d(TAG, "animateCollapse():"
+ Log.d(TAG, "animateCollapse():"
+ " mExpandedVisible=" + mExpandedVisible
+ " flags=" + flags);
}
@@ -1517,7 +1516,7 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void animateExpandNotificationsPanel() {
- if (SPEW) Slog.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
+ if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
return ;
}
@@ -1572,7 +1571,7 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void animateExpandSettingsPanel() {
- if (SPEW) Slog.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
+ if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
return;
}
@@ -1671,7 +1670,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
void makeExpandedInvisible() {
- if (SPEW) Slog.d(TAG, "makeExpandedInvisible: mExpandedVisible=" + mExpandedVisible
+ if (SPEW) Log.d(TAG, "makeExpandedInvisible: mExpandedVisible=" + mExpandedVisible
+ " mExpandedVisible=" + mExpandedVisible);
if (!mExpandedVisible) {
@@ -1842,11 +1841,11 @@ public class PhoneStatusBar extends BaseStatusBar {
}
if (SPEW) {
- Slog.d(TAG, "Touch: rawY=" + event.getRawY() + " event=" + event + " mDisabled="
+ Log.d(TAG, "Touch: rawY=" + event.getRawY() + " event=" + event + " mDisabled="
+ mDisabled + " mTracking=" + mTracking);
} else if (CHATTY) {
if (event.getAction() != MotionEvent.ACTION_MOVE) {
- Slog.d(TAG, String.format(
+ Log.d(TAG, String.format(
"panel: %s at (%f, %f) mDisabled=0x%08x",
MotionEvent.actionToString(event.getAction()),
event.getRawX(), event.getRawY(), mDisabled));
@@ -1896,7 +1895,7 @@ public class PhoneStatusBar extends BaseStatusBar {
final int oldVal = mSystemUiVisibility;
final int newVal = (oldVal&~mask) | (vis&mask);
final int diff = newVal ^ oldVal;
- if (DEBUG) Slog.d(TAG, String.format(
+ if (DEBUG) Log.d(TAG, String.format(
"setSystemUiVisibility vis=%s mask=%s oldVal=%s newVal=%s diff=%s",
Integer.toHexString(vis), Integer.toHexString(mask),
Integer.toHexString(oldVal), Integer.toHexString(newVal),
@@ -1959,7 +1958,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
private void setHideybarConfirmationVisible(boolean visible) {
- if (DEBUG) Slog.d(TAG, "setHideybarConfirmationVisible " + visible);
+ if (DEBUG) Log.d(TAG, "setHideybarConfirmationVisible " + visible);
if (visible && mHideybarConfirmation == null && !mHideybarConfirmationDismissed) {
// create the confirmation toast bar with the correct message for this config
float widthDp = mCurrentDisplaySize.x /
@@ -2016,7 +2015,7 @@ public class PhoneStatusBar extends BaseStatusBar {
private void setTransparent(View view, boolean transparent) {
float alpha = transparent ? TRANSPARENT_ALPHA : 1;
- if (DEBUG) Slog.d(TAG, "Setting " + (view == mStatusBarView ? "status bar" :
+ if (DEBUG) Log.d(TAG, "Setting " + (view == mStatusBarView ? "status bar" :
view == mNavigationBarView ? "navigation bar" : "view") + " alpha to " + alpha);
view.setAlpha(alpha);
}
@@ -2084,7 +2083,7 @@ public class PhoneStatusBar extends BaseStatusBar {
public void topAppWindowChanged(boolean showMenu) {
if (DEBUG) {
- Slog.d(TAG, (showMenu?"showing":"hiding") + " the MENU button");
+ Log.d(TAG, (showMenu?"showing":"hiding") + " the MENU button");
}
if (mNavigationBarView != null) {
mNavigationBarView.setMenuVisibility(showMenu);
@@ -2247,7 +2246,7 @@ public class PhoneStatusBar extends BaseStatusBar {
mHandler.post(new Runnable() {
public void run() {
mStatusBarView.getLocationOnScreen(mAbsPos);
- Slog.d(TAG, "mStatusBarView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
+ Log.d(TAG, "mStatusBarView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
+ ") " + mStatusBarView.getWidth() + "x"
+ getStatusBarHeight());
mStatusBarView.debug();
@@ -2319,7 +2318,7 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void updateExpandedViewPos(int thingy) {
- if (DEBUG) Slog.v(TAG, "updateExpandedViewPos");
+ if (DEBUG) Log.v(TAG, "updateExpandedViewPos");
// on larger devices, the notification panel is propped open a bit
mNotificationPanel.setMinimumHeight(
@@ -2387,7 +2386,7 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void run() {
if (DEBUG) {
- Slog.v(TAG, "running post-collapse cleanup");
+ Log.v(TAG, "running post-collapse cleanup");
}
try {
mPile.setViewRemoval(true);
@@ -2465,7 +2464,7 @@ public class PhoneStatusBar extends BaseStatusBar {
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
- if (DEBUG) Slog.v(TAG, "onReceive: " + intent);
+ if (DEBUG) Log.v(TAG, "onReceive: " + intent);
String action = intent.getAction();
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
int flags = CommandQueue.FLAG_EXCLUDE_NONE;
@@ -2484,7 +2483,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
if (DEBUG) {
- Slog.v(TAG, "configuration changed: " + mContext.getResources().getConfiguration());
+ Log.v(TAG, "configuration changed: " + mContext.getResources().getConfiguration());
}
mDisplay.getSize(mCurrentDisplaySize);
@@ -2521,7 +2520,7 @@ public class PhoneStatusBar extends BaseStatusBar {
private void setIntruderAlertVisibility(boolean vis) {
if (!ENABLE_INTRUDERS) return;
if (DEBUG) {
- Slog.v(TAG, (vis ? "showing" : "hiding") + " intruder alert window");
+ Log.v(TAG, (vis ? "showing" : "hiding") + " intruder alert window");
}
mIntruderAlertView.setVisibility(vis ? View.VISIBLE : View.GONE);
}
@@ -2572,7 +2571,7 @@ public class PhoneStatusBar extends BaseStatusBar {
R.dimen.status_bar_icon_padding);
if (newIconHPadding != mIconHPadding || newIconSize != mIconSize) {
-// Slog.d(TAG, "size=" + newIconSize + " padding=" + newIconHPadding);
+// Log.d(TAG, "size=" + newIconSize + " padding=" + newIconHPadding);
mIconHPadding = newIconHPadding;
mIconSize = newIconSize;
//reloadAllNotificationIcons(); // reload the tray
@@ -2617,7 +2616,7 @@ public class PhoneStatusBar extends BaseStatusBar {
mNotificationPanelMinHeightFrac = 0f;
}
- if (false) Slog.v(TAG, "updateResources");
+ if (false) Log.v(TAG, "updateResources");
}
//
@@ -2638,7 +2637,7 @@ public class PhoneStatusBar extends BaseStatusBar {
public void run() {
vibrate();
SystemClock.sleep(250);
- Slog.d(TAG, "startTracing");
+ Log.d(TAG, "startTracing");
android.os.Debug.startMethodTracing("/data/statusbar-traces/trace");
mHandler.postDelayed(mStopTracing, 10000);
}
@@ -2647,7 +2646,7 @@ public class PhoneStatusBar extends BaseStatusBar {
Runnable mStopTracing = new Runnable() {
public void run() {
android.os.Debug.stopMethodTracing();
- Slog.d(TAG, "stopTracing");
+ Log.d(TAG, "stopTracing");
vibrate();
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index 9b8bd224e7fa..80734ee66047 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -36,7 +36,7 @@ import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
-import android.util.Slog;
+import android.util.Log;
import com.android.internal.telephony.IccCard;
import com.android.internal.telephony.IccCardConstants;
@@ -284,17 +284,17 @@ public class PhoneStatusBarPolicy {
final String action = intent.getAction();
final boolean enabled = intent.getBooleanExtra(TtyIntent.TTY_ENABLED, false);
- if (false) Slog.v(TAG, "updateTTY: enabled: " + enabled);
+ if (false) Log.v(TAG, "updateTTY: enabled: " + enabled);
if (enabled) {
// TTY is on
- if (false) Slog.v(TAG, "updateTTY: set TTY on");
+ if (false) Log.v(TAG, "updateTTY: set TTY on");
mService.setIcon("tty", R.drawable.stat_sys_tty_mode, 0,
mContext.getString(R.string.accessibility_tty_enabled));
mService.setIconVisibility("tty", true);
} else {
// TTY is off
- if (false) Slog.v(TAG, "updateTTY: set TTY off");
+ if (false) Log.v(TAG, "updateTTY: set TTY off");
mService.setIconVisibility("tty", false);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index de9f7506dd1d..2a65381c9ef1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.util.AttributeSet;
import android.util.EventLog;
-import android.util.Slog;
+import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
@@ -128,7 +128,7 @@ public class PhoneStatusBarView extends PanelBar {
float region = (w * mSettingsPanelDragzoneFrac);
if (DEBUG) {
- Slog.v(TAG, String.format(
+ Log.v(TAG, String.format(
"w=%.1f frac=%.3f region=%.1f min=%.1f x=%.1f w-x=%.1f",
w, mSettingsPanelDragzoneFrac, region, mSettingsPanelDragzoneMin, x, (w-x)));
}
@@ -152,7 +152,7 @@ public class PhoneStatusBarView extends PanelBar {
// which is kind of tricky to determine
mShouldFade = (mFadingPanel == null || mFadingPanel.isFullyExpanded());
if (DEBUG) {
- Slog.v(TAG, "start opening: " + panel + " shouldfade=" + mShouldFade);
+ Log.v(TAG, "start opening: " + panel + " shouldfade=" + mShouldFade);
}
mFadingPanel = panel;
}
@@ -202,7 +202,7 @@ public class PhoneStatusBarView extends PanelBar {
super.panelExpansionChanged(panel, frac);
if (DEBUG) {
- Slog.v(TAG, "panelExpansionChanged: f=" + frac);
+ Log.v(TAG, "panelExpansionChanged: f=" + frac);
}
if (panel == mFadingPanel && mScrimColor != 0 && ActivityManager.isHighEndGfx()) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrackingPatternView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrackingPatternView.java
index d2ed5ffc00b1..f3cf65c6b345 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrackingPatternView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrackingPatternView.java
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
-import android.util.Slog;
import android.view.View;
import android.graphics.BitmapFactory;
import android.graphics.Bitmap;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java
index 3c8276d9bfa8..71a7aa8dad5d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java
@@ -26,7 +26,6 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.provider.Settings;
-import android.util.Slog;
import android.widget.CompoundButton;
public class AirplaneModeController extends BroadcastReceiver
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java
index 716341f17abf..0f56ba6b4336 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java
@@ -24,7 +24,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.BatteryManager;
-import android.util.Slog;
import android.widget.ImageView;
import android.widget.TextView;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
index bff6cdad74bd..91a1a6d884e2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
@@ -34,7 +34,6 @@ import android.text.style.RelativeSizeSpan;
import android.text.style.RelativeSizeSpan;
import android.text.style.StyleSpan;
import android.util.AttributeSet;
-import android.util.Slog;
import android.view.View;
import android.widget.TextView;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java
index 2d951c25f58b..3083e8b94d79 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java
@@ -21,7 +21,7 @@ import android.content.Context;
import android.content.res.TypedArray;
import android.os.RemoteException;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.View;
import android.widget.ImageView;
@@ -55,7 +55,7 @@ public class CompatModeButton extends ImageView {
}
final boolean vis = (mode != ActivityManager.COMPAT_MODE_NEVER
&& mode != ActivityManager.COMPAT_MODE_ALWAYS);
- if (DEBUG) Slog.d(TAG, "compat mode is " + mode + "; icon will " + (vis ? "show" : "hide"));
+ if (DEBUG) Log.d(TAG, "compat mode is " + mode + "; icon will " + (vis ? "show" : "hide"));
setVisibility(vis ? View.VISIBLE : View.GONE);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DeadZone.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DeadZone.java
index 6eb88be48569..dca5e41b59cf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DeadZone.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DeadZone.java
@@ -22,7 +22,7 @@ import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.os.SystemClock;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
@@ -75,7 +75,7 @@ public class DeadZone extends View {
mVertical = (index == VERTICAL);
if (DEBUG)
- Slog.v(TAG, this + " size=[" + mSizeMin + "-" + mSizeMax + "] hold=" + mHold
+ Log.v(TAG, this + " size=[" + mSizeMin + "-" + mSizeMax + "] hold=" + mHold
+ (mVertical ? " vertical" : " horizontal"));
setFlashOnTouchCapture(context.getResources().getBoolean(R.bool.config_dead_zone_flash));
@@ -106,7 +106,7 @@ public class DeadZone extends View {
@Override
public boolean onTouchEvent(MotionEvent event) {
if (DEBUG) {
- Slog.v(TAG, this + " onTouch: " + MotionEvent.actionToString(event.getAction()));
+ Log.v(TAG, this + " onTouch: " + MotionEvent.actionToString(event.getAction()));
}
final int action = event.getAction();
@@ -114,12 +114,12 @@ public class DeadZone extends View {
poke(event);
} else if (action == MotionEvent.ACTION_DOWN) {
if (DEBUG) {
- Slog.v(TAG, this + " ACTION_DOWN: " + event.getX() + "," + event.getY());
+ Log.v(TAG, this + " ACTION_DOWN: " + event.getX() + "," + event.getY());
}
int size = (int) getSize(event.getEventTime());
if ((mVertical && event.getX() < size) || event.getY() < size) {
if (CHATTY) {
- Slog.v(TAG, "consuming errant click: (" + event.getX() + "," + event.getY() + ")");
+ Log.v(TAG, "consuming errant click: (" + event.getX() + "," + event.getY() + ")");
}
if (mShouldFlash) {
post(mDebugFlash);
@@ -134,7 +134,7 @@ public class DeadZone extends View {
public void poke(MotionEvent event) {
mLastPokeTime = event.getEventTime();
if (DEBUG)
- Slog.v(TAG, "poked! size=" + getSize(mLastPokeTime));
+ Log.v(TAG, "poked! size=" + getSize(mLastPokeTime));
if (mShouldFlash) postInvalidate();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DoNotDisturbController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DoNotDisturbController.java
index 94c8aa5d3dde..d45a94f0707c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DoNotDisturbController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DoNotDisturbController.java
@@ -22,7 +22,7 @@ import android.content.SharedPreferences;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.provider.Settings;
-import android.util.Slog;
+import android.util.Log;
import android.view.IWindowManager;
import android.widget.CompoundButton;
@@ -52,7 +52,7 @@ public class DoNotDisturbController implements CompoundButton.OnCheckedChangeLis
// The checkbox is ON for notifications coming in and OFF for Do not disturb, so we
// don't have a double negative.
public void onCheckedChanged(CompoundButton view, boolean checked) {
- //Slog.d(TAG, "onCheckedChanged checked=" + checked + " mDoNotDisturb=" + mDoNotDisturb);
+ //Log.d(TAG, "onCheckedChanged checked=" + checked + " mDoNotDisturb=" + mDoNotDisturb);
final boolean value = !checked;
if (value != mDoNotDisturb) {
SharedPreferences.Editor editor = Prefs.edit(mContext);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/EventHole.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/EventHole.java
index 47e758c58fe6..4de42414cd6b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/EventHole.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/EventHole.java
@@ -25,7 +25,6 @@ import android.os.RemoteException;
import android.os.SystemClock;
import android.os.ServiceManager;
import android.util.AttributeSet;
-import android.util.Slog;
import android.view.HapticFeedbackConstants;
import android.view.IWindowManager;
import android.view.InputDevice;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/FixedSizeDrawable.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/FixedSizeDrawable.java
index 0e8095c1be00..37513996d1fc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/FixedSizeDrawable.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/FixedSizeDrawable.java
@@ -20,7 +20,6 @@ import android.graphics.drawable.Drawable;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
-import android.util.Slog;
public class FixedSizeDrawable extends Drawable {
Drawable mDrawable;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java
index ee5c86303f22..9b963840d862 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java
@@ -28,7 +28,6 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
-import android.util.Slog;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
@@ -102,7 +101,7 @@ public class IntruderAlertView extends LinearLayout implements SwipeHelper.Callb
}
public void onChildDismissed(View v) {
- Slog.v(TAG, "User swiped intruder to dismiss");
+ Log.v(TAG, "User swiped intruder to dismiss");
mBar.dismissIntruder();
}
@@ -134,7 +133,7 @@ public class IntruderAlertView extends LinearLayout implements SwipeHelper.Callb
public void onDraw(android.graphics.Canvas c) {
super.onDraw(c);
if (DEBUG) {
- //Slog.d(TAG, "onDraw: canvas height: " + c.getHeight() + "px; measured height: "
+ //Log.d(TAG, "onDraw: canvas height: " + c.getHeight() + "px; measured height: "
// + getMeasuredHeight() + "px");
c.save();
c.clipRect(6, 6, c.getWidth() - 6, getMeasuredHeight() - 6,
@@ -146,7 +145,7 @@ public class IntruderAlertView extends LinearLayout implements SwipeHelper.Callb
public void applyIntruderContent(RemoteViews intruderView, OnClickListener listener) {
if (DEBUG) {
- Slog.v(TAG, "applyIntruderContent: view=" + intruderView + " listener=" + listener);
+ Log.v(TAG, "applyIntruderContent: view=" + intruderView + " listener=" + listener);
}
mIntruderRemoteViews = intruderView;
mOnClickListener = listener;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
index 82d6a990928c..db0e4c3ac73a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
@@ -61,7 +61,7 @@ public class KeyButtonView extends ImageView {
Runnable mCheckLongPress = new Runnable() {
public void run() {
if (isPressed()) {
- // Slog.d("KeyButtonView", "longpressed: " + this);
+ // Log.d("KeyButtonView", "longpressed: " + this);
if (mCode != 0) {
sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_LONG_PRESS);
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
@@ -213,7 +213,7 @@ public class KeyButtonView extends ImageView {
switch (action) {
case MotionEvent.ACTION_DOWN:
- //Slog.d("KeyButtonView", "press");
+ //Log.d("KeyButtonView", "press");
mDownTime = SystemClock.uptimeMillis();
setPressed(true);
if (mCode != 0) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 36195871ee4f..57c347bf488a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -37,7 +37,7 @@ import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
-import android.util.Slog;
+import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
@@ -429,7 +429,7 @@ public class NetworkController extends BroadcastReceiver {
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
if (DEBUG) {
- Slog.d(TAG, "onSignalStrengthsChanged signalStrength=" + signalStrength +
+ Log.d(TAG, "onSignalStrengthsChanged signalStrength=" + signalStrength +
((signalStrength == null) ? "" : (" level=" + signalStrength.getLevel())));
}
mSignalStrength = signalStrength;
@@ -440,7 +440,7 @@ public class NetworkController extends BroadcastReceiver {
@Override
public void onServiceStateChanged(ServiceState state) {
if (DEBUG) {
- Slog.d(TAG, "onServiceStateChanged state=" + state.getState());
+ Log.d(TAG, "onServiceStateChanged state=" + state.getState());
}
mServiceState = state;
updateTelephonySignalStrength();
@@ -452,7 +452,7 @@ public class NetworkController extends BroadcastReceiver {
@Override
public void onCallStateChanged(int state, String incomingNumber) {
if (DEBUG) {
- Slog.d(TAG, "onCallStateChanged state=" + state);
+ Log.d(TAG, "onCallStateChanged state=" + state);
}
// In cdma, if a voice call is made, RSSI should switch to 1x.
if (isCdma()) {
@@ -464,7 +464,7 @@ public class NetworkController extends BroadcastReceiver {
@Override
public void onDataConnectionStateChanged(int state, int networkType) {
if (DEBUG) {
- Slog.d(TAG, "onDataConnectionStateChanged: state=" + state
+ Log.d(TAG, "onDataConnectionStateChanged: state=" + state
+ " type=" + networkType);
}
mDataState = state;
@@ -477,7 +477,7 @@ public class NetworkController extends BroadcastReceiver {
@Override
public void onDataActivity(int direction) {
if (DEBUG) {
- Slog.d(TAG, "onDataActivity: direction=" + direction);
+ Log.d(TAG, "onDataActivity: direction=" + direction);
}
mDataActivity = direction;
updateDataIcon();
@@ -539,13 +539,13 @@ public class NetworkController extends BroadcastReceiver {
private final void updateTelephonySignalStrength() {
if (!hasService()) {
- if (CHATTY) Slog.d(TAG, "updateTelephonySignalStrength: !hasService()");
+ if (CHATTY) Log.d(TAG, "updateTelephonySignalStrength: !hasService()");
mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
mQSPhoneSignalIconId = R.drawable.ic_qs_signal_no_signal;
mDataSignalIconId = R.drawable.stat_sys_signal_null;
} else {
if (mSignalStrength == null) {
- if (CHATTY) Slog.d(TAG, "updateTelephonySignalStrength: mSignalStrength == null");
+ if (CHATTY) Log.d(TAG, "updateTelephonySignalStrength: mSignalStrength == null");
mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
mQSPhoneSignalIconId = R.drawable.ic_qs_signal_no_signal;
mDataSignalIconId = R.drawable.stat_sys_signal_null;
@@ -556,7 +556,7 @@ public class NetworkController extends BroadcastReceiver {
int[] iconList;
if (isCdma() && mAlwaysShowCdmaRssi) {
mLastSignalLevel = iconLevel = mSignalStrength.getCdmaLevel();
- if(DEBUG) Slog.d(TAG, "mAlwaysShowCdmaRssi=" + mAlwaysShowCdmaRssi
+ if(DEBUG) Log.d(TAG, "mAlwaysShowCdmaRssi=" + mAlwaysShowCdmaRssi
+ " set to cdmaLevel=" + mSignalStrength.getCdmaLevel()
+ " instead of level=" + mSignalStrength.getLevel());
} else {
@@ -798,7 +798,7 @@ public class NetworkController extends BroadcastReceiver {
void updateNetworkName(boolean showSpn, String spn, boolean showPlmn, String plmn) {
if (false) {
- Slog.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn
+ Log.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn
+ " showPlmn=" + showPlmn + " plmn=" + plmn);
}
StringBuilder str = new StringBuilder();
@@ -832,7 +832,7 @@ public class NetworkController extends BroadcastReceiver {
mWifiChannel.sendMessage(Message.obtain(this,
AsyncChannel.CMD_CHANNEL_FULL_CONNECTION));
} else {
- Slog.e(TAG, "Failed to connect to wifi");
+ Log.e(TAG, "Failed to connect to wifi");
}
break;
case WifiManager.DATA_ACTIVITY_NOTIFICATION:
@@ -964,7 +964,7 @@ public class NetworkController extends BroadcastReceiver {
private void updateConnectivity(Intent intent) {
if (CHATTY) {
- Slog.d(TAG, "updateConnectivity: intent=" + intent);
+ Log.d(TAG, "updateConnectivity: intent=" + intent);
}
final ConnectivityManager connManager = (ConnectivityManager) mContext
@@ -984,8 +984,8 @@ public class NetworkController extends BroadcastReceiver {
int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0);
if (CHATTY) {
- Slog.d(TAG, "updateConnectivity: networkInfo=" + info);
- Slog.d(TAG, "updateConnectivity: connectionStatus=" + connectionStatus);
+ Log.d(TAG, "updateConnectivity: networkInfo=" + info);
+ Log.d(TAG, "updateConnectivity: connectionStatus=" + connectionStatus);
}
mInetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
@@ -1173,7 +1173,7 @@ public class NetworkController extends BroadcastReceiver {
}
if (DEBUG) {
- Slog.d(TAG, "refreshViews connected={"
+ Log.d(TAG, "refreshViews connected={"
+ (mWifiConnected?" wifi":"")
+ (mDataConnected?" data":"")
+ " } level="
@@ -1312,7 +1312,7 @@ public class NetworkController extends BroadcastReceiver {
// the data direction overlay
if (mLastDataDirectionOverlayIconId != combinedActivityIconId) {
if (DEBUG) {
- Slog.d(TAG, "changing data overlay icon id to " + combinedActivityIconId);
+ Log.d(TAG, "changing data overlay icon id to " + combinedActivityIconId);
}
mLastDataDirectionOverlayIconId = combinedActivityIconId;
N = mDataDirectionOverlayIconViews.size();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java
index 89eed1bd6138..9bf1c1b67794 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java
@@ -27,7 +27,6 @@ import android.content.res.TypedArray;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
-import android.util.Slog;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
@@ -87,11 +86,11 @@ public class NotificationRowLayout
setOnHierarchyChangeListener(new ViewGroup.OnHierarchyChangeListener() {
@Override
public void onChildViewAdded(View parent, View child) {
- Slog.d(TAG, "view added: " + child + "; new count: " + getChildCount());
+ Log.d(TAG, "view added: " + child + "; new count: " + getChildCount());
}
@Override
public void onChildViewRemoved(View parent, View child) {
- Slog.d(TAG, "view removed: " + child + "; new count: " + (getChildCount() - 1));
+ Log.d(TAG, "view removed: " + child + "; new count: " + (getChildCount() - 1));
}
});
@@ -167,7 +166,7 @@ public class NotificationRowLayout
}
public void onChildDismissed(View v) {
- if (DEBUG) Slog.v(TAG, "onChildDismissed: " + v + " mRemoveViews=" + mRemoveViews);
+ if (DEBUG) Log.v(TAG, "onChildDismissed: " + v + " mRemoveViews=" + mRemoveViews);
final View veto = v.findViewById(R.id.veto);
if (veto != null && veto.getVisibility() != View.GONE && mRemoveViews) {
veto.performClick();
@@ -231,7 +230,7 @@ public class NotificationRowLayout
* get removed properly.
*/
public void setViewRemoval(boolean removeViews) {
- if (DEBUG) Slog.v(TAG, "setViewRemoval: " + removeViews);
+ if (DEBUG) Log.v(TAG, "setViewRemoval: " + removeViews);
mRemoveViews = removeViews;
}
@@ -266,7 +265,7 @@ public class NotificationRowLayout
super.onDraw(c);
if (DEBUG) logLayoutTransition();
if (DEBUG) {
- //Slog.d(TAG, "onDraw: canvas height: " + c.getHeight() + "px; measured height: "
+ //Log.d(TAG, "onDraw: canvas height: " + c.getHeight() + "px; measured height: "
// + getMeasuredHeight() + "px");
c.save();
c.clipRect(6, 6, c.getWidth() - 6, getMeasuredHeight() - 6,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java
index 70f9ac88d64b..3e138d52760e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java
@@ -23,7 +23,6 @@ import android.os.ServiceManager;
import android.os.Vibrator;
import android.media.AudioManager;
import android.provider.Settings;
-import android.util.Slog;
import android.view.IWindowManager;
import android.widget.CompoundButton;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/CompatModePanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/CompatModePanel.java
index 8c4ae197d3b7..080cbd535bdc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/CompatModePanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/CompatModePanel.java
@@ -21,7 +21,6 @@ import android.content.Context;
import android.content.res.TypedArray;
import android.os.RemoteException;
import android.util.AttributeSet;
-import android.util.Slog;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java
index 3d6c1a2f8a19..4f3c4d5761aa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java
@@ -20,7 +20,6 @@ import android.content.Context;
import android.content.res.Resources;
import android.os.Handler;
import android.util.AttributeSet;
-import android.util.Slog;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationLinearLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationLinearLayout.java
index 9ecb2e43146d..51980dd0eec9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationLinearLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationLinearLayout.java
@@ -26,7 +26,6 @@ import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
-import android.util.Slog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index 87fc6fce8d39..585c0676d056 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -23,7 +23,7 @@ import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -224,7 +224,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
- if (DEBUG) Slog.d(TAG, String.format("PANEL: onLayout: (%d, %d, %d, %d)", l, t, r, b));
+ if (DEBUG) Log.d(TAG, String.format("PANEL: onLayout: (%d, %d, %d, %d)", l, t, r, b));
}
@Override
@@ -232,7 +232,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
super.onSizeChanged(w, h, oldw, oldh);
if (DEBUG) {
- Slog.d(TAG, String.format("PANEL: onSizeChanged: (%d -> %d, %d -> %d)",
+ Log.d(TAG, String.format("PANEL: onSizeChanged: (%d -> %d, %d -> %d)",
oldw, w, oldh, h));
}
}
@@ -390,7 +390,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
}
void startAnimation(boolean appearing) {
- if (DEBUG) Slog.d(TAG, "startAnimation(appearing=" + appearing + ")");
+ if (DEBUG) Log.d(TAG, "startAnimation(appearing=" + appearing + ")");
createAnimation(appearing);
mContentAnim.start();
@@ -402,11 +402,11 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
}
public void onAnimationCancel(Animator animation) {
- if (DEBUG) Slog.d(TAG, "onAnimationCancel");
+ if (DEBUG) Log.d(TAG, "onAnimationCancel");
}
public void onAnimationEnd(Animator animation) {
- if (DEBUG) Slog.d(TAG, "onAnimationEnd");
+ if (DEBUG) Log.d(TAG, "onAnimationEnd");
if (! mVisible) {
setVisibility(View.GONE);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java
index 2924cc954454..48486b2908b6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java
@@ -28,7 +28,7 @@ import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.DragEvent;
import android.view.Gravity;
import android.view.MotionEvent;
@@ -96,21 +96,21 @@ public class ShirtPocket extends ImageView {
@Override
public boolean onDragEvent(DragEvent event) {
- if (DEBUG) Slog.d(TAG, "onDragEvent: " + event);
+ if (DEBUG) Log.d(TAG, "onDragEvent: " + event);
switch (event.getAction()) {
// We want to appear whenever a potential drag takes off from anywhere in the UI.
case DragEvent.ACTION_DRAG_STARTED:
show(true);
break;
case DragEvent.ACTION_DRAG_ENTERED:
- if (DEBUG) Slog.d(TAG, "entered!");
+ if (DEBUG) Log.d(TAG, "entered!");
// XXX: TODO
break;
case DragEvent.ACTION_DRAG_EXITED:
- if (DEBUG) Slog.d(TAG, "exited!");
+ if (DEBUG) Log.d(TAG, "exited!");
break;
case DragEvent.ACTION_DROP:
- if (DEBUG) Slog.d(TAG, "dropped!");
+ if (DEBUG) Log.d(TAG, "dropped!");
mPocket.stash(event.getClipData());
break;
case DragEvent.ACTION_DRAG_ENDED:
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index bfa1b635f06b..c2054d02b0ca 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -40,7 +40,7 @@ import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.text.TextUtils;
-import android.util.Slog;
+import android.util.Log;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
@@ -427,7 +427,7 @@ public class TabletStatusBar extends BaseStatusBar implements
}
if (newIconHPadding != mIconHPadding || newIconSize != mIconSize) {
-// Slog.d(TAG, "size=" + newIconSize + " padding=" + newIconHPadding);
+// Log.d(TAG, "size=" + newIconSize + " padding=" + newIconHPadding);
mIconHPadding = newIconHPadding;
mIconSize = newIconSize;
reloadAllNotificationIcons(); // reload the tray
@@ -436,7 +436,7 @@ public class TabletStatusBar extends BaseStatusBar implements
final int numIcons = res.getInteger(R.integer.config_maxNotificationIcons);
if (numIcons != mMaxNotificationIcons) {
mMaxNotificationIcons = numIcons;
- if (DEBUG) Slog.d(TAG, "max notification icons: " + mMaxNotificationIcons);
+ if (DEBUG) Log.d(TAG, "max notification icons: " + mMaxNotificationIcons);
reloadAllNotificationIcons();
}
}
@@ -461,7 +461,7 @@ public class TabletStatusBar extends BaseStatusBar implements
// Sanity-check that someone hasn't set up the config wrong and asked for a navigation
// bar on a tablet that has only the system bar
if (mWindowManagerService.hasNavigationBar()) {
- Slog.e(TAG, "Tablet device cannot show navigation bar and system bar");
+ Log.e(TAG, "Tablet device cannot show navigation bar and system bar");
}
} catch (RemoteException ex) {
}
@@ -711,7 +711,7 @@ public class TabletStatusBar extends BaseStatusBar implements
super.handleMessage(m);
switch (m.what) {
case MSG_OPEN_NOTIFICATION_PEEK:
- if (DEBUG) Slog.d(TAG, "opening notification peek window; arg=" + m.arg1);
+ if (DEBUG) Log.d(TAG, "opening notification peek window; arg=" + m.arg1);
if (m.arg1 >= 0) {
final int N = mNotificationData.size();
@@ -727,7 +727,7 @@ public class TabletStatusBar extends BaseStatusBar implements
final int peekIndex = m.arg1;
if (peekIndex < N) {
- //Slog.d(TAG, "loading peek: " + peekIndex);
+ //Log.d(TAG, "loading peek: " + peekIndex);
NotificationData.Entry entry =
mNotificationDNDMode
? mNotificationDNDDummyEntry
@@ -769,7 +769,7 @@ public class TabletStatusBar extends BaseStatusBar implements
}
break;
case MSG_CLOSE_NOTIFICATION_PEEK:
- if (DEBUG) Slog.d(TAG, "closing notification peek window");
+ if (DEBUG) Log.d(TAG, "closing notification peek window");
mNotificationPeekWindow.setVisibility(View.GONE);
mNotificationPeekRow.removeAllViews();
@@ -786,7 +786,7 @@ public class TabletStatusBar extends BaseStatusBar implements
mNotificationPeekKey = null;
break;
case MSG_OPEN_NOTIFICATION_PANEL:
- if (DEBUG) Slog.d(TAG, "opening notifications panel");
+ if (DEBUG) Log.d(TAG, "opening notifications panel");
if (!mNotificationPanel.isShowing()) {
mNotificationPanel.show(true, true);
mNotificationArea.setVisibility(View.INVISIBLE);
@@ -794,37 +794,37 @@ public class TabletStatusBar extends BaseStatusBar implements
}
break;
case MSG_CLOSE_NOTIFICATION_PANEL:
- if (DEBUG) Slog.d(TAG, "closing notifications panel");
+ if (DEBUG) Log.d(TAG, "closing notifications panel");
if (mNotificationPanel.isShowing()) {
mNotificationPanel.show(false, true);
mNotificationArea.setVisibility(View.VISIBLE);
}
break;
case MSG_OPEN_INPUT_METHODS_PANEL:
- if (DEBUG) Slog.d(TAG, "opening input methods panel");
+ if (DEBUG) Log.d(TAG, "opening input methods panel");
if (mInputMethodsPanel != null) mInputMethodsPanel.openPanel();
break;
case MSG_CLOSE_INPUT_METHODS_PANEL:
- if (DEBUG) Slog.d(TAG, "closing input methods panel");
+ if (DEBUG) Log.d(TAG, "closing input methods panel");
if (mInputMethodsPanel != null) mInputMethodsPanel.closePanel(false);
break;
case MSG_OPEN_COMPAT_MODE_PANEL:
- if (DEBUG) Slog.d(TAG, "opening compat panel");
+ if (DEBUG) Log.d(TAG, "opening compat panel");
if (mCompatModePanel != null) mCompatModePanel.openPanel();
break;
case MSG_CLOSE_COMPAT_MODE_PANEL:
- if (DEBUG) Slog.d(TAG, "closing compat panel");
+ if (DEBUG) Log.d(TAG, "closing compat panel");
if (mCompatModePanel != null) mCompatModePanel.closePanel();
break;
case MSG_SHOW_CHROME:
- if (DEBUG) Slog.d(TAG, "hiding shadows (lights on)");
+ if (DEBUG) Log.d(TAG, "hiding shadows (lights on)");
mBarContents.setVisibility(View.VISIBLE);
mShadow.setVisibility(View.GONE);
mSystemUiVisibility &= ~View.SYSTEM_UI_FLAG_LOW_PROFILE;
notifyUiVisibilityChanged();
break;
case MSG_HIDE_CHROME:
- if (DEBUG) Slog.d(TAG, "showing shadows (lights out)");
+ if (DEBUG) Log.d(TAG, "showing shadows (lights out)");
animateCollapsePanels();
visibilityChanged(false);
mBarContents.setVisibility(View.GONE);
@@ -840,20 +840,20 @@ public class TabletStatusBar extends BaseStatusBar implements
}
public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) {
- if (DEBUG) Slog.d(TAG, "addIcon(" + slot + ") -> " + icon);
+ if (DEBUG) Log.d(TAG, "addIcon(" + slot + ") -> " + icon);
}
public void updateIcon(String slot, int index, int viewIndex,
StatusBarIcon old, StatusBarIcon icon) {
- if (DEBUG) Slog.d(TAG, "updateIcon(" + slot + ") -> " + icon);
+ if (DEBUG) Log.d(TAG, "updateIcon(" + slot + ") -> " + icon);
}
public void removeIcon(String slot, int index, int viewIndex) {
- if (DEBUG) Slog.d(TAG, "removeIcon(" + slot + ")");
+ if (DEBUG) Log.d(TAG, "removeIcon(" + slot + ")");
}
public void addNotification(IBinder key, StatusBarNotification notification) {
- if (DEBUG) Slog.d(TAG, "addNotification(" + key + " -> " + notification + ")");
+ if (DEBUG) Log.d(TAG, "addNotification(" + key + " -> " + notification + ")");
addNotificationViews(key, notification);
final boolean immersive = isImmersive();
@@ -861,7 +861,7 @@ public class TabletStatusBar extends BaseStatusBar implements
// TODO: immersive mode popups for tablet
} else if (notification.getNotification().fullScreenIntent != null) {
// not immersive & a full-screen alert should be shown
- Slog.w(TAG, "Notification has fullScreenIntent and activity is not immersive;"
+ Log.w(TAG, "Notification has fullScreenIntent and activity is not immersive;"
+ " sending fullScreenIntent");
try {
notification.getNotification().fullScreenIntent.send();
@@ -875,7 +875,7 @@ public class TabletStatusBar extends BaseStatusBar implements
}
public void removeNotification(IBinder key) {
- if (DEBUG) Slog.d(TAG, "removeNotification(" + key + ")");
+ if (DEBUG) Log.d(TAG, "removeNotification(" + key + ")");
removeNotificationViews(key);
mTicker.remove(key);
setAreThereNotifications();
@@ -900,17 +900,17 @@ public class TabletStatusBar extends BaseStatusBar implements
// act accordingly
if ((diff & StatusBarManager.DISABLE_CLOCK) != 0) {
boolean show = (state & StatusBarManager.DISABLE_CLOCK) == 0;
- Slog.i(TAG, "DISABLE_CLOCK: " + (show ? "no" : "yes"));
+ Log.i(TAG, "DISABLE_CLOCK: " + (show ? "no" : "yes"));
showClock(show);
}
if ((diff & StatusBarManager.DISABLE_SYSTEM_INFO) != 0) {
boolean show = (state & StatusBarManager.DISABLE_SYSTEM_INFO) == 0;
- Slog.i(TAG, "DISABLE_SYSTEM_INFO: " + (show ? "no" : "yes"));
+ Log.i(TAG, "DISABLE_SYSTEM_INFO: " + (show ? "no" : "yes"));
mNotificationTrigger.setVisibility(show ? View.VISIBLE : View.GONE);
}
if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
if ((state & StatusBarManager.DISABLE_EXPAND) != 0) {
- Slog.i(TAG, "DISABLE_EXPAND: yes");
+ Log.i(TAG, "DISABLE_EXPAND: yes");
animateCollapsePanels();
visibilityChanged(false);
}
@@ -920,10 +920,10 @@ public class TabletStatusBar extends BaseStatusBar implements
.getBoolean(Prefs.DO_NOT_DISTURB_PREF, Prefs.DO_NOT_DISTURB_DEFAULT);
if ((state & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {
- Slog.i(TAG, "DISABLE_NOTIFICATION_ICONS: yes" + (mNotificationDNDMode?" (DND)":""));
+ Log.i(TAG, "DISABLE_NOTIFICATION_ICONS: yes" + (mNotificationDNDMode?" (DND)":""));
mTicker.halt();
} else {
- Slog.i(TAG, "DISABLE_NOTIFICATION_ICONS: no" + (mNotificationDNDMode?" (DND)":""));
+ Log.i(TAG, "DISABLE_NOTIFICATION_ICONS: no" + (mNotificationDNDMode?" (DND)":""));
}
// refresh icons to show either notifications or the DND message
@@ -1089,7 +1089,7 @@ public class TabletStatusBar extends BaseStatusBar implements
on = true;
}
- Slog.v(TAG, "setLightsOn(" + on + ")");
+ Log.v(TAG, "setLightsOn(" + on + ")");
if (on) {
setSystemUiVisibility(0, View.SYSTEM_UI_FLAG_LOW_PROFILE);
} else {
@@ -1099,7 +1099,7 @@ public class TabletStatusBar extends BaseStatusBar implements
public void topAppWindowChanged(boolean showMenu) {
if (DEBUG) {
- Slog.d(TAG, (showMenu?"showing":"hiding") + " the MENU button");
+ Log.d(TAG, (showMenu?"showing":"hiding") + " the MENU button");
}
mMenuButton.setVisibility(showMenu ? View.VISIBLE : View.GONE);
@@ -1182,7 +1182,7 @@ public class TabletStatusBar extends BaseStatusBar implements
@Override
public void setHardKeyboardStatus(boolean available, boolean enabled) {
if (DEBUG) {
- Slog.d(TAG, "Set hard keyboard status: available=" + available
+ Log.d(TAG, "Set hard keyboard status: available=" + available
+ ", enabled=" + enabled);
}
mInputMethodSwitchButton.setHardKeyboardStatus(available);
@@ -1201,7 +1201,7 @@ public class TabletStatusBar extends BaseStatusBar implements
private boolean isImmersive() {
try {
return ActivityManagerNative.getDefault().isTopActivityImmersive();
- //Slog.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive"));
+ //Log.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive"));
} catch (RemoteException ex) {
// the end is nigh
return false;
@@ -1228,14 +1228,14 @@ public class TabletStatusBar extends BaseStatusBar implements
};
public void onClickRecentButton() {
- if (DEBUG) Slog.d(TAG, "clicked recent apps; disabled=" + mDisabled);
+ if (DEBUG) Log.d(TAG, "clicked recent apps; disabled=" + mDisabled);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) == 0) {
toggleRecentApps();
}
}
public void onClickInputMethodSwitchButton() {
- if (DEBUG) Slog.d(TAG, "clicked input methods panel; disabled=" + mDisabled);
+ if (DEBUG) Log.d(TAG, "clicked input methods panel; disabled=" + mDisabled);
int msg = (mInputMethodsPanel.getVisibility() == View.GONE) ?
MSG_OPEN_INPUT_METHODS_PANEL : MSG_CLOSE_INPUT_METHODS_PANEL;
mHandler.removeMessages(msg);
@@ -1272,7 +1272,7 @@ public class TabletStatusBar extends BaseStatusBar implements
}
public boolean onTouch(View v, MotionEvent event) {
-// Slog.d(TAG, String.format("touch: (%.1f, %.1f) initial: (%.1f, %.1f)",
+// Log.d(TAG, String.format("touch: (%.1f, %.1f) initial: (%.1f, %.1f)",
// event.getX(),
// event.getY(),
// mInitialTouchX,
@@ -1333,7 +1333,7 @@ public class TabletStatusBar extends BaseStatusBar implements
public void resetNotificationPeekFadeTimer() {
if (DEBUG) {
- Slog.d(TAG, "setting peek fade timer for " + NOTIFICATION_PEEK_FADE_DELAY
+ Log.d(TAG, "setting peek fade timer for " + NOTIFICATION_PEEK_FADE_DELAY
+ "ms from now");
}
mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PEEK);
@@ -1393,7 +1393,7 @@ public class TabletStatusBar extends BaseStatusBar implements
int N = mNotificationData.size();
if (DEBUG) {
- Slog.d(TAG, "refreshing icons: " + N + " notifications, mIconLayout=" + mIconLayout);
+ Log.d(TAG, "refreshing icons: " + N + " notifications, mIconLayout=" + mIconLayout);
}
ArrayList<View> toShow = new ArrayList<View>();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java
index 30d49ca86d84..cd1c942854d2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java
@@ -23,7 +23,7 @@ import com.android.systemui.statusbar.DelegateViewHelper;
import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
-import android.util.Slog;
+import android.util.Log;
import android.view.View;
import android.view.MotionEvent;
import android.widget.FrameLayout;
@@ -80,7 +80,7 @@ public class TabletStatusBarView extends FrameLayout {
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
if (TabletStatusBar.DEBUG) {
- Slog.d(TabletStatusBar.TAG, "TabletStatusBarView intercepting touch event: " + ev);
+ Log.d(TabletStatusBar.TAG, "TabletStatusBarView intercepting touch event: " + ev);
}
// do not close the recents panel here- the intended behavior is that recents is dismissed
// on touch up when clicking on status bar buttons
@@ -96,7 +96,7 @@ public class TabletStatusBarView extends FrameLayout {
if (mPanels[i] != null && mPanels[i].getVisibility() == View.VISIBLE) {
if (eventInside(mIgnoreChildren[i], ev)) {
if (TabletStatusBar.DEBUG) {
- Slog.d(TabletStatusBar.TAG,
+ Log.d(TabletStatusBar.TAG,
"TabletStatusBarView eating event for view: "
+ mIgnoreChildren[i]);
}
@@ -106,7 +106,7 @@ public class TabletStatusBarView extends FrameLayout {
}
}
if (TabletStatusBar.DEBUG) {
- Slog.d(TabletStatusBar.TAG, "TabletStatusBarView not intercepting event");
+ Log.d(TabletStatusBar.TAG, "TabletStatusBarView not intercepting event");
}
if (mDelegateHelper != null && mDelegateHelper.onInterceptTouchEvent(ev)) {
return true;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
index 095c4410552d..04e0e5662340 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
@@ -29,7 +29,7 @@ import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
-import android.util.Slog;
+import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@@ -89,7 +89,7 @@ public class TabletTicker
public void add(IBinder key, StatusBarNotification notification) {
if (false) {
- Slog.d(TAG, "add 1 mCurrentNotification=" + mCurrentNotification
+ Log.d(TAG, "add 1 mCurrentNotification=" + mCurrentNotification
+ " mQueuePos=" + mQueuePos + " mQueue=" + Arrays.toString(mQueue));
}
@@ -195,7 +195,7 @@ public class TabletTicker
mCurrentKey = mKeys[0];
mCurrentNotification = mQueue[0];
if (false) {
- Slog.d(TAG, "dequeue mQueuePos=" + mQueuePos + " mQueue=" + Arrays.toString(mQueue));
+ Log.d(TAG, "dequeue mQueuePos=" + mQueuePos + " mQueue=" + Arrays.toString(mQueue));
}
final int N = mQueuePos;
for (int i=0; i<N; i++) {
@@ -276,7 +276,7 @@ public class TabletTicker
if (expanded == null) {
final String ident = notification.getPackageName()
+ "/0x" + Integer.toHexString(notification.getId());
- Slog.e(TAG, "couldn't inflate view for notification " + ident, exception);
+ Log.e(TAG, "couldn't inflate view for notification " + ident, exception);
return null;
}
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
index 06696febad80..a3eeb477b2f7 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -29,7 +29,7 @@ import android.os.UserHandle;
import android.os.storage.StorageEventListener;
import android.os.storage.StorageManager;
import android.provider.Settings;
-import android.util.Slog;
+import android.util.Log;
public class StorageNotification extends StorageEventListener {
private static final String TAG = "StorageNotification";
@@ -71,7 +71,7 @@ public class StorageNotification extends StorageEventListener {
mStorageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
final boolean connected = mStorageManager.isUsbMassStorageConnected();
- if (DEBUG) Slog.d(TAG, String.format( "Startup with UMS connection %s (media state %s)",
+ if (DEBUG) Log.d(TAG, String.format( "Startup with UMS connection %s (media state %s)",
mUmsAvailable, Environment.getExternalStorageState()));
HandlerThread thr = new HandlerThread("SystemUI StorageNotification");
@@ -102,7 +102,7 @@ public class StorageNotification extends StorageEventListener {
*/
String st = Environment.getExternalStorageState();
- if (DEBUG) Slog.i(TAG, String.format("UMS connection changed to %s (media state %s)",
+ if (DEBUG) Log.i(TAG, String.format("UMS connection changed to %s (media state %s)",
connected, st));
if (connected && (st.equals(
@@ -129,7 +129,7 @@ public class StorageNotification extends StorageEventListener {
}
private void onStorageStateChangedAsync(String path, String oldState, String newState) {
- if (DEBUG) Slog.i(TAG, String.format(
+ if (DEBUG) Log.i(TAG, String.format(
"Media {%s} state changed from {%s} -> {%s}", path, oldState, newState));
if (newState.equals(Environment.MEDIA_SHARED)) {
/*
@@ -250,7 +250,7 @@ public class StorageNotification extends StorageEventListener {
true, true, null);
updateUsbMassStorageNotification(false);
} else {
- Slog.w(TAG, String.format("Ignoring unknown state {%s}", newState));
+ Log.w(TAG, String.format("Ignoring unknown state {%s}", newState));
}
}
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 0d266c27bdc7..a78d68b6c163 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -50,12 +50,14 @@ import android.os.INetworkManagementService;
import android.os.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
+import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.util.Log;
import android.util.Slog;
import android.util.SparseBooleanArray;
+import com.android.internal.app.IBatteryStats;
import com.android.internal.net.NetworkStatsFactory;
import com.android.internal.util.Preconditions;
import com.android.server.NativeDaemonConnector.Command;
@@ -343,6 +345,14 @@ public class NetworkManagementService extends INetworkManagementService.Stub
SystemProperties.set(PROP_QTAGUID_ENABLED, mBandwidthControlEnabled ? "1" : "0");
+ if (mBandwidthControlEnabled) {
+ try {
+ IBatteryStats.Stub.asInterface(ServiceManager.getService("batteryinfo"))
+ .noteNetworkStatsEnabled();
+ } catch (RemoteException e) {
+ }
+ }
+
// push any existing quota or UID rules
synchronized (mQuotaLock) {
int size = mActiveQuotas.size();
diff --git a/services/java/com/android/server/am/BatteryStatsService.java b/services/java/com/android/server/am/BatteryStatsService.java
index 9b3fbe93a909..5a15f0bb8846 100644
--- a/services/java/com/android/server/am/BatteryStatsService.java
+++ b/services/java/com/android/server/am/BatteryStatsService.java
@@ -431,6 +431,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub {
}
}
+ @Override
public void noteNetworkInterfaceType(String iface, int type) {
enforceCallingPermission();
synchronized (mStats) {
@@ -438,6 +439,14 @@ public final class BatteryStatsService extends IBatteryStats.Stub {
}
}
+ @Override
+ public void noteNetworkStatsEnabled() {
+ enforceCallingPermission();
+ synchronized (mStats) {
+ mStats.noteNetworkStatsEnabledLocked();
+ }
+ }
+
public boolean isOnBattery() {
return mStats.isOnBattery();
}