am a8e77099: am e23ae144: am fa74f7e0: am bba948dc: Merge "Delay AccountManagerService initialization" into jb-dev
* commit 'a8e770991e8659d775d97f603e8f1a542aa0229e':
Delay AccountManagerService initialization
diff --git a/api/current.txt b/api/current.txt
index f987d5e..91f0476 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -26740,7 +26740,7 @@
field public static final int LOAD_CACHE_ELSE_NETWORK = 1; // 0x1
field public static final int LOAD_CACHE_ONLY = 3; // 0x3
field public static final int LOAD_DEFAULT = -1; // 0xffffffff
- field public static final int LOAD_NORMAL = 0; // 0x0
+ field public static final deprecated int LOAD_NORMAL = 0; // 0x0
field public static final int LOAD_NO_CACHE = 2; // 0x2
}
diff --git a/core/java/android/net/INetworkStatsService.aidl b/core/java/android/net/INetworkStatsService.aidl
index b7b8731..4d46334 100644
--- a/core/java/android/net/INetworkStatsService.aidl
+++ b/core/java/android/net/INetworkStatsService.aidl
@@ -45,4 +45,7 @@
/** Advise persistance threshold; may be overridden internally. */
void advisePersistThreshold(long thresholdBytes);
+ /** Adjust recorded network stats. */
+ void adjustNetworkStats(int uid, int tag, long rxBytes, long rxPackets, long txBytes, long txPackets, long operationCount);
+
}
diff --git a/core/java/android/net/TrafficStats.java b/core/java/android/net/TrafficStats.java
index e437d2e..b66c2fe 100644
--- a/core/java/android/net/TrafficStats.java
+++ b/core/java/android/net/TrafficStats.java
@@ -88,6 +88,13 @@
*/
public static final int TAG_SYSTEM_BACKUP = 0xFFFFFF03;
+ /**
+ * Default tag value for cloud messaging traffic.
+ *
+ * @hide
+ */
+ public static final int TAG_SYSTEM_CLOUD_MESSAGING = 0xFFFFFF04;
+
private static INetworkStatsService sStatsService;
private synchronized static INetworkStatsService getStatsService() {
@@ -246,6 +253,27 @@
}
}
+ /**
+ * Adjust network statistics for the given UID and tag by the requested
+ * amount. This can be used to correctly account network usage performed on
+ * behalf of another application. Values can be negative.
+ * <p>
+ * Requires that caller holds
+ * {@link android.Manifest.permission#MODIFY_NETWORK_ACCOUNTING} permission.
+ *
+ * @see #setThreadStatsUid(int)
+ * @hide
+ */
+ public static void adjustNetworkStats(int uid, int tag, long rxBytes, long rxPackets,
+ long txBytes, long txPackets, long operationCount) {
+ try {
+ getStatsService().adjustNetworkStats(
+ uid, tag, rxBytes, rxPackets, txBytes, txPackets, operationCount);
+ } catch (RemoteException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
/** {@hide} */
public static void closeQuietly(INetworkStatsSession session) {
// TODO: move to NetworkStatsService once it exists
diff --git a/core/java/android/text/format/Time.java b/core/java/android/text/format/Time.java
index e9b0d32..b0b18da 100644
--- a/core/java/android/text/format/Time.java
+++ b/core/java/android/text/format/Time.java
@@ -437,6 +437,9 @@
* @throws android.util.TimeFormatException if s cannot be parsed.
*/
public boolean parse(String s) {
+ if (s == null) {
+ throw new NullPointerException("time string is null");
+ }
if (nativeParse(s)) {
timezone = TIMEZONE_UTC;
return true;
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index 193e98d..cb54600 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -72,6 +72,14 @@
TextSize(int size) {
value = size;
}
+
+ /**
+ * @hide Only for use by WebViewProvider implementations
+ */
+ public int getValue() {
+ return value;
+ }
+
int value;
}
@@ -90,6 +98,14 @@
ZoomDensity(int size) {
value = size;
}
+
+ /**
+ * @hide Only for use by WebViewProvider implementations
+ */
+ public int getValue() {
+ return value;
+ }
+
int value;
}
@@ -103,6 +119,10 @@
/**
* Normal cache usage mode. Use with {@link #setCacheMode}.
+ *
+ * @deprecated This value is obsolete, as from API level
+ * {@link android.os.Build.VERSION_CODES#HONEYCOMB} and onwards it has the
+ * same effect as {@link #LOAD_DEFAULT}.
*/
public static final int LOAD_NORMAL = 0;
@@ -1253,7 +1273,7 @@
* and content is re-validated as needed. When navigating back, content is
* not revalidated, instead the content is just retrieved from the cache.
* This method allows the client to override this behavior by specifying
- * one of {@link #LOAD_DEFAULT}, {@link #LOAD_NORMAL},
+ * one of {@link #LOAD_DEFAULT},
* {@link #LOAD_CACHE_ELSE_NETWORK}, {@link #LOAD_NO_CACHE} or
* {@link #LOAD_CACHE_ONLY}. The default value is {@link #LOAD_DEFAULT}.
*
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 46079f9..7e85324 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -223,7 +223,7 @@
final int bottom = top + height;
final int left = isLayoutRtl ? getPaddingEnd() : width - getPaddingEnd();
final int right = left + mCheckMarkWidth;
- checkMarkDrawable.setBounds( left, top, right, bottom);
+ checkMarkDrawable.setBounds(left, top, right, bottom);
checkMarkDrawable.draw(canvas);
}
}
diff --git a/core/jni/android_text_format_Time.cpp b/core/jni/android_text_format_Time.cpp
index 776733c..bb09421 100644
--- a/core/jni/android_text_format_Time.cpp
+++ b/core/jni/android_text_format_Time.cpp
@@ -23,6 +23,7 @@
#include "jni.h"
#include "utils/misc.h"
#include "android_runtime/AndroidRuntime.h"
+#include "ScopedStringChars.h"
#include "TimeUtils.h"
#include <nativehelper/JNIHelp.h>
#include <cutils/tztime.h>
@@ -71,11 +72,10 @@
t->t.tm_gmtoff = env->GetLongField(o, g_gmtoffField);
bool allDay = env->GetBooleanField(o, g_allDayField);
if (allDay &&
- ((t->t.tm_sec !=0) || (t->t.tm_min != 0) || (t->t.tm_hour != 0))) {
- char msg[100];
- sprintf(msg, "allDay is true but sec, min, hour are not 0.");
- jniThrowException(env, "java/lang/IllegalArgumentException", msg);
- return false;
+ ((t->t.tm_sec !=0) || (t->t.tm_min != 0) || (t->t.tm_hour != 0))) {
+ jniThrowException(env, "java/lang/IllegalArgumentException",
+ "allDay is true but sec, min, hour are not 0.");
+ return false;
}
return true;
}
@@ -308,7 +308,7 @@
static jstring android_text_format_Time_toString(JNIEnv* env, jobject This)
{
Time t;
- if (!java2time(env, &t, This)) return env->NewStringUTF("");;
+ if (!java2time(env, &t, This)) return env->NewStringUTF("");
ACQUIRE_TIMEZONE(This, t)
String8 r = t.toString();
@@ -360,32 +360,30 @@
// ============================================================================
// Just do this here because it's not worth recreating the strings
-static int get_char(JNIEnv* env, const jchar *s, int spos, int mul,
- bool *thrown)
+static int get_char(JNIEnv* env, const ScopedStringChars& s, int spos, int mul,
+ bool* thrown)
{
jchar c = s[spos];
if (c >= '0' && c <= '9') {
return (c - '0') * mul;
} else {
if (!*thrown) {
- char msg[100];
- sprintf(msg, "Parse error at pos=%d", spos);
- jniThrowException(env, "android/util/TimeFormatException", msg);
+ jniThrowExceptionFmt(env, "android/util/TimeFormatException",
+ "Parse error at pos=%d", spos);
*thrown = true;
}
return 0;
}
}
-static bool check_char(JNIEnv* env, const jchar *s, int spos, jchar expected)
+static bool check_char(JNIEnv* env, const ScopedStringChars& s, int spos, jchar expected)
{
jchar c = s[spos];
if (c != expected) {
- char msg[100];
- sprintf(msg, "Unexpected character 0x%02x at pos=%d. Expected %c.", c, spos,
- expected);
- jniThrowException(env, "android/util/TimeFormatException", msg);
- return false;
+ jniThrowExceptionFmt(env, "android/util/TimeFormatException",
+ "Unexpected character 0x%02x at pos=%d. Expected %c.",
+ c, spos, expected);
+ return false;
}
return true;
}
@@ -394,20 +392,19 @@
static jboolean android_text_format_Time_parse(JNIEnv* env, jobject This, jstring strObj)
{
jsize len = env->GetStringLength(strObj);
- const jchar *s = env->GetStringChars(strObj, NULL);
-
- bool thrown = false;
- int n;
- jboolean inUtc = false;
-
if (len < 8) {
- char msg[100];
- sprintf(msg, "String too short -- expected at least 8 characters.");
- jniThrowException(env, "android/util/TimeFormatException", msg);
- return false;
+ jniThrowException(env, "android/util/TimeFormatException",
+ "String too short -- expected at least 8 characters.");
+ return false;
}
+ jboolean inUtc = false;
+
+ ScopedStringChars s(env, strObj);
+
// year
+ int n;
+ bool thrown = false;
n = get_char(env, s, 0, 1000, &thrown);
n += get_char(env, s, 1, 100, &thrown);
n += get_char(env, s, 2, 10, &thrown);
@@ -454,7 +451,7 @@
if (len > 15) {
// Z
if (!check_char(env, s, 15, 'Z')) return false;
- inUtc = true;
+ inUtc = true;
}
} else {
env->SetBooleanField(This, g_allDayField, JNI_TRUE);
@@ -467,8 +464,7 @@
env->SetIntField(This, g_ydayField, 0);
env->SetIntField(This, g_isdstField, -1);
env->SetLongField(This, g_gmtoffField, 0);
-
- env->ReleaseStringChars(strObj, s);
+
return inUtc;
}
@@ -477,19 +473,19 @@
jstring strObj)
{
jsize len = env->GetStringLength(strObj);
- const jchar *s = env->GetStringChars(strObj, NULL);
-
- bool thrown = false;
- int n;
- jboolean inUtc = false;
-
if (len < 10) {
jniThrowException(env, "android/util/TimeFormatException",
- "Time input is too short; must be at least 10 characters");
+ "String too short --- expected at least 10 characters.");
return false;
}
+ jboolean inUtc = false;
+
+ ScopedStringChars s(env, strObj);
+
// year
+ int n;
+ bool thrown = false;
n = get_char(env, s, 0, 1000, &thrown);
n += get_char(env, s, 1, 100, &thrown);
n += get_char(env, s, 2, 10, &thrown);
@@ -520,28 +516,28 @@
// T
if (!check_char(env, s, 10, 'T')) return false;
- env->SetBooleanField(This, g_allDayField, JNI_FALSE);
+ env->SetBooleanField(This, g_allDayField, JNI_FALSE);
// hour
n = get_char(env, s, 11, 10, &thrown);
n += get_char(env, s, 12, 1, &thrown);
if (thrown) return false;
- int hour = n;
+ int hour = n;
// env->SetIntField(This, g_hourField, n);
-
- // :
- if (!check_char(env, s, 13, ':')) return false;
- // minute
+ // :
+ if (!check_char(env, s, 13, ':')) return false;
+
+ // minute
n = get_char(env, s, 14, 10, &thrown);
n += get_char(env, s, 15, 1, &thrown);
if (thrown) return false;
- int minute = n;
+ int minute = n;
// env->SetIntField(This, g_minField, n);
- // :
- if (!check_char(env, s, 16, ':')) return false;
+ // :
+ if (!check_char(env, s, 16, ':')) return false;
- // second
+ // second
n = get_char(env, s, 17, 10, &thrown);
n += get_char(env, s, 18, 1, &thrown);
if (thrown) return false;
@@ -561,64 +557,63 @@
if (len > tz_index) {
char c = s[tz_index];
- // NOTE: the offset is meant to be subtracted to get from local time
- // to UTC. we therefore use 1 for '-' and -1 for '+'.
- switch (c) {
- case 'Z':
- // Zulu time -- UTC
- offset = 0;
- break;
- case '-':
+ // NOTE: the offset is meant to be subtracted to get from local time
+ // to UTC. we therefore use 1 for '-' and -1 for '+'.
+ switch (c) {
+ case 'Z':
+ // Zulu time -- UTC
+ offset = 0;
+ break;
+ case '-':
offset = 1;
- break;
- case '+':
+ break;
+ case '+':
offset = -1;
- break;
- default:
- char msg[100];
- sprintf(msg, "Unexpected character 0x%02x at position %d. Expected + or -",
- c, tz_index);
- jniThrowException(env, "android/util/TimeFormatException", msg);
- return false;
- }
+ break;
+ default:
+ jniThrowExceptionFmt(env, "android/util/TimeFormatException",
+ "Unexpected character 0x%02x at position %d. Expected + or -",
+ c, tz_index);
+ return false;
+ }
inUtc = true;
- if (offset != 0) {
- if (len < tz_index + 6) {
- char msg[100];
- sprintf(msg, "Unexpected length; should be %d characters", tz_index + 6);
- jniThrowException(env, "android/util/TimeFormatException", msg);
- return false;
- }
+ if (offset != 0) {
+ if (len < tz_index + 6) {
+ jniThrowExceptionFmt(env, "android/util/TimeFormatException",
+ "Unexpected length; should be %d characters",
+ tz_index + 6);
+ return false;
+ }
- // hour
- n = get_char(env, s, tz_index + 1, 10, &thrown);
- n += get_char(env, s, tz_index + 2, 1, &thrown);
- if (thrown) return false;
- n *= offset;
- hour += n;
+ // hour
+ n = get_char(env, s, tz_index + 1, 10, &thrown);
+ n += get_char(env, s, tz_index + 2, 1, &thrown);
+ if (thrown) return false;
+ n *= offset;
+ hour += n;
- // :
- if (!check_char(env, s, tz_index + 3, ':')) return false;
-
- // minute
- n = get_char(env, s, tz_index + 4, 10, &thrown);
- n += get_char(env, s, tz_index + 5, 1, &thrown);
- if (thrown) return false;
- n *= offset;
- minute += n;
- }
- }
- env->SetIntField(This, g_hourField, hour);
+ // :
+ if (!check_char(env, s, tz_index + 3, ':')) return false;
+
+ // minute
+ n = get_char(env, s, tz_index + 4, 10, &thrown);
+ n += get_char(env, s, tz_index + 5, 1, &thrown);
+ if (thrown) return false;
+ n *= offset;
+ minute += n;
+ }
+ }
+ env->SetIntField(This, g_hourField, hour);
env->SetIntField(This, g_minField, minute);
- if (offset != 0) {
- // we need to normalize after applying the hour and minute offsets
- android_text_format_Time_normalize(env, This, false /* use isdst */);
- // The timezone is set to UTC in the calling Java code.
- }
+ if (offset != 0) {
+ // we need to normalize after applying the hour and minute offsets
+ android_text_format_Time_normalize(env, This, false /* use isdst */);
+ // The timezone is set to UTC in the calling Java code.
+ }
} else {
- env->SetBooleanField(This, g_allDayField, JNI_TRUE);
+ env->SetBooleanField(This, g_allDayField, JNI_TRUE);
env->SetIntField(This, g_hourField, 0);
env->SetIntField(This, g_minField, 0);
env->SetIntField(This, g_secField, 0);
@@ -628,8 +623,7 @@
env->SetIntField(This, g_ydayField, 0);
env->SetIntField(This, g_isdstField, -1);
env->SetLongField(This, g_gmtoffField, 0);
-
- env->ReleaseStringChars(strObj, s);
+
return inUtc;
}
diff --git a/docs/html/guide/google/gcm/gcm.jd b/docs/html/guide/google/gcm/gcm.jd
index 1b95520..0b05c53 100644
--- a/docs/html/guide/google/gcm/gcm.jd
+++ b/docs/html/guide/google/gcm/gcm.jd
@@ -56,7 +56,7 @@
</div>
</div>
-<p>Google Cloud Messaging for Android (GCM) is a service that helps
+<p>Google Cloud Messaging for Android (GCM) is a free service that helps
developers send data from servers to their Android applications on Android devices. This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of
messages and delivery to the target Android application running on the target
device.</p>
@@ -545,7 +545,8 @@
<p>The <code>com.google.android.c2dm.intent.RECEIVE</code> intent is used by GCM to
deliver the messages sent by the 3rd-party server to the application running in the device.
If the server included key-pair values in the <code>data</code> parameter, they are available as
-extras in this intent, with the keys being the extra names.
+extras in this intent, with the keys being the extra names. GCM also includes an extra called
+<code>from</code> which contains the sender ID as an string.
<p>Here is an example, again using the <code>MyIntentReceiver</code> class:</p>
@@ -652,7 +653,7 @@
<td><code>data</code></td>
<td>A JSON object whose fields represents the key-value pairs of the message's payload data. If present, the payload data it will be
included in the Intent as application data, with the key being the extra's name. For instance, <code>"data":{"score":"3x1"}</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>.
-There is no limit on the number of key/value pairs, though there is a limit on the total size of the message (4kb). Note that the values <em>must be enclosed by strings</em>. If you want to include objects or other non-string data types (such as integers or booleans), you have to do the conversion to string yourself. Optional.</td>
+There is no limit on the number of key/value pairs, though there is a limit on the total size of the message (4kb). Note that the values <em>must be enclosed by strings</em>. If you want to include objects or other non-string data types (such as integers or booleans), you have to do the conversion to string yourself. Also note that the key cannot be a reserved word ("from" or any word starting with "google."). Optional.</td>
</tr>
<tr>
<td><code>delay_while_idle</code></td>
@@ -683,7 +684,7 @@
</tr>
<tr>
<td><code>data.<key></code></td>
- <td>Payload data, expressed as parameters prefixed with <code>data.</code> and suffixed as the key. For instance, a parameter of <code>data.score=3x1</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. There is no limit on the number of key/value parameters, though there is a limit on the total size of the message. Optional.</td>
+ <td>Payload data, expressed as parameters prefixed with <code>data.</code> and suffixed as the key. For instance, a parameter of <code>data.score=3x1</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. There is no limit on the number of key/value parameters, though there is a limit on the total size of the message. Note that the key cannot be a reserved word ("from" or any word starting with "google."). Optional.</td>
</tr>
<tr>
<td><code>delay_while_idle</code></td>
@@ -879,8 +880,20 @@
<li>Request originated from a server not whitelisted in the Server Key IPs.</li>
</ul>
-Check that the token you're sending inside the <code>Authorization</code> header is the correct API key associated with your project.<br/>
+Check that the token you're sending inside the <code>Authorization</code> header is the correct API key associated with your project. You can check the validity of your API key by running the following command:<br/>
+<pre># api_key=YOUR_API_KEY
+
+# curl --header "Authorization: key=$api_key" --header Content-Type:"application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"ABC\"]}"</pre>
+
+
+If you receive a 401 HTTP status code, your API key is not valid. Otherwise you should see something like this:<br/>
+
+<pre>
+{"multicast_id":6782339717028231855,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]}
+</pre>
+If you want to confirm the validity of a registration ID, you can do so by replacing "ABC" with the registration ID.
+<br/>
Happens when the HTTP status code is 401.
<dt id="timeout"><strong>Timeout</strong></dt>
@@ -974,7 +987,7 @@
<p>To view statistics and any error messages for your GCM applications:</p>
<ol>
- <li> Go to <code><a href="http://play.google.com/apps/publish">play.google.com/apps/publish</a></code>.</li>
+ <li> Go to the <code><a href="http://play.google.com/apps/publish">Android Developer Console</a></code>.</li>
<li>Login with your developer account.
<p>You will see a page that has a list of all of your apps.</p></li>
<li> Click on the "statistics" link next to the app for which you want to view GCM stats.
@@ -982,6 +995,8 @@
<li>Go to the drop-down menu and select the GCM metric you want to view.
</li>
</ol>
+<p class="note"><strong>Note:</strong> Stats on the Google API Console are not enabled for GCM. You must use the <a href="http://play.google.com/apps/publish">Android Developer Console</a>.</p>
+
<h2 id="example">Examples</h2>
<p>See the <a href="demo.html">GCM Demo Application</a> document.</p>
diff --git a/docs/html/guide/google/gcm/index.jd b/docs/html/guide/google/gcm/index.jd
index 140b076..8079eba 100644
--- a/docs/html/guide/google/gcm/index.jd
+++ b/docs/html/guide/google/gcm/index.jd
@@ -5,6 +5,8 @@
<p><img src="{@docRoot}images/gcm/gcm-logo.png" /></p>
<p>Google Cloud Messaging for Android (GCM) is a service that helps developers send data from servers to their Android applications on Android devices. This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device.</p>
+<p>GCM is completely free no matter how big your messaging needs are, and there are no quotas.</p>
+
<p>To learn more about GCM, you can join the <a href="https://groups.google.com/forum/?fromgroups#!forum/android-gcm">android-gcm group</a> and read the following documents:</p>
<dl>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index 155238a..a58a1bf 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -25,7 +25,7 @@
<string name="status_bar_please_disturb_button" msgid="3345398298841572813">"Показать уведомления"</string>
<string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Удаление из списка"</string>
<string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"О приложении"</string>
- <string name="status_bar_no_recent_apps" msgid="6576392951053994640">"Нет данных"</string>
+ <string name="status_bar_no_recent_apps" msgid="6576392951053994640">"Приложения не найдены"</string>
<string name="status_bar_accessibility_dismiss_recents" msgid="4576076075226540105">"Закрыть недавние приложения"</string>
<plurals name="status_bar_accessibility_recent_apps">
<item quantity="one" msgid="5854176083865845541">"Недавних приложений: 1"</item>
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index f25ac0d..2723f82 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -82,6 +82,7 @@
private static final String SCREENSHOTS_DIR_NAME = "Screenshots";
private static final String SCREENSHOT_FILE_NAME_TEMPLATE = "Screenshot_%s.png";
private static final String SCREENSHOT_FILE_PATH_TEMPLATE = "%s/%s/%s";
+ private static final String SCREENSHOT_SHARE_SUBJECT_TEMPLATE = "Screenshot (%s)";
private int mNotificationId;
private NotificationManager mNotificationManager;
@@ -184,9 +185,13 @@
values.put(MediaStore.Images.ImageColumns.MIME_TYPE, "image/png");
Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
+ String subjectDate = new SimpleDateFormat("hh:mma, MMM dd, yyyy")
+ .format(new Date(mImageTime));
+ String subject = String.format(SCREENSHOT_SHARE_SUBJECT_TEMPLATE, subjectDate);
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("image/png");
sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
+ sharingIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
Intent chooserIntent = Intent.createChooser(sharingIntent, null);
chooserIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
@@ -600,14 +605,17 @@
Resources r = context.getResources();
// Clear all existing notification, compose the new notification and show it
- Notification n = new Notification.Builder(context)
+ Notification.Builder b = new Notification.Builder(context)
.setTicker(r.getString(R.string.screenshot_failed_title))
.setContentTitle(r.getString(R.string.screenshot_failed_title))
.setContentText(r.getString(R.string.screenshot_failed_text))
.setSmallIcon(R.drawable.stat_notify_image_error)
.setWhen(System.currentTimeMillis())
- .setAutoCancel(true)
- .getNotification();
+ .setAutoCancel(true);
+ Notification n =
+ new Notification.BigTextStyle(b)
+ .bigText(r.getString(R.string.screenshot_failed_text))
+ .build();
nManager.notify(SCREENSHOT_NOTIFICATION_ID, n);
}
}
diff --git a/services/java/com/android/server/net/NetworkStatsService.java b/services/java/com/android/server/net/NetworkStatsService.java
index ba122ec..373576b 100644
--- a/services/java/com/android/server/net/NetworkStatsService.java
+++ b/services/java/com/android/server/net/NetworkStatsService.java
@@ -695,6 +695,14 @@
mGlobalAlertBytes = mSettings.getGlobalAlertBytes(mPersistThreshold);
}
+ @Override
+ public void adjustNetworkStats(int uid, int tag, long rxBytes, long rxPackets, long txBytes,
+ long txPackets, long operationCount) {
+ mContext.enforceCallingOrSelfPermission(MODIFY_NETWORK_ACCOUNTING, TAG);
+
+ // TODO: store adjusted network stats in separate data structure
+ }
+
/**
* Receiver that watches for {@link IConnectivityManager} to claim network
* interfaces. Used to associate {@link TelephonyManager#getSubscriberId()}