From 4d7a38588911bf7de3803ea7d53783d3a89bd2f2 Mon Sep 17 00:00:00 2001
From: Mike Lockwood <>
Date: Tue, 31 Mar 2009 13:59:40 -0700
Subject: [PATCH 01/19] AI 143648: am: CL 143616 Fix ANR that could occur when
disabling GPS in Settings while the GPS is active. Exit from GpsEventThread
immediately when the GPS is disabled instead of waiting for the GPS to shut
down fully. BUG=1729031 Original author: lockwood Merged from:
//branches/donutburger/...
Automated import of CL 143648
---
.../android/internal/location/GpsLocationProvider.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java
index 887574a66bad1..f5950501d5107 100644
--- a/location/java/com/android/internal/location/GpsLocationProvider.java
+++ b/location/java/com/android/internal/location/GpsLocationProvider.java
@@ -412,6 +412,12 @@ public class GpsLocationProvider extends LocationProviderImpl {
mNetworkThread = null;
}
+ // The GpsEventThread does not wait for the GPS to shutdown
+ // so we need to report the GPS_STATUS_ENGINE_OFF event here
+ if (mNavigating) {
+ reportStatus(GPS_STATUS_ENGINE_OFF);
+ }
+
native_cleanup();
}
@@ -797,8 +803,8 @@ public class GpsLocationProvider extends LocationProviderImpl {
public void run() {
if (Config.LOGD) Log.d(TAG, "GpsEventThread starting");
- // thread exits after disable() is called and navigation has stopped
- while (mEnabled || mNavigating) {
+ // Exit as soon as disable() is called instead of waiting for the GPS to stop.
+ while (mEnabled) {
// this will wait for an event from the GPS,
// which will be reported via reportLocation or reportStatus
native_wait_for_event();
From a3ea3ae07ff3fec565215ad73fc7430a07b57418 Mon Sep 17 00:00:00 2001
From: Eric Fischer <>
Date: Tue, 31 Mar 2009 14:17:10 -0700
Subject: [PATCH 02/19] AI 143697: am: CL 143669 am: CL 143495 Add more
accented letters to the character picker. The hardware keyboard doesn't
have all the accents needed for Czech and Polish, so round out the
selection. Original author: enf Merged from: //branches/cupcake/...
Original author: android-build Merged from: //branches/donutburger/...
Automated import of CL 143697
---
.../text/method/QwertyKeyListener.java | 41 ++++++++++++-------
1 file changed, 26 insertions(+), 15 deletions(-)
diff --git a/core/java/android/text/method/QwertyKeyListener.java b/core/java/android/text/method/QwertyKeyListener.java
index 21bc2a6311b64..e420c27516e30 100644
--- a/core/java/android/text/method/QwertyKeyListener.java
+++ b/core/java/android/text/method/QwertyKeyListener.java
@@ -405,23 +405,34 @@ public class QwertyKeyListener extends BaseKeyListener {
PICKER_SETS.put('<', "\u00AB");
PICKER_SETS.put('>', "\u00BB");
PICKER_SETS.put('?', "\u00BF");
- PICKER_SETS.put('A', "\u00C0\u00C1\u00C2\u00C4\u00C6\u00C3\u00C5");
- PICKER_SETS.put('C', "\u00C7");
- PICKER_SETS.put('E', "\u00C8\u00C9\u00CA\u00CB");
- PICKER_SETS.put('I', "\u00CC\u00CD\u00CE\u00CF");
- PICKER_SETS.put('N', "\u00D1");
- PICKER_SETS.put('O', "\u00D8\u0152\u00D5\u00D2\u00D3\u00D4\u00D6");
- PICKER_SETS.put('U', "\u00D9\u00DA\u00DB\u00DC");
+ PICKER_SETS.put('A', "\u00C0\u00C1\u00C2\u00C4\u00C6\u00C3\u00C5\u0104\u0100");
+ PICKER_SETS.put('C', "\u00C7\u0106\u010C");
+ PICKER_SETS.put('D', "\u010E");
+ PICKER_SETS.put('E', "\u00C8\u00C9\u00CA\u00CB\u0118\u011A\u0112");
+ PICKER_SETS.put('L', "\u0141");
+ PICKER_SETS.put('I', "\u00CC\u00CD\u00CE\u00CF\u012A");
+ PICKER_SETS.put('N', "\u00D1\u0143\u0147");
+ PICKER_SETS.put('O', "\u00D8\u0152\u00D5\u00D2\u00D3\u00D4\u00D6\u014C");
+ PICKER_SETS.put('R', "\u0158");
+ PICKER_SETS.put('S', "\u015A\u0160");
+ PICKER_SETS.put('T', "\u0164");
+ PICKER_SETS.put('U', "\u00D9\u00DA\u00DB\u00DC\u016E\u016A");
PICKER_SETS.put('Y', "\u00DD\u0178");
- PICKER_SETS.put('a', "\u00E0\u00E1\u00E2\u00E4\u00E6\u00E3\u00E5");
- PICKER_SETS.put('c', "\u00E7");
- PICKER_SETS.put('e', "\u00E8\u00E9\u00EA\u00EB");
- PICKER_SETS.put('i', "\u00EC\u00ED\u00EE\u00EF");
- PICKER_SETS.put('n', "\u00F1");
- PICKER_SETS.put('o', "\u00F8\u0153\u00F5\u00F2\u00F3\u00F4\u00F6");
- PICKER_SETS.put('s', "\u00A7\u00DF");
- PICKER_SETS.put('u', "\u00F9\u00FA\u00FB\u00FC");
+ PICKER_SETS.put('Z', "\u0179\u017B\u017D");
+ PICKER_SETS.put('a', "\u00E0\u00E1\u00E2\u00E4\u00E6\u00E3\u00E5\u0105\u0101");
+ PICKER_SETS.put('c', "\u00E7\u0107\u010D");
+ PICKER_SETS.put('d', "\u010F");
+ PICKER_SETS.put('e', "\u00E8\u00E9\u00EA\u00EB\u0119\u011B\u0113");
+ PICKER_SETS.put('i', "\u00EC\u00ED\u00EE\u00EF\u012B");
+ PICKER_SETS.put('l', "\u0142");
+ PICKER_SETS.put('n', "\u00F1\u0144\u0148");
+ PICKER_SETS.put('o', "\u00F8\u0153\u00F5\u00F2\u00F3\u00F4\u00F6\u014D");
+ PICKER_SETS.put('r', "\u0159");
+ PICKER_SETS.put('s', "\u00A7\u00DF\u015B\u0161");
+ PICKER_SETS.put('t', "\u0165");
+ PICKER_SETS.put('u', "\u00F9\u00FA\u00FB\u00FC\u016F\u016B");
PICKER_SETS.put('y', "\u00FD\u00FF");
+ PICKER_SETS.put('z', "\u017A\u017C\u017E");
PICKER_SETS.put(KeyCharacterMap.PICKER_DIALOG_INPUT,
"\u2026\u00A5\u2022\u00AE\u00A9\u00B1");
};
From 549d7243ff9cf638a63a0d5cc82c792b39484e8e Mon Sep 17 00:00:00 2001
From: Eric Fischer <>
Date: Tue, 31 Mar 2009 14:19:47 -0700
Subject: [PATCH 03/19] AI 143709: am: CL 143678 am: CL 143540 Try not to start
TextView lines with non-starter characters. TextView was previously
following the "relaxed" line breaking convention and would allow a line
break between any two ideographic characters. Tighten that up and do not
allow line breaks before non-starter characters (sound and iteration
marks and small Hiragana and Katakana). Original author: enf Merged from:
//branches/cupcake/... Original author: android-build Merged from:
//branches/donutburger/...
Automated import of CL 143709
---
core/java/android/text/StaticLayout.java | 57 ++++++++++++++++++++++--
1 file changed, 53 insertions(+), 4 deletions(-)
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index 686e8f5327e85..c133cf2b30a00 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -618,7 +618,9 @@ extends Layout
* - is class HY: a breakpoint
* except when followed by a digit.
*
- * Ideographs are class ID: breakpoints when adjacent.
+ * Ideographs are class ID: breakpoints when adjacent,
+ * except for NS (non-starters), which can be broken
+ * after but not before.
*/
if (c == ' ' || c == '\t' ||
@@ -627,8 +629,8 @@ extends Layout
(j + 1 >= next || !Character.isDigit(chs[j + 1 - start]))) ||
((c == '/' || c == '-') &&
(j + 1 >= next || !Character.isDigit(chs[j + 1 - start]))) ||
- (c >= FIRST_CJK && isIdeographic(c) &&
- j + 1 < next && isIdeographic(chs[j + 1 - start]))) {
+ (c >= FIRST_CJK && isIdeographic(c, true) &&
+ j + 1 < next && isIdeographic(chs[j + 1 - start], false))) {
okwidth = w;
ok = j + 1;
@@ -807,8 +809,12 @@ extends Layout
* as being Ideographic (class ID) by the Unicode Line Breaking Algorithm
* (http://www.unicode.org/unicode/reports/tr14/), and is therefore OK
* to break between a pair of.
+ *
+ * @param includeNonStarters also return true for category NS
+ * (non-starters), which can be broken
+ * after but not before.
*/
- private static final boolean isIdeographic(char c) {
+ private static final boolean isIdeographic(char c, boolean includeNonStarters) {
if (c >= '\u2E80' && c <= '\u2FFF') {
return true; // CJK, KANGXI RADICALS, DESCRIPTION SYMBOLS
}
@@ -816,9 +822,52 @@ extends Layout
return true; // IDEOGRAPHIC SPACE
}
if (c >= '\u3040' && c <= '\u309F') {
+ if (!includeNonStarters) {
+ switch (c) {
+ case '\u3041': // # HIRAGANA LETTER SMALL A
+ case '\u3043': // # HIRAGANA LETTER SMALL I
+ case '\u3045': // # HIRAGANA LETTER SMALL U
+ case '\u3047': // # HIRAGANA LETTER SMALL E
+ case '\u3049': // # HIRAGANA LETTER SMALL O
+ case '\u3063': // # HIRAGANA LETTER SMALL TU
+ case '\u3083': // # HIRAGANA LETTER SMALL YA
+ case '\u3085': // # HIRAGANA LETTER SMALL YU
+ case '\u3087': // # HIRAGANA LETTER SMALL YO
+ case '\u308E': // # HIRAGANA LETTER SMALL WA
+ case '\u3095': // # HIRAGANA LETTER SMALL KA
+ case '\u3096': // # HIRAGANA LETTER SMALL KE
+ case '\u309B': // # KATAKANA-HIRAGANA VOICED SOUND MARK
+ case '\u309C': // # KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ case '\u309D': // # HIRAGANA ITERATION MARK
+ case '\u309E': // # HIRAGANA VOICED ITERATION MARK
+ return false;
+ }
+ }
return true; // Hiragana (except small characters)
}
if (c >= '\u30A0' && c <= '\u30FF') {
+ if (!includeNonStarters) {
+ switch (c) {
+ case '\u30A0': // # KATAKANA-HIRAGANA DOUBLE HYPHEN
+ case '\u30A1': // # KATAKANA LETTER SMALL A
+ case '\u30A3': // # KATAKANA LETTER SMALL I
+ case '\u30A5': // # KATAKANA LETTER SMALL U
+ case '\u30A7': // # KATAKANA LETTER SMALL E
+ case '\u30A9': // # KATAKANA LETTER SMALL O
+ case '\u30C3': // # KATAKANA LETTER SMALL TU
+ case '\u30E3': // # KATAKANA LETTER SMALL YA
+ case '\u30E5': // # KATAKANA LETTER SMALL YU
+ case '\u30E7': // # KATAKANA LETTER SMALL YO
+ case '\u30EE': // # KATAKANA LETTER SMALL WA
+ case '\u30F5': // # KATAKANA LETTER SMALL KA
+ case '\u30F6': // # KATAKANA LETTER SMALL KE
+ case '\u30FB': // # KATAKANA MIDDLE DOT
+ case '\u30FC': // # KATAKANA-HIRAGANA PROLONGED SOUND MARK
+ case '\u30FD': // # KATAKANA ITERATION MARK
+ case '\u30FE': // # KATAKANA VOICED ITERATION MARK
+ return false;
+ }
+ }
return true; // Katakana (except small characters)
}
if (c >= '\u3400' && c <= '\u4DB5') {
From dd5ebe0c5b4ebc7748f894ca199acc9fbaad8928 Mon Sep 17 00:00:00 2001
From: Eric Fischer <>
Date: Tue, 31 Mar 2009 14:20:40 -0700
Subject: [PATCH 04/19] AI 143712: am: CL 143685 am: CL 143547 Import revised
translations. Original author: enf Merged from: //branches/cupcake/...
Original author: android-build Merged from: //branches/donutburger/...
Automated import of CL 143712
---
core/res/res/values-ja/strings.xml | 38 +++++++++++++--------------
core/res/res/values-zh-rCN/arrays.xml | 32 ----------------------
core/res/res/values-zh-rTW/arrays.xml | 32 ----------------------
3 files changed, 19 insertions(+), 83 deletions(-)
delete mode 100644 core/res/res/values-zh-rCN/arrays.xml
delete mode 100644 core/res/res/values-zh-rTW/arrays.xml
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index ccc7f198ac3a6..29e4a6d994a0b 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -572,7 +572,7 @@
"%1$s %2$s"
"%1$s %2$s"
"%2$s、%1$s"
- "yyyy'/'MMMM'/'d"
+ "MMMMd'日 'yyyy"
"yyyy'年'MMMM'月'd'日'"
"MMM'/'d' 'yyyy'年'"
"d'/'MMM'/'yyyy"
@@ -586,16 +586,16 @@
"%Y年%B%-d日"
- "%Y年%B月"
+ "%Y年%B"
"%H:%M:%S"
"%Y/%B/%-d %H:%M:%S"
- "%2$s月%3$s日~%7$s月%8$s日"
+ "%2$s/%3$s~%7$s/%8$s"
"%2$s/%3$s%1$s~%7$s/%8$s%6$s"
- "%9$s年%2$s月%3$s日~%7$s月%8$s日"
+ "%2$s/%3$s~%7$s/%8$s, %9$s"
"%9$s/%2$s/%3$s%1$s~%7$s/%8$s%6$s"
- "%2$s月%3$s日%5$s~%7$s月%8$s日%10$s"
+ "%2$s/%3$s %5$s~%7$s/%8$s %10$s"
"%2$s/%3$s%1$s%5$s~%7$s/%8$s%6$s%10$s"
- "%4$s年%2$s月%3$s日 %5$s~%9$s年%7$s月%8$s日 %10$s"
+ "%4$s/%2$s/%3$s %5$s~%9$s/%7$s/%8$s %10$s"
"%4$s/%2$s/%3$s%1$s%5$s~%9$s/%7$s/%8$s%6$s%10$s"
"%2$s/%3$s~%7$s/%8$s"
"%2$s/%3$s%1$s~%7$s/%8$s%6$s"
@@ -607,7 +607,7 @@
"%4$s/%2$s/%3$s%1$s%5$s~%9$s/%7$s/%8$s%6$s%10$s"
"%2$s月%3$s日~%8$s日"
"%2$s/%3$s%1$s~%7$s/%8$s%6$s"
- "%9$s年%2$s月%3$s日~%8$s日"
+ "%2$s/%3$s - %8$s, %9$s"
"%4$s/%2$s/%3$s%1$s~%9$s/%7$s/%8$s%6$s"
"%2$s/%3$s%5$s~%7$s/%8$s%10$s"
"%2$s/%3$s%1$s%5$s~%7$s/%8$s%6$s%10$s"
@@ -665,18 +665,18 @@
"10月"
"11月"
"12月"
- "1月"
- "2月"
- "3月"
- "4月"
- "5月"
- "6月"
- "7月"
- "8月"
- "9月"
- "10月"
- "11月"
- "12月"
+ "1"
+ "2"
+ "3"
+ "4"
+ "5"
+ "6"
+ "7"
+ "8"
+ "9"
+ "10"
+ "11"
+ "12"
"1"
"2"
"3"
diff --git a/core/res/res/values-zh-rCN/arrays.xml b/core/res/res/values-zh-rCN/arrays.xml
deleted file mode 100644
index 16da6d91e49fb..0000000000000
--- a/core/res/res/values-zh-rCN/arrays.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
- - 39937795
- - 116387224
-
-
-
- - 2
-
-
-
diff --git a/core/res/res/values-zh-rTW/arrays.xml b/core/res/res/values-zh-rTW/arrays.xml
deleted file mode 100644
index be0795b84af01..0000000000000
--- a/core/res/res/values-zh-rTW/arrays.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
- - 25022112
- - 121478019
-
-
-
- - 3
-
-
-
From 538e53569b0c67dacf9f8f0b17ac8e5c080b55bb Mon Sep 17 00:00:00 2001
From: Dirk Dougherty <>
Date: Tue, 31 Mar 2009 14:24:19 -0700
Subject: [PATCH 05/19] AI 143716: am: CL 143696 am: CL 143576 SDK doc change:
Fix links from SDK upgrading docs to migration and diff info. Original
author: ddougherty Merged from: //branches/cupcake/... Original author:
android-build Merged from: //branches/donutburger/...
Automated import of CL 143716
---
docs/html/sdk/1.0_r1/upgrading.jd | 12 +++++++++---
docs/html/sdk/1.0_r2/upgrading.jd | 12 +++++++++---
docs/html/sdk/1.1_r1/upgrading.jd | 10 +++++-----
docs/html/sdk/1.5_r1/upgrading.jd | 11 ++++++-----
4 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/docs/html/sdk/1.0_r1/upgrading.jd b/docs/html/sdk/1.0_r1/upgrading.jd
index 480bff384a9f5..d6d5dc486c59e 100644
--- a/docs/html/sdk/1.0_r1/upgrading.jd
+++ b/docs/html/sdk/1.0_r1/upgrading.jd
@@ -133,11 +133,17 @@ to place 3rd jar files, which are now automatically handled by the Ant script.
Migrate your applications
-After updating your SDK, you will likely encounter breakages in your code, due to
-framework and API changes. You'll need to update your code to match changes in the Android APIs.
+If (and only if) you have written apps in an SDK released previous to
+the Android 1.0 SDK, you will need to migrate your applications. After
+updating your SDK, you may encounter breakages in your code, due to
+framework and API changes. You'll need to update your code to match
+changes in the Android APIs.
One way to start is to open your project in Eclipse and see where the ADT
-identifies errors in your application.
+identifies errors in your application. You can also look up
+specific changes in the Android APIs in the Overview of Changes and
+API Diffs Report, both available in the documentation included with the
+Android 1.0 SDK package.
If you have additional trouble updating your code, visit the
Android Developers Group
diff --git a/docs/html/sdk/1.0_r2/upgrading.jd b/docs/html/sdk/1.0_r2/upgrading.jd
index df9b6579273b0..409e30e8c1959 100644
--- a/docs/html/sdk/1.0_r2/upgrading.jd
+++ b/docs/html/sdk/1.0_r2/upgrading.jd
@@ -133,11 +133,17 @@ to place 3rd jar files, which are now automatically handled by the Ant script.
Migrate your applications
-After updating your SDK, you will likely encounter breakages in your code, due to
-framework and API changes. You'll need to update your code to match changes in the Android APIs.
+If (and only if) you have written apps in an SDK released previous to
+the Android 1.0 SDK, you will need to migrate your applications. After
+updating your SDK, you may encounter breakages in your code, due to
+framework and API changes. You'll need to update your code to match
+changes in the Android APIs.
One way to start is to open your project in Eclipse and see where the ADT
-identifies errors in your application.
+identifies errors in your application. You can also look up
+specific changes in the Android APIs in the Overview of Changes and
+API Diffs Report, both available in the documentation included with the
+Android 1.0 SDK package.
If you have additional trouble updating your code, visit the
Android Developers Group
diff --git a/docs/html/sdk/1.1_r1/upgrading.jd b/docs/html/sdk/1.1_r1/upgrading.jd
index 2ad6757c0904d..19095c0be948e 100644
--- a/docs/html/sdk/1.1_r1/upgrading.jd
+++ b/docs/html/sdk/1.1_r1/upgrading.jd
@@ -131,11 +131,11 @@ framework and API changes. You'll need to update your code to match the
latest APIs.
One way to start is to open your project in Eclipse and see where the ADT
-identifies errors in your application. From there, you can lookup
-specific API changes in the Android 1.0 APIs in the
-
-Overview of Changes and
-API Diffs Report.
+identifies errors in your application. You can also look up
+specific changes in the Android APIs in the
+Android 1.1 Version
+Notes document.
+
If you have additional trouble updating your code, visit the
Android Developers Group
diff --git a/docs/html/sdk/1.5_r1/upgrading.jd b/docs/html/sdk/1.5_r1/upgrading.jd
index 23cb82c29fa07..63b7a3ce559c4 100644
--- a/docs/html/sdk/1.5_r1/upgrading.jd
+++ b/docs/html/sdk/1.5_r1/upgrading.jd
@@ -131,11 +131,12 @@ framework and API changes. You'll need to update your code to match the
latest APIs.
One way to start is to open your project in Eclipse and see where the ADT
-identifies errors in your application. From there, you can lookup
-specific API changes in the Android 1.0 APIs in the
-
-Overview of Changes and
-API Diffs Report.
+identifies errors in your application. You can also look up
+specific changes in the Android APIs in the
+
+Android 1.5 Version Notes
+
+document.
If you have additional trouble updating your code, visit the
Android Developers Group
From c38c0f6b9869889fbb6743275e35f120a27f6361 Mon Sep 17 00:00:00 2001
From: Evan Millar <>
Date: Tue, 31 Mar 2009 14:27:47 -0700
Subject: [PATCH 06/19] AI 143720: am: CL 143710 am: CL 143615 -Add more stats:
-total network sent/received -total full/partial wakelock times.
-Format the network sent/received amounts to be more easily readable.
Original author: emillar Merged from: //branches/cupcake/... Original
author: android-build Merged from: //branches/donutburger/...
Automated import of CL 143720
---
core/java/android/os/BatteryStats.java | 113 +++++++++++++++++++++++--
1 file changed, 105 insertions(+), 8 deletions(-)
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index b0ae0e60b42e9..c747c43b81e7c 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -77,7 +77,11 @@ public abstract class BatteryStats implements Parcelable {
/**
* Bump the version on this if the checkin format changes.
*/
- private static final int BATTERY_STATS_CHECKIN_VERSION = 1;
+ private static final int BATTERY_STATS_CHECKIN_VERSION = 2;
+
+ private static final long BYTES_PER_KB = 1024;
+ private static final long BYTES_PER_MB = 1048576; // 1024^2
+ private static final long BYTES_PER_GB = 1073741824; //1024^3
// TODO: Update this list if you add/change any stats above.
private static final String[] STAT_NAMES = { "total", "last", "current", "unplugged" };
@@ -482,6 +486,23 @@ public abstract class BatteryStats implements Parcelable {
return mFormatBuilder.toString();
}
+ private final String formatBytesLocked(long bytes) {
+ mFormatBuilder.setLength(0);
+
+ if (bytes < BYTES_PER_KB) {
+ return bytes + "B";
+ } else if (bytes < BYTES_PER_MB) {
+ mFormatter.format("%.2fKB", bytes / (double) BYTES_PER_KB);
+ return mFormatBuilder.toString();
+ } else if (bytes < BYTES_PER_GB){
+ mFormatter.format("%.2fMB", bytes / (double) BYTES_PER_MB);
+ return mFormatBuilder.toString();
+ } else {
+ mFormatter.format("%.2fGB", bytes / (double) BYTES_PER_GB);
+ return mFormatBuilder.toString();
+ }
+ }
+
/**
*
* @param sb a StringBuilder object.
@@ -590,6 +611,9 @@ public abstract class BatteryStats implements Parcelable {
StringBuilder sb = new StringBuilder(128);
+ SparseArray extends Uid> uidStats = getUidStats();
+ final int NU = uidStats.size();
+
String category = STAT_NAMES[which];
// Dump "battery" stat
@@ -598,10 +622,42 @@ public abstract class BatteryStats implements Parcelable {
whichBatteryUptime / 1000, whichBatteryRealtime / 1000,
totalUptime / 1000, totalRealtime / 1000);
+ // Calculate total network and wakelock times across all uids.
+ long rxTotal = 0;
+ long txTotal = 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);
+
+ Map wakelocks = u.getWakelockStats();
+ if (wakelocks.size() > 0) {
+ for (Map.Entry ent
+ : wakelocks.entrySet()) {
+ Uid.Wakelock wl = ent.getValue();
+
+ Timer fullWakeTimer = wl.getWakeTime(WAKE_TYPE_FULL);
+ if (fullWakeTimer != null) {
+ fullWakeLockTimeTotal += fullWakeTimer.getTotalTime(batteryRealtime, which);
+ }
+
+ Timer partialWakeTimer = wl.getWakeTime(WAKE_TYPE_PARTIAL);
+ if (partialWakeTimer != null) {
+ partialWakeLockTimeTotal += partialWakeTimer.getTotalTime(
+ batteryRealtime, which);
+ }
+ }
+ }
+ }
+
// Dump misc stats
dumpLine(pw, 0 /* uid */, category, MISC_DATA,
screenOnTime / 1000, phoneOnTime / 1000, wifiOnTime / 1000,
- wifiRunningTime / 1000, bluetoothOnTime / 1000);
+ wifiRunningTime / 1000, bluetoothOnTime / 1000, rxTotal, txTotal,
+ fullWakeLockTimeTotal, partialWakeLockTimeTotal);
// Dump signal strength stats
Object[] args = new Object[NUM_SIGNAL_STRENGTH_BINS];
@@ -622,8 +678,6 @@ public abstract class BatteryStats implements Parcelable {
getPluggedStartLevel());
}
- SparseArray extends Uid> uidStats = getUidStats();
- final int NU = uidStats.size();
for (int iu = 0; iu < NU; iu++) {
final int uid = uidStats.keyAt(iu);
Uid u = uidStats.valueAt(iu);
@@ -741,6 +795,9 @@ public abstract class BatteryStats implements Parcelable {
final long totalUptime = computeUptime(rawUptime, which);
StringBuilder sb = new StringBuilder(128);
+
+ SparseArray extends Uid> uidStats = getUidStats();
+ final int NU = uidStats.size();
pw.println(prefix
+ " Time on battery: " + formatTimeMs(whichBatteryUptime / 1000)
@@ -774,6 +831,47 @@ public abstract class BatteryStats implements Parcelable {
+ "), Bluetooth on: " + formatTimeMs(bluetoothOnTime / 1000)
+ "(" + formatRatioLocked(bluetoothOnTime, whichBatteryRealtime)+ ")");
+ // Calculate total network and wakelock times across all uids.
+ long rxTotal = 0;
+ long txTotal = 0;
+ long fullWakeLockTimeTotalMicros = 0;
+ long partialWakeLockTimeTotalMicros = 0;
+
+ for (int iu = 0; iu < NU; iu++) {
+ Uid u = uidStats.valueAt(iu);
+ rxTotal += u.getTcpBytesReceived(which);
+ txTotal += u.getTcpBytesSent(which);
+
+ Map wakelocks = u.getWakelockStats();
+ if (wakelocks.size() > 0) {
+ for (Map.Entry ent
+ : wakelocks.entrySet()) {
+ Uid.Wakelock wl = ent.getValue();
+
+ Timer fullWakeTimer = wl.getWakeTime(WAKE_TYPE_FULL);
+ if (fullWakeTimer != null) {
+ fullWakeLockTimeTotalMicros += fullWakeTimer.getTotalTime(
+ batteryRealtime, which);
+ }
+
+ Timer partialWakeTimer = wl.getWakeTime(WAKE_TYPE_PARTIAL);
+ if (partialWakeTimer != null) {
+ partialWakeLockTimeTotalMicros += partialWakeTimer.getTotalTime(
+ batteryRealtime, which);
+ }
+ }
+ }
+ }
+
+ pw.println(prefix
+ + " Total received: " + formatBytesLocked(rxTotal)
+ + ", Total sent: " + formatBytesLocked(txTotal));
+ pw.println(prefix
+ + " Total full wakelock time: " + formatTimeMs(
+ (fullWakeLockTimeTotalMicros + 500) / 1000)
+ + ", Total partial waklock time: " + formatTimeMs(
+ (partialWakeLockTimeTotalMicros + 500) / 1000));
+
sb.setLength(0);
sb.append(" Signal strengths: ");
boolean didOne = false;
@@ -832,8 +930,7 @@ public abstract class BatteryStats implements Parcelable {
pw.println(" ");
- SparseArray extends Uid> uidStats = getUidStats();
- final int NU = uidStats.size();
+
for (int iu=0; iu
Date: Tue, 31 Mar 2009 14:29:35 -0700
Subject: [PATCH 07/19] AI 143733: Fix for issue 1648553: IME overlaps over
focus ring in gmail search box. In WebView::requestChildRectangleOnScreen we
now move a rectangle up if its bottom is offscreen, even if its top is not.
We also move it so that its top is at the top third of the WebView's height
(if it still fits on screen) so that you can see space (and potentially other
input fields) below it. BUG=1648553
Automated import of CL 143733
---
core/java/android/webkit/WebView.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 052c2d3835d30..17ab8c92365d4 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -4405,14 +4405,19 @@ public class WebView extends AbsoluteLayout
int scrollYDelta = 0;
- if (rect.bottom > screenBottom && rect.top > screenTop) {
- if (rect.height() > height) {
- scrollYDelta += (rect.top - screenTop);
+ if (rect.bottom > screenBottom) {
+ int oneThirdOfScreenHeight = height / 3;
+ if (rect.height() > 2 * oneThirdOfScreenHeight) {
+ // If the rectangle is too tall to fit in the bottom two thirds
+ // of the screen, place it at the top.
+ scrollYDelta = rect.top - screenTop;
} else {
- scrollYDelta += (rect.bottom - screenBottom);
+ // If the rectangle will still fit on screen, we want its
+ // top to be in the top third of the screen.
+ scrollYDelta = rect.top - (screenTop + oneThirdOfScreenHeight);
}
} else if (rect.top < screenTop) {
- scrollYDelta -= (screenTop - rect.top);
+ scrollYDelta = rect.top - screenTop;
}
int width = getWidth() - getVerticalScrollbarWidth();
From d3b4d0cfc10c95c9190a2b0e6a8c8e8f3d448b87 Mon Sep 17 00:00:00 2001
From: Eric Laurent <>
Date: Tue, 31 Mar 2009 14:34:35 -0700
Subject: [PATCH 08/19] AI 143785: am: CL 143775 am: CL 143620 Attempt for
fixing crash in AudioFlinger::MixerThread::dumpTracks() seen in bug report
for issue 1747119. AudioFlinger::MixerThread::dumpTracks() was reading
mTracks[] vector instead of mActiveTracks[] when dumping active tracks.
Original author: elaurent Merged from: //branches/cupcake/... Original
author: android-build Merged from: //branches/donutburger/...
Automated import of CL 143785
---
libs/audioflinger/AudioFlinger.cpp | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index b9ecdd8e41fb2..d11e13a7fb4aa 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -941,13 +941,10 @@ status_t AudioFlinger::MixerThread::dumpTracks(int fd, const Vector& a
result.append(buffer);
result.append(" Name Clien Typ Fmt Chn Buf S M F SRate LeftV RighV Serv User\n");
for (size_t i = 0; i < mTracks.size(); ++i) {
- wp