Merge "Clean up the Builder test." into jb-mr1.1-dev
diff --git a/cmds/content/src/com/android/commands/content/Content.java b/cmds/content/src/com/android/commands/content/Content.java
index 787fbdb..070e105 100644
--- a/cmds/content/src/com/android/commands/content/Content.java
+++ b/cmds/content/src/com/android/commands/content/Content.java
@@ -83,14 +83,14 @@
+ " Example:\n"
+ " # Change \"new_setting\" secure setting to \"newer_value\".\n"
+ " adb shell content update --uri content://settings/secure --bind"
- + " value:s:newer_value --where \"name=\'new_setting\'\"\n"
+ + " value:s:newer_value --where \"name=\\'new_setting\\'\"\n"
+ "\n"
+ "usage: adb shell content delete --uri <URI> [--user <USER_ID>] --bind <BINDING>"
+ " [--bind <BINDING>...] [--where <WHERE>]\n"
+ " Example:\n"
+ " # Remove \"new_setting\" secure setting.\n"
+ " adb shell content delete --uri content://settings/secure "
- + "--where \"name=\'new_setting\'\"\n"
+ + "--where \"name=\\'new_setting\\'\"\n"
+ "\n"
+ "usage: adb shell content query --uri <URI> [--user <USER_ID>]"
+ " [--projection <PROJECTION>] [--where <WHERE>] [--sort <SORT_ORDER>]\n"
@@ -101,7 +101,7 @@
+ " # Select \"name\" and \"value\" columns from secure settings where \"name\" is "
+ "equal to \"new_setting\" and sort the result by name in ascending order.\n"
+ " adb shell content query --uri content://settings/secure --projection name:value"
- + " --where \"name=\'new_setting\'\" --sort \"name ASC\"\n"
+ + " --where \"name=\\'new_setting\\'\" --sort \"name ASC\"\n"
+ "\n";
private static class Parser {
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 67d3930..61b2067 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -1701,6 +1701,21 @@
return true;
}
+ case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
+ data.enforceInterface(IActivityManager.descriptor);
+ IIntentSender r = IIntentSender.Stub.asInterface(
+ data.readStrongBinder());
+ Intent intent = getIntentForIntentSender(r);
+ reply.writeNoException();
+ if (intent != null) {
+ reply.writeInt(1);
+ intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+ } else {
+ reply.writeInt(0);
+ }
+ return true;
+ }
+
case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
Configuration config = Configuration.CREATOR.createFromParcel(data);
@@ -3977,6 +3992,20 @@
return res;
}
+ public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
+ Parcel data = Parcel.obtain();
+ Parcel reply = Parcel.obtain();
+ data.writeInterfaceToken(IActivityManager.descriptor);
+ data.writeStrongBinder(sender.asBinder());
+ mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
+ reply.readException();
+ Intent res = reply.readInt() != 0
+ ? Intent.CREATOR.createFromParcel(reply) : null;
+ data.recycle();
+ reply.recycle();
+ return res;
+ }
+
public void updatePersistentConfiguration(Configuration values) throws RemoteException
{
Parcel data = Parcel.obtain();
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 8fc1c86..8af17a4 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -341,6 +341,8 @@
public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException;
+ public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException;
+
public void updatePersistentConfiguration(Configuration values) throws RemoteException;
public long[] getProcessPss(int[] pids) throws RemoteException;
@@ -621,4 +623,5 @@
int REQUEST_BUG_REPORT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+157;
int INPUT_DISPATCHING_TIMED_OUT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+158;
int CLEAR_PENDING_BACKUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+159;
+ int GET_INTENT_FOR_INTENT_SENDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+160;
}
diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java
index d36d99d..5c75aff 100644
--- a/core/java/android/app/PendingIntent.java
+++ b/core/java/android/app/PendingIntent.java
@@ -790,6 +790,20 @@
}
/**
+ * @hide
+ * Return the Intent of this PendingIntent.
+ */
+ public Intent getIntent() {
+ try {
+ return ActivityManagerNative.getDefault()
+ .getIntentForIntentSender(mTarget);
+ } catch (RemoteException e) {
+ // Should never happen.
+ return null;
+ }
+ }
+
+ /**
* Comparison operator on two PendingIntent objects, such that true
* is returned then they both represent the same operation from the
* same package. This allows you to use {@link #getActivity},
diff --git a/core/java/android/appwidget/AppWidgetHost.java b/core/java/android/appwidget/AppWidgetHost.java
index cb61a71..24fd2e4 100644
--- a/core/java/android/appwidget/AppWidgetHost.java
+++ b/core/java/android/appwidget/AppWidgetHost.java
@@ -224,6 +224,22 @@
}
}
+ /**
+ * Gets a list of all the appWidgetIds that are bound to the current host
+ *
+ * @hide
+ */
+ public int[] getAppWidgetIds() {
+ try {
+ if (sService == null) {
+ bindService();
+ }
+ return sService.getAppWidgetIdsForHost(mHostId);
+ } catch (RemoteException e) {
+ throw new RuntimeException("system server dead?", e);
+ }
+ }
+
private static void checkCallerIsSystem() {
int uid = Process.myUid();
if (UserHandle.getAppId(uid) == Process.SYSTEM_UID || uid == 0) {
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java
index 977b461..e4b4b97 100644
--- a/core/java/android/content/SyncManager.java
+++ b/core/java/android/content/SyncManager.java
@@ -58,6 +58,7 @@
import android.util.Slog;
import com.android.internal.R;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.IndentingPrintWriter;
import com.google.android.collect.Lists;
import com.google.android.collect.Maps;
@@ -155,7 +156,7 @@
private SyncStorageEngine mSyncStorageEngine;
- // @GuardedBy("mSyncQueue")
+ @GuardedBy("mSyncQueue")
private final SyncQueue mSyncQueue;
protected final ArrayList<ActiveSyncContext> mActiveSyncContexts = Lists.newArrayList();
diff --git a/core/java/android/content/SyncStorageEngine.java b/core/java/android/content/SyncStorageEngine.java
index 10e7bff..bdc5a3f 100644
--- a/core/java/android/content/SyncStorageEngine.java
+++ b/core/java/android/content/SyncStorageEngine.java
@@ -16,6 +16,7 @@
package android.content;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.FastXmlSerializer;
@@ -74,7 +75,7 @@
private static final long DEFAULT_POLL_FREQUENCY_SECONDS = 60 * 60 * 24; // One day
- // @VisibleForTesting
+ @VisibleForTesting
static final long MILLIS_IN_4WEEKS = 1000L * 60 * 60 * 24 * 7 * 4;
/** Enum value for a sync start event. */
diff --git a/core/java/android/content/pm/RegisteredServicesCache.java b/core/java/android/content/pm/RegisteredServicesCache.java
index 6def4a1..a07a865 100644
--- a/core/java/android/content/pm/RegisteredServicesCache.java
+++ b/core/java/android/content/pm/RegisteredServicesCache.java
@@ -34,6 +34,7 @@
import android.util.SparseArray;
import android.util.Xml;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.FastXmlSerializer;
import com.google.android.collect.Lists;
import com.google.android.collect.Maps;
@@ -77,15 +78,15 @@
private final Object mServicesLock = new Object();
- // @GuardedBy("mServicesLock")
+ @GuardedBy("mServicesLock")
private boolean mPersistentServicesFileDidNotExist;
- // @GuardedBy("mServicesLock")
+ @GuardedBy("mServicesLock")
private final SparseArray<UserServices<V>> mUserServices = new SparseArray<UserServices<V>>();
private static class UserServices<V> {
- // @GuardedBy("mServicesLock")
+ @GuardedBy("mServicesLock")
public final Map<V, Integer> persistentServices = Maps.newHashMap();
- // @GuardedBy("mServicesLock")
+ @GuardedBy("mServicesLock")
public Map<V, ServiceInfo<V>> services = null;
}
diff --git a/core/java/android/net/NetworkStats.java b/core/java/android/net/NetworkStats.java
index 446bbf0..c757605 100644
--- a/core/java/android/net/NetworkStats.java
+++ b/core/java/android/net/NetworkStats.java
@@ -21,6 +21,7 @@
import android.os.SystemClock;
import android.util.SparseBooleanArray;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.Objects;
@@ -190,14 +191,14 @@
return clone;
}
- // @VisibleForTesting
+ @VisibleForTesting
public NetworkStats addIfaceValues(
String iface, long rxBytes, long rxPackets, long txBytes, long txPackets) {
return addValues(
iface, UID_ALL, SET_DEFAULT, TAG_NONE, rxBytes, rxPackets, txBytes, txPackets, 0L);
}
- // @VisibleForTesting
+ @VisibleForTesting
public NetworkStats addValues(String iface, int uid, int set, int tag, long rxBytes,
long rxPackets, long txBytes, long txPackets, long operations) {
return addValues(new Entry(
@@ -269,7 +270,7 @@
return size;
}
- // @VisibleForTesting
+ @VisibleForTesting
public int internalSize() {
return iface.length;
}
@@ -335,7 +336,7 @@
* Find first stats index that matches the requested parameters, starting
* search around the hinted index as an optimization.
*/
- // @VisibleForTesting
+ @VisibleForTesting
public int findIndexHinted(String iface, int uid, int set, int tag, int hintIndex) {
for (int offset = 0; offset < size; offset++) {
final int halfOffset = offset / 2;
diff --git a/core/java/android/net/NetworkTemplate.java b/core/java/android/net/NetworkTemplate.java
index d8e53d5..d3839ad 100644
--- a/core/java/android/net/NetworkTemplate.java
+++ b/core/java/android/net/NetworkTemplate.java
@@ -33,6 +33,7 @@
import android.os.Parcel;
import android.os.Parcelable;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.Objects;
/**
@@ -63,7 +64,7 @@
private static boolean sForceAllNetworkTypes = false;
- // @VisibleForTesting
+ @VisibleForTesting
public static void forceAllNetworkTypes() {
sForceAllNetworkTypes = true;
}
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index 54f2fe3..9821824 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -18,6 +18,8 @@
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.Formatter;
import java.util.List;
import java.util.Map;
@@ -1127,8 +1129,10 @@
if (totalTimeMillis != 0) {
sb.append(linePrefix);
formatTimeMs(sb, totalTimeMillis);
- if (name != null) sb.append(name);
- sb.append(' ');
+ if (name != null) {
+ sb.append(name);
+ sb.append(' ');
+ }
sb.append('(');
sb.append(count);
sb.append(" times)");
@@ -1440,8 +1444,21 @@
}
}
+ static final class TimerEntry {
+ final String mName;
+ final int mId;
+ final BatteryStats.Timer mTimer;
+ final long mTime;
+ TimerEntry(String name, int id, BatteryStats.Timer timer, long time) {
+ mName = name;
+ mId = id;
+ mTimer = timer;
+ mTime = time;
+ }
+ }
+
@SuppressWarnings("unused")
- public final void dumpLocked(PrintWriter pw, String prefix, int which, int reqUid) {
+ public final void dumpLocked(PrintWriter pw, String prefix, final int which, int reqUid) {
final long rawUptime = SystemClock.uptimeMillis() * 1000;
final long rawRealtime = SystemClock.elapsedRealtime() * 1000;
final long batteryUptime = getBatteryUptime(rawUptime);
@@ -1516,19 +1533,43 @@
long txTotal = 0;
long fullWakeLockTimeTotalMicros = 0;
long partialWakeLockTimeTotalMicros = 0;
-
+
+ final Comparator<TimerEntry> timerComparator = new Comparator<TimerEntry>() {
+ @Override
+ public int compare(TimerEntry lhs, TimerEntry rhs) {
+ long lhsTime = lhs.mTime;
+ long rhsTime = rhs.mTime;
+ if (lhsTime < rhsTime) {
+ return 1;
+ }
+ if (lhsTime > rhsTime) {
+ return -1;
+ }
+ return 0;
+ }
+ };
+
if (reqUid < 0) {
Map<String, ? extends BatteryStats.Timer> kernelWakelocks = getKernelWakelockStats();
if (kernelWakelocks.size() > 0) {
+ final ArrayList<TimerEntry> timers = new ArrayList<TimerEntry>();
for (Map.Entry<String, ? extends BatteryStats.Timer> ent : kernelWakelocks.entrySet()) {
-
+ BatteryStats.Timer timer = ent.getValue();
+ long totalTimeMillis = computeWakeLock(timer, batteryRealtime, which);
+ if (totalTimeMillis > 0) {
+ timers.add(new TimerEntry(ent.getKey(), 0, timer, totalTimeMillis));
+ }
+ }
+ Collections.sort(timers, timerComparator);
+ for (int i=0; i<timers.size(); i++) {
+ TimerEntry timer = timers.get(i);
String linePrefix = ": ";
sb.setLength(0);
sb.append(prefix);
sb.append(" Kernel Wake lock ");
- sb.append(ent.getKey());
- linePrefix = printWakeLock(sb, ent.getValue(), batteryRealtime, null, which,
- linePrefix);
+ sb.append(timer.mName);
+ linePrefix = printWakeLock(sb, timer.mTimer, batteryRealtime, null,
+ which, linePrefix);
if (!linePrefix.equals(": ")) {
sb.append(" realtime");
// Only print out wake locks that were held
@@ -1537,7 +1578,9 @@
}
}
}
-
+
+ final ArrayList<TimerEntry> timers = new ArrayList<TimerEntry>();
+
for (int iu = 0; iu < NU; iu++) {
Uid u = uidStats.valueAt(iu);
rxTotal += u.getTcpBytesReceived(which);
@@ -1557,8 +1600,18 @@
Timer partialWakeTimer = wl.getWakeTime(WAKE_TYPE_PARTIAL);
if (partialWakeTimer != null) {
- partialWakeLockTimeTotalMicros += partialWakeTimer.getTotalTimeLocked(
+ long totalTimeMicros = partialWakeTimer.getTotalTimeLocked(
batteryRealtime, which);
+ if (totalTimeMicros > 0) {
+ if (reqUid < 0) {
+ // Only show the ordered list of all wake
+ // locks if the caller is not asking for data
+ // about a specific uid.
+ timers.add(new TimerEntry(ent.getKey(), u.getUid(),
+ partialWakeTimer, totalTimeMicros));
+ }
+ partialWakeLockTimeTotalMicros += totalTimeMicros;
+ }
}
}
}
@@ -1571,7 +1624,7 @@
sb.append(prefix);
sb.append(" Total full wakelock time: "); formatTimeMs(sb,
(fullWakeLockTimeTotalMicros + 500) / 1000);
- sb.append(", Total partial waklock time: "); formatTimeMs(sb,
+ sb.append(", Total partial wakelock time: "); formatTimeMs(sb,
(partialWakeLockTimeTotalMicros + 500) / 1000);
pw.println(sb.toString());
@@ -1676,9 +1729,26 @@
pw.println(getDischargeAmountScreenOnSinceCharge());
pw.print(prefix); pw.print(" Amount discharged while screen off: ");
pw.println(getDischargeAmountScreenOffSinceCharge());
- pw.println(" ");
+ pw.println();
}
-
+
+ if (timers.size() > 0) {
+ Collections.sort(timers, timerComparator);
+ pw.print(prefix); pw.println(" All partial wake locks:");
+ for (int i=0; i<timers.size(); i++) {
+ TimerEntry timer = timers.get(i);
+ sb.setLength(0);
+ sb.append(" Wake lock #");
+ sb.append(timer.mId);
+ sb.append(" ");
+ sb.append(timer.mName);
+ printWakeLock(sb, timer.mTimer, batteryRealtime, null, which, ": ");
+ sb.append(" realtime");
+ pw.println(sb.toString());
+ }
+ timers.clear();
+ pw.println();
+ }
for (int iu=0; iu<NU; iu++) {
final int uid = uidStats.keyAt(iu);
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index 88529f8..1bada67 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -22,6 +22,8 @@
import android.text.TextUtils;
import android.util.Log;
+import com.android.internal.annotations.GuardedBy;
+
import java.io.File;
/**
@@ -47,7 +49,7 @@
private static final Object sLock = new Object();
- // @GuardedBy("sLock")
+ @GuardedBy("sLock")
private static volatile StorageVolume sPrimaryVolume;
private static StorageVolume getPrimaryVolume() {
diff --git a/core/java/android/os/ParcelFileDescriptor.java b/core/java/android/os/ParcelFileDescriptor.java
index 3e90dfc..ec660ee 100644
--- a/core/java/android/os/ParcelFileDescriptor.java
+++ b/core/java/android/os/ParcelFileDescriptor.java
@@ -15,6 +15,9 @@
*/
package android.os;
+
+import dalvik.system.CloseGuard;
+
import java.io.Closeable;
import java.io.File;
import java.io.FileDescriptor;
@@ -31,12 +34,16 @@
*/
public class ParcelFileDescriptor implements Parcelable, Closeable {
private final FileDescriptor mFileDescriptor;
- private boolean mClosed;
- //this field is to create wrapper for ParcelFileDescriptor using another
- //PartialFileDescriptor but avoid invoking close twice
- //consider ParcelFileDescriptor A(fileDescriptor fd), ParcelFileDescriptor B(A)
- //in this particular case fd.close might be invoked twice.
- private final ParcelFileDescriptor mParcelDescriptor;
+
+ /**
+ * Wrapped {@link ParcelFileDescriptor}, if any. Used to avoid
+ * double-closing {@link #mFileDescriptor}.
+ */
+ private final ParcelFileDescriptor mWrapped;
+
+ private volatile boolean mClosed;
+
+ private final CloseGuard mGuard = CloseGuard.get();
/**
* For use with {@link #open}: if {@link #MODE_CREATE} has been supplied
@@ -289,13 +296,15 @@
if (mClosed) {
throw new IllegalStateException("Already closed");
}
- if (mParcelDescriptor != null) {
- int fd = mParcelDescriptor.detachFd();
+ if (mWrapped != null) {
+ int fd = mWrapped.detachFd();
mClosed = true;
+ mGuard.close();
return fd;
}
int fd = getFd();
mClosed = true;
+ mGuard.close();
Parcel.clearFileDescriptor(mFileDescriptor);
return fd;
}
@@ -307,15 +316,16 @@
* @throws IOException
* If an error occurs attempting to close this ParcelFileDescriptor.
*/
+ @Override
public void close() throws IOException {
- synchronized (this) {
- if (mClosed) return;
- mClosed = true;
- }
- if (mParcelDescriptor != null) {
+ if (mClosed) return;
+ mClosed = true;
+ mGuard.close();
+
+ if (mWrapped != null) {
// If this is a proxy to another file descriptor, just call through to its
// close method.
- mParcelDescriptor.close();
+ mWrapped.close();
} else {
Parcel.closeFileDescriptor(mFileDescriptor);
}
@@ -374,6 +384,9 @@
@Override
protected void finalize() throws Throwable {
+ if (mGuard != null) {
+ mGuard.warnIfOpen();
+ }
try {
if (!mClosed) {
close();
@@ -384,21 +397,22 @@
}
public ParcelFileDescriptor(ParcelFileDescriptor descriptor) {
- super();
- mParcelDescriptor = descriptor;
- mFileDescriptor = mParcelDescriptor.mFileDescriptor;
+ mWrapped = descriptor;
+ mFileDescriptor = mWrapped.mFileDescriptor;
+ mGuard.open("close");
}
- /*package */ParcelFileDescriptor(FileDescriptor descriptor) {
- super();
+ /** {@hide} */
+ public ParcelFileDescriptor(FileDescriptor descriptor) {
if (descriptor == null) {
throw new NullPointerException("descriptor must not be null");
}
+ mWrapped = null;
mFileDescriptor = descriptor;
- mParcelDescriptor = null;
+ mGuard.open("close");
}
- /* Parcelable interface */
+ @Override
public int describeContents() {
return Parcelable.CONTENTS_FILE_DESCRIPTOR;
}
@@ -408,6 +422,7 @@
* If {@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE} is set in flags,
* the file descriptor will be closed after a copy is written to the Parcel.
*/
+ @Override
public void writeToParcel(Parcel out, int flags) {
out.writeFileDescriptor(mFileDescriptor);
if ((flags&PARCELABLE_WRITE_RETURN_VALUE) != 0 && !mClosed) {
@@ -421,12 +436,14 @@
public static final Parcelable.Creator<ParcelFileDescriptor> CREATOR
= new Parcelable.Creator<ParcelFileDescriptor>() {
+ @Override
public ParcelFileDescriptor createFromParcel(Parcel in) {
return in.readFileDescriptor();
}
+
+ @Override
public ParcelFileDescriptor[] newArray(int size) {
return new ParcelFileDescriptor[size];
}
};
-
}
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 4a01113..736762f 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -182,6 +182,8 @@
* </p><p>
* Since not all devices have proximity sensors, use {@link #isWakeLockLevelSupported}
* to determine whether this wake lock level is supported.
+ * </p><p>
+ * Cannot be used with {@link #ACQUIRE_CAUSES_WAKEUP}.
* </p>
*
* {@hide}
diff --git a/core/java/android/text/format/DateUtils.java b/core/java/android/text/format/DateUtils.java
index 1060bd8..bcce61d 100644
--- a/core/java/android/text/format/DateUtils.java
+++ b/core/java/android/text/format/DateUtils.java
@@ -607,6 +607,30 @@
}
/**
+ * Return given duration in a human-friendly format. For example, "4
+ * minutes" or "1 second". Returns only largest meaningful unit of time,
+ * from seconds up to hours.
+ *
+ * @hide
+ */
+ public static CharSequence formatDuration(long millis) {
+ final Resources res = Resources.getSystem();
+ if (millis >= HOUR_IN_MILLIS) {
+ final int hours = (int) ((millis + 1800000) / HOUR_IN_MILLIS);
+ return res.getQuantityString(
+ com.android.internal.R.plurals.duration_hours, hours, hours);
+ } else if (millis >= MINUTE_IN_MILLIS) {
+ final int minutes = (int) ((millis + 30000) / MINUTE_IN_MILLIS);
+ return res.getQuantityString(
+ com.android.internal.R.plurals.duration_minutes, minutes, minutes);
+ } else {
+ final int seconds = (int) ((millis + 500) / SECOND_IN_MILLIS);
+ return res.getQuantityString(
+ com.android.internal.R.plurals.duration_seconds, seconds, seconds);
+ }
+ }
+
+ /**
* Formats an elapsed time in the form "MM:SS" or "H:MM:SS"
* for display on the call-in-progress screen.
* @param elapsedSeconds the elapsed time in seconds.
diff --git a/core/java/android/util/IntProperty.java b/core/java/android/util/IntProperty.java
index 459d6b2..17977ca 100644
--- a/core/java/android/util/IntProperty.java
+++ b/core/java/android/util/IntProperty.java
@@ -42,7 +42,7 @@
@Override
final public void set(T object, Integer value) {
- set(object, value.intValue());
+ setValue(object, value.intValue());
}
}
\ No newline at end of file
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index ff44475..1747627 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -623,6 +623,7 @@
* @attr ref android.R.styleable#View_hapticFeedbackEnabled
* @attr ref android.R.styleable#View_keepScreenOn
* @attr ref android.R.styleable#View_layerType
+ * @attr ref android.R.styleable#View_layoutDirection
* @attr ref android.R.styleable#View_longClickable
* @attr ref android.R.styleable#View_minHeight
* @attr ref android.R.styleable#View_minWidth
@@ -660,6 +661,7 @@
* @attr ref android.R.styleable#View_soundEffectsEnabled
* @attr ref android.R.styleable#View_tag
* @attr ref android.R.styleable#View_textAlignment
+ * @attr ref android.R.styleable#View_textDirection
* @attr ref android.R.styleable#View_transformPivotX
* @attr ref android.R.styleable#View_transformPivotY
* @attr ref android.R.styleable#View_translationX
@@ -5854,6 +5856,7 @@
* {@link #LAYOUT_DIRECTION_RTL},
* {@link #LAYOUT_DIRECTION_INHERIT} or
* {@link #LAYOUT_DIRECTION_LOCALE}.
+ *
* @attr ref android.R.styleable#View_layoutDirection
*
* @hide
@@ -5909,6 +5912,8 @@
*
* For compatibility, this will return {@link #LAYOUT_DIRECTION_LTR} if API version
* is lower than {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}.
+ *
+ * @attr ref android.R.styleable#View_layoutDirection
*/
@ViewDebug.ExportedProperty(category = "layout", mapping = {
@ViewDebug.IntToString(from = LAYOUT_DIRECTION_LTR, to = "RESOLVED_DIRECTION_LTR"),
@@ -16627,6 +16632,8 @@
* {@link #TEXT_DIRECTION_RTL},
* {@link #TEXT_DIRECTION_LOCALE}
*
+ * @attr ref android.R.styleable#View_textDirection
+ *
* @hide
*/
@ViewDebug.ExportedProperty(category = "text", mapping = {
@@ -16656,6 +16663,8 @@
* Resolution will be done if the value is set to TEXT_DIRECTION_INHERIT. The resolution
* proceeds up the parent chain of the view to get the value. If there is no parent, then it will
* return the default {@link #TEXT_DIRECTION_FIRST_STRONG}.
+ *
+ * @attr ref android.R.styleable#View_textDirection
*/
public void setTextDirection(int textDirection) {
if (getRawTextDirection() != textDirection) {
@@ -16684,6 +16693,8 @@
* {@link #TEXT_DIRECTION_LTR},
* {@link #TEXT_DIRECTION_RTL},
* {@link #TEXT_DIRECTION_LOCALE}
+ *
+ * @attr ref android.R.styleable#View_textDirection
*/
public int getTextDirection() {
return (mPrivateFlags2 & PFLAG2_TEXT_DIRECTION_RESOLVED_MASK) >> PFLAG2_TEXT_DIRECTION_RESOLVED_MASK_SHIFT;
@@ -16816,6 +16827,8 @@
* {@link #TEXT_ALIGNMENT_VIEW_START},
* {@link #TEXT_ALIGNMENT_VIEW_END}
*
+ * @attr ref android.R.styleable#View_textAlignment
+ *
* @hide
*/
@ViewDebug.ExportedProperty(category = "text", mapping = {
@@ -16879,6 +16892,8 @@
* {@link #TEXT_ALIGNMENT_TEXT_END},
* {@link #TEXT_ALIGNMENT_VIEW_START},
* {@link #TEXT_ALIGNMENT_VIEW_END}
+ *
+ * @attr ref android.R.styleable#View_textAlignment
*/
@ViewDebug.ExportedProperty(category = "text", mapping = {
@ViewDebug.IntToString(from = TEXT_ALIGNMENT_INHERIT, to = "INHERIT"),
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 521e686..85972c3 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -309,13 +309,15 @@
}
private void setErrorIcon(Drawable icon) {
- final Drawables dr = mTextView.mDrawables;
- if (dr != null) {
- mTextView.setCompoundDrawables(dr.mDrawableLeft, dr.mDrawableTop, icon,
- dr.mDrawableBottom);
- } else {
- mTextView.setCompoundDrawables(null, null, icon, null);
+ Drawables dr = mTextView.mDrawables;
+ if (dr == null) {
+ mTextView.mDrawables = dr = new Drawables();
}
+ dr.setErrorDrawable(icon, mTextView);
+
+ mTextView.resetResolvedDrawables();
+ mTextView.invalidate();
+ mTextView.requestLayout();
}
private void hideError() {
@@ -329,7 +331,7 @@
}
/**
- * Returns the Y offset to make the pointy top of the error point
+ * Returns the X offset to make the pointy top of the error point
* at the middle of the error icon.
*/
private int getErrorX() {
@@ -340,8 +342,23 @@
final float scale = mTextView.getResources().getDisplayMetrics().density;
final Drawables dr = mTextView.mDrawables;
- return mTextView.getWidth() - mErrorPopup.getWidth() - mTextView.getPaddingRight() -
- (dr != null ? dr.mDrawableSizeRight : 0) / 2 + (int) (25 * scale + 0.5f);
+
+ final int layoutDirection = mTextView.getLayoutDirection();
+ int errorX;
+ int offset;
+ switch (layoutDirection) {
+ default:
+ case View.LAYOUT_DIRECTION_LTR:
+ offset = - (dr != null ? dr.mDrawableSizeRight : 0) / 2 + (int) (25 * scale + 0.5f);
+ errorX = mTextView.getWidth() - mErrorPopup.getWidth() -
+ mTextView.getPaddingRight() + offset;
+ break;
+ case View.LAYOUT_DIRECTION_RTL:
+ offset = (dr != null ? dr.mDrawableSizeLeft : 0) / 2 - (int) (25 * scale + 0.5f);
+ errorX = mTextView.getPaddingLeft() + offset;
+ break;
+ }
+ return errorX;
}
/**
@@ -358,16 +375,27 @@
mTextView.getCompoundPaddingBottom() - compoundPaddingTop;
final Drawables dr = mTextView.mDrawables;
- int icontop = compoundPaddingTop +
- (vspace - (dr != null ? dr.mDrawableHeightRight : 0)) / 2;
+
+ final int layoutDirection = mTextView.getLayoutDirection();
+ int height;
+ switch (layoutDirection) {
+ default:
+ case View.LAYOUT_DIRECTION_LTR:
+ height = (dr != null ? dr.mDrawableHeightRight : 0);
+ break;
+ case View.LAYOUT_DIRECTION_RTL:
+ height = (dr != null ? dr.mDrawableHeightLeft : 0);
+ break;
+ }
+
+ int icontop = compoundPaddingTop + (vspace - height) / 2;
/*
* The "2" is the distance between the point and the top edge
* of the background.
*/
final float scale = mTextView.getResources().getDisplayMetrics().density;
- return icontop + (dr != null ? dr.mDrawableHeightRight : 0) - mTextView.getHeight() -
- (int) (2 * scale + 0.5f);
+ return icontop + height - mTextView.getHeight() - (int) (2 * scale + 0.5f);
}
void createInputContentTypeIfNeeded() {
@@ -3726,7 +3754,7 @@
super(v, width, height);
mView = v;
// Make sure the TextView has a background set as it will be used the first time it is
- // shown and positionned. Initialized with below background, which should have
+ // shown and positioned. Initialized with below background, which should have
// dimensions identical to the above version for this to work (and is more likely).
mPopupInlineErrorBackgroundId = getResourceId(mPopupInlineErrorBackgroundId,
com.android.internal.R.styleable.Theme_errorMessageBackground);
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 4918e48..ac21671 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -1284,7 +1284,12 @@
/**
* Sets the min value of the picker.
*
- * @param minValue The min value.
+ * @param minValue The min value inclusive.
+ *
+ * <strong>Note:</strong> The length of the displayed values array
+ * set via {@link #setDisplayedValues(String[])} must be equal to the
+ * range of selectable numbers which is equal to
+ * {@link #getMaxValue()} - {@link #getMinValue()} + 1.
*/
public void setMinValue(int minValue) {
if (mMinValue == minValue) {
@@ -1317,7 +1322,12 @@
/**
* Sets the max value of the picker.
*
- * @param maxValue The max value.
+ * @param maxValue The max value inclusive.
+ *
+ * <strong>Note:</strong> The length of the displayed values array
+ * set via {@link #setDisplayedValues(String[])} must be equal to the
+ * range of selectable numbers which is equal to
+ * {@link #getMaxValue()} - {@link #getMinValue()} + 1.
*/
public void setMaxValue(int maxValue) {
if (mMaxValue == maxValue) {
@@ -1351,6 +1361,10 @@
* Sets the values to be displayed.
*
* @param displayedValues The displayed values.
+ *
+ * <strong>Note:</strong> The length of the displayed values array
+ * must be equal to the range of selectable numbers which is equal to
+ * {@link #getMaxValue()} - {@link #getMinValue()} + 1.
*/
public void setDisplayedValues(String[] displayedValues) {
if (mDisplayedValues == displayedValues) {
@@ -1361,14 +1375,6 @@
// Allow text entry rather than strictly numeric entry.
mInputText.setRawInputType(InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
- // Make sure the min, max, respect the size of the displayed
- // values. This will take care of the current value as well.
- if (getMinValue() >= displayedValues.length) {
- setMinValue(0);
- }
- if (getMaxValue() >= displayedValues.length) {
- setMaxValue(displayedValues.length - 1);
- }
} else {
mInputText.setRawInputType(InputType.TYPE_CLASS_NUMBER);
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 5d90400..0a16a66 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -284,15 +284,144 @@
private TextUtils.TruncateAt mEllipsize;
static class Drawables {
+ final static int DRAWABLE_NONE = -1;
+ final static int DRAWABLE_RIGHT = 0;
+ final static int DRAWABLE_LEFT = 1;
+
final Rect mCompoundRect = new Rect();
+
Drawable mDrawableTop, mDrawableBottom, mDrawableLeft, mDrawableRight,
- mDrawableStart, mDrawableEnd;
+ mDrawableStart, mDrawableEnd, mDrawableError, mDrawableTemp;
+
int mDrawableSizeTop, mDrawableSizeBottom, mDrawableSizeLeft, mDrawableSizeRight,
- mDrawableSizeStart, mDrawableSizeEnd;
+ mDrawableSizeStart, mDrawableSizeEnd, mDrawableSizeError, mDrawableSizeTemp;
+
int mDrawableWidthTop, mDrawableWidthBottom, mDrawableHeightLeft, mDrawableHeightRight,
- mDrawableHeightStart, mDrawableHeightEnd;
+ mDrawableHeightStart, mDrawableHeightEnd, mDrawableHeightError, mDrawableHeightTemp;
+
int mDrawablePadding;
+
+ int mDrawableSaved = DRAWABLE_NONE;
+
+ public void resolveWithLayoutDirection(int layoutDirection) {
+ switch(layoutDirection) {
+ case LAYOUT_DIRECTION_RTL:
+ if (mDrawableStart != null) {
+ mDrawableRight = mDrawableStart;
+
+ mDrawableSizeRight = mDrawableSizeStart;
+ mDrawableHeightRight = mDrawableHeightStart;
+ }
+ if (mDrawableEnd != null) {
+ mDrawableLeft = mDrawableEnd;
+
+ mDrawableSizeLeft = mDrawableSizeEnd;
+ mDrawableHeightLeft = mDrawableHeightEnd;
+ }
+ break;
+
+ case LAYOUT_DIRECTION_LTR:
+ default:
+ if (mDrawableStart != null) {
+ mDrawableLeft = mDrawableStart;
+
+ mDrawableSizeLeft = mDrawableSizeStart;
+ mDrawableHeightLeft = mDrawableHeightStart;
+ }
+ if (mDrawableEnd != null) {
+ mDrawableRight = mDrawableEnd;
+
+ mDrawableSizeRight = mDrawableSizeEnd;
+ mDrawableHeightRight = mDrawableHeightEnd;
+ }
+ break;
+ }
+ applyErrorDrawableIfNeeded(layoutDirection);
+ updateDrawablesLayoutDirection(layoutDirection);
+ }
+
+ private void updateDrawablesLayoutDirection(int layoutDirection) {
+ if (mDrawableLeft != null) {
+ mDrawableLeft.setLayoutDirection(layoutDirection);
+ }
+ if (mDrawableRight != null) {
+ mDrawableRight.setLayoutDirection(layoutDirection);
+ }
+ if (mDrawableTop != null) {
+ mDrawableTop.setLayoutDirection(layoutDirection);
+ }
+ if (mDrawableBottom != null) {
+ mDrawableBottom.setLayoutDirection(layoutDirection);
+ }
+ }
+
+ public void setErrorDrawable(Drawable dr, TextView tv) {
+ if (mDrawableError != dr && mDrawableError != null) {
+ mDrawableError.setCallback(null);
+ }
+ mDrawableError = dr;
+
+ final Rect compoundRect = mCompoundRect;
+ int[] state = tv.getDrawableState();
+
+ if (mDrawableError != null) {
+ mDrawableError.setState(state);
+ mDrawableError.copyBounds(compoundRect);
+ mDrawableError.setCallback(tv);
+ mDrawableSizeError = compoundRect.width();
+ mDrawableHeightError = compoundRect.height();
+ } else {
+ mDrawableSizeError = mDrawableHeightError = 0;
+ }
+ }
+
+ private void applyErrorDrawableIfNeeded(int layoutDirection) {
+ // first restore the initial state if needed
+ switch (mDrawableSaved) {
+ case DRAWABLE_LEFT:
+ mDrawableLeft = mDrawableTemp;
+ mDrawableSizeLeft = mDrawableSizeTemp;
+ mDrawableHeightLeft = mDrawableHeightTemp;
+ break;
+ case DRAWABLE_RIGHT:
+ mDrawableRight = mDrawableTemp;
+ mDrawableSizeRight = mDrawableSizeTemp;
+ mDrawableHeightRight = mDrawableHeightTemp;
+ break;
+ case DRAWABLE_NONE:
+ default:
+ }
+ // then, if needed, assign the Error drawable to the correct location
+ if (mDrawableError != null) {
+ switch(layoutDirection) {
+ case LAYOUT_DIRECTION_RTL:
+ mDrawableSaved = DRAWABLE_LEFT;
+
+ mDrawableTemp = mDrawableLeft;
+ mDrawableSizeTemp = mDrawableSizeLeft;
+ mDrawableHeightTemp = mDrawableHeightLeft;
+
+ mDrawableLeft = mDrawableError;
+ mDrawableSizeLeft = mDrawableSizeError;
+ mDrawableHeightLeft = mDrawableHeightError;
+ break;
+ case LAYOUT_DIRECTION_LTR:
+ default:
+ mDrawableSaved = DRAWABLE_RIGHT;
+
+ mDrawableTemp = mDrawableRight;
+ mDrawableSizeTemp = mDrawableSizeRight;
+ mDrawableHeightTemp = mDrawableHeightRight;
+
+ mDrawableRight = mDrawableError;
+ mDrawableSizeRight = mDrawableSizeError;
+ mDrawableHeightRight = mDrawableHeightError;
+ break;
+ }
+ }
+ }
}
+
Drawables mDrawables;
private CharWrapper mCharWrapper;
@@ -8229,9 +8358,8 @@
TextDirectionHeuristic getTextDirectionHeuristic() {
if (hasPasswordTransformationMethod()) {
- // TODO: take care of the content direction to show the password text and dots justified
- // to the left or to the right
- return TextDirectionHeuristics.LOCALE;
+ // passwords fields should be LTR
+ return TextDirectionHeuristics.LTR;
}
// Always need to resolve layout direction first
@@ -8264,63 +8392,10 @@
return;
}
mLastLayoutDirection = layoutDirection;
- // No drawable to resolve
- if (mDrawables == null) {
- return;
- }
- // No relative drawable to resolve
- if (mDrawables.mDrawableStart == null && mDrawables.mDrawableEnd == null) {
- return;
- }
- Drawables dr = mDrawables;
- switch(layoutDirection) {
- case LAYOUT_DIRECTION_RTL:
- if (dr.mDrawableStart != null) {
- dr.mDrawableRight = dr.mDrawableStart;
-
- dr.mDrawableSizeRight = dr.mDrawableSizeStart;
- dr.mDrawableHeightRight = dr.mDrawableHeightStart;
- }
- if (dr.mDrawableEnd != null) {
- dr.mDrawableLeft = dr.mDrawableEnd;
-
- dr.mDrawableSizeLeft = dr.mDrawableSizeEnd;
- dr.mDrawableHeightLeft = dr.mDrawableHeightEnd;
- }
- break;
-
- case LAYOUT_DIRECTION_LTR:
- default:
- if (dr.mDrawableStart != null) {
- dr.mDrawableLeft = dr.mDrawableStart;
-
- dr.mDrawableSizeLeft = dr.mDrawableSizeStart;
- dr.mDrawableHeightLeft = dr.mDrawableHeightStart;
- }
- if (dr.mDrawableEnd != null) {
- dr.mDrawableRight = dr.mDrawableEnd;
-
- dr.mDrawableSizeRight = dr.mDrawableSizeEnd;
- dr.mDrawableHeightRight = dr.mDrawableHeightEnd;
- }
- break;
- }
- updateDrawablesLayoutDirection(dr, layoutDirection);
- }
-
- private void updateDrawablesLayoutDirection(Drawables dr, int layoutDirection) {
- if (dr.mDrawableLeft != null) {
- dr.mDrawableLeft.setLayoutDirection(layoutDirection);
- }
- if (dr.mDrawableRight != null) {
- dr.mDrawableRight.setLayoutDirection(layoutDirection);
- }
- if (dr.mDrawableTop != null) {
- dr.mDrawableTop.setLayoutDirection(layoutDirection);
- }
- if (dr.mDrawableBottom != null) {
- dr.mDrawableBottom.setLayoutDirection(layoutDirection);
+ // Resolve drawables
+ if (mDrawables != null) {
+ mDrawables.resolveWithLayoutDirection(layoutDirection);
}
}
@@ -8328,6 +8403,7 @@
* @hide
*/
protected void resetResolvedDrawables() {
+ super.resetResolvedDrawables();
mLastLayoutDirection = -1;
}
diff --git a/core/java/com/android/internal/annotations/GuardedBy.java b/core/java/com/android/internal/annotations/GuardedBy.java
new file mode 100644
index 0000000..fc61945
--- /dev/null
+++ b/core/java/com/android/internal/annotations/GuardedBy.java
@@ -0,0 +1,32 @@
+/*
+ * 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.internal.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation type used to mark a method or field that can only be accessed when
+ * holding the referenced lock.
+ */
+@Target({ ElementType.FIELD, ElementType.METHOD })
+@Retention(RetentionPolicy.CLASS)
+public @interface GuardedBy {
+ String value();
+}
diff --git a/core/java/com/android/internal/annotations/Immutable.java b/core/java/com/android/internal/annotations/Immutable.java
new file mode 100644
index 0000000..b424275
--- /dev/null
+++ b/core/java/com/android/internal/annotations/Immutable.java
@@ -0,0 +1,30 @@
+/*
+ * 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.internal.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation type used to mark a class which is immutable.
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.CLASS)
+public @interface Immutable {
+}
diff --git a/core/java/com/android/internal/annotations/VisibleForTesting.java b/core/java/com/android/internal/annotations/VisibleForTesting.java
new file mode 100644
index 0000000..bc3121c
--- /dev/null
+++ b/core/java/com/android/internal/annotations/VisibleForTesting.java
@@ -0,0 +1,50 @@
+/*
+ * 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.internal.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Denotes that the class, method or field has its visibility relaxed so
+ * that unit tests can access it.
+ * <p/>
+ * The <code>visibility</code> argument can be used to specific what the original
+ * visibility should have been if it had not been made public or package-private for testing.
+ * The default is to consider the element private.
+ */
+@Retention(RetentionPolicy.SOURCE)
+public @interface VisibleForTesting {
+ /**
+ * Intended visibility if the element had not been made public or package-private for
+ * testing.
+ */
+ enum Visibility {
+ /** The element should be considered protected. */
+ PROTECTED,
+ /** The element should be considered package-private. */
+ PACKAGE,
+ /** The element should be considered private. */
+ PRIVATE
+ }
+
+ /**
+ * Intended visibility if the element had not been made public or package-private for testing.
+ * If not specified, one should assume the element originally intended to be private.
+ */
+ Visibility visibility() default Visibility.PRIVATE;
+}
diff --git a/core/java/com/android/internal/appwidget/IAppWidgetService.aidl b/core/java/com/android/internal/appwidget/IAppWidgetService.aidl
index cfb16fa..b63ad62 100644
--- a/core/java/com/android/internal/appwidget/IAppWidgetService.aidl
+++ b/core/java/com/android/internal/appwidget/IAppWidgetService.aidl
@@ -38,6 +38,7 @@
void deleteHost(int hostId);
void deleteAllHosts();
RemoteViews getAppWidgetViews(int appWidgetId);
+ int[] getAppWidgetIdsForHost(int hostId);
//
// for AppWidgetManager
diff --git a/core/java/com/android/internal/net/NetworkStatsFactory.java b/core/java/com/android/internal/net/NetworkStatsFactory.java
index 8b222f0..c517a68 100644
--- a/core/java/com/android/internal/net/NetworkStatsFactory.java
+++ b/core/java/com/android/internal/net/NetworkStatsFactory.java
@@ -25,6 +25,7 @@
import android.os.StrictMode;
import android.os.SystemClock;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ProcFileReader;
import java.io.File;
@@ -53,7 +54,7 @@
this(new File("/proc/"));
}
- // @VisibleForTesting
+ @VisibleForTesting
public NetworkStatsFactory(File procRoot) {
mStatsXtIfaceAll = new File(procRoot, "net/xt_qtaguid/iface_stat_all");
mStatsXtIfaceFmt = new File(procRoot, "net/xt_qtaguid/iface_stat_fmt");
diff --git a/core/java/com/android/internal/util/LocalLog.java b/core/java/com/android/internal/util/LocalLog.java
new file mode 100644
index 0000000..f0e6171
--- /dev/null
+++ b/core/java/com/android/internal/util/LocalLog.java
@@ -0,0 +1,66 @@
+/*
+ * 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.internal.util;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+
+import android.util.Slog;
+
+/**
+ * Helper class for logging serious issues, which also keeps a small
+ * snapshot of the logged events that can be printed later, such as part
+ * of a system service's dumpsys output.
+ * @hide
+ */
+public class LocalLog {
+ private final String mTag;
+ private final int mMaxLines = 20;
+ private final ArrayList<String> mLines = new ArrayList<String>(mMaxLines);
+
+ public LocalLog(String tag) {
+ mTag = tag;
+ }
+
+ public void w(String msg) {
+ synchronized (mLines) {
+ Slog.w(mTag, msg);
+ if (mLines.size() >= mMaxLines) {
+ mLines.remove(0);
+ }
+ mLines.add(msg);
+ }
+ }
+
+ public boolean dump(PrintWriter pw, String header, String prefix) {
+ synchronized (mLines) {
+ if (mLines.size() <= 0) {
+ return false;
+ }
+ if (header != null) {
+ pw.println(header);
+ }
+ for (int i=0; i<mLines.size(); i++) {
+ if (prefix != null) {
+ pw.print(prefix);
+ }
+ pw.println(mLines.get(i));
+ }
+ return true;
+ }
+ }
+}
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 75fef24..5fa0b78 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -116,16 +116,6 @@
public static final String KEYGUARD_SHOW_APPWIDGET = "showappwidget";
/**
- * Options used to lock the device upon user switch.
- */
- public static final Bundle USER_SWITCH_LOCK_OPTIONS = new Bundle();
-
- static {
- USER_SWITCH_LOCK_OPTIONS.putBoolean(KEYGUARD_SHOW_USER_SWITCHER, true);
- USER_SWITCH_LOCK_OPTIONS.putBoolean(KEYGUARD_SHOW_SECURITY_CHALLENGE, true);
- }
-
- /**
* The bit in LOCK_BIOMETRIC_WEAK_FLAGS to be used to indicate whether liveliness should
* be used
*/
diff --git a/core/res/res/drawable-hdpi/kg_add_widget.png b/core/res/res/drawable-hdpi/kg_add_widget.png
index 723d97a..68971a5 100644
--- a/core/res/res/drawable-hdpi/kg_add_widget.png
+++ b/core/res/res/drawable-hdpi/kg_add_widget.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_add_widget_disabled.png b/core/res/res/drawable-hdpi/kg_add_widget_disabled.png
new file mode 100644
index 0000000..f24cf642
--- /dev/null
+++ b/core/res/res/drawable-hdpi/kg_add_widget_disabled.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/kg_add_widget_pressed.png b/core/res/res/drawable-hdpi/kg_add_widget_pressed.png
new file mode 100644
index 0000000..55112ca
--- /dev/null
+++ b/core/res/res/drawable-hdpi/kg_add_widget_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-hdpi/popup_inline_error.9.png b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error.9.png
new file mode 100644
index 0000000..8b43f4e
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_above.9.png b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_above.9.png
new file mode 100644
index 0000000..20e9002
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_above.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_above_holo_dark.9.png b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_above_holo_dark.9.png
new file mode 100644
index 0000000..b5f397c
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_above_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_above_holo_light.9.png b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_above_holo_light.9.png
new file mode 100644
index 0000000..a04d695
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_above_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_holo_dark.9.png b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_holo_dark.9.png
new file mode 100644
index 0000000..8567b1f
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_holo_light.9.png b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_holo_light.9.png
new file mode 100644
index 0000000..7d1754c
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-hdpi/popup_inline_error_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-ldpi/popup_inline_error.9.png b/core/res/res/drawable-ldrtl-ldpi/popup_inline_error.9.png
new file mode 100644
index 0000000..d2efb62
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-ldpi/popup_inline_error.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-ldpi/popup_inline_error_above.9.png b/core/res/res/drawable-ldrtl-ldpi/popup_inline_error_above.9.png
new file mode 100644
index 0000000..04d200d
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-ldpi/popup_inline_error_above.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-mdpi/popup_inline_error.9.png b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error.9.png
new file mode 100644
index 0000000..27e8d4f
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_above.9.png b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_above.9.png
new file mode 100644
index 0000000..4ae2b91
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_above.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_above_holo_dark.9.png b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_above_holo_dark.9.png
new file mode 100644
index 0000000..8cc3b69
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_above_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_above_holo_light.9.png b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_above_holo_light.9.png
new file mode 100644
index 0000000..7a84200
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_above_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_holo_dark.9.png b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_holo_dark.9.png
new file mode 100644
index 0000000..8fc2e2e
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_holo_light.9.png b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_holo_light.9.png
new file mode 100644
index 0000000..687a691
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-mdpi/popup_inline_error_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error.9.png b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error.9.png
new file mode 100644
index 0000000..db91a56
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_above.9.png b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_above.9.png
new file mode 100644
index 0000000..90820b5
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_above.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_above_holo_dark.9.png b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_above_holo_dark.9.png
new file mode 100644
index 0000000..5989975
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_above_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_above_holo_light.9.png b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_above_holo_light.9.png
new file mode 100644
index 0000000..3b3f87d3
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_above_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_holo_dark.9.png b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_holo_dark.9.png
new file mode 100644
index 0000000..75baba2
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_holo_light.9.png b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_holo_light.9.png
new file mode 100644
index 0000000..6c0203d
--- /dev/null
+++ b/core/res/res/drawable-ldrtl-xhdpi/popup_inline_error_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_add_widget.png b/core/res/res/drawable-mdpi/kg_add_widget.png
index 5b0a5a4..136ae17 100644
--- a/core/res/res/drawable-mdpi/kg_add_widget.png
+++ b/core/res/res/drawable-mdpi/kg_add_widget.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_add_widget_disabled.png b/core/res/res/drawable-mdpi/kg_add_widget_disabled.png
new file mode 100644
index 0000000..02e0f0e
--- /dev/null
+++ b/core/res/res/drawable-mdpi/kg_add_widget_disabled.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/kg_add_widget_pressed.png b/core/res/res/drawable-mdpi/kg_add_widget_pressed.png
new file mode 100644
index 0000000..34a7aaa
--- /dev/null
+++ b/core/res/res/drawable-mdpi/kg_add_widget_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_add_widget.png b/core/res/res/drawable-xhdpi/kg_add_widget.png
index 9c84de2..ca48be2 100644
--- a/core/res/res/drawable-xhdpi/kg_add_widget.png
+++ b/core/res/res/drawable-xhdpi/kg_add_widget.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_add_widget_disabled.png b/core/res/res/drawable-xhdpi/kg_add_widget_disabled.png
new file mode 100644
index 0000000..55fa1ac
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/kg_add_widget_disabled.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/kg_add_widget_pressed.png b/core/res/res/drawable-xhdpi/kg_add_widget_pressed.png
new file mode 100644
index 0000000..4b86727
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/kg_add_widget_pressed.png
Binary files differ
diff --git a/core/res/res/drawable/keyguard_add_widget_button.xml b/core/res/res/drawable/keyguard_add_widget_button.xml
new file mode 100644
index 0000000..c26f81d
--- /dev/null
+++ b/core/res/res/drawable/keyguard_add_widget_button.xml
@@ -0,0 +1,21 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true" android:drawable="@drawable/kg_add_widget_pressed" />
+ <item android:state_enabled="false" android:drawable="@drawable/kg_add_widget_disabled" />
+ <item android:drawable="@drawable/kg_add_widget" />
+</selector>
diff --git a/core/res/res/layout/keyguard_add_widget.xml b/core/res/res/layout/keyguard_add_widget.xml
index db166ac..d043fdb 100644
--- a/core/res/res/layout/keyguard_add_widget.xml
+++ b/core/res/res/layout/keyguard_add_widget.xml
@@ -36,7 +36,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="24dp"
- android:src="@drawable/kg_add_widget"
+ android:src="@drawable/keyguard_add_widget_button"
android:contentDescription="@string/keyguard_accessibility_add_widget"/>
</FrameLayout>
</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame>
diff --git a/core/res/res/layout/keyguard_pin_view.xml b/core/res/res/layout/keyguard_pin_view.xml
index e494b69..6a3b9e6 100644
--- a/core/res/res/layout/keyguard_pin_view.xml
+++ b/core/res/res/layout/keyguard_pin_view.xml
@@ -39,6 +39,7 @@
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="1"
+ android:layoutDirection="ltr"
>
<LinearLayout
android:layout_width="match_parent"
diff --git a/core/res/res/layout/keyguard_sim_pin_view.xml b/core/res/res/layout/keyguard_sim_pin_view.xml
index 026b025..6e6fe08 100644
--- a/core/res/res/layout/keyguard_sim_pin_view.xml
+++ b/core/res/res/layout/keyguard_sim_pin_view.xml
@@ -44,6 +44,7 @@
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="1"
+ android:layoutDirection="ltr"
>
<LinearLayout
android:layout_width="match_parent"
diff --git a/core/res/res/layout/keyguard_sim_puk_view.xml b/core/res/res/layout/keyguard_sim_puk_view.xml
index 28a9f9a..0412fdc 100644
--- a/core/res/res/layout/keyguard_sim_puk_view.xml
+++ b/core/res/res/layout/keyguard_sim_puk_view.xml
@@ -45,6 +45,7 @@
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="1"
+ android:layoutDirection="ltr"
>
<LinearLayout
android:layout_width="match_parent"
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 51d23e8..0fa1b13 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"weke"</string>
<string name="year" msgid="4001118221013892076">"jaar"</string>
<string name="years" msgid="6881577717993213522">"jaar"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 sekonde"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> sekondes"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuut"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minute"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 uur"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> ure"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Videoprobleem"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Hierdie video is nie geldig vir stroming na hierdie toestel nie."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Kan nie hierdie video speel nie."</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index f846ffd..e326639 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"ሳምንቶች"</string>
<string name="year" msgid="4001118221013892076">"ዓመት"</string>
<string name="years" msgid="6881577717993213522">"ዓመታት"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 ሰከንድ"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> ሰከንዶች"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 ደቂቃ"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> ደቂቃዎች"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 ሰዓት"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> ሰዓታት"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"የቪዲዮ ችግር"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"ይቅርታ፣ ይህ ቪዲዮ በዚህ መሣሪያ ለመልቀቅ ትክክል አይደለም።"</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"ይሄን ቪዲዮ ማጫወት አልተቻለም።"</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index a7c0c50..82902c4 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"أسابيع"</string>
<string name="year" msgid="4001118221013892076">"سنة"</string>
<string name="years" msgid="6881577717993213522">"أعوام"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"ثانية واحدة"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> من الثواني"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"دقيقة واحدة"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> من الدقائق"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"ساعة واحدة"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> من الساعات"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"مشكلة في الفيديو"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"عذرًا، هذا الفيديو غير صالح للبث على هذا الجهاز."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"لا يمكنك تشغيل هذا الفيديو."</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 6ae68f9..711dc46 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"тыд."</string>
<string name="year" msgid="4001118221013892076">"год"</string>
<string name="years" msgid="6881577717993213522">"г."</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 секунда"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> с"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 хвіліна"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> хв."</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 гадзіна"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> гадз."</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Праблема з відэа"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Відэа не падыходзіць для патокавай перадачы на гэту прыладу."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Немагчыма прайграць гэта відэа."</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 838f0cf..859614f 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"седмици"</string>
<string name="year" msgid="4001118221013892076">"година"</string>
<string name="years" msgid="6881577717993213522">"години"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 секунда"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> секунди"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 минута"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> минути"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 час"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> часа"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Проблем с видеоклипа"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Този видеоклип не е валиден за поточно предаване към това устройство."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Този видеоклип не може да се пусне."</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index fdc9506..d3e32c3 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"setmanes"</string>
<string name="year" msgid="4001118221013892076">"any"</string>
<string name="years" msgid="6881577717993213522">"anys"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 segon"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> segons"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minut"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minuts"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 hora"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> hores"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Problema amb el vídeo"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Aquest vídeo no és vàlid per a la reproducció en aquest dispositiu."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"No es pot reproduir aquest vídeo."</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index 374a6d5..f5ccf1e 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -362,7 +362,7 @@
<string name="permlab_deletePackages" msgid="184385129537705938">"smazání aplikací"</string>
<string name="permdesc_deletePackages" msgid="7411480275167205081">"Umožňuje aplikaci smazat balíčky Android. Škodlivé aplikace mohou toto oprávnění použít ke smazání důležitých aplikací."</string>
<string name="permlab_clearAppUserData" msgid="274109191845842756">"smazání dat ostatních aplikací"</string>
- <string name="permdesc_clearAppUserData" msgid="4625323684125459488">"Umožňuje aplikaci smazat data uživatele."</string>
+ <string name="permdesc_clearAppUserData" msgid="4625323684125459488">"Umožňuje aplikaci vymazat data uživatele."</string>
<string name="permlab_deleteCacheFiles" msgid="3128665571837408675">"smazání mezipaměti ostatních aplikací"</string>
<string name="permdesc_deleteCacheFiles" msgid="3812998599006730196">"Umožňuje aplikaci smazat soubory v mezipaměti."</string>
<string name="permlab_getPackageSize" msgid="7472921768357981986">"výpočet místa pro ukládání aplikací"</string>
@@ -446,7 +446,7 @@
<string name="permdesc_controlWifiDisplay" msgid="4543912292681826986">"Povoluje aplikaci ovládat základní funkce displejů přes Wi-Fi."</string>
<string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"změna vašeho nastavení zvuku"</string>
<string name="permdesc_modifyAudioSettings" msgid="3522565366806248517">"Umožňuje aplikaci změnit globální nastavení zvuku, například hlasitost či reproduktor pro výstup zvuku."</string>
- <string name="permlab_recordAudio" msgid="3876049771427466323">"nahrání zvuku"</string>
+ <string name="permlab_recordAudio" msgid="3876049771427466323">"nahrávání zvuku"</string>
<string name="permdesc_recordAudio" msgid="4906839301087980680">"Umožňuje aplikaci zaznamenat zvuk pomocí mikrofonu. Toto oprávnění umožňuje aplikaci kdykoliv zaznamenat zvuk bez vašeho svolení."</string>
<string name="permlab_camera" msgid="3616391919559751192">"pořizování fotografií a videí"</string>
<string name="permdesc_camera" msgid="8497216524735535009">"Umožňuje aplikaci pořizovat fotografie a videa pomocí fotoaparátu. Toto oprávnění umožňuje aplikaci používat fotoaparát kdykoliv i bez vašeho svolení."</string>
@@ -587,8 +587,8 @@
<string name="permlab_sdcardRead" product="default" msgid="8235341515605559677">"testování přístupu do chráněného úložiště"</string>
<string name="permdesc_sdcardRead" product="nosdcard" msgid="3642473292348132072">"Umožňuje aplikaci testovat oprávnění pro úložiště USB, které bude dostupné v budoucích zařízeních."</string>
<string name="permdesc_sdcardRead" product="default" msgid="5914402684685848828">"Umožňuje aplikaci testovat oprávnění pro kartu SD, která bude dostupná v budoucích zařízeních."</string>
- <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"úprava nebo smazání obsahu v úložišti USB"</string>
- <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"úprava nebo smazání obsahu na kartě SD"</string>
+ <string name="permlab_sdcardWrite" product="nosdcard" msgid="8485979062254666748">"úprava nebo mazání obsahu v úložišti USB"</string>
+ <string name="permlab_sdcardWrite" product="default" msgid="8805693630050458763">"úprava nebo mazání obsahu na kartě SD"</string>
<string name="permdesc_sdcardWrite" product="nosdcard" msgid="6175406299445710888">"Umožňuje aplikaci zapisovat do úložiště USB."</string>
<string name="permdesc_sdcardWrite" product="default" msgid="4337417790936632090">"Umožňuje aplikaci zapisovat na kartu SD."</string>
<string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"Upravit/smazat interní úlož."</string>
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"týd."</string>
<string name="year" msgid="4001118221013892076">"rokem"</string>
<string name="years" msgid="6881577717993213522">"lety"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 sekunda"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> s"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuta"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> min"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 hodina"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> h"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Potíže s videem"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Toto video nelze přenášet datovým proudem do tohoto zařízení."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Toto video nelze přehrát."</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index b0fcf8b..a3dd19a 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"uger"</string>
<string name="year" msgid="4001118221013892076">"år"</string>
<string name="years" msgid="6881577717993213522">"år"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"Ét sekund"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> sekunder"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"Ét minut"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minutter"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"Én time"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> timer"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Videoproblem"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Denne video kan ikke streames på denne enhed."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Videoen kan ikke afspilles."</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index b4f87ef..48da500 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -121,7 +121,7 @@
<string name="httpErrorRedirectLoop" msgid="8679596090392779516">"Die Seite enthält zu viele Server-Redirects."</string>
<string name="httpErrorUnsupportedScheme" msgid="5015730812906192208">"Das Protokoll wird nicht unterstützt."</string>
<string name="httpErrorFailedSslHandshake" msgid="96549606000658641">"Es konnte keine sichere Verbindung hergestellt werden."</string>
- <string name="httpErrorBadUrl" msgid="3636929722728881972">"Die Seite kann nicht geöffnet werden, da die URL ungültig ist."</string>
+ <string name="httpErrorBadUrl" msgid="3636929722728881972">"Die Seite kann nicht geöffnet werden, weil die URL ungültig ist."</string>
<string name="httpErrorFile" msgid="2170788515052558676">"Auf die Datei konnte nicht zugegriffen werden."</string>
<string name="httpErrorFileNotFound" msgid="6203856612042655084">"Die angeforderte Datei wurde nicht gefunden."</string>
<string name="httpErrorTooManyRequests" msgid="1235396927087188253">"Es werden zurzeit zu viele Anfragen verarbeitet. Versuchen Sie es später erneut."</string>
@@ -382,8 +382,8 @@
<string name="permlab_diagnostic" msgid="8076743953908000342">"Lese-/Schreibberechtigung für zu Diagnosegruppe gehörige Elemente"</string>
<string name="permdesc_diagnostic" msgid="6608295692002452283">"Ermöglicht der App, alle Elemente in der Diagnosegruppe zu lesen und zu bearbeiten, etwa Dateien in \"/dev\". Dies könnte eine potenzielle Gefährdung für die Stabilität und Sicherheit des Systems darstellen und sollte NUR für hardwarespezifische Diagnosen des Herstellers oder Mobilfunkanbieters verwendet werden."</string>
<string name="permlab_changeComponentState" msgid="6335576775711095931">"App-Komponenten aktivieren oder deaktivieren"</string>
- <string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"Ermöglicht der App, Komponenten einer anderen App zu aktivieren oder zu deaktivieren. Schädliche Apps können so wichtige Tabletfunktionen deaktivieren. Bei der Erteilung dieser Berechtigung ist Vorsicht geboten, da die App-Komponenten unbrauchbar, inkonsistent oder instabil werden können."</string>
- <string name="permdesc_changeComponentState" product="default" msgid="1827232484416505615">"Ermöglicht der App, Komponenten einer anderen App zu aktivieren oder zu deaktivieren. Schädliche Apps können so wichtige Telefonfunktionen deaktivieren. Bei der Erteilung dieser Berechtigung ist Vorsicht geboten, da die App-Komponenten unbrauchbar, inkonsistent oder instabil werden können."</string>
+ <string name="permdesc_changeComponentState" product="tablet" msgid="8887435740982237294">"Ermöglicht der App, Komponenten einer anderen App zu aktivieren oder zu deaktivieren. Schädliche Apps können so wichtige Tabletfunktionen deaktivieren. Bei der Erteilung dieser Berechtigung ist Vorsicht geboten, weil die App-Komponenten unbrauchbar, inkonsistent oder instabil werden können."</string>
+ <string name="permdesc_changeComponentState" product="default" msgid="1827232484416505615">"Ermöglicht der App, Komponenten einer anderen App zu aktivieren oder zu deaktivieren. Schädliche Apps können so wichtige Telefonfunktionen deaktivieren. Bei der Erteilung dieser Berechtigung ist Vorsicht geboten, weil die App-Komponenten unbrauchbar, inkonsistent oder instabil werden können."</string>
<string name="permlab_grantRevokePermissions" msgid="4627315351093508795">"Berechtigungen erteilen oder entziehen"</string>
<string name="permdesc_grantRevokePermissions" msgid="4088642654085850662">"Hiermit kann eine App sich selbst oder anderen Apps bestimmte Berechtigungen erteilen oder entziehen. Schädliche Apps können hierdurch Zugriff auf Funktionen erlangen, den Sie nicht gewährt haben."</string>
<string name="permlab_setPreferredApplications" msgid="8463181628695396391">"Bevorzugte Apps festlegen"</string>
@@ -398,8 +398,8 @@
<string name="permdesc_receiveBootCompleted" product="tablet" msgid="7390304664116880704">"Ermöglicht der App, sich selbst zu starten, sobald das System gebootet wurde. Dadurch kann es länger dauern, bis das Tablet gestartet wird, und durch die ständige Aktivität der App wird die gesamte Leistung des Tablets beeinträchtigt."</string>
<string name="permdesc_receiveBootCompleted" product="default" msgid="513950589102617504">"Ermöglicht der App, sich selbst zu starten, sobald das System gebootet wurde. Dadurch kann es länger dauern, bis das Telefon gestartet wird, und durch die ständige Aktivität der App wird die gesamte Leistung des Telefons beeinträchtigt."</string>
<string name="permlab_broadcastSticky" msgid="7919126372606881614">"dauerhaften Broadcast senden"</string>
- <string name="permdesc_broadcastSticky" product="tablet" msgid="7749760494399915651">"Ermöglicht der App, dauerhafte Broadcasts zu senden, die auch nach Ende des Broadcasts bestehen bleiben. Ein zu intensiver Einsatz kann das Tablet langsam oder instabil machen, da zu viel Arbeitsspeicher belegt wird."</string>
- <string name="permdesc_broadcastSticky" product="default" msgid="2825803764232445091">"Ermöglicht der App, dauerhafte Broadcasts zu senden, die auch nach Ende des Broadcasts bestehen bleiben. Ein zu intensiver Einsatz kann das Telefon langsam oder instabil machen, da zu viel Arbeitsspeicher belegt wird."</string>
+ <string name="permdesc_broadcastSticky" product="tablet" msgid="7749760494399915651">"Ermöglicht der App, weiluerhafte Broadcasts zu senden, die auch nach Ende des Broadcasts bestehen bleiben. Ein zu intensiver Einsatz kann das Tablet langsam oder instabil machen, weil zu viel Arbeitsspeicher belegt wird."</string>
+ <string name="permdesc_broadcastSticky" product="default" msgid="2825803764232445091">"Ermöglicht der App, weiluerhafte Broadcasts zu senden, die auch nach Ende des Broadcasts bestehen bleiben. Ein zu intensiver Einsatz kann das Telefon langsam oder instabil machen, weil zu viel Arbeitsspeicher belegt wird."</string>
<string name="permlab_readContacts" msgid="8348481131899886131">"Kontakte lesen"</string>
<string name="permdesc_readContacts" product="tablet" msgid="5294866856941149639">"Ermöglicht der App, Daten zu den auf Ihrem Tablet gespeicherten Kontakten zu lesen, einschließlich der Häufigkeit, mit der Sie bestimmte Personen angerufen, diesen E-Mails gesendet oder anderweitig mit ihnen kommuniziert haben. Die Berechtigung erlaubt Apps, Ihre Kontaktdaten zu speichern, und schädliche Apps können Kontaktdaten ohne Ihr Wissen weiterleiten."</string>
<string name="permdesc_readContacts" product="default" msgid="8440654152457300662">"Ermöglicht der App, Daten zu den auf Ihrem Telefon gespeicherten Kontakten zu lesen, einschließlich der Häufigkeit, mit der Sie bestimmte Personen angerufen, diesen E-Mails gesendet oder anderweitig mit ihnen kommuniziert haben. Die Berechtigung erlaubt Apps, Ihre Kontaktdaten zu speichern, und schädliche Apps können Kontaktdaten ohne Ihr Wissen weiterleiten."</string>
@@ -485,7 +485,7 @@
<string name="permlab_hardware_test" msgid="4148290860400659146">"Hardware testen"</string>
<string name="permdesc_hardware_test" msgid="6597964191208016605">"Ermöglicht der App, verschiedene Peripherie-Geräte zu Hardware-Testzwecken zu steuern"</string>
<string name="permlab_callPhone" msgid="3925836347681847954">"Telefonnummern direkt anrufen"</string>
- <string name="permdesc_callPhone" msgid="3740797576113760827">"Ermöglicht der App, Telefonnummern zu wählen, ohne dass ein Eingreifen Ihrerseits nötig ist. Dies kann zu unerwarteten Kosten und Anrufen führen. Beachten Sie, dass die App keine Notrufnummern wählen kann. Schädliche Apps verursachen möglicherweise Kosten, indem sie Anrufe ohne Ihre Bestätigung tätigen."</string>
+ <string name="permdesc_callPhone" msgid="3740797576113760827">"Ermöglicht der App, ohne Ihr Eingreifen Telefonnummern zu wählen. Dies kann zu unerwarteten Kosten und Anrufen führen. Beachten Sie, dass die App keine Notrufnummern wählen kann. Schädliche Apps verursachen möglicherweise Kosten, indem sie Anrufe ohne Ihre Bestätigung tätigen."</string>
<string name="permlab_callPrivileged" msgid="4198349211108497879">"Alle Telefonnummern direkt anrufen"</string>
<string name="permdesc_callPrivileged" msgid="1689024901509996810">"Ermöglicht der App, ohne Ihr Eingreifen eine beliebige Telefonnummer zu wählen, einschließlich Notrufnummern. Schädliche Apps können so unnötige und illegale Notrufe tätigen."</string>
<string name="permlab_performCdmaProvisioning" product="tablet" msgid="4842576994144604821">"CDMA-Tablet-Einrichtung direkt starten"</string>
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"Wochen"</string>
<string name="year" msgid="4001118221013892076">"Jahr"</string>
<string name="years" msgid="6881577717993213522">"Jahre"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 Sekunde"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> Sekunden"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 Minute"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> Minuten"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 Stunde"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> Stunden"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Videoprobleme"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Dieses Video ist nicht für Streaming auf diesem Gerät gültig."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Video kann nicht wiedergegeben werden."</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 32d6d3d..9b35015 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -762,7 +762,7 @@
<string name="lockscreen_password_wrong" msgid="5737815393253165301">"Προσπαθήστε ξανά"</string>
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Έγινε υπέρβαση του μέγιστου αριθμού προσπαθειών Face Unlock"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Φόρτιση, <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
- <string name="lockscreen_charged" msgid="321635745684060624">"Χρεώθηκε"</string>
+ <string name="lockscreen_charged" msgid="321635745684060624">"Μπαταρία πλήρης"</string>
<string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Συνδέστε τον φορτιστή."</string>
<string name="lockscreen_missing_sim_message_short" msgid="5099439277819215399">"Δεν υπάρχει κάρτα SIM"</string>
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"εβδομάδες"</string>
<string name="year" msgid="4001118221013892076">"έτος"</string>
<string name="years" msgid="6881577717993213522">"έτη"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"Πρόβλημα με το βίντεο"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Αυτό το βίντεο δεν είναι έγκυρο για ροή σε αυτή τη συσκευή."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Δεν μπορείτε να αναπαράγετε αυτό το βίντεο."</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 888e42e..5ceae63 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"weeks"</string>
<string name="year" msgid="4001118221013892076">"year"</string>
<string name="years" msgid="6881577717993213522">"years"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 second"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> seconds"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minute"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minutes"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 hour"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> hours"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Video problem"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"This video isn\'t valid for streaming to this device."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Can\'t play this video."</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 47d436d..648f1f6 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"semanas"</string>
<string name="year" msgid="4001118221013892076">"año"</string>
<string name="years" msgid="6881577717993213522">"años"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 segundo"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> segundos"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuto"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minutos"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 hora"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> horas"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Problemas de video"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"No es posible transmitir este video al dispositivo."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"No se puede reproducir el video."</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index c129483..a5f3526 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"semanas"</string>
<string name="year" msgid="4001118221013892076">"año"</string>
<string name="years" msgid="6881577717993213522">"años"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 segundo"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> segundos"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuto"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minutos"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 hora"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> horas"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Incidencias con el vídeo"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Este vídeo no se puede transmitir al dispositivo."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"No se puede reproducir el vídeo."</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 5fb21d4..85167ce 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"nädalat"</string>
<string name="year" msgid="4001118221013892076">"aasta"</string>
<string name="years" msgid="6881577717993213522">"aastat"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 sekund"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> sekundit"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minut"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minutit"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 tund"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> tundi"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Probleem videoga"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"See video ei sobi voogesituseks selles seadmes."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Videot ei saa esitada."</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 13ad8a7..95d3bfa 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"هفته"</string>
<string name="year" msgid="4001118221013892076">"سال"</string>
<string name="years" msgid="6881577717993213522">"سال"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"مشکل در ویدئو"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"متأسفیم، این ویدئو برای پخش جریانی با این دستگاه معتبر نیست."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"پخش این ویدئو ممکن نیست."</string>
@@ -1128,10 +1134,10 @@
<string name="sms_short_code_confirm_always_allow" msgid="3241181154869493368">"همیشه مجاز"</string>
<string name="sms_short_code_confirm_never_allow" msgid="446992765774269673">"همیشه غیرمجاز"</string>
<string name="sim_removed_title" msgid="6227712319223226185">"سیم کارت برداشته شد"</string>
- <string name="sim_removed_message" msgid="2333164559970958645">"تا وقتی که با یک سیمکارت معتبر راهاندازی مجدد نکنید شبکه تلفن همراه غیر قابل دسترس خواهد بود."</string>
+ <string name="sim_removed_message" msgid="2333164559970958645">"تا وقتی که با یک سیمکارت معتبر راهاندازی مجدد نکنید شبکهٔ تلفن همراه غیر قابل دسترس خواهد بود."</string>
<string name="sim_done_button" msgid="827949989369963775">"انجام شد"</string>
<string name="sim_added_title" msgid="3719670512889674693">"سیم کارت اضافه شد"</string>
- <string name="sim_added_message" msgid="6599945301141050216">"برای دسترسی به شبکه تلفن همراه، دستگاه خود را مجدداً راهاندازی کنید."</string>
+ <string name="sim_added_message" msgid="6599945301141050216">"برای دسترسی به شبکهٔ تلفن همراه، دستگاه خود را مجدداً راهاندازی کنید."</string>
<string name="sim_restart_button" msgid="4722407842815232347">"راهاندازی مجدد"</string>
<string name="time_picker_dialog_title" msgid="8349362623068819295">"تنظیم زمان"</string>
<string name="date_picker_dialog_title" msgid="5879450659453782278">"تاریخ تنظیم"</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 2b08bea..70f5dc5 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"viikkoa"</string>
<string name="year" msgid="4001118221013892076">"vuosi"</string>
<string name="years" msgid="6881577717993213522">"vuotta"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 sekunti"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> sekuntia"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuutti"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minuuttia"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 tunti"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> tuntia"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Video-ongelma"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Tätä videota ei voi suoratoistaa tällä laitteella."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Videota ei voida toistaa."</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 479fe18..c319c6d 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"semaines"</string>
<string name="year" msgid="4001118221013892076">"année"</string>
<string name="years" msgid="6881577717993213522">"années"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 seconde"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> secondes"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minute"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minutes"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 heure"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> heures"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Problème vidéo"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Impossible de lire cette vidéo en streaming sur cet appareil."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Impossible de lire la vidéo."</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 65aa563..f272ef4 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"सप्ताह"</string>
<string name="year" msgid="4001118221013892076">"वर्ष"</string>
<string name="years" msgid="6881577717993213522">"वर्ष"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 सेकंड"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> सेकंड"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 मिनट"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> मिनट"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 घंटा"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> घंटे"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"वीडियो समस्याएं"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"यह वीडियो इस उपकरण पर स्ट्रीमिंग के लिए मान्य नहीं है."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"यह वीडियो नहीं चलाया जा सकता."</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index e279216..a581517 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"tjedna"</string>
<string name="year" msgid="4001118221013892076">"godina"</string>
<string name="years" msgid="6881577717993213522">"godina"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 s"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> s"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 min"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> min"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 sat"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> h"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Problem s videozapisom"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Ovaj videozapis nije valjan za streaming na ovaj uređaj."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Ovaj videozapis nije moguće reproducirati."</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 88f4046..c53108c 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"hét"</string>
<string name="year" msgid="4001118221013892076">"év"</string>
<string name="years" msgid="6881577717993213522">"év"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 másodperc"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> másodperc"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 perc"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> perc"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 óra"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> óra"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Videoprobléma"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Ezt a videót nem lehet megjeleníteni ezen az eszközön."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Nem lehet lejátszani ezt a videót."</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index b5dfcd5..d281e03 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"minggu"</string>
<string name="year" msgid="4001118221013892076">"tahun"</string>
<string name="years" msgid="6881577717993213522">"tahun"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 detik"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> detik"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 menit"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> menit"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 jam"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> jam"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Masalah video"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Video ini tidak valid untuk pengaliran ke perangkat ini."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Tidak dapat memutar video ini."</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 0edb0c1..92e7c95 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"settimane"</string>
<string name="year" msgid="4001118221013892076">"anno"</string>
<string name="years" msgid="6881577717993213522">"anni"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 secondo"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> secondi"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuto"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minuti"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 ora"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> ore"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Problemi video"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Questo video non è valido per lo streaming su questo dispositivo."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Impossibile riprodurre il video."</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index bb6a3ac..bfdca9f 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"שבועות"</string>
<string name="year" msgid="4001118221013892076">"שנה"</string>
<string name="years" msgid="6881577717993213522">"שנים"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"שנייה אחת"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> שניות"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"דקה אחת"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> דקות"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"שעה אחת"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> שעות"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"בעיה בווידאו"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"סרטון זה אינו חוקי להעברה כמדיה זורמת למכשיר זה."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"לא ניתן להפעיל סרטון זה."</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index 8af0fed..02126f0 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"週間"</string>
<string name="year" msgid="4001118221013892076">"年"</string>
<string name="years" msgid="6881577717993213522">"年"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"動画の問題"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"この動画はこの端末にストリーミングできません。"</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"この動画を再生できません。"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 37c6b01..6bdb5d7 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"주"</string>
<string name="year" msgid="4001118221013892076">"년"</string>
<string name="years" msgid="6881577717993213522">"년"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1초"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g>초"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1분"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g>분"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1시간"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g>시간"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"영상 문제"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"이 기기로 스트리밍하기에 적합하지 않은 동영상입니다."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"동영상을 재생할 수 없습니다."</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index f2ad504..3e3c396 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"sav."</string>
<string name="year" msgid="4001118221013892076">"metai"</string>
<string name="years" msgid="6881577717993213522">"metai"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 sek."</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> sek."</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 min."</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> min."</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 val."</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> val."</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Vaizdo įrašo problema"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Šis vaizdo įrašas netinkamas srautiniu būdu perduoti į šį įrenginį."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Negalima paleisti šio vaizdo įrašo."</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index ee0b023..dc4312f 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"nedēļas"</string>
<string name="year" msgid="4001118221013892076">"gads"</string>
<string name="years" msgid="6881577717993213522">"gadi"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 s"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> s"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 min"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> min"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 h"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> h"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Video problēma"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Šis video nav derīgs straumēšanai uz šo ierīci."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Nevar atskaņot šo video."</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index e89f70f..5e649a7 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"minggu"</string>
<string name="year" msgid="4001118221013892076">"tahun"</string>
<string name="years" msgid="6881577717993213522">"tahun"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 saat"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> saat"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minit"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minit"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 jam"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> jam"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Masalah video"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Maaf, video ini tidak sah untuk penstriman ke peranti ini."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Tidak dapat mainkan video ini."</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 65014d3..79cf1ea 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -571,7 +571,7 @@
<string name="permdesc_disableKeyguard" msgid="6034203065077122992">"Lar appen deaktivere tastelåsen og eventuell tilknyttet passordsikkerhet. Et eksempel er at telefonen deaktiverer tastelåsen når du mottar et innkommende anrop, og deretter aktiverer tastelåsen igjen når samtalen er ferdig."</string>
<string name="permlab_readSyncSettings" msgid="6201810008230503052">"lese synkroniseringsinnstillinger"</string>
<string name="permdesc_readSyncSettings" msgid="2706745674569678644">"Lar appen lese synkroniseringsinnstillingene for en konto. For eksempel kan den finne ut om Personer-appen er synkronisert med en konto."</string>
- <string name="permlab_writeSyncSettings" msgid="5408694875793945314">"slår synkronisering av og på"</string>
+ <string name="permlab_writeSyncSettings" msgid="5408694875793945314">"slå synkronisering av og på"</string>
<string name="permdesc_writeSyncSettings" msgid="8956262591306369868">"Lar appen endre synkroniseringsinnstillingene for en konto. For eksempel kan dette brukes til å synkronisere Personer-appen med en konto."</string>
<string name="permlab_readSyncStats" msgid="7396577451360202448">"lese synkroniseringsstatistikk"</string>
<string name="permdesc_readSyncStats" msgid="1510143761757606156">"Lar appen lese synkroniseringsstatistikk for en konto, inkludert loggen over synkroniseringsaktiviteter og hvor mye data som er synkronisert."</string>
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"uker"</string>
<string name="year" msgid="4001118221013892076">"år"</string>
<string name="years" msgid="6881577717993213522">"år"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"Ett sekund"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> sekunder"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"Ett minutt"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minutter"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"Én time"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> timer"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Videoproblem"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Denne videoen er ikke gyldig for direkteavspilling på enheten."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Kan ikke spille av denne videoen."</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 21fe1cc..50b3a87 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"weken"</string>
<string name="year" msgid="4001118221013892076">"jaar"</string>
<string name="years" msgid="6881577717993213522">"jaren"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 seconde"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> seconden"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuut"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minuten"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 uur"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> uur"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Probleem met video"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Deze video kan niet worden gestreamd naar dit apparaat."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Deze video kan niet worden afgespeeld."</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 4282be6..3a9a0f6 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -762,7 +762,7 @@
<string name="lockscreen_password_wrong" msgid="5737815393253165301">"Spróbuj ponownie."</string>
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Przekroczono maksymalną liczbę prób rozpoznania twarzy."</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Ładowanie (<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>)"</string>
- <string name="lockscreen_charged" msgid="321635745684060624">"Naładowana"</string>
+ <string name="lockscreen_charged" msgid="321635745684060624">"Naładowany"</string>
<string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Podłącz ładowarkę."</string>
<string name="lockscreen_missing_sim_message_short" msgid="5099439277819215399">"Brak karty SIM"</string>
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"tygodni"</string>
<string name="year" msgid="4001118221013892076">"rok"</string>
<string name="years" msgid="6881577717993213522">"lat"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"Problem z filmem"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Ten film nie nadaje się do strumieniowego przesyłania do tego urządzenia."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Nie można odtworzyć tego filmu."</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index fd7211e..f1ac978 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"semanas"</string>
<string name="year" msgid="4001118221013892076">"ano"</string>
<string name="years" msgid="6881577717993213522">"anos"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 segundo"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> segundos"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuto"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minutos"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 hora"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> horas"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Problema com o vídeo"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Este vídeo não é válido para transmissão em fluxo contínuo neste aparelho."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Não é possível reproduzir este vídeo."</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index ed656fe..d4dd494 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"semanas"</string>
<string name="year" msgid="4001118221013892076">"ano"</string>
<string name="years" msgid="6881577717993213522">"anos"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"Um segundo"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> segundos"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"Um minuto"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minutos"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"Uma hora"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> horas"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Problema com o vídeo"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Este vídeo não é válido para transmissão neste dispositivo."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Não é possível reproduzir este vídeo."</string>
diff --git a/core/res/res/values-rm/strings.xml b/core/res/res/values-rm/strings.xml
index 0e7aaec..d3efd7e 100644
--- a/core/res/res/values-rm/strings.xml
+++ b/core/res/res/values-rm/strings.xml
@@ -1558,6 +1558,12 @@
<string name="weeks" msgid="6509623834583944518">"emnas"</string>
<string name="year" msgid="4001118221013892076">"onn"</string>
<string name="years" msgid="6881577717993213522">"onns"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<!-- no translation found for VideoView_error_title (3534509135438353077) -->
<skip />
<!-- no translation found for VideoView_error_text_invalid_progressive_playback (3186670335938670444) -->
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index f274acd..d0ef774 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"săptămâni"</string>
<string name="year" msgid="4001118221013892076">"an"</string>
<string name="years" msgid="6881577717993213522">"ani"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"Problemă video"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Acest fişier video nu este valid pentru a fi transmis în flux către acest dispozitiv."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Nu puteţi reda acest videoclip"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index 42e5f86..31c2802 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -149,7 +149,7 @@
<string name="reboot_safemode_title" msgid="7054509914500140361">"Переход в безопасный режим"</string>
<string name="reboot_safemode_confirm" msgid="55293944502784668">"Перейти в безопасный режим? Все приложения сторонних поставщиков отключатся. Они будут включены по возвращении в обычный режим."</string>
<string name="recent_tasks_title" msgid="3691764623638127888">"Недавние"</string>
- <string name="no_recent_tasks" msgid="8794906658732193473">"В последнее время вы не запускали приложения."</string>
+ <string name="no_recent_tasks" msgid="8794906658732193473">"Список недавно использованных приложений пуст."</string>
<string name="global_actions" product="tablet" msgid="408477140088053665">"Настройки планшетного ПК"</string>
<string name="global_actions" product="default" msgid="2406416831541615258">"Параметры телефона"</string>
<string name="global_action_lock" msgid="2844945191792119712">"Блокировка экрана"</string>
@@ -182,7 +182,7 @@
<string name="permgroupdesc_bluetoothNetwork" msgid="5625288577164282391">"Доступ к устройствам и сетям через Bluetooth."</string>
<string name="permgrouplab_audioSettings" msgid="8329261670151871235">"Настройки звука"</string>
<string name="permgroupdesc_audioSettings" msgid="2641515403347568130">"Изменение настроек звука."</string>
- <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Воздействие на батарею"</string>
+ <string name="permgrouplab_affectsBattery" msgid="6209246653424798033">"Батарея"</string>
<string name="permgroupdesc_affectsBattery" msgid="6441275320638916947">"Использование функций, приводящих к быстрой разрядке батареи."</string>
<string name="permgrouplab_calendar" msgid="5863508437783683902">"Календарь"</string>
<string name="permgroupdesc_calendar" msgid="5777534316982184416">"Прямой доступ к календарю и мероприятиям."</string>
@@ -759,7 +759,7 @@
<string name="lockscreen_return_to_call" msgid="5244259785500040021">"Вернуться к вызову"</string>
<string name="lockscreen_pattern_correct" msgid="9039008650362261237">"Правильно!"</string>
<string name="lockscreen_pattern_wrong" msgid="4317955014948108794">"Повторите попытку"</string>
- <string name="lockscreen_password_wrong" msgid="5737815393253165301">"Повторить попытку"</string>
+ <string name="lockscreen_password_wrong" msgid="5737815393253165301">"Повторите попытку"</string>
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"Все попытки войти с помощью Фейсконтроля использованы"</string>
<string name="lockscreen_plugged_in" msgid="8057762828355572315">"Идет зарядка (<xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>)"</string>
<string name="lockscreen_charged" msgid="321635745684060624">"Заряжено"</string>
@@ -829,7 +829,7 @@
<string name="keyguard_accessibility_pin_unlock" msgid="2469687111784035046">"PIN-код"</string>
<string name="keyguard_accessibility_password_unlock" msgid="7675777623912155089">"Пароль"</string>
<string name="keyguard_accessibility_pattern_area" msgid="7679891324509597904">"Область ввода графического ключа"</string>
- <string name="keyguard_accessibility_slide_area" msgid="6736064494019979544">"Область прокрутки"</string>
+ <string name="keyguard_accessibility_slide_area" msgid="6736064494019979544">"Область слайдера"</string>
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"АБВ"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"нед."</string>
<string name="year" msgid="4001118221013892076">"г."</string>
<string name="years" msgid="6881577717993213522">"г."</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"Ошибка"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Это видео не предназначено для потокового воспроизведения на данном устройстве."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Не удалось воспроизвести видео."</string>
@@ -1140,7 +1146,7 @@
<string name="perms_new_perm_prefix" msgid="8257740710754301407"><font size="12" fgcolor="#ff33b5e5">"НОВОЕ: "</font></string>
<string name="perms_description_app" msgid="5139836143293299417">"Источник: <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
<string name="no_permissions" msgid="7283357728219338112">"Не требуется разрешений"</string>
- <string name="perm_costs_money" msgid="4902470324142151116">"за это может взиматься плата"</string>
+ <string name="perm_costs_money" msgid="4902470324142151116">"это может стоить вам денег!"</string>
<string name="usb_storage_activity_title" msgid="4465055157209648641">"Запоминающее устройство USB"</string>
<string name="usb_storage_title" msgid="5901459041398751495">"USB-подключение установлено"</string>
<string name="usb_storage_message" product="nosdcard" msgid="3308538094316477839">"Устройство подключено к компьютеру через USB-порт. Нажмите кнопку ниже, чтобы скопировать файлы с компьютера на USB-накопитель Android-устройства."</string>
@@ -1370,7 +1376,7 @@
<string name="fingerprints" msgid="4516019619850763049">"Отпечатки:"</string>
<string name="sha256_fingerprint" msgid="4391271286477279263">"Отпечаток SHA-256:"</string>
<string name="sha1_fingerprint" msgid="7930330235269404581">"Отпечаток SHA-1:"</string>
- <string name="activity_chooser_view_see_all" msgid="4292569383976636200">"Просмотреть все"</string>
+ <string name="activity_chooser_view_see_all" msgid="4292569383976636200">"Показать все"</string>
<string name="activity_chooser_view_dialog_title_default" msgid="4710013864974040615">"Выберите"</string>
<string name="share_action_provider_share_with" msgid="5247684435979149216">"Открыть доступ"</string>
<string name="status_bar_device_locked" msgid="3092703448690669768">"Устройство заблокировано."</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index c364380..12a3b8f 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"týždne"</string>
<string name="year" msgid="4001118221013892076">"rok"</string>
<string name="years" msgid="6881577717993213522">"roky"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"Problém s videom"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Je nám ľúto, ale toto video sa nedá streamovať do tohto zariadenia."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Toto video nie je možné prehrať."</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 7f94c204..3e9273d 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"tednov"</string>
<string name="year" msgid="4001118221013892076">"leto"</string>
<string name="years" msgid="6881577717993213522">"let"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 sekunda"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> s"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuta"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> min"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 ura"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> h"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Težava z videoposnetkom"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Ta videoposnetek ni veljaven za pretakanje v to napravo."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Tega videoposnetka ni mogoče predvajati."</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 5a94aad..53604f1 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"недеље(а)"</string>
<string name="year" msgid="4001118221013892076">"година"</string>
<string name="years" msgid="6881577717993213522">"годинe(а)"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"Проблем са видео снимком"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Овај видео не може да се стримује на овом уређају."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Не можете да пустите овај видео."</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 2737d62..d36ae44 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -132,7 +132,7 @@
<string name="low_memory" product="tablet" msgid="6494019234102154896">"Pekdatorns lagringsutrymme är fullt. Ta bort några filer för att frigöra utrymme."</string>
<string name="low_memory" product="default" msgid="3475999286680000541">"Mobilens lagringsutrymme är fullt. Ta bort några filer för att frigöra utrymme."</string>
<string name="me" msgid="6545696007631404292">"Jag"</string>
- <string name="power_dialog" product="tablet" msgid="8545351420865202853">"Alternativ för pekdatorn"</string>
+ <string name="power_dialog" product="tablet" msgid="8545351420865202853">"Alternativ för surfplattan"</string>
<string name="power_dialog" product="default" msgid="1319919075463988638">"Telefonalternativ"</string>
<string name="silent_mode" msgid="7167703389802618663">"Tyst läge"</string>
<string name="turn_on_radio" msgid="3912793092339962371">"Aktivera trådlöst"</string>
@@ -150,7 +150,7 @@
<string name="reboot_safemode_confirm" msgid="55293944502784668">"Vill du starta om datorn i felsäkert läge? Då inaktiveras alla appar från tredje part som du har installerat. Apparna återställs när du startar om datorn igen."</string>
<string name="recent_tasks_title" msgid="3691764623638127888">"Senaste"</string>
<string name="no_recent_tasks" msgid="8794906658732193473">"Inga nya appar."</string>
- <string name="global_actions" product="tablet" msgid="408477140088053665">"Alternativ för pekdatorn"</string>
+ <string name="global_actions" product="tablet" msgid="408477140088053665">"Alternativ för surfplattan"</string>
<string name="global_actions" product="default" msgid="2406416831541615258">"Telefonalternativ"</string>
<string name="global_action_lock" msgid="2844945191792119712">"Skärmlås"</string>
<string name="global_action_power_off" msgid="4471879440839879722">"Stäng av"</string>
@@ -450,7 +450,7 @@
<string name="permdesc_recordAudio" msgid="4906839301087980680">"Tillåter att appen spelar in ljud med mikrofonen. Med den här behörigheten tillåts appen att spela in ljud när som helst utan ditt godkännande."</string>
<string name="permlab_camera" msgid="3616391919559751192">"ta bilder och spela in videoklipp"</string>
<string name="permdesc_camera" msgid="8497216524735535009">"Tillåter att appen tar bilder och spelar in videor med kameran. Med den här behörigheten tillåts appen att använda kameran när som helst utan ditt godkännande."</string>
- <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"inaktivera pekdatorn permanent"</string>
+ <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"inaktivera surfplattan permanent"</string>
<string name="permlab_brick" product="default" msgid="8337817093326370537">"inaktivera telefonen permanent"</string>
<string name="permdesc_brick" product="tablet" msgid="4334818808001699530">"Tillåter att appen inaktiverar hela pekdatorn permanent. Detta är mycket farligt."</string>
<string name="permdesc_brick" product="default" msgid="5788903297627283099">"Tillåter att appen inaktiverar hela mobilen permanent. Detta är mycket farligt."</string>
@@ -501,16 +501,16 @@
<string name="permdesc_modifyPhoneState" msgid="1029877529007686732">"Tillåter att appen styr enhetens telefonfunktioner. En app med den här behörigheten kan byta nätverk, aktivera/inaktivera mobilens radio och liknande utan att meddela dig."</string>
<string name="permlab_readPhoneState" msgid="9178228524507610486">"läsa telefonens status och identitet"</string>
<string name="permdesc_readPhoneState" msgid="1639212771826125528">"Tillåter att appen kommer åt enhetens telefonfunktioner. Med den här behörigheten tillåts appen att identifiera mobilens telefonnummer och enhets-ID, om ett samtal pågår och vilket nummer samtalet är kopplat till."</string>
- <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"förhindra att pekdatorn går in i viloläge"</string>
+ <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"förhindra att surfplattan går in i viloläge"</string>
<string name="permlab_wakeLock" product="default" msgid="573480187941496130">"förhindra att telefonen sätts i viloläge"</string>
<string name="permdesc_wakeLock" product="tablet" msgid="7311319824400447868">"Tillåter att appen förhindrar att pekdatorn går in i viloläge."</string>
<string name="permdesc_wakeLock" product="default" msgid="8559100677372928754">"Tillåter att appen förhindrar att mobilen går in i viloläge."</string>
- <string name="permlab_devicePower" product="tablet" msgid="2787034722616350417">"slå på eller stänga av pekdatorn"</string>
+ <string name="permlab_devicePower" product="tablet" msgid="2787034722616350417">"slå på eller stänga av surfplattan"</string>
<string name="permlab_devicePower" product="default" msgid="4928622470980943206">"sätta på eller stänga av telefonen"</string>
<string name="permdesc_devicePower" product="tablet" msgid="6689862878984631831">"Tillåter att appen slår på eller stänger av pekdatorn."</string>
<string name="permdesc_devicePower" product="default" msgid="6037057348463131032">"Tillåter att appen slår på eller stänger av mobilen."</string>
<string name="permlab_factoryTest" msgid="3715225492696416187">"kör i fabrikstestläge"</string>
- <string name="permdesc_factoryTest" product="tablet" msgid="3952059318359653091">"Köra som ett testläge för tillverkaren på låg nivå. På så sätt får du fullständig åtkomst till pekdatorns maskinvara. Är endast tillgänglig när pekdatorn körs i tillverkarens testläge."</string>
+ <string name="permdesc_factoryTest" product="tablet" msgid="3952059318359653091">"Köra som ett testläge för tillverkaren på låg nivå. På så sätt får du fullständig åtkomst till surfplattans maskinvara. Är endast tillgänglig när surfplattan körs i tillverkarens testläge."</string>
<string name="permdesc_factoryTest" product="default" msgid="8136644990319244802">"Köra som ett testläge för tillverkaren på låg nivå. På så sätt får du fullständig åtkomst till telefonens maskinvara. Är endast tillgänglig när telefonen körs i tillverkarens testläge."</string>
<string name="permlab_setWallpaper" msgid="6627192333373465143">"ange bakgrund"</string>
<string name="permdesc_setWallpaper" msgid="7373447920977624745">"Tillåter att appen anger systemets bakgrund."</string>
@@ -766,7 +766,7 @@
<string name="lockscreen_battery_short" msgid="4477264849386850266">"<xliff:g id="NUMBER">%d</xliff:g> <xliff:g id="PERCENT">%%</xliff:g>"</string>
<string name="lockscreen_low_battery" msgid="1482873981919249740">"Anslut din laddare."</string>
<string name="lockscreen_missing_sim_message_short" msgid="5099439277819215399">"Inget SIM-kort"</string>
- <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Inget SIM-kort i pekdatorn."</string>
+ <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"Inget SIM-kort i surfplattan."</string>
<string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"Inget SIM-kort i telefonen."</string>
<string name="lockscreen_missing_sim_instructions" msgid="5372787138023272615">"Sätt i ett SIM-kort."</string>
<string name="lockscreen_missing_sim_instructions_long" msgid="3526573099019319472">"SIM-kort saknas eller kan inte läsas. Sätt i ett SIM-kort."</string>
@@ -788,9 +788,9 @@
<string name="lockscreen_too_many_failed_pin_attempts_dialog_message" msgid="6216672706545696955">"Du har angett fel lösenord <xliff:g id="NUMBER_0">%d</xliff:g> gånger. "\n\n"Försök igen om <xliff:g id="NUMBER_1">%d</xliff:g> sekunder."</string>
<string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="9191611984625460820">"Du har ritat ditt grafiska lösenord fel <xliff:g id="NUMBER_0">%d</xliff:g> gånger. Efter <xliff:g id="NUMBER_1">%d</xliff:g> försök till ombeds du att låsa upp pekdatorn med din Google-inloggning."\n\n" Försök igen om <xliff:g id="NUMBER_2">%d</xliff:g> sekunder."</string>
<string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="2590227559763762751">"Du har ritat ditt grafiska lösenord fel <xliff:g id="NUMBER_0">%d</xliff:g> gånger. Efter <xliff:g id="NUMBER_1">%d</xliff:g> försök till ombeds du att låsa upp mobilen med uppgifterna som du använder när du loggar in på Google."\n\n" Försök igen om <xliff:g id="NUMBER_2">%d</xliff:g> sekunder."</string>
- <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"Du har försökt låsa upp pekdatorn på fel sätt <xliff:g id="NUMBER_0">%d</xliff:g> gånger. Efter <xliff:g id="NUMBER_1">%d</xliff:g> misslyckade försök till kommer pekdatorn att återställas till fabriksinställningarna. Du förlorar då alla användardata."</string>
+ <string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="6128106399745755604">"Du har försökt låsa upp surfplattan på fel sätt <xliff:g id="NUMBER_0">%d</xliff:g> gånger. Efter <xliff:g id="NUMBER_1">%d</xliff:g> misslyckade försök till kommer pekdatorn att återställas till fabriksinställningarna. Du förlorar då alla användardata."</string>
<string name="lockscreen_failed_attempts_almost_at_wipe" product="default" msgid="8603565142156826565">"Du har försökt låsa upp mobilen på fel sätt <xliff:g id="NUMBER_0">%d</xliff:g> gånger. Efter <xliff:g id="NUMBER_1">%d</xliff:g> misslyckade försök till kommer mobilen att återställas till fabriksinställningarna. Du förlorar då alla användardata."</string>
- <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"Du har försökt låsa upp pekdatorn på fel sätt <xliff:g id="NUMBER">%d</xliff:g> gånger. Pekdatorn återställs nu till fabriksinställningarna."</string>
+ <string name="lockscreen_failed_attempts_now_wiping" product="tablet" msgid="280873516493934365">"Du har försökt låsa upp surfplattan på fel sätt <xliff:g id="NUMBER">%d</xliff:g> gånger. Surfplattan återställs nu till fabriksinställningarna."</string>
<string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="3025504721764922246">"Du har försökt låsa upp mobilen på fel sätt <xliff:g id="NUMBER">%d</xliff:g> gånger. Mobilen återställs nu till fabriksinställningarna."</string>
<string name="lockscreen_too_many_failed_attempts_countdown" msgid="6251480343394389665">"Försök igen om <xliff:g id="NUMBER">%d</xliff:g> sekunder."</string>
<string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"Glömt ditt grafiska lösenord?"</string>
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"veckor"</string>
<string name="year" msgid="4001118221013892076">"år"</string>
<string name="years" msgid="6881577717993213522">"år"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 sekund"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> sekunder"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minut"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> minuter"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 timme"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> timmar"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Videoproblem"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Videon kan tyvärr inte spelas upp i den här enheten."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Det går inte att spela upp videon."</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index afdb39e..14f2b22 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -257,7 +257,7 @@
<string name="permdesc_getTasks" msgid="7454215995847658102">"Inaruhusu programu kurudisha taarifa kuhusu kazi zinazoendeshwa sasa na hivi karibuni. Hii inaweza kuruhusu programu kugundua taarifa kuhusu ni programu zipi zinazotumika kwenye kifaa."</string>
<string name="permlab_interactAcrossUsers" msgid="7114255281944211682">"Tagusana na watumiaji"</string>
<string name="permdesc_interactAcrossUsers" msgid="364670963623385786">"Inaruhusu programu kutenda vitendo kwa watumiaji tofauti kwenye kifaa. Programu hasidi huenda zikatumia hii ili kukiuka ulinzi kati ya watumiaji."</string>
- <string name="permlab_interactAcrossUsersFull" msgid="2567734285545074105">"leseni kamili ili kutagusana na watumiaji"</string>
+ <string name="permlab_interactAcrossUsersFull" msgid="2567734285545074105">"leseni kamili ili kushirikiana na watumiaji"</string>
<string name="permdesc_interactAcrossUsersFull" msgid="376841368395502366">"Inaruhusu miingialiano yote inayowezekana kwa watumiaji."</string>
<string name="permlab_manageUsers" msgid="1676150911672282428">"dhibiti watumiaji"</string>
<string name="permdesc_manageUsers" msgid="8409306667645355638">"Inaruhusu programu kudhibiti watumiaji kwenye kifaa, pamoja na hoji, uundaji na ufutaji."</string>
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"wiki"</string>
<string name="year" msgid="4001118221013892076">"mwaka"</string>
<string name="years" msgid="6881577717993213522">"miaka"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"Sekunde 1"</item>
+ <item quantity="other" msgid="1886107766577166786">"Sekunde <xliff:g id="COUNT">%d</xliff:g>"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"Dakika 1"</item>
+ <item quantity="other" msgid="3165187169224908775">"Dakika <xliff:g id="COUNT">%d</xliff:g>"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"Saa 1"</item>
+ <item quantity="other" msgid="3863962854246773930">"Saa <xliff:g id="COUNT">%d</xliff:g>"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Shida ya video"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Video hii si halali kutiririshwa kwa kifaa hiki."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Haiwezi kucheza video hii."</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index 0a86a86..d26b2d5 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"สัปดาห์"</string>
<string name="year" msgid="4001118221013892076">"ปี"</string>
<string name="years" msgid="6881577717993213522">" ปี"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"ปัญหาเกี่ยวกับวิดีโอ"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"วิดีโอนี้ไม่สามารถสตรีมไปยังอุปกรณ์นี้"</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"ไม่สามารถเล่นวิดีโอนี้"</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 072f6df..3d68842 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"mga linggo"</string>
<string name="year" msgid="4001118221013892076">"taon"</string>
<string name="years" msgid="6881577717993213522">"mga taon"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 segundo"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> (na) segundo"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 minuto"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> (na) minuto"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 oras"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> (na) oras"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Problema sa video"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Hindi wasto ang video na ito para sa streaming sa device na ito."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Hindi ma-play ang video na ito."</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index dbb7b0d..d775233 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"hafta"</string>
<string name="year" msgid="4001118221013892076">"yıl"</string>
<string name="years" msgid="6881577717993213522">"yıl"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 saniye"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> saniye"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 dakika"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> dakika"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 saat"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> saat"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Video sorunu"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Bu video bu cihazda akış için uygun değil."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Bu video oynatılamıyor."</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 6512007..cc33b7b 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"тижн."</string>
<string name="year" msgid="4001118221013892076">"рік"</string>
<string name="years" msgid="6881577717993213522">"р."</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 с"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> с"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 хв"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> хв"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 год"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> год"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Проблема з відео"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Відео не придатне для потокового передавання в цей пристрій."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Неможливо відтворити це відео."</string>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 7fb3412..3e47de5 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"tuần"</string>
<string name="year" msgid="4001118221013892076">"năm"</string>
<string name="years" msgid="6881577717993213522">"năm"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 giây"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> giây"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 phút"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> phút"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 giờ"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> giờ"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Sự cố video"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Video này không hợp lệ để phát trực tuyến đến thiết bị này."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Không thể phát video này."</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index 251389b..e21ebcf 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"周"</string>
<string name="year" msgid="4001118221013892076">"年"</string>
<string name="years" msgid="6881577717993213522">"年"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 秒"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> 秒"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 分钟"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> 分钟"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 小时"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> 小时"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"视频问题"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"抱歉,该视频不适合在此设备上播放。"</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"无法播放此视频。"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 473b9d0..a1286f1 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -993,6 +993,12 @@
<string name="weeks" msgid="6509623834583944518">"週"</string>
<string name="year" msgid="4001118221013892076">"年"</string>
<string name="years" msgid="6881577717993213522">"年"</string>
+ <!-- no translation found for duration_seconds:one (6962015528372969481) -->
+ <!-- no translation found for duration_seconds:other (1886107766577166786) -->
+ <!-- no translation found for duration_minutes:one (4915414002546085617) -->
+ <!-- no translation found for duration_minutes:other (3165187169224908775) -->
+ <!-- no translation found for duration_hours:one (8917467491248809972) -->
+ <!-- no translation found for duration_hours:other (3863962854246773930) -->
<string name="VideoView_error_title" msgid="3534509135438353077">"影片發生問題"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"這部影片的格式無效,因此無法在此裝置中串流播放。"</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"無法播放這部影片。"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index eb1cbfb..e422e26 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -993,6 +993,18 @@
<string name="weeks" msgid="6509623834583944518">"amaviki"</string>
<string name="year" msgid="4001118221013892076">"unyaka"</string>
<string name="years" msgid="6881577717993213522">"iminyaka"</string>
+ <plurals name="duration_seconds">
+ <item quantity="one" msgid="6962015528372969481">"1 isekhondi"</item>
+ <item quantity="other" msgid="1886107766577166786">"<xliff:g id="COUNT">%d</xliff:g> amasekhondi"</item>
+ </plurals>
+ <plurals name="duration_minutes">
+ <item quantity="one" msgid="4915414002546085617">"1 iminithi"</item>
+ <item quantity="other" msgid="3165187169224908775">"<xliff:g id="COUNT">%d</xliff:g> amaminithi"</item>
+ </plurals>
+ <plurals name="duration_hours">
+ <item quantity="one" msgid="8917467491248809972">"1 ihora"</item>
+ <item quantity="other" msgid="3863962854246773930">"<xliff:g id="COUNT">%d</xliff:g> amahora"</item>
+ </plurals>
<string name="VideoView_error_title" msgid="3534509135438353077">"Inkinga yevidiyo"</string>
<string name="VideoView_error_text_invalid_progressive_playback" msgid="3186670335938670444">"Uxolo, le vidiyo ayilungele ukusakaza bukhomo kwale divaysi."</string>
<string name="VideoView_error_text_unknown" msgid="3450439155187810085">"Iyehluleka ukudlala levidiyo."</string>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 447daab..48ee429 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2107,8 +2107,8 @@
<enum name="locale" value="3" />
</attr>
- <!-- Direction of the text. A heuristic is used to determine the resolved text direction
- of paragraphs. -->
+ <!-- Defines the direction of the text. A heuristic is used to determine the resolved text
+ direction of paragraphs. -->
<attr name="textDirection" format="integer">
<!-- Default -->
<enum name="inherit" value="0" />
@@ -2128,7 +2128,7 @@
<enum name="locale" value="5" />
</attr>
- <!-- Alignment of the text. A heuristic is used to determine the resolved
+ <!-- Defines the alignment of the text. A heuristic is used to determine the resolved
text alignment. -->
<attr name="textAlignment" format="integer">
<!-- Default -->
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 9932d1e..80c2a13 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2838,6 +2838,21 @@
<!-- Appened to express the value is this unit of time. -->
<string name="years">years</string>
+ <!-- Phrase describing a time duration using seconds [CHAR LIMIT=16] -->
+ <plurals name="duration_seconds">
+ <item quantity="one">1 second</item>
+ <item quantity="other"><xliff:g id="count">%d</xliff:g> seconds</item>
+ </plurals>
+ <!-- Phrase describing a time duration using minutes [CHAR LIMIT=16] -->
+ <plurals name="duration_minutes">
+ <item quantity="one">1 minute</item>
+ <item quantity="other"><xliff:g id="count">%d</xliff:g> minutes</item>
+ </plurals>
+ <!-- Phrase describing a time duration using hours [CHAR LIMIT=16] -->
+ <plurals name="duration_hours">
+ <item quantity="one">1 hour</item>
+ <item quantity="other"><xliff:g id="count">%d</xliff:g> hours</item>
+ </plurals>
<!-- Title for error alert when a video cannot be played. it can be used by any app. -->
<string name="VideoView_error_title">Video problem</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 6858732..1d29d8c 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -870,6 +870,9 @@
<java-symbol type="plurals" name="abbrev_num_hours_ago" />
<java-symbol type="plurals" name="abbrev_num_minutes_ago" />
<java-symbol type="plurals" name="abbrev_num_seconds_ago" />
+ <java-symbol type="plurals" name="duration_hours" />
+ <java-symbol type="plurals" name="duration_minutes" />
+ <java-symbol type="plurals" name="duration_seconds" />
<java-symbol type="plurals" name="in_num_days" />
<java-symbol type="plurals" name="in_num_hours" />
<java-symbol type="plurals" name="in_num_minutes" />
diff --git a/core/tests/coretests/src/android/text/format/DateUtilsTest.java b/core/tests/coretests/src/android/text/format/DateUtilsTest.java
new file mode 100644
index 0000000..cf42bb1
--- /dev/null
+++ b/core/tests/coretests/src/android/text/format/DateUtilsTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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 android.text.format;
+
+import android.test.suitebuilder.annotation.SmallTest;
+
+import junit.framework.TestCase;
+
+public class DateUtilsTest extends TestCase {
+ @SmallTest
+ public void testFormatDurationSeconds() throws Exception {
+ assertEquals("0 seconds", DateUtils.formatDuration(0));
+ assertEquals("0 seconds", DateUtils.formatDuration(1));
+ assertEquals("0 seconds", DateUtils.formatDuration(499));
+ assertEquals("1 second", DateUtils.formatDuration(500));
+ assertEquals("1 second", DateUtils.formatDuration(1000));
+ assertEquals("2 seconds", DateUtils.formatDuration(1500));
+ }
+
+ @SmallTest
+ public void testFormatDurationMinutes() throws Exception {
+ assertEquals("59 seconds", DateUtils.formatDuration(59000));
+ assertEquals("60 seconds", DateUtils.formatDuration(59500));
+ assertEquals("1 minute", DateUtils.formatDuration(60000));
+ assertEquals("2 minutes", DateUtils.formatDuration(120000));
+ }
+
+ @SmallTest
+ public void testFormatDurationHours() throws Exception {
+ assertEquals("59 minutes", DateUtils.formatDuration(3540000));
+ assertEquals("1 hour", DateUtils.formatDuration(3600000));
+ assertEquals("48 hours", DateUtils.formatDuration(172800000));
+ }
+}
diff --git a/data/etc/platform.xml b/data/etc/platform.xml
index 13d1791..83ecdd9 100644
--- a/data/etc/platform.xml
+++ b/data/etc/platform.xml
@@ -134,6 +134,7 @@
<assign-permission name="android.permission.ACCESS_NETWORK_STATE" uid="shell" />
<assign-permission name="android.permission.ACCESS_WIFI_STATE" uid="shell" />
<assign-permission name="android.permission.BLUETOOTH" uid="shell" />
+ <assign-permission name="android.permission.EXPAND_STATUS_BAR" uid="shell" />
<!-- System tool permissions granted to the shell. -->
<assign-permission name="android.permission.GET_TASKS" uid="shell" />
<assign-permission name="android.permission.CHANGE_CONFIGURATION" uid="shell" />
diff --git a/docs/downloads/training/NotifyUser.zip b/docs/downloads/training/NotifyUser.zip
new file mode 100644
index 0000000..c335157
--- /dev/null
+++ b/docs/downloads/training/NotifyUser.zip
Binary files differ
diff --git a/docs/html/about/versions/jelly-bean.jd b/docs/html/about/versions/jelly-bean.jd
index 87ebbe0..5350941 100644
--- a/docs/html/about/versions/jelly-bean.jd
+++ b/docs/html/about/versions/jelly-bean.jd
@@ -464,7 +464,7 @@
<p style="image-caption">Renderscript image-processing benchmarks comparing operations run with GPU + CPU to those run in CPU only on the same Nexus 10 device.</p>
</div>
-<p>If you have a direct acyclic graph of Renderscript operations to run, you can
+<p>If you have a directed acyclic graph of Renderscript operations to run, you can
use a builder class to create a script group defining the operations. At
execution time, Renderscript optimizes the run order and the connections between
these operations for best performance.</p>
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
index 9c21b3a..5982e62 100644
--- a/docs/html/develop/index.jd
+++ b/docs/html/develop/index.jd
@@ -296,17 +296,17 @@
* Each string in 'ids' is the ID of a YouTube playlist that belongs in the corresponding tab.
*/
var playlists = {
- 'googleio' : {
- 'ids': ["4C6BCDE45E05F49E"]
- },
- 'fridayreview' : {
- 'ids': ["B7B9B23D864A55C3"]
- },
- 'officehours' : {
- 'ids': ["7383D9AADA6E6D55"]
+ 'designinaction' : {
+ 'ids': ["PLWz5rJ2EKKc8j2B95zGMb8muZvrIy-wcF"]
},
'about' : {
- 'ids': ["D7C64411AF40DEA5"]
+ 'ids': ["PL611F8C5DBF49CEC6"]
+ },
+ 'developersstrikeback' : {
+ 'ids': ["PLWz5rJ2EKKc8nhhIOieejm1PxYHmPkIPh"]
+ },
+ 'googleio' : {
+ 'ids': ["PL4C6BCDE45E05F49E"]
}
};
@@ -326,7 +326,7 @@
/* Request the playlist feeds from YouTube */
function showDevelopersLivePlaylist() {
- var playlistId = "B7B9B23D864A55C3"; /* The Friday Review */
+ var playlistId = "PLB7B9B23D864A55C3"; /* The App Clinic */
var script = "<script type='text/javascript' src='//gdata.youtube.com/feeds/api/playlists/"
+ playlistId +
"?v=2&alt=json-in-script&max-results=10&callback=renderDevelopersLivePlaylist&orderby=published'><\/script > ";
diff --git a/docs/html/distribute/googleplay/about/visibility.jd b/docs/html/distribute/googleplay/about/visibility.jd
index 38fb395..2ff1293 100644
--- a/docs/html/distribute/googleplay/about/visibility.jd
+++ b/docs/html/distribute/googleplay/about/visibility.jd
@@ -112,7 +112,8 @@
users, right from the Apps and Games home pages. The charts are generated
several times each day based on recent download activity, keeping them fresh and
allowing new apps to move upward in the charts. To make the charts as relevant
-as possible for users across the world, they are also country-specific.</p>
+as possible for users across the world, they are also country-specific in
+Google Play's most popular countries.</p>
<p>As your apps get traction and build momentum in downloads and ratings,
they’ll climb one or more of the top charts and gain even more exposure.</p>
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/land_back.png b/docs/html/distribute/promote/device-art-resources/nexus_10/land_back.png
index d082d50..24a9c80 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_10/land_back.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_10/land_back.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/land_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_10/land_fore.png
index d29f818..183caa1 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_10/land_fore.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_10/land_fore.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/land_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_10/land_shadow.png
index af1a249..1d23d70 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_10/land_shadow.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_10/land_shadow.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/port_back.png b/docs/html/distribute/promote/device-art-resources/nexus_10/port_back.png
index 501690b..51328b4 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_10/port_back.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_10/port_back.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/port_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_10/port_fore.png
index 689a72a3..57899d4 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_10/port_fore.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_10/port_fore.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/port_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_10/port_shadow.png
index b2265ef..c329f10 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_10/port_shadow.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_10/port_shadow.png
Binary files differ
diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/thumb.png b/docs/html/distribute/promote/device-art-resources/nexus_10/thumb.png
index 8d8dee9..ec12a01 100644
--- a/docs/html/distribute/promote/device-art-resources/nexus_10/thumb.png
+++ b/docs/html/distribute/promote/device-art-resources/nexus_10/thumb.png
Binary files differ
diff --git a/docs/html/guide/google/gcm/adv.jd b/docs/html/google/gcm/adv.jd
similarity index 100%
rename from docs/html/guide/google/gcm/adv.jd
rename to docs/html/google/gcm/adv.jd
diff --git a/docs/html/guide/google/gcm/c2dm.jd b/docs/html/google/gcm/c2dm.jd
similarity index 100%
rename from docs/html/guide/google/gcm/c2dm.jd
rename to docs/html/google/gcm/c2dm.jd
diff --git a/docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html b/docs/html/google/gcm/client-javadoc/allclasses-frame.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/allclasses-frame.html
rename to docs/html/google/gcm/client-javadoc/allclasses-frame.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html b/docs/html/google/gcm/client-javadoc/allclasses-noframe.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/allclasses-noframe.html
rename to docs/html/google/gcm/client-javadoc/allclasses-noframe.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html b/docs/html/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html
rename to docs/html/google/gcm/client-javadoc/com/google/android/gcm/GCMBaseIntentService.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html b/docs/html/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html
rename to docs/html/google/gcm/client-javadoc/com/google/android/gcm/GCMBroadcastReceiver.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html b/docs/html/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html
rename to docs/html/google/gcm/client-javadoc/com/google/android/gcm/GCMConstants.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html b/docs/html/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html
rename to docs/html/google/gcm/client-javadoc/com/google/android/gcm/GCMRegistrar.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html b/docs/html/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html
rename to docs/html/google/gcm/client-javadoc/com/google/android/gcm/package-frame.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html b/docs/html/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html
rename to docs/html/google/gcm/client-javadoc/com/google/android/gcm/package-summary.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html b/docs/html/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html
rename to docs/html/google/gcm/client-javadoc/com/google/android/gcm/package-tree.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/constant-values.html b/docs/html/google/gcm/client-javadoc/constant-values.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/constant-values.html
rename to docs/html/google/gcm/client-javadoc/constant-values.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/default.css b/docs/html/google/gcm/client-javadoc/default.css
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/default.css
rename to docs/html/google/gcm/client-javadoc/default.css
diff --git a/docs/html/guide/google/gcm/client-javadoc/deprecated-list.html b/docs/html/google/gcm/client-javadoc/deprecated-list.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/deprecated-list.html
rename to docs/html/google/gcm/client-javadoc/deprecated-list.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/help-doc.html b/docs/html/google/gcm/client-javadoc/help-doc.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/help-doc.html
rename to docs/html/google/gcm/client-javadoc/help-doc.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/index-all.html b/docs/html/google/gcm/client-javadoc/index-all.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/index-all.html
rename to docs/html/google/gcm/client-javadoc/index-all.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/index.html b/docs/html/google/gcm/client-javadoc/index.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/index.html
rename to docs/html/google/gcm/client-javadoc/index.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/overview-tree.html b/docs/html/google/gcm/client-javadoc/overview-tree.html
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/overview-tree.html
rename to docs/html/google/gcm/client-javadoc/overview-tree.html
diff --git a/docs/html/guide/google/gcm/client-javadoc/package-list b/docs/html/google/gcm/client-javadoc/package-list
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/package-list
rename to docs/html/google/gcm/client-javadoc/package-list
diff --git a/docs/html/guide/google/gcm/client-javadoc/resources/inherit.gif b/docs/html/google/gcm/client-javadoc/resources/inherit.gif
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/resources/inherit.gif
rename to docs/html/google/gcm/client-javadoc/resources/inherit.gif
Binary files differ
diff --git a/docs/html/guide/google/gcm/client-javadoc/stylesheet.css b/docs/html/google/gcm/client-javadoc/stylesheet.css
similarity index 100%
rename from docs/html/guide/google/gcm/client-javadoc/stylesheet.css
rename to docs/html/google/gcm/client-javadoc/stylesheet.css
diff --git a/docs/html/guide/google/gcm/demo.jd b/docs/html/google/gcm/demo.jd
similarity index 100%
rename from docs/html/guide/google/gcm/demo.jd
rename to docs/html/google/gcm/demo.jd
diff --git a/docs/html/guide/google/gcm/gcm.jd b/docs/html/google/gcm/gcm.jd
similarity index 99%
rename from docs/html/guide/google/gcm/gcm.jd
rename to docs/html/google/gcm/gcm.jd
index a402e8e..1762e12 100644
--- a/docs/html/guide/google/gcm/gcm.jd
+++ b/docs/html/google/gcm/gcm.jd
@@ -80,7 +80,6 @@
<ul>
<li>It allows 3rd-party application servers to send messages to
their Android applications.</li>
- <li>GCM makes no guarantees about delivery or the order of messages.</li>
<li>An Android application on an Android device doesn't need to be running to receive
messages. The system will wake up the Android application via Intent broadcast when the message arrives, as long as the application is set up with the proper
broadcast receiver and permissions.</li>
diff --git a/docs/html/guide/google/gcm/gs.jd b/docs/html/google/gcm/gs.jd
similarity index 100%
rename from docs/html/guide/google/gcm/gs.jd
rename to docs/html/google/gcm/gs.jd
diff --git a/docs/html/guide/google/gcm/index.jd b/docs/html/google/gcm/index.jd
similarity index 100%
rename from docs/html/guide/google/gcm/index.jd
rename to docs/html/google/gcm/index.jd
diff --git a/docs/html/guide/google/gcm/server-javadoc/allclasses-frame.html b/docs/html/google/gcm/server-javadoc/allclasses-frame.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/allclasses-frame.html
rename to docs/html/google/gcm/server-javadoc/allclasses-frame.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/allclasses-noframe.html b/docs/html/google/gcm/server-javadoc/allclasses-noframe.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/allclasses-noframe.html
rename to docs/html/google/gcm/server-javadoc/allclasses-noframe.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Constants.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Constants.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Constants.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Constants.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/InvalidRequestException.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/InvalidRequestException.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/InvalidRequestException.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/InvalidRequestException.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Message.Builder.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Message.Builder.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Message.Builder.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Message.Builder.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Message.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Message.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Message.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Message.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/MulticastResult.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/MulticastResult.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/MulticastResult.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/MulticastResult.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Result.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Result.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Result.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Result.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Sender.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Sender.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/Sender.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/Sender.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/package-frame.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/package-frame.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/package-frame.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/package-frame.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/package-summary.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/package-summary.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/package-summary.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/package-summary.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/package-tree.html b/docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/package-tree.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/com/google/android/gcm/server/package-tree.html
rename to docs/html/google/gcm/server-javadoc/com/google/android/gcm/server/package-tree.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/constant-values.html b/docs/html/google/gcm/server-javadoc/constant-values.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/constant-values.html
rename to docs/html/google/gcm/server-javadoc/constant-values.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/default.css b/docs/html/google/gcm/server-javadoc/default.css
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/default.css
rename to docs/html/google/gcm/server-javadoc/default.css
diff --git a/docs/html/guide/google/gcm/server-javadoc/deprecated-list.html b/docs/html/google/gcm/server-javadoc/deprecated-list.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/deprecated-list.html
rename to docs/html/google/gcm/server-javadoc/deprecated-list.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/help-doc.html b/docs/html/google/gcm/server-javadoc/help-doc.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/help-doc.html
rename to docs/html/google/gcm/server-javadoc/help-doc.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/index-all.html b/docs/html/google/gcm/server-javadoc/index-all.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/index-all.html
rename to docs/html/google/gcm/server-javadoc/index-all.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/index.html b/docs/html/google/gcm/server-javadoc/index.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/index.html
rename to docs/html/google/gcm/server-javadoc/index.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/overview-tree.html b/docs/html/google/gcm/server-javadoc/overview-tree.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/overview-tree.html
rename to docs/html/google/gcm/server-javadoc/overview-tree.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/package-list b/docs/html/google/gcm/server-javadoc/package-list
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/package-list
rename to docs/html/google/gcm/server-javadoc/package-list
diff --git a/docs/html/guide/google/gcm/server-javadoc/resources/inherit.gif b/docs/html/google/gcm/server-javadoc/resources/inherit.gif
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/resources/inherit.gif
rename to docs/html/google/gcm/server-javadoc/resources/inherit.gif
Binary files differ
diff --git a/docs/html/guide/google/gcm/server-javadoc/serialized-form.html b/docs/html/google/gcm/server-javadoc/serialized-form.html
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/serialized-form.html
rename to docs/html/google/gcm/server-javadoc/serialized-form.html
diff --git a/docs/html/guide/google/gcm/server-javadoc/stylesheet.css b/docs/html/google/gcm/server-javadoc/stylesheet.css
similarity index 100%
rename from docs/html/guide/google/gcm/server-javadoc/stylesheet.css
rename to docs/html/google/gcm/server-javadoc/stylesheet.css
diff --git a/docs/html/google/google_toc.cs b/docs/html/google/google_toc.cs
new file mode 100644
index 0000000..d371fa1
--- /dev/null
+++ b/docs/html/google/google_toc.cs
@@ -0,0 +1,149 @@
+<?cs # Table of contents for Dev Guide.
+
+ For each document available in translation, add an localized title to this TOC.
+ Do not add localized title for docs not available in translation.
+ Below are template spans for adding localized doc titles. Please ensure that
+ localized titles are added in the language order specified below.
+?>
+
+<ul id="nav">
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>google/index.html">
+ <span class="en">Overview</span>
+ </a></div>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>google/play-services/index.html">
+ <span class="en">Google Play services</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot?>google/play-services/overview.html">
+ <span class="en">Overview</span></a>
+ </li>
+
+ <li><a href="<?cs var:toroot?>google/play-services/download.html">
+ <span class="en">Downloading and Configuring</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play-services/auth.html">
+ <span class="en">Authentication</span></a>
+ </li>
+
+ <li><a href="<?cs var:toroot?>google/play-services/analytics.html">
+ <span class="en">Analytics</span></a>
+ </li>
+
+ <li><a href="<?cs var:toroot?>google/play-services/plus.html">
+ <span class="en">Google+</span></a>
+ </li>
+
+ <li><a href="<?cs var:toroot?>google/play-services/maps.html">
+ <span class="en">Maps</span></a>
+ </li>
+
+ <li id="tree-list">
+ <a href="<?cs var:toroot?>google/play-services/reference/packages.html">
+ <span class="en">Reference</span></a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>google/play/billing/index.html">
+ <span class="en">Google Play <br />In-app Billing</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot?>google/play/billing/billing_overview.html">
+ <span class="en">In-app Billing Overview</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play/billing/billing_integrate.html">
+ <span class="en">Implementing In-app Billing</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play/billing/billing_subscriptions.html">
+ <span class="en">Subscriptions</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play/billing/billing_best_practices.html">
+ <span class="en">Security and Design</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play/billing/billing_testing.html">
+ <span class="en">Testing <br/>In-app Billing</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play/billing/billing_admin.html">
+ <span class="en">Administering In-app Billing</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play/billing/billing_reference.html">
+ <span class="en">In-app Billing Reference</span></a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>google/play/dist.html">
+ <span class="en">Google Play Distribution and Licensing</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>google/play/filters.html">
+ <span class="en">Filters on Google Play</span></a>
+ </li>
+
+ <li><a href="<?cs var:toroot ?>google/play/publishing/multiple-apks.html">
+ <span class="en">Multiple APK Support</span></a>
+ </li>
+
+ <li><a href="<?cs var:toroot ?>google/play/expansion-files.html">
+ <span class="en">APK Expansion Files</span></a>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>google/play/licensing/index.html">
+ <span class="en">Application Licensing</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot?>google/play/licensing/overview.html">
+ <span class="en">Licensing Overview</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play/licensing/setting-up.html">
+ <span class="en">Setting Up for Licensing</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play/licensing/adding-licensing.html">
+ <span class="en">Adding Licensing to Your App</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/play/licensing/licensing-reference.html">
+ <span class="en">Licensing Reference</span></a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>google/gcm/index.html">
+ <span class="en">Google Cloud Messaging</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot?>google/gcm/gs.html">
+ <span class="en">Getting Started</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/gcm/gcm.html">
+ <span class="en">Architectural Overview</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/gcm/demo.html">
+ <span class="en">Demo App Tutorial</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/gcm/adv.html">
+ <span class="en">Advanced Topics</span></a>
+ </li>
+ <li><a href="<?cs var:toroot?>google/gcm/c2dm.html">
+ <span class="en">Migration</span></a>
+ </li>
+ </ul>
+ </li>
+</ul>
+
+<script type="text/javascript">
+<!--
+ buildToggleLists();
+ changeNavLang(getLangPref());
+//-->
+</script>
+
diff --git a/docs/html/google/index.jd b/docs/html/google/index.jd
new file mode 100644
index 0000000..ab2c58c
--- /dev/null
+++ b/docs/html/google/index.jd
@@ -0,0 +1,86 @@
+page.title=Google Services
+@jd:body
+
+<p>
+ Google offers a variety of services that help you build new revenue streams, enhance your app's
+ capabilities, manage distribution and payloads, and track usage and installs.
+ The sections below highlight some of the services offered by Google and link you to more information about
+ how to use them in your Android app.
+</p>
+ <h2>
+ Integrate Google Products
+ </h2>
+ <img src="{@docRoot}images/gps-small.png" style="float:left; padding-right:10px">
+ <p>Utilize the most up-to-date features of Google products in your app
+ without worrying the Android versions running on your users' devices. Users receive updates to Google Play
+ services through the Google Play store whenever available, ensuring
+ that exciting, new features of your app reach the most devices possible.
+ All of this comes with an easy-to-use authentication flow for you and your users.
+ </p><a href="{@docRoot}guide/google/play-services/index.html">Learn more »</a>
+
+<div class="vspace size-1">
+
+</div>
+
+<h2 id="monetization">
+ Monetize Your App
+</h2>
+<p>
+ Make the most out of your app's revenue potential by using monetization policies targeted
+ at your users' needs.
+</p>
+
+<div class="vspace size-1">
+
+</div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+ <h4>
+ Google Play In-App Billing
+ </h4>
+ <p>
+ Engage users by offering features such as new content or virtual goods directly in your app.
+ </p><a href="{@docRoot}guide/google/play/billing/index.html">Learn more »</a>
+ </div>
+
+ <div class="layout-content-col span-6">
+ <h4>
+ Google AdMob Ads
+ </h4>
+ <p>
+ Generate revenue by displaying ads in your app with multiple ad networks.
+ </p><a href="http://www.google.com/ads/admob/index.html">Learn more »</a>
+ </div>
+</div>
+
+
+
+<h2 id="gcm">
+ Receive Messages from the Cloud
+</h2>
+ <img src="/images/gcm/gcm-logo.png" width="150px" style="padding:9px; float:left">
+
+ <p>Use Google Cloud Messaging to notify your apps of important events with
+ that are lightweight and battery-saving. There are no quotas or charges
+ to use Google Cloud Messaging, no matter how big your messaging needs are.</p>
+
+ <a href="{@docRoot}guide/google/gcm/index.html">Learn more »</a>
+
+<div class="vspace size-1">
+
+</div>
+
+
+<h2 id="distribution">
+ Manage App Distribution and Licensing
+</h2>
+<p>
+ Google Play allows you to manage your app distribution with features such as app licensing
+ and device filtering. Take advantage of features that let you reach the right users with
+ the right content while protecting your app from unauthorized use.
+</p>
+
+ <a href="{@docRoot}guide/google/play/dist.html">Learn more »</a>
+</div>
+
diff --git a/docs/html/google/play-services/analytics.jd b/docs/html/google/play-services/analytics.jd
new file mode 100644
index 0000000..df93cbe
--- /dev/null
+++ b/docs/html/google/play-services/analytics.jd
@@ -0,0 +1,56 @@
+page.title=Google Analytics
+page.landing=true
+page.landing.intro=The Google Analytics Platform lets you measure user interactions with your business across various devices and environments. The platform provides all the computing resources to collect, store, process, and report on these user-interactions.
+page.landing.link=https://developers.google.com/analytics/devguides/collection/android/v2/
+page.landing.link.text=developers.google.com/analytics
+page.landing.image=images/gps-analytics.png
+
+@jd:body
+
+<div class="landing-docs">
+ <div class="col-6">
+ <h3 style="clear:left">Key Developer Features</h3>
+
+ <a href="https://developers.google.com/analytics/devguides/collection/android/v2/campaigns">
+ <h4>Discover user geography and habits</h4>
+ Discover where your users are coming from and how they are accessing your app,
+ from the moment they download your app from the Google Play Store.</a>
+
+ <a href="https://developers.google.com/analytics/devguides/collection/android/v2/ecommerce">
+ <h4>Track monetization performance</h4>
+ Monitor the success of mobile marketing campaigns by taking advantage of the end-to-end visibility
+ into the performance of your in-app purchases and transactions.
+ </a>
+
+ <a href="https://developers.google.com/analytics/devguides/collection/android/v2/screens">
+ <h4>Monitor app usage</h4>
+ Record data about the screens your users are viewing in your app and gain insight
+ on what features they use most. All of this information can help you pinpoint specific
+ markets and enhance features to make your app the best it can be.
+ </a>
+
+ </div>
+
+ <div class="col-6 normal-links">
+ <h3 style="clear:left">Getting Started</h3>
+ <h4>Get the Google Play services SDK</h4>
+ <p>The Google Analytics Android APIs are part of the Google Play services platform.</p>
+ <p><a href="{@docRoot}google/play-services/download.html">Download and configure</a>
+ the SDK to begin integrating Google Analytics into your app.
+ </p>
+
+ <h4>Visit the Google Analytics developer site</h4>
+ <p>For instructions on how to fully integrate Google+ into your app, with code snippets, visit the
+ <a href="https://developers.google.com/analytics/devguides/collection/android/v2/">Google
+ Analytics developer documentation</a> located at developers.google.com.
+ </p>
+
+ <h4>See the reference documentation</h4>
+ <p>
+ The <a href="{@docRoot}google/play-services/reference/com/google/android/gms/analytics/package-summary.html">Google
+ Analytics API reference</a> as well as the entire <a href="{@docRoot}google/play-services/reference/packages.html">Google
+ Play services platform reference</a> is provided for you on this site.
+ </p>
+
+ </div>
+</div>
\ No newline at end of file
diff --git a/docs/html/google/play-services/auth.jd b/docs/html/google/play-services/auth.jd
new file mode 100644
index 0000000..8787ec9
--- /dev/null
+++ b/docs/html/google/play-services/auth.jd
@@ -0,0 +1,196 @@
+page.title=Authentication
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#choose">Choosing an account</a></li>
+ <li><a href="#obtain">Obtaining an authorization token</a></li>
+ <li><a href="#handle">Handling exceptions</a></li>
+ <li><a href="#use">Using the token</a></li>
+ </ol>
+ </div>
+</div>
+
+<p>
+ Google Play services offers a standard authentication flow for all Google APIs and
+ all components of Google Play services. In addition, you can leverage the authentication
+ portion of the Google Play services SDK to authenticate to services that are not yet supported
+ in the Google Play services platform by using the authentication token to manually make API
+ requests or using a client library provided by the service provider.
+</p>
+
+<p>For implementation details, see the sample in <code><android-sdk>/extras/google-play-services/samples/auth</code>, which shows you how
+to carry out these basic steps for obtaining an authentication token.</p>
+
+<h2 id="choose">Choosing an Account</h2>
+<p>
+ Google Play services leverage existing accounts on an Android-powered device
+ to authenticate to the services that you want to use. To obtain an authorization token,
+ a valid Google account is required and it must exist on the device. You can ask your users which
+ account they want to use by enumerating the Google accounts on the device or using the
+ built-in
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/AccountPicker.html">AccountPicker</a>
+ class to display a standard account picker view. You'll need the
+ {@link android.Manifest.permission#GET_ACCOUNTS}
+ permission set in your manifest file for both methods.
+</p>
+<p>
+ For example, here's how to gather all of the Google accounts on a device and return them
+ in an array. When obtaining an authorization token, only the email address of the account is
+ needed, so that is what the array stores:
+</p>
+
+<pre>
+private String[] getAccountNames() {
+ mAccountManager = AccountManager.get(this);
+ Account[] accounts = mAccountManager.getAccountsByType(
+ GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
+ String[] names = new String[accounts.length];
+ for (int i = 0; i < names.length; i++) {
+ names[i] = accounts[i].name;
+ }
+ return names;
+}
+</pre>
+<h2 id="obtain">Obtaining an Authorization Token</h2>
+<p>
+ With an email address, you can now obtain an authorization token. There are two general
+ ways to get a token:</p>
+
+ <ul>
+ <li>Call one of the two overloaded <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context, java.lang.String, java.lang.String)">GoogleAuthUtil.getToken()</a> methods in a foreground activity where you can
+ display a dialog to the user to interactively handle authentication errors.</li>
+ <li>Call one of the three <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle)">getTokenWithNotification()</a>
+ methods if you are authenticating in a background service or sync adapter so that a notification is displayed if an authentication
+ error occurs.</a></li>
+ </ul>
+
+ <h3>Using getToken()</h3>
+ The following code snippet obtains an authentication token with an email address, the scope that you want to use for the service, and a {@link android.content.Context}:
+<pre>
+HelloActivity mActivity;
+String mEmail;
+String mScope;
+String token;
+
+...
+
+try {
+ token = GoogleAuthUtil.getToken(mActivity, mEmail, mScope);
+} catch {
+ ...
+}
+</pre>
+
+<p>Call this method off of the main UI thread since it executes network transactions. An easy way to do this
+ is in an <a href="http://developer.android.com/reference/android/os/AsyncTask.html">AsyncTask</a>.
+ The sample in the Google Play services SDK shows you how to wrap this call in an AsyncTask.
+ If authentication is successful, the token is returned. If not, the exceptions described in <a href="#handle">Handling Exceptions</a>
+ are thrown that you can catch and handle appropriately.
+</p>
+
+ <h3>Using getTokenWithNotification()</h3>
+ <p>If you are obtaining authentication tokens in a background service or sync adapter, there are three overloaded <code>getTokenWithNotification()</code> methods
+ that you can use:</p>
+ <ul>
+ <li><a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle)">getTokenWithNotification(Context context, String accountName, String scope, Bundle extras)</a>:
+ For background services. Displays a notification to the user when authentication errors occur.</li>
+ <li><a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle, android.content.Intent)">getTokenWithNotification(Context context, String accountName, String scope, Bundle extras, Intent callback)</a>:
+ This method is for use in background services. It displays a notification to the user when authentication errors occur. If a user clicks the notification and then authorizes the app to access the account, the intent is broadcasted. When using this method:
+ <ul>
+ <li>Create a {@link android.content.BroadcastReceiver} that registers the intent and handles it appropriately</li>
+ <li>In the app's manifest file, set the <code>android:exported</code> attribute to <code>true</code> for the broadcast receiver</li>
+ <li>Ensure that the intent is serializable using the {@link android.content.Intent#toUri toUri(Intent.URI_INTENT_SCHEME)} and
+ {@link android.content.Intent#parseUri parseUri(intentUri, Intent.URI_INTENT_SCHEME)} methods.</li>
+ </ul>
+ <li><a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle, java.lang.String, android.os.Bundle)">getTokenWithNotification(Context context, String accountName, String scope, Bundle extras, String authority, Bundle syncBundle)</a>: This method is for use in sync adapters. It displays a notification to the user when authentication errors occur. If a user clicks the notification and then authorizes the app to access the account, the sync adapter retries syncing with the information
+ contained in the <code>syncBundle</code> parameter.</li>
+ </ul>
+
+ <p>See the sample in <code><android-sdk>/extras/google-play-services/samples/auth</code> for implementation details.</p>
+
+<h2 id="handle">Handling Exceptions</h2>
+<p>
+ When requesting an authentication token with
+ <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context, java.lang.String, java.lang.String)">GoogleAuthUtil.getToken()</a>,
+ the following exceptions can be thrown:
+</p>
+<ul>
+ <li>
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/UserRecoverableAuthException.html">UserRecoverableAuthException</a>:
+ This exception is thrown when an error occurs that users can resolve, such as not yet granting access to their accounts or if they changed their password.
+ This exception class contains a {@link android.app.Activity#getIntent getIntent()}
+ method that you can call to obtain an intent that you can use with
+{@link android.app.Activity#startActivityForResult startActivityForResult()}
+ to obtain the user's resolution. You will need to handle the
+{@link android.app.Activity#onActivityResult onActivityResult()}
+ callback when this activity returns to take action based on the user's actions.
+ </li>
+ <li>
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GooglePlayServicesAvailabilityException.html">GooglePlayServicesAvailabilityException</a>:
+ This exception is a special case of <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/UserRecoverableAuthException.html">UserRecoverableAuthException</a>
+ and occurs when the actual Google Play services APK is not installed or unavailable.
+ This exception provides additional client support to
+ handle and fix this issue by providing an error code that describes the exact cause of the problem.
+ This exception also contains an intent that you can obtain and use to start
+ an activity to resolve the issue.
+ </li>
+ <li>
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthException.html">GoogleAuthException</a>:
+ This exception is thrown when the authorization fails, such as when an invalid scope is
+ specified or if the email address used to authenticate is actually not on the user's
+ device.
+ </li>
+ <li>
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/UserRecoverableNotifiedException.html">UserRecoverableNotifiedException</a>:
+ This exception is thrown when the authorization fails using one of the <code>getTokenWithNotification()</code> methods and if the error
+ is recoverable with a user action.
+ </li>
+</ul>
+<p>
+ For more information on how to handle these exceptions and code snippets, see the reference
+ documentation for the
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html">GoogleAuthUtil</a>
+ class.
+</p>
+<h2 id="use">Using the Token</h2>
+<p>
+ Once you have successfully obtained a token, you can use it to access Google services.
+ Many Google services provide client libraries, so it is recommended that you use these when
+ possible, but you can make raw HTTP requests as well with the token. The following example
+ shows you how to do this and handle HTTP error and success responses accordingly:
+</p>
+
+<pre>
+URL url = new URL("https://www.googleapis.com/oauth2/v1/userinfo?access_token="
+ + token);
+HttpURLConnection con = (HttpURLConnection) url.openConnection();
+int serverCode = con.getResponseCode();
+//successful query
+if (serverCode == 200) {
+ InputStream is = con.getInputStream();
+ String name = getFirstName(readResponse(is));
+ mActivity.show("Hello " + name + "!");
+ is.close();
+ return;
+//bad token, invalidate and get a new one
+} else if (serverCode == 401) {
+ GoogleAuthUtil.invalidateToken(mActivity, token);
+ onError("Server auth error, please try again.", null);
+ Log.e(TAG, "Server auth error: " + readResponse(con.getErrorStream()));
+ return;
+//unknown error, do something else
+} else {
+ Log.e("Server returned the following error code: " + serverCode, null);
+ return;
+}
+</pre>
+
+<p>
+ Notice that you must manually invalidate the token if the response from the server
+ signifies an authentication error (401). This could mean the authentication token
+ being used is invalid for the service's scope or the token may have expired. If this is the
+ case, obtain a new token using <a href="{@docRoot}google/play-services/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context, java.lang.String, java.lang.String)">GoogleAuthUtil.getToken()</a>.
+</p>
\ No newline at end of file
diff --git a/docs/html/google/play-services/dist.jd b/docs/html/google/play-services/dist.jd
new file mode 100644
index 0000000..85a64f9
--- /dev/null
+++ b/docs/html/google/play-services/dist.jd
@@ -0,0 +1,56 @@
+page.title=Google Play Distribution and Licensing
+@jd:body
+
+
+<h2 id="distribution">
+ Manage App Distribution and Licensing
+</h2>
+<p>
+ Google Play allows you to manage your app distribution with features that let you control which users
+ can download your app as well as deliver separate versions of your app based on certain
+ characteristics like platform version.
+</p>
+<div class="vspace size-1">
+
+</div>
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+ <h4>
+ Device Filtering
+ </h4>
+ <p>
+ Make sure your app gets to the right users by filtering on a wide range of characteristics
+ such as platform versions and hardware features.
+ </p><p><a href="{@docRoot}guide/google/play/filters.html">Learn more »</a></p>
+ </div>
+
+ <div class="layout-content-col span-6">
+ <h4>
+ Multiple APK Support
+ </h4>
+ <p>
+ Distribute different APKs based on a variety of properties such as platform version, screen
+ size, and GLES texture compression support.
+ </p><p><a href="{@docRoot}guide/google/play/publishing/multiple-apks.html">Learn more »</a></p>
+ </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+ <h4>
+ APK Expansion files
+ </h4>
+ <p>
+ Tap into Google's content delivery services by serving up to 4GB of assets for free. Provide
+ users with high-fidelity graphics, media files, or other large assets that are required by
+ your app.
+ </p><a href="{@docRoot}guide/google/play/expansion-files.html">Learn more »</a>
+ </div>
+
+ <div class="layout-content-col span-6">
+ <h4>
+ Application Licensing
+ </h4>
+ <p>Protect your revenue streams and integrate policies for usage into your app.
+ </p><a href="{@docRoot}guide/google/play/licensing/index.html">Learn more »</a>
+ </div>
+</div>
\ No newline at end of file
diff --git a/docs/html/google/play-services/download.jd b/docs/html/google/play-services/download.jd
new file mode 100644
index 0000000..fb03035
--- /dev/null
+++ b/docs/html/google/play-services/download.jd
@@ -0,0 +1,140 @@
+page.title=Downloading and Configuring the Google Play services SDK
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#ensure">Ensuring Devices Have the Google Play services APK</a></li>
+ </ol>
+ </div>
+</div>
+
+
+<p>
+ The Google Play services SDK is an extension to the Android SDK and is available to you as a
+ downloadable SDK component. This download includes the client library and code samples.
+</p>
+
+<p>
+ Before you get started developing, make sure that you have an updated version of the Android SDK
+ installed on your computer, including the SDK Tools component. If you don't have the SDK,
+ visit the <a href="{@docRoot}sdk/index.html">SDK Download page</a>
+ on the Android Developers site.
+</p>
+
+<p>
+ To download and configure the Google Play services SDK:
+</p>
+
+<ol>
+ <li>
+ Launch Eclipse and select <b>Window > Android SDK Manager</b> or run <code>android</code>
+ at the command line.
+ </li>
+ <li>
+ Scroll to the bottom of the package list and select <b>Extras > Google Play services</b>.
+ The add-on is downloaded to your computer and installed in your SDK environment at
+ <code><android-sdk-folder>/extras/google/google_play_services/</code>.
+ </li>
+ <li>
+ Reference the Google Play services client library project located in
+ <code><android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib</code> as
+ a library project for your Android project. See the
+ <a href="{@docRoot}tools/projects/projects-eclipse.html#ReferencingLibraryProject">Referencing a Library Project for Eclipse</a>
+ or <a href="{@docRoot}tools/projects/projects-cmdline.html#ReferencingLibraryProject">Referencing a Library Project on the Command Line</a>
+ for more information on how to do this.
+ </li>
+ <li>If you are using <a href="{@docRoot}tools/help/proguard.html">ProGuard</a>, add the following
+ lines in the <code><project_directory>/proguard-project.txt</code> file:
+ to prevent ProGuard from stripping away required classes:
+<pre>
+-keep class * extends java.util.ListResourceBundle {
+ protected Object[][] getContents();
+}
+</pre>
+</ol>
+
+<h2 id="ensure">Ensuring Devices Have the Google Play services APK</h2>
+<p>
+ Google Play delivers updates to the majority of the devices that support Google Play services
+ (Android 2.2 devices with the Google Play Store app installed). However, updates might not reach
+ supported devices in a timely manner, which are desribed in the following four scenarios:
+<p class="note">
+<strong>Important:</strong>
+<span>
+ Because it is hard to anticipate the state devices are in, you must <em>always</em> check for a
+ compatible Google Play services APK in your app when you are accessing Google Play services
+ features. For many apps, this is each time in the
+ {@link android.app.Activity#onResume onResume()} method of the main activity.
+</span>
+</p>
+<ol>
+ <li>
+ A recent version of the Google Play Store app is installed, and the most recent Google Play
+ services APK has been downloaded.
+ </li>
+ <li>
+ A recent version of the Google Play Store app is installed, but the most recent Google Play
+ services APK has <em>not</em> been downloaded.
+ </li>
+ <li>
+ An old version of the Google Play Store app, which does not proactively download Google Play
+ services updates, is present.
+ </li>
+ <li>
+ The Google Play services APK is missing or disabled on the device, which might happen if the
+ user explicitly uninstalls or disables it.
+ </li>
+</ol>
+<p>
+ Case 1 is the success scenario and is the most common. However, because the other scenarios can
+ still happen, you must handle them every time your app connects to a Google Play service to
+ ensure that the Google Play services APK is present, up-to-date, and enabled.
+</p>
+<p>
+ To help you, the Google Play services client library has utility methods to assist in
+ determining whether or not the Google Play services APK is recent enough to support the
+ version of the client library that you are using. If not, the client library sends users to the
+ Google Play Store to download a recent version of the Google Play services APK.
+</p>
+
+<p class="note">
+<b>Note:</b>
+<span>
+ The Google Play services APK is not visible by searching the Google Play Store. The client
+ library provides a deep link into the Google Play Store when it detects that the device has a
+ missing or incompatible Google Play services APK.
+</span>
+</p>
+
+<p>
+ It is up to you choose the appropriate place in your app to do the following steps to check for
+ a valid Google Play services APK. For example, if Google Play services is required for your app,
+ you might want to do it when your app first launches. On the other hand, if Google Play services
+ is an optional part of your app, you can do these checks if the user navigates to that portion
+ of your app:
+</p>
+
+<ol>
+ <li>
+ Query for the status of Google Play services on the device with the
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/GooglePlayServicesUtil.html#isGooglePlayServicesAvailable(android.content.Context)">isGooglePlayServicesAvailable()</a>
+ method, which returns a result code.
+ </li>
+ <li>
+ If the result code is
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/ConnectionResult.html#SUCCESS">SUCCESS</a>,
+ then the Google Play services APK is up-to-date, and you can proceed as normal.
+ </li>
+ <li>
+ If the result is
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_MISSING">SERVICE_MISSING</a>,
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_VERSION_UPDATE_REQUIRED">SERVICE_VERSION_UPDATE_REQUIRED</a>,
+ or
+<a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/ConnectionResult.html#SERVICE_DISABLED">SERVICE_DISABLED</a>,
+ call <a href="{@docRoot}google/play-services/reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getErrorDialog(int, android.app.Activity, int)">getErrorDialog()</a>
+ to display an error message to the user, which will then allow the user to download the APK
+ from the Google Play Store or enable it in the device's system settings.
+ </li>
+</ol>
\ No newline at end of file
diff --git a/docs/html/google/play-services/index.jd b/docs/html/google/play-services/index.jd
new file mode 100644
index 0000000..60a689d
--- /dev/null
+++ b/docs/html/google/play-services/index.jd
@@ -0,0 +1,76 @@
+page.title=Google Maps
+page.landing=true
+page.landing.intro=Add Google maps to your Android apps and let your users explore the world. Give your users all of the benefits of the Google Maps, but with the customizations that you need for your app and users.
+page.landing.link=https://developers.google.com/maps/documentation/android/
+page.landing.link.text=developers.google.com/maps
+page.landing.image=images/gps.png
+
+@jd:body
+<img src="{@docRoot}images/gps.png" style="float:right;" />
+
+<p>
+ Google Play services is a platform delivered through the Google Play Store that
+ lets you integrate Google products into your Android apps.
+ The Google Play services framework consists of a services component
+ that runs on the device and a thin client library that you package with your app.
+</p>
+
+
+<p>
+<a class="next-page-link topic-start-link"
+href="{@docRoot}google/play-services/overview.html">
+OVERVIEW</a>
+</p>
+
+<div class="vspace size-1"> </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-4">
+
+<h4>Google Technology</h4>
+<p>Add exciting and useful Google features such as Maps, Google+, Analytics, and more
+to your Android apps. Easy-to-use client libraries are provided for the products in Google
+Play services, so you can implement the functionality you want faster. New features
+and products are continuously being added, so make sure to check back often.</p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<h4>Standard Authentication</h4>
+<p>All products in Google Play services share a common authentication API
+ that leverages the existing Google accounts on the device. You and your
+ users have a consistent and safe way to grant and receive OAuth2 authentication
+ to Google services. Even services that are not bundled in Google Play services
+ can take advantage of the authentication APIs as long as they accept OAuth2
+ tokens associated with a Google account.</p>
+
+ </div>
+ <div class="layout-content-col span-4">
+
+<h4>Automatic Updates</h4>
+<p>Devices running Android 2.2 and newer and that have the Google Play Store app installed
+automatically receive updates to Google Play services. New products, features, and fixes are
+automatically pushed to a wide range of devices, old and new. You can now enhance your app with the most
+up-to-date version of Google Play services without worrying about your users' Android platform version.</p>
+
+ </div>
+</div>
+
+<h2>Services</h2>
+ <div class="landing-docs">
+ <a href="">
+ <h4>Google+</h4>
+ <p>Add social features to your app to with Google+.</p>
+ </a>
+
+ <a href="">
+ <h4>Google Analytics</h4>
+ <p>Make sure you're reaching the right users and find ways to reach more with Google Analytics.</p>
+ </a>
+
+ <a href="">
+ <h4>Google Maps</h4>
+ <p>Add compelling location-based features to your app to direct your users where they
+ want to go.</p>
+ </a>
+</div>
\ No newline at end of file
diff --git a/docs/html/google/play-services/maps.jd b/docs/html/google/play-services/maps.jd
new file mode 100644
index 0000000..eea17e9
--- /dev/null
+++ b/docs/html/google/play-services/maps.jd
@@ -0,0 +1,73 @@
+page.title=Google Maps
+page.landing=true
+page.landing.intro=Add Google maps to your Android apps and let your users explore the world. Give your users all of the benefits of the Google Maps, but with the customizations that you need for your app and users.
+page.landing.link=https://developers.google.com/maps/documentation/android/
+page.landing.link.text=developers.google.com/maps
+page.landing.image=images/gps-maps.png
+
+@jd:body
+
+<div class="landing-docs">
+ <div class="col-6">
+ <h3 style="clear:left">Key Developer Features</h3>
+ <a href="https://developers.google.com/maps/documentation/android/map">
+ <h4>Bring Maps to your Mobile Apps</h4>
+ The Google Maps APIs let you embed Google Maps into an Activity with a simple XML snippet
+ in the form of a fragment. With MapFragment, you can take advantage of exciting features such as 3D maps;
+ indoor, satellite, terrain, and hybrid maps; and vector-based tiles for efficient caching and drawing.
+ </a>
+
+ <a href="https://developers.google.com/maps/documentation/android/marker">
+ <h4>Highlight important places and routes</h4>
+ <p>
+ Overlay markers onto your maps to highlight places your users are interested
+ in. You can also define custom colors or icons for your map markers to
+ coincide with the look and feel of your app.</p>
+
+ <p>In addition, you can draw polylines, a set of connected line segments on a map
+ and polygons, a set of polylines in a closed loop.</p>
+ </a>
+
+ <a href="https://developers.google.com/maps/documentation/android/views">
+ <h4>Change views and perspectives</h4>
+ Give your users a different view of the world with the ability to control rotation, tilting,
+ zooming, and panning properties of the maps you are displaying. Show 3D views of maps,
+ zoom in on terrain maps, allow users to swipe across areas, and much more.
+ </a>
+
+ </div>
+
+ <div class="col-6 normal-links">
+ <h3 style="clear:left">Getting Started</h3>
+ <h4>Configure Maps</h4>
+ <p>The Google Maps Android APIs are part of the Google Play services platform.</p>
+ <p>To use Google Maps, <a href="{@docRoot}google/play-services/download.html">download and configure</a>
+ the Google Play services SDK and see the <a href="https://developers.google.com/maps/documentation/android/start#installing_the_google_maps_android_v2_api">
+ Getting Started guide</a> on how to configure Google Maps for your app.
+ </p>
+
+ <h4>Run the sample</h4>
+ <p>
+ The Google Maps sample is located in <code><android-sdk>/extras/google-play-services/samples/maps</code>
+ and shows you how to use the major components of the Google Maps Android APIs.
+ </p>
+
+ <h4>Visit the Google Maps developer site</h4>
+ <p>
+ For instructions on how to fully integrate Google+ into your app, with code snippets, visit the
+ <a href="https://developers.google.com/maps/documentation/android/intro">Google Maps developer documentation</a>
+ located at developers.google.com.
+ </p>
+
+ <h4>See the reference documentation</h4>
+ <p>
+ The <a href="{@docRoot}google/play-services/reference/com/google/android/gms/maps/package-summary.html">Google Maps API reference</a>
+ is provided for you on this site and is also available at <a href="https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/package-summary">developers.google.com</a> if you
+ prefer to read them there.</p>
+ <p>
+ In addition, the entire <a href="{@docRoot}google/play-services/reference/packages.html">Google Play
+ services platform reference</a> is hosted on this site for your convenience.
+ </p>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/docs/html/google/play-services/overview.jd b/docs/html/google/play-services/overview.jd
new file mode 100644
index 0000000..5ea72d9
--- /dev/null
+++ b/docs/html/google/play-services/overview.jd
@@ -0,0 +1,49 @@
+page.title=Overview
+@jd:body
+
+<p>
+Google Play services is a platform delivered by the Google Play Store that offers integration with Google products,
+such as Google+, in Android apps. The Google Play services platform consists of a services component that runs on
+the device and a thin client library that you package with your app. The following diagram shows the interaction
+between the two components:
+</p>
+
+<img src="{@docRoot}images/play-services-diagram.png" />
+
+<p>
+ The Google Play services component is delivered as an APK through the Google Play Store, so
+ updates to Google Play services are not dependent on carrier or OEM system image updates. Newer
+ devices will also have Google Play services as part of the device's system image, but updates
+ are still pushed to these newer devices through the Google Play Store. In general, devices
+ running Android 2.2 (Froyo) or later that have the Google Play Store receive updates within a
+ few days. This allows you to leverage the newest APIs for Google products and reach most of the
+ devices in the Android ecosystem. Devices older than Android 2.2 or devices without the Google
+ Play Store app are not supported.
+</p>
+
+<p>
+ The Google Play services component contains much of the logic to communicate with the specific
+ Google product that you want to interact with. An easy-to-use authentication flow is also
+ provided to gain access to supported Google products, which provides consistency for both the
+ developer and user. From the developer's point of view, requesting credentials is mostly taken
+ care of by the services component through calls to the client library. From the user's point of
+ view, authorization is granted with a few simple clicks.
+</p>
+
+<p>
+ The client library contains the interfaces to call into the services component. It also contains
+ APIs that allow you to resolve any issues at runtime such as a missing, disabled, or out-of-date
+ Google Play services APK. The client library has a light footprint if you use
+ ProGuard as part of your build process, so it won't have an adverse impact on your app's file size. See the
+ <a href="{@docRoot}google/play-services/overview.html">Downloading and Configuring the Google Play services SDK</a> for more
+ information on how to configure
+ <a href="{@docRoot}tools/help/proguard.html">ProGuard</a>.
+</p>
+
+<p>
+ If you want to access added features or products that are periodically added to the client
+ library, you can upgrade to a new version as they are released. However, upgrading is not
+ necessary if you don't care about new features or bug fixes in the new versions of the client
+ library. We anticipate more Google services to be continuously added, so be on the lookout for
+ these updates.
+</p>
\ No newline at end of file
diff --git a/docs/html/google/play-services/plus.jd b/docs/html/google/play-services/plus.jd
new file mode 100644
index 0000000..7742318
--- /dev/null
+++ b/docs/html/google/play-services/plus.jd
@@ -0,0 +1,65 @@
+page.title=Google+
+page.landing=true
+page.landing.intro=Create an engaging social experience and connect with more users by integrating G+ into your app.
+page.landing.link=https://developers.google.com/+/mobile/android/
+page.landing.link.text=developers.google.com/+
+page.landing.image=images/gps-plus.png
+
+@jd:body
+
+<div class="landing-docs">
+ <div class="col-6">
+ <h3 style="clear:left">Key Developer Features</h3>
+
+ <a href="https://developers.google.com/+/mobile/android/share">
+ <h4>Share to Google+</h4>
+ Display a Share dialog that lets your users share rich content from your app, including text,
+ photos, URL attachments, and location, into the Google+ stream.
+ </a>
+
+ <a href="https://developers.google.com/+/mobile/android/recommend">
+ <h4>Recommend content</h4>
+ Add a native +1 button so users can recommend content from your app. When users +1, they can
+ also share content with their circles. These endorsements can give your app more
+ credibility and help it grow faster.
+ </a>
+
+ <a href="https://developers.google.com/+/mobile/android/sign-in">
+ <h4>Sign in with Google+</h4>
+ Allow users to easily and securely sign in to your app using their Google+ credentials.
+ This allows you to know who they are on Google+ and to build a more personalized experience in your app.
+ </a>
+ <a href="https://developers.google.com/+/mobile/android/write-moments">
+ <h4>Save moments</h4>
+ Save user actions from your app such as check-ins, reviews, video views, comments, and more,
+ to your users' private Google+ history. From there, users can share these moments with others.
+ </a>
+ </div>
+
+ <div class="col-6 normal-links">
+ <h3 style="clear:left">Getting Started</h3>
+ <h4>Get the Google Play services SDK</h4>
+ <p>The Google+ Android APIs are part of the Google Play services platform.</p>
+ <p><a href="{@docRoot}google/play-services/download.html">Download and configure</a>
+ the SDK to begin integrating Google+ into your app.
+ </p>
+
+ <h4>Run the sample</h4>
+ <p>
+ The Google+ sample is located in <code><android-sdk>/extras/google-play-services/samples/plus</code> and shows you
+ how to use the major components of the Google+ Android APIs.
+ </p>
+
+ <h4>Visit the Google+ developer site</h4>
+ <p>For instructions on how to fully integrate Google+ into your app, with code snippets, visit the
+ <a href="https://developers.google.com/+/mobile/android/">Google+ developer documentation</a> located at
+ developers.google.com.
+ </p>
+
+ <h4>See the reference documentation</h4>
+ <p>The <a href="{@docRoot}google/play-services/reference/com/google/android/gms/plus/package-summary.html">Google+ API reference</a>
+ as well as the entire <a href="{@docRoot}google/play-services/reference/packages.html">Google Play services platform reference</a>
+ is provided for you on this site.
+ </p>
+ </div>
+</div>
\ No newline at end of file
diff --git a/docs/html/google/play-services/reference/packages.jd b/docs/html/google/play-services/reference/packages.jd
new file mode 100644
index 0000000..4f1ce79
--- /dev/null
+++ b/docs/html/google/play-services/reference/packages.jd
@@ -0,0 +1,6 @@
+page.title=Reference
+@jd:body
+
+<p>
+ See offline docs
+</p>
\ No newline at end of file
diff --git a/docs/html/guide/google/play/billing/billing_about.html b/docs/html/google/play/billing/billing_about.html
similarity index 100%
rename from docs/html/guide/google/play/billing/billing_about.html
rename to docs/html/google/play/billing/billing_about.html
diff --git a/docs/html/guide/google/play/billing/billing_admin.jd b/docs/html/google/play/billing/billing_admin.jd
similarity index 100%
rename from docs/html/guide/google/play/billing/billing_admin.jd
rename to docs/html/google/play/billing/billing_admin.jd
diff --git a/docs/html/guide/google/play/billing/billing_best_practices.jd b/docs/html/google/play/billing/billing_best_practices.jd
similarity index 100%
rename from docs/html/guide/google/play/billing/billing_best_practices.jd
rename to docs/html/google/play/billing/billing_best_practices.jd
diff --git a/docs/html/guide/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd
similarity index 100%
rename from docs/html/guide/google/play/billing/billing_integrate.jd
rename to docs/html/google/play/billing/billing_integrate.jd
diff --git a/docs/html/guide/google/play/billing/billing_overview.jd b/docs/html/google/play/billing/billing_overview.jd
similarity index 100%
rename from docs/html/guide/google/play/billing/billing_overview.jd
rename to docs/html/google/play/billing/billing_overview.jd
diff --git a/docs/html/guide/google/play/billing/billing_reference.jd b/docs/html/google/play/billing/billing_reference.jd
similarity index 100%
rename from docs/html/guide/google/play/billing/billing_reference.jd
rename to docs/html/google/play/billing/billing_reference.jd
diff --git a/docs/html/guide/google/play/billing/billing_subscriptions.jd b/docs/html/google/play/billing/billing_subscriptions.jd
similarity index 100%
rename from docs/html/guide/google/play/billing/billing_subscriptions.jd
rename to docs/html/google/play/billing/billing_subscriptions.jd
diff --git a/docs/html/guide/google/play/billing/billing_testing.jd b/docs/html/google/play/billing/billing_testing.jd
similarity index 100%
rename from docs/html/guide/google/play/billing/billing_testing.jd
rename to docs/html/google/play/billing/billing_testing.jd
diff --git a/docs/html/guide/google/play/billing/index.jd b/docs/html/google/play/billing/index.jd
similarity index 100%
rename from docs/html/guide/google/play/billing/index.jd
rename to docs/html/google/play/billing/index.jd
diff --git a/docs/html/google/play/dist.jd b/docs/html/google/play/dist.jd
new file mode 100644
index 0000000..7e60315
--- /dev/null
+++ b/docs/html/google/play/dist.jd
@@ -0,0 +1,52 @@
+page.title=Google Play Distribution and Licensing
+@jd:body
+
+<p>
+ Google Play allows you to manage your app distribution with features that let you control which users
+ can download your app as well as deliver separate versions of your app based on certain
+ characteristics like platform version.
+</p>
+<div class="vspace size-1">
+
+</div>
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+ <h4>
+ Device Filtering
+ </h4>
+ <p>
+ Make sure your app gets to the right users by filtering on a wide range of characteristics
+ such as platform versions and hardware features.
+ </p><p><a href="{@docRoot}guide/google/play/filters.html">Learn more »</a></p>
+ </div>
+
+ <div class="layout-content-col span-6">
+ <h4>
+ Multiple APK Support
+ </h4>
+ <p>
+ Distribute different APKs based on a variety of properties such as platform version, screen
+ size, and GLES texture compression support.
+ </p><p><a href="{@docRoot}guide/google/play/publishing/multiple-apks.html">Learn more »</a></p>
+ </div>
+
+<div class="layout-content-row">
+ <div class="layout-content-col span-6">
+ <h4>
+ APK Expansion files
+ </h4>
+ <p>
+ Tap into Google's content delivery services by serving up to 4GB of assets for free. Provide
+ users with high-fidelity graphics, media files, or other large assets that are required by
+ your app.
+ </p><a href="{@docRoot}guide/google/play/expansion-files.html">Learn more »</a>
+ </div>
+
+ <div class="layout-content-col span-6">
+ <h4>
+ Application Licensing
+ </h4>
+ <p>Protect your revenue streams and integrate policies for usage into your app.
+ </p><a href="{@docRoot}guide/google/play/licensing/index.html">Learn more »</a>
+ </div>
+</div>
\ No newline at end of file
diff --git a/docs/html/guide/google/play/expansion-files.jd b/docs/html/google/play/expansion-files.jd
similarity index 100%
rename from docs/html/guide/google/play/expansion-files.jd
rename to docs/html/google/play/expansion-files.jd
diff --git a/docs/html/guide/google/play/filters.jd b/docs/html/google/play/filters.jd
similarity index 100%
rename from docs/html/guide/google/play/filters.jd
rename to docs/html/google/play/filters.jd
diff --git a/docs/html/guide/google/play/licensing/adding-licensing.jd b/docs/html/google/play/licensing/adding-licensing.jd
similarity index 100%
rename from docs/html/guide/google/play/licensing/adding-licensing.jd
rename to docs/html/google/play/licensing/adding-licensing.jd
diff --git a/docs/html/guide/google/play/licensing/index.jd b/docs/html/google/play/licensing/index.jd
similarity index 100%
rename from docs/html/guide/google/play/licensing/index.jd
rename to docs/html/google/play/licensing/index.jd
diff --git a/docs/html/guide/google/play/licensing/licensing-reference.jd b/docs/html/google/play/licensing/licensing-reference.jd
similarity index 100%
rename from docs/html/guide/google/play/licensing/licensing-reference.jd
rename to docs/html/google/play/licensing/licensing-reference.jd
diff --git a/docs/html/guide/google/play/licensing/overview.jd b/docs/html/google/play/licensing/overview.jd
similarity index 100%
rename from docs/html/guide/google/play/licensing/overview.jd
rename to docs/html/google/play/licensing/overview.jd
diff --git a/docs/html/guide/google/play/licensing/setting-up.jd b/docs/html/google/play/licensing/setting-up.jd
similarity index 100%
rename from docs/html/guide/google/play/licensing/setting-up.jd
rename to docs/html/google/play/licensing/setting-up.jd
diff --git a/docs/html/guide/google/play/publishing/multiple-apks.jd b/docs/html/google/play/publishing/multiple-apks.jd
similarity index 100%
rename from docs/html/guide/google/play/publishing/multiple-apks.jd
rename to docs/html/google/play/publishing/multiple-apks.jd
diff --git a/docs/html/guide/google/play/services.jd b/docs/html/google/play/services.jd
similarity index 100%
rename from docs/html/guide/google/play/services.jd
rename to docs/html/google/play/services.jd
diff --git a/docs/html/guide/google/index.jd b/docs/html/guide/google/index.jd
deleted file mode 100644
index e1fc581..0000000
--- a/docs/html/guide/google/index.jd
+++ /dev/null
@@ -1,134 +0,0 @@
-page.title=Google Services
-footer.hide=1
-@jd:body
-
-<p>
- Google offers a variety of services that help you build new revenue streams, enhance your app's
- capabilities, manage distribution and payloads, and track usage and installs.
- The sections below highlight some of the services offered by Google and link you to more information about
- how to use them in your Android app.
-</p>
-<h2 id="monetization">
- Monetize your app
-</h2>
-<p>
- There are many ways to monetize your Android app, such as with ad impressions or In-App billing. If you
- choose to charge a price to download your app, Android also provides the ability to check
- for valid application licenses to protect your revenue. Because different apps require
- different strategies, you can pick which ones are best for your app.
-</p>
-<div class="vspace size-1">
-
-</div>
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
- <h4>
- Google AdMob Ads
- </h4>
- <p>
- Generate revenue by displaying ads in your app with multiple ad networks.
- </p><a href="http://www.google.com/ads/admob/index.html">Learn more »</a>
- </div>
- <div class="layout-content-col span-4">
- <h4>
- In-App Billing
- </h4>
- <p>
- Engage users by offering features such as new content or virtual goods directly in your app.
- </p><a href="{@docRoot}guide/google/play/billing/index.html">Learn more »</a>
- </div>
- <div class="layout-content-col span-4">
- <h4>
- Application Licensing
- </h4>
- <p>Protect your revenue streams and integrate policies for usage into your a
-pp.
- </p><a href="{@docRoot}guide/google/play/licensing/index.html">Learn more »</a>
- </div>
-</div>
-<h2 id="integration">
- Enhance Your App's Capabilities
-</h2>
-<p>
- Android and Google technologies work together to provide your users with compelling interactions
- with technologies such as Maps and Google+.
-</p>
-<div class="vspace size-1">
-
-</div>
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
- <h4>
- Google Play Services
- </h4><img src="{@docRoot}images/play_dev.png">
- <p>
- Leverage Google products in your app with an easy to use authentication flow for your users.
- </p><a href="{@docRoot}guide/google/play/services.html">Learn more »</a>
- </div>
- <div class="layout-content-col span-4">
- <h4>
- Google Cloud Messaging
- </h4><img src="{@docRoot}images/gcm/gcm-logo.png" width="150px" style="padding:9px;">
- <p>
- Notify your apps of important events with messages that are lightweight and battery-saving.
- </p><a href="{@docRoot}guide/google/gcm/index.html">Learn more »</a>
- </div>
- <div class="layout-content-col span-4">
- <h4>
- Google Maps
- </h4><img src="{@docRoot}images/google-apis.png">
- <p>
- The Google Maps library for Android brings powerful mapping capabilities to your app.
- </p><a href="https://developers.google.com/android/add-ons/google-apis/index">Learn more
- »</a>
- </div>
-</div>
-<h2 id="integration">
- Manage App Distribution
-</h2>
-<p>
- Google Play allows you to manage your app distribution with features that let you control which users
- can download your app as well as deliver separate versions of your app based on certain
- characteristics like platform version.
-</p>
-<div class="vspace size-1">
-
-</div>
-<div class="layout-content-row">
- <div class="layout-content-col span-4">
- <h4>
- Filters on Google Play
- </h4>
- <p>
- Make sure your app gets to the right users by filtering on a wide range of characteristics
- such as platform versions and hardware features.
- </p><a href="{@docRoot}guide/google/play/filters.html">Learn more »</a>
- </div>
- <div class="layout-content-col span-4">
- <h4>
- Multiple APK Support
- </h4>
- <p>
- Distribute different APKs based on a variety of properties such as platform version, screen
- size, and GLES texture compression support.
- </p><a href="{@docRoot}guide/google/play/publishing/multiple-apks.html">Learn more »</a>
- </div>
- <div class="layout-content-col span-4">
- <h4>
- APK Expansion files
- </h4>
- <p>
- Tap into Google's content delivery services by serving up to 4GB of assets for free. Provide
- users with high-fidelity graphics, media files, or other large assets that are required by
- your app.
- </p><a href="{@docRoot}guide/google/play/expansion-files.html">Learn more »</a>
- </div>
-</div>
-<h2 id="integration">
- Track Performance with Analytics
-</h2>
-<p>
- Google Analytics let you find out how users find your apps and how they use them. Start
- integrating analytics to measure your app's success.
-</p><a href="https://developers.google.com/analytics/devguides/collection/android/">Learn more
-»</a>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 46c4398..d7aacbf 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -529,125 +529,10 @@
<li><a href="<?cs var:toroot ?>guide/practices/tablets-and-handsets.html">
<span class="en">Supporting Tablets and Handsets</span>
</a></li>
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/performance.html">
- <span class="en">Designing for Performance</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/practices/jni.html">
- <span class="en">JNI Tips</span>
- </a></li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>guide/practices/responsiveness.html">
- <span class="en">Designing for Responsiveness</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/seamlessness.html">
- <span class="en">Designing for Seamlessness</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/security.html">
- <span class="en">Designing for Security</span>
- </a></li>
</ul>
</li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/google/index.html">
- <span class="en">Google Services</span>
- </a></div>
- <ul>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot?>guide/google/play/billing/index.html">
- <span class="en">In-app Billing</span></a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_overview.html">
- <span class="en">In-app Billing Overview</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_integrate.html">
- <span class="en">Implementing In-app Billing</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_subscriptions.html">
- <span class="en">Subscriptions</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_best_practices.html">
- <span class="en">Security and Design</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_testing.html">
- <span class="en">Testing In-app Billing</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_admin.html">
- <span class="en">Administering In-app Billing</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/play/billing/billing_reference.html">
- <span class="en">In-app Billing Reference</span></a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/google/play/licensing/index.html">
- <span class="en">Application Licensing</span></a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot?>guide/google/play/licensing/overview.html">
- <span class="en">Licensing Overview</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/play/licensing/setting-up.html">
- <span class="en">Setting Up for Licensing</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/play/licensing/adding-licensing.html">
- <span class="en">Adding Licensing to Your App</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/play/licensing/licensing-reference.html">
- <span class="en">Licensing Reference</span></a>
- </li>
- </ul>
- </li>
- <li><a href="<?cs var:toroot ?>guide/google/play/services.html">
- <span class="en">Google Play Services</span></a>
- </li>
- <li><a href="<?cs var:toroot ?>guide/google/play/filters.html">
- <span class="en">Filters on Google Play</span></a>
- </li>
- <li><a href="<?cs var:toroot ?>guide/google/play/publishing/multiple-apks.html">
- <span class="en">Multiple APK Support</span></a>
- </li>
- <li><a href="<?cs var:toroot ?>guide/google/play/expansion-files.html">
- <span class="en">APK Expansion Files</span></a>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/google/gcm/index.html">
- <span class="en">Google Cloud Messaging</span></a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot?>guide/google/gcm/gs.html">
- <span class="en">Getting Started</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/gcm/gcm.html">
- <span class="en">Architectural Overview</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/gcm/demo.html">
- <span class="en">Demo App Tutorial</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/gcm/adv.html">
- <span class="en">Advanced Topics</span></a>
- </li>
- <li><a href="<?cs var:toroot?>guide/google/gcm/c2dm.html">
- <span class="en">Migration</span></a>
- </li>
- </ul>
- </li>
-
- </ul>
- </li><!-- end Google Play -->
-
-
-
<!-- this needs to move
<li class="nav-section">
<div class="nav-section-header"><a href="<?cs var:toroot ?>guide/practices/ui_guidelines/index.html">
diff --git a/docs/html/guide/practices/app-design/performance.jd b/docs/html/guide/practices/app-design/performance.jd
deleted file mode 100644
index 078999b..0000000
--- a/docs/html/guide/practices/app-design/performance.jd
+++ /dev/null
@@ -1,410 +0,0 @@
-page.title=Designing for Performance
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#intro">Introduction</a></li>
- <li><a href="#optimize_judiciously">Optimize Judiciously</a></li>
- <li><a href="#object_creation">Avoid Creating Unnecessary Objects</a></li>
- <li><a href="#myths">Performance Myths</a></li>
- <li><a href="#prefer_static">Prefer Static Over Virtual</a></li>
- <li><a href="#internal_get_set">Avoid Internal Getters/Setters</a></li>
- <li><a href="#use_final">Use Static Final For Constants</a></li>
- <li><a href="#foreach">Use Enhanced For Loop Syntax</a></li>
- <li><a href="#package_inner">Consider Package Instead of Private Access with Inner Classes</a></li>
- <li><a href="#avoidfloat">Use Floating-Point Judiciously</a> </li>
- <li><a href="#library">Know And Use The Libraries</a></li>
- <li><a href="#native_methods">Use Native Methods Judiciously</a></li>
- <li><a href="#closing_notes">Closing Notes</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>An Android application will run on a mobile device with limited computing
-power and storage, and constrained battery life. Because of
-this, it should be <em>efficient</em>. Battery life is one reason you might
-want to optimize your app even if it already seems to run "fast enough".
-Battery life is important to users, and Android's battery usage breakdown
-means users will know if your app is responsible draining their battery.</p>
-
-<p>Note that although this document primarily covers micro-optimizations,
-these will almost never make or break your software. Choosing the right
-algorithms and data structures should always be your priority, but is
-outside the scope of this document.</p>
-
-<a name="intro" id="intro"></a>
-<h2>Introduction</h2>
-
-<p>There are two basic rules for writing efficient code:</p>
-<ul>
- <li>Don't do work that you don't need to do.</li>
- <li>Don't allocate memory if you can avoid it.</li>
-</ul>
-
-<h2 id="optimize_judiciously">Optimize Judiciously</h2>
-
-<p>This document is about Android-specific micro-optimization, so it assumes
-that you've already used profiling to work out exactly what code needs to be
-optimized, and that you already have a way to measure the effect (good or bad)
-of any changes you make. You only have so much engineering time to invest, so
-it's important to know you're spending it wisely.
-
-<p>(See <a href="#closing_notes">Closing Notes</a> for more on profiling and
-writing effective benchmarks.)
-
-<p>This document also assumes that you made the best decisions about data
-structures and algorithms, and that you've also considered the future
-performance consequences of your API decisions. Using the right data
-structures and algorithms will make more difference than any of the advice
-here, and considering the performance consequences of your API decisions will
-make it easier to switch to better implementations later (this is more
-important for library code than for application code).
-
-<p>(If you need that kind of advice, see Josh Bloch's <em>Effective Java</em>,
-item 47.)</p>
-
-<p>One of the trickiest problems you'll face when micro-optimizing an Android
-app is that your app is pretty much guaranteed to be running on multiple
-hardware platforms. Different versions of the VM running on different
-processors running at different speeds. It's not even generally the case
-that you can simply say "device X is a factor F faster/slower than device Y",
-and scale your results from one device to others. In particular, measurement
-on the emulator tells you very little about performance on any device. There
-are also huge differences between devices with and without a JIT: the "best"
-code for a device with a JIT is not always the best code for a device
-without.</p>
-
-<p>If you want to know how your app performs on a given device, you need to
-test on that device.</p>
-
-<a name="object_creation"></a>
-<h2>Avoid Creating Unnecessary Objects</h2>
-
-<p>Object creation is never free. A generational GC with per-thread allocation
-pools for temporary objects can make allocation cheaper, but allocating memory
-is always more expensive than not allocating memory.</p>
-
-<p>If you allocate objects in a user interface loop, you will force a periodic
-garbage collection, creating little "hiccups" in the user experience. The
-concurrent collector introduced in Gingerbread helps, but unnecessary work
-should always be avoided.</p>
-
-<p>Thus, you should avoid creating object instances you don't need to. Some
-examples of things that can help:</p>
-
-<ul>
- <li>If you have a method returning a string, and you know that its result
- will always be appended to a StringBuffer anyway, change your signature
- and implementation so that the function does the append directly,
- instead of creating a short-lived temporary object.</li>
- <li>When extracting strings from a set of input data, try
- to return a substring of the original data, instead of creating a copy.
- You will create a new String object, but it will share the char[]
- with the data. (The trade-off being that if you're only using a small
- part of the original input, you'll be keeping it all around in memory
- anyway if you go this route.)</li>
-</ul>
-
-<p>A somewhat more radical idea is to slice up multidimensional arrays into
-parallel single one-dimension arrays:</p>
-
-<ul>
- <li>An array of ints is a much better than an array of Integers,
- but this also generalizes to the fact that two parallel arrays of ints
- are also a <strong>lot</strong> more efficient than an array of (int,int)
- objects. The same goes for any combination of primitive types.</li>
- <li>If you need to implement a container that stores tuples of (Foo,Bar)
- objects, try to remember that two parallel Foo[] and Bar[] arrays are
- generally much better than a single array of custom (Foo,Bar) objects.
- (The exception to this, of course, is when you're designing an API for
- other code to access; in those cases, it's usually better to trade
- good API design for a small hit in speed. But in your own internal
- code, you should try and be as efficient as possible.)</li>
-</ul>
-
-<p>Generally speaking, avoid creating short-term temporary objects if you
-can. Fewer objects created mean less-frequent garbage collection, which has
-a direct impact on user experience.</p>
-
-<a name="avoid_enums" id="avoid_enums"></a>
-<a name="myths" id="myths"></a>
-<h2>Performance Myths</h2>
-
-<p>Previous versions of this document made various misleading claims. We
-address some of them here.</p>
-
-<p>On devices without a JIT, it is true that invoking methods via a
-variable with an exact type rather than an interface is slightly more
-efficient. (So, for example, it was cheaper to invoke methods on a
-<code>HashMap map</code> than a <code>Map map</code>, even though in both
-cases the map was a <code>HashMap</code>.) It was not the case that this
-was 2x slower; the actual difference was more like 6% slower. Furthermore,
-the JIT makes the two effectively indistinguishable.</p>
-
-<p>On devices without a JIT, caching field accesses is about 20% faster than
-repeatedly accesssing the field. With a JIT, field access costs about the same
-as local access, so this isn't a worthwhile optimization unless you feel it
-makes your code easier to read. (This is true of final, static, and static
-final fields too.)
-
-<a name="prefer_static" id="prefer_static"></a>
-<h2>Prefer Static Over Virtual</h2>
-
-<p>If you don't need to access an object's fields, make your method static.
-Invocations will be about 15%-20% faster.
-It's also good practice, because you can tell from the method
-signature that calling the method can't alter the object's state.</p>
-
-<a name="internal_get_set" id="internal_get_set"></a>
-<h2>Avoid Internal Getters/Setters</h2>
-
-<p>In native languages like C++ it's common practice to use getters (e.g.
-<code>i = getCount()</code>) instead of accessing the field directly (<code>i
-= mCount</code>). This is an excellent habit for C++, because the compiler can
-usually inline the access, and if you need to restrict or debug field access
-you can add the code at any time.</p>
-
-<p>On Android, this is a bad idea. Virtual method calls are expensive,
-much more so than instance field lookups. It's reasonable to follow
-common object-oriented programming practices and have getters and setters
-in the public interface, but within a class you should always access
-fields directly.</p>
-
-<p>Without a JIT, direct field access is about 3x faster than invoking a
-trivial getter. With the JIT (where direct field access is as cheap as
-accessing a local), direct field access is about 7x faster than invoking a
-trivial getter. This is true in Froyo, but will improve in the future when
-the JIT inlines getter methods.</p>
-
-<p>Note that if you're using ProGuard, you can have the best
-of both worlds because ProGuard can inline accessors for you.</p>
-
-<a name="use_final" id="use_final"></a>
-<h2>Use Static Final For Constants</h2>
-
-<p>Consider the following declaration at the top of a class:</p>
-
-<pre>static int intVal = 42;
-static String strVal = "Hello, world!";</pre>
-
-<p>The compiler generates a class initializer method, called
-<code><clinit></code>, that is executed when the class is first used.
-The method stores the value 42 into <code>intVal</code>, and extracts a
-reference from the classfile string constant table for <code>strVal</code>.
-When these values are referenced later on, they are accessed with field
-lookups.</p>
-
-<p>We can improve matters with the "final" keyword:</p>
-
-<pre>static final int intVal = 42;
-static final String strVal = "Hello, world!";</pre>
-
-<p>The class no longer requires a <code><clinit></code> method,
-because the constants go into static field initializers in the dex file.
-Code that refers to <code>intVal</code> will use
-the integer value 42 directly, and accesses to <code>strVal</code> will
-use a relatively inexpensive "string constant" instruction instead of a
-field lookup. (Note that this optimization only applies to primitive types and
-<code>String</code> constants, not arbitrary reference types. Still, it's good
-practice to declare constants <code>static final</code> whenever possible.)</p>
-
-<a name="foreach" id="foreach"></a>
-<h2>Use Enhanced For Loop Syntax</h2>
-
-<p>The enhanced for loop (also sometimes known as "for-each" loop) can be used
-for collections that implement the Iterable interface and for arrays.
-With collections, an iterator is allocated to make interface calls
-to hasNext() and next(). With an ArrayList, a hand-written counted loop is
-about 3x faster (with or without JIT), but for other collections the enhanced
-for loop syntax will be exactly equivalent to explicit iterator usage.</p>
-
-<p>There are several alternatives for iterating through an array:</p>
-
-<pre> static class Foo {
- int mSplat;
- }
- Foo[] mArray = ...
-
- public void zero() {
- int sum = 0;
- for (int i = 0; i < mArray.length; ++i) {
- sum += mArray[i].mSplat;
- }
- }
-
- public void one() {
- int sum = 0;
- Foo[] localArray = mArray;
- int len = localArray.length;
-
- for (int i = 0; i < len; ++i) {
- sum += localArray[i].mSplat;
- }
- }
-
- public void two() {
- int sum = 0;
- for (Foo a : mArray) {
- sum += a.mSplat;
- }
- }
-</pre>
-
-<p><strong>zero()</strong> is slowest, because the JIT can't yet optimize away
-the cost of getting the array length once for every iteration through the
-loop.</p>
-
-<p><strong>one()</strong> is faster. It pulls everything out into local
-variables, avoiding the lookups. Only the array length offers a performance
-benefit.</p>
-
-<p><strong>two()</strong> is fastest for devices without a JIT, and
-indistinguishable from <strong>one()</strong> for devices with a JIT.
-It uses the enhanced for loop syntax introduced in version 1.5 of the Java
-programming language.</p>
-
-<p>To summarize: use the enhanced for loop by default, but consider a
-hand-written counted loop for performance-critical ArrayList iteration.</p>
-
-<p>(See also <em>Effective Java</em> item 46.)</p>
-
-<a name="package_inner" id="package_inner"></a>
-<h2>Consider Package Instead of Private Access with Private Inner Classes</h2>
-
-<p>Consider the following class definition:</p>
-
-<pre>public class Foo {
- private class Inner {
- void stuff() {
- Foo.this.doStuff(Foo.this.mValue);
- }
- }
-
- private int mValue;
-
- public void run() {
- Inner in = new Inner();
- mValue = 27;
- in.stuff();
- }
-
- private void doStuff(int value) {
- System.out.println("Value is " + value);
- }
-}</pre>
-
-<p>The key things to note here are that we define a private inner class
-(<code>Foo$Inner</code>) that directly accesses a private method and a private
-instance field in the outer class. This is legal, and the code prints "Value is
-27" as expected.</p>
-
-<p>The problem is that the VM considers direct access to <code>Foo</code>'s
-private members from <code>Foo$Inner</code> to be illegal because
-<code>Foo</code> and <code>Foo$Inner</code> are different classes, even though
-the Java language allows an inner class to access an outer class' private
-members. To bridge the gap, the compiler generates a couple of synthetic
-methods:</p>
-
-<pre>/*package*/ static int Foo.access$100(Foo foo) {
- return foo.mValue;
-}
-/*package*/ static void Foo.access$200(Foo foo, int value) {
- foo.doStuff(value);
-}</pre>
-
-<p>The inner class code calls these static methods whenever it needs to
-access the <code>mValue</code> field or invoke the <code>doStuff</code> method
-in the outer class. What this means is that the code above really boils down to
-a case where you're accessing member fields through accessor methods.
-Earlier we talked about how accessors are slower than direct field
-accesses, so this is an example of a certain language idiom resulting in an
-"invisible" performance hit.</p>
-
-<p>If you're using code like this in a performance hotspot, you can avoid the
-overhead by declaring fields and methods accessed by inner classes to have
-package access, rather than private access. Unfortunately this means the fields
-can be accessed directly by other classes in the same package, so you shouldn't
-use this in public API.</p>
-
-<a name="avoidfloat" id="avoidfloat"></a>
-<h2>Use Floating-Point Judiciously</h2>
-
-<p>As a rule of thumb, floating-point is about 2x slower than integer on
-Android devices. This is true on a FPU-less, JIT-less G1 and a Nexus One with
-an FPU and the JIT. (Of course, absolute speed difference between those two
-devices is about 10x for arithmetic operations.)</p>
-
-<p>In speed terms, there's no difference between <code>float</code> and
-<code>double</code> on the more modern hardware. Space-wise, <code>double</code>
-is 2x larger. As with desktop machines, assuming space isn't an issue, you
-should prefer <code>double</code> to <code>float</code>.</p>
-
-<p>Also, even for integers, some chips have hardware multiply but lack
-hardware divide. In such cases, integer division and modulus operations are
-performed in software — something to think about if you're designing a
-hash table or doing lots of math.</p>
-
-<a name="library" id="library"></a>
-<h2>Know And Use The Libraries</h2>
-
-<p>In addition to all the usual reasons to prefer library code over rolling
-your own, bear in mind that the system is at liberty to replace calls
-to library methods with hand-coded assembler, which may be better than the
-best code the JIT can produce for the equivalent Java. The typical example
-here is <code>String.indexOf</code> and friends, which Dalvik replaces with
-an inlined intrinsic. Similarly, the <code>System.arraycopy</code> method
-is about 9x faster than a hand-coded loop on a Nexus One with the JIT.</p>
-
-<p>(See also <em>Effective Java</em> item 47.)</p>
-
-<a name="native_methods" id="native_methods"></a>
-<h2>Use Native Methods Judiciously</h2>
-
-<p>Native code isn't necessarily more efficient than Java. For one thing,
-there's a cost associated with the Java-native transition, and the JIT can't
-optimize across these boundaries. If you're allocating native resources (memory
-on the native heap, file descriptors, or whatever), it can be significantly
-more difficult to arrange timely collection of these resources. You also
-need to compile your code for each architecture you wish to run on (rather
-than rely on it having a JIT). You may even have to compile multiple versions
-for what you consider the same architecture: native code compiled for the ARM
-processor in the G1 can't take full advantage of the ARM in the Nexus One, and
-code compiled for the ARM in the Nexus One won't run on the ARM in the G1.</p>
-
-<p>Native code is primarily useful when you have an existing native codebase
-that you want to port to Android, not for "speeding up" parts of a Java app.</p>
-
-<p>If you do need to use native code, you should read our
-<a href="{@docRoot}guide/practices/jni.html">JNI Tips</a>.</p>
-
-<p>(See also <em>Effective Java</em> item 54.)</p>
-
-<a name="closing_notes" id="closing_notes"></a>
-<h2>Closing Notes</h2>
-
-<p>One last thing: always measure. Before you start optimizing, make sure you
-have a problem. Make sure you can accurately measure your existing performance,
-or you won't be able to measure the benefit of the alternatives you try.</p>
-
-<p>Every claim made in this document is backed up by a benchmark. The source
-to these benchmarks can be found in the <a href="http://code.google.com/p/dalvik/source/browse/#svn/trunk/benchmarks">code.google.com "dalvik" project</a>.</p>
-
-<p>The benchmarks are built with the
-<a href="http://code.google.com/p/caliper/">Caliper</a> microbenchmarking
-framework for Java. Microbenchmarks are hard to get right, so Caliper goes out
-of its way to do the hard work for you, and even detect some cases where you're
-not measuring what you think you're measuring (because, say, the VM has
-managed to optimize all your code away). We highly recommend you use Caliper
-to run your own microbenchmarks.</p>
-
-<p>You may also find
-<a href="{@docRoot}tools/debugging/debugging-tracing.html">Traceview</a> useful
-for profiling, but it's important to realize that it currently disables the JIT,
-which may cause it to misattribute time to code that the JIT may be able to win
-back. It's especially important after making changes suggested by Traceview
-data to ensure that the resulting code actually runs faster when run without
-Traceview.
diff --git a/docs/html/guide/practices/app-design/responsiveness.jd b/docs/html/guide/practices/app-design/responsiveness.jd
deleted file mode 100644
index a00e3aa..0000000
--- a/docs/html/guide/practices/app-design/responsiveness.jd
+++ /dev/null
@@ -1,140 +0,0 @@
-page.title=Designing for Responsiveness
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#anr">What Triggers ANR?</a></li>
- <li><a href="#avoiding">How to Avoid ANR</a></li>
- <li><a href="#reinforcing">Reinforcing Responsiveness</a></li>
-</ol>
-
-</div>
-</div>
-
-<div class="figure">
-<img src="{@docRoot}images/anr.png" alt="Screenshot of ANR dialog box" width="240" height="320"/>
-<p><strong>Figure 1.</strong> An ANR dialog displayed to the user.</p>
-</div>
-
-<p>It's possible to write code that wins every performance test in the world,
-but still sends users in a fiery rage when they try to use the application.
-These are the applications that aren't <em>responsive</em> enough — the
-ones that feel sluggish, hang or freeze for significant periods, or take too
-long to process input. </p>
-
-<p>In Android, the system guards against applications that are insufficiently
-responsive for a period of time by displaying a dialog to the user, called the
-Application Not Responding (ANR) dialog, shown at right in Figure 1. The user
-can choose to let the application continue, but the user won't appreciate having
-to act on this dialog every time he or she uses your application. It's critical
-to design responsiveness into your application, so that the system never has
-cause to display an ANR dialog to the user. </p>
-
-<p>Generally, the system displays an ANR if an application cannot respond to
-user input. For example, if an application blocks on some I/O operation
-(frequently a network access), then the main application thread won't be able to
-process incoming user input events. After a time, the system concludes that the
-application is frozen, and displays the ANR to give the user the option to kill
-it. </p>
-
-<p>Similarly, if your application spends too much time building an elaborate in-memory
-structure, or perhaps computing the next move in a game, the system will
-conclude that your application has hung. It's always important to make
-sure these computations are efficient using the techniques above, but even the
-most efficient code still takes time to run.</p>
-
-<p>In both of these cases, the recommended approach is to create a child thread and do
-most of your work there. This keeps the main thread (which drives the user
-interface event loop) running and prevents the system from concluding that your code
-has frozen. Since such threading usually is accomplished at the class
-level, you can think of responsiveness as a <em>class</em> problem. (Compare
-this with basic performance, which was described above as a <em>method</em>-level
-concern.)</p>
-
-<p>This document describes how the Android system determines whether an
-application is not responding and provides guidelines for ensuring that your
-application stays responsive. </p>
-
-<h2 id="anr">What Triggers ANR?</h2>
-
-<p>In Android, application responsiveness is monitored by the Activity Manager
-and Window Manager system services. Android will display the ANR dialog
-for a particular application when it detects one of the following
-conditions:</p>
-<ul>
- <li>No response to an input event (e.g. key press, screen touch)
- within 5 seconds</li>
- <li>A {@link android.content.BroadcastReceiver BroadcastReceiver}
- hasn't finished executing within 10 seconds</li>
-</ul>
-
-<h2 id="avoiding">How to Avoid ANR</h2>
-
-<p>Given the above definition for ANR, let's examine why this can occur in
-Android applications and how best to structure your application to avoid ANR.</p>
-
-<p>Android applications normally run entirely on a single (i.e. main) thread.
-This means that anything your application is doing in the main thread that
-takes a long time to complete can trigger the ANR dialog because your
-application is not giving itself a chance to handle the input event or Intent
-broadcast.</p>
-
-<p>Therefore any method that runs in the main thread should do as little work
-as possible. In particular, Activities should do as little as possible to set
-up in key life-cycle methods such as <code>onCreate()</code> and
-<code>onResume()</code>. Potentially long running operations such as network
-or database operations, or computationally expensive calculations such as
-resizing bitmaps should be done in a child thread (or in the case of databases
-operations, via an asynchronous request). However, this does not mean that
-your main thread should block while waiting for the child thread to
-complete — nor should you call <code>Thread.wait()</code> or
-<code>Thread.sleep()</code>. Instead of blocking while waiting for a child
-thread to complete, your main thread should provide a {@link
-android.os.Handler Handler} for child threads to post back to upon completion.
-Designing your application in this way will allow your main thread to remain
-responsive to input and thus avoid ANR dialogs caused by the 5 second input
-event timeout. These same practices should be followed for any other threads
-that display UI, as they are also subject to the same timeouts.</p>
-
-<p>You can use {@link android.os.StrictMode} to help find potentially
-long running operations such as network or database operations that
-you might accidentally be doing your main thread.</p>
-
-<p>The specific constraint on IntentReceiver execution time emphasizes what
-they were meant to do: small, discrete amounts of work in the background such
-as saving a setting or registering a Notification. So as with other methods
-called in the main thread, applications should avoid potentially long-running
-operations or calculations in BroadcastReceivers. But instead of doing intensive
-tasks via child threads (as the life of a BroadcastReceiver is short), your
-application should start a {@link android.app.Service Service} if a
-potentially long running action needs to be taken in response to an Intent
-broadcast. As a side note, you should also avoid starting an Activity from an
-Intent Receiver, as it will spawn a new screen that will steal focus from
-whatever application the user is currently has running. If your application
-has something to show the user in response to an Intent broadcast, it should
-do so using the {@link android.app.NotificationManager Notification
-Manager}.</p>
-
-<h2 id="reinforcing">Reinforcing Responsiveness</h2>
-
-<p>Generally, 100 to 200ms is the threshold beyond which users will perceive
-lag (or lack of "snappiness," if you will) in an application. As such, here
-are some additional tips beyond what you should do to avoid ANR that will help
-make your application seem responsive to users.</p>
-
-<ul>
- <li>If your application is doing work in the background in response to
- user input, show that progress is being made ({@link
- android.widget.ProgressBar ProgressBar} and {@link
- android.app.ProgressDialog ProgressDialog} are useful for this).</li>
- <li>For games specifically, do calculations for moves in a child
- thread.</li>
- <li>If your application has a time-consuming initial setup phase, consider
- showing a splash screen or rendering the main view as quickly as possible
- and filling in the information asynchronously. In either case, you should
- indicate somehow that progress is being made, lest the user perceive that
- the application is frozen.</li>
-</ul>
diff --git a/docs/html/guide/practices/performance.jd b/docs/html/guide/practices/performance.jd
deleted file mode 100644
index 3e2714c..0000000
--- a/docs/html/guide/practices/performance.jd
+++ /dev/null
@@ -1,413 +0,0 @@
-page.title=Designing for Performance
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#intro">Introduction</a></li>
- <li><a href="#optimize_judiciously">Optimize Judiciously</a></li>
- <li><a href="#object_creation">Avoid Creating Unnecessary Objects</a></li>
- <li><a href="#myths">Performance Myths</a></li>
- <li><a href="#prefer_static">Prefer Static Over Virtual</a></li>
- <li><a href="#internal_get_set">Avoid Internal Getters/Setters</a></li>
- <li><a href="#use_final">Use Static Final For Constants</a></li>
- <li><a href="#foreach">Use Enhanced For Loop Syntax</a></li>
- <li><a href="#package_inner">Consider Package Instead of Private Access with Inner Classes</a></li>
- <li><a href="#avoidfloat">Use Floating-Point Judiciously</a> </li>
- <li><a href="#library">Know And Use The Libraries</a></li>
- <li><a href="#native_methods">Use Native Methods Judiciously</a></li>
- <li><a href="#closing_notes">Closing Notes</a></li>
-</ol>
-
-</div>
-</div>
-
-<p>An Android application will run on a mobile device with limited computing
-power and storage, and constrained battery life. Because of
-this, it should be <em>efficient</em>. Battery life is one reason you might
-want to optimize your app even if it already seems to run "fast enough".
-Battery life is important to users, and Android's battery usage breakdown
-means users will know if your app is responsible draining their battery.</p>
-
-<p>Note that although this document primarily covers micro-optimizations,
-these will almost never make or break your software. Choosing the right
-algorithms and data structures should always be your priority, but is
-outside the scope of this document.</p>
-
-<a name="intro" id="intro"></a>
-<h2>Introduction</h2>
-
-<p>There are two basic rules for writing efficient code:</p>
-<ul>
- <li>Don't do work that you don't need to do.</li>
- <li>Don't allocate memory if you can avoid it.</li>
-</ul>
-
-<h2 id="optimize_judiciously">Optimize Judiciously</h2>
-
-<p>This document is about Android-specific micro-optimization, so it assumes
-that you've already used profiling to work out exactly what code needs to be
-optimized, and that you already have a way to measure the effect (good or bad)
-of any changes you make. You only have so much engineering time to invest, so
-it's important to know you're spending it wisely.
-
-<p>(See <a href="#closing_notes">Closing Notes</a> for more on profiling and
-writing effective benchmarks.)
-
-<p>This document also assumes that you made the best decisions about data
-structures and algorithms, and that you've also considered the future
-performance consequences of your API decisions. Using the right data
-structures and algorithms will make more difference than any of the advice
-here, and considering the performance consequences of your API decisions will
-make it easier to switch to better implementations later (this is more
-important for library code than for application code).
-
-<p>(If you need that kind of advice, see Josh Bloch's <em>Effective Java</em>,
-item 47.)</p>
-
-<p>One of the trickiest problems you'll face when micro-optimizing an Android
-app is that your app is pretty much guaranteed to be running on multiple
-hardware platforms. Different versions of the VM running on different
-processors running at different speeds. It's not even generally the case
-that you can simply say "device X is a factor F faster/slower than device Y",
-and scale your results from one device to others. In particular, measurement
-on the emulator tells you very little about performance on any device. There
-are also huge differences between devices with and without a JIT: the "best"
-code for a device with a JIT is not always the best code for a device
-without.</p>
-
-<p>If you want to know how your app performs on a given device, you need to
-test on that device.</p>
-
-<a name="object_creation"></a>
-<h2>Avoid Creating Unnecessary Objects</h2>
-
-<p>Object creation is never free. A generational GC with per-thread allocation
-pools for temporary objects can make allocation cheaper, but allocating memory
-is always more expensive than not allocating memory.</p>
-
-<p>If you allocate objects in a user interface loop, you will force a periodic
-garbage collection, creating little "hiccups" in the user experience. The
-concurrent collector introduced in Gingerbread helps, but unnecessary work
-should always be avoided.</p>
-
-<p>Thus, you should avoid creating object instances you don't need to. Some
-examples of things that can help:</p>
-
-<ul>
- <li>If you have a method returning a string, and you know that its result
- will always be appended to a StringBuffer anyway, change your signature
- and implementation so that the function does the append directly,
- instead of creating a short-lived temporary object.</li>
- <li>When extracting strings from a set of input data, try
- to return a substring of the original data, instead of creating a copy.
- You will create a new String object, but it will share the char[]
- with the data. (The trade-off being that if you're only using a small
- part of the original input, you'll be keeping it all around in memory
- anyway if you go this route.)</li>
-</ul>
-
-<p>A somewhat more radical idea is to slice up multidimensional arrays into
-parallel single one-dimension arrays:</p>
-
-<ul>
- <li>An array of ints is a much better than an array of Integers,
- but this also generalizes to the fact that two parallel arrays of ints
- are also a <strong>lot</strong> more efficient than an array of (int,int)
- objects. The same goes for any combination of primitive types.</li>
- <li>If you need to implement a container that stores tuples of (Foo,Bar)
- objects, try to remember that two parallel Foo[] and Bar[] arrays are
- generally much better than a single array of custom (Foo,Bar) objects.
- (The exception to this, of course, is when you're designing an API for
- other code to access; in those cases, it's usually better to trade
- good API design for a small hit in speed. But in your own internal
- code, you should try and be as efficient as possible.)</li>
-</ul>
-
-<p>Generally speaking, avoid creating short-term temporary objects if you
-can. Fewer objects created mean less-frequent garbage collection, which has
-a direct impact on user experience.</p>
-
-<a name="avoid_enums" id="avoid_enums"></a>
-<a name="myths" id="myths"></a>
-<h2>Performance Myths</h2>
-
-<p>Previous versions of this document made various misleading claims. We
-address some of them here.</p>
-
-<p>On devices without a JIT, it is true that invoking methods via a
-variable with an exact type rather than an interface is slightly more
-efficient. (So, for example, it was cheaper to invoke methods on a
-<code>HashMap map</code> than a <code>Map map</code>, even though in both
-cases the map was a <code>HashMap</code>.) It was not the case that this
-was 2x slower; the actual difference was more like 6% slower. Furthermore,
-the JIT makes the two effectively indistinguishable.</p>
-
-<p>On devices without a JIT, caching field accesses is about 20% faster than
-repeatedly accesssing the field. With a JIT, field access costs about the same
-as local access, so this isn't a worthwhile optimization unless you feel it
-makes your code easier to read. (This is true of final, static, and static
-final fields too.)
-
-<a name="prefer_static" id="prefer_static"></a>
-<h2>Prefer Static Over Virtual</h2>
-
-<p>If you don't need to access an object's fields, make your method static.
-Invocations will be about 15%-20% faster.
-It's also good practice, because you can tell from the method
-signature that calling the method can't alter the object's state.</p>
-
-<a name="internal_get_set" id="internal_get_set"></a>
-<h2>Avoid Internal Getters/Setters</h2>
-
-<p>In native languages like C++ it's common practice to use getters (e.g.
-<code>i = getCount()</code>) instead of accessing the field directly (<code>i
-= mCount</code>). This is an excellent habit for C++, because the compiler can
-usually inline the access, and if you need to restrict or debug field access
-you can add the code at any time.</p>
-
-<p>On Android, this can be a bad idea. Virtual method calls can be more
-expensive than instance field lookups. It's reasonable to follow
-common object-oriented programming practices and have getters and setters
-in the public interface, but within a class you might want to access
-fields directly.</p>
-
-<p>Without a JIT, direct field access is about 3x faster than invoking a
-trivial getter (one that simply returns the value of a field, without
-any dereferencing or array indexing). With the Froyo JIT, direct field
-access was about 7x faster than invoking a trivial getter. Since
-Gingerbread, though, the JIT inlines trivial getter methods, making
-that particular optimization obsolete. Manual inlining guided by
-profiling can still be a useful technique in general, though.</a>
-
-<p>Note that if you're using ProGuard, you can have the best
-of both worlds even with non-trival accessors, because ProGuard can inline
-for you.</p>
-
-<a name="use_final" id="use_final"></a>
-<h2>Use Static Final For Constants</h2>
-
-<p>Consider the following declaration at the top of a class:</p>
-
-<pre>static int intVal = 42;
-static String strVal = "Hello, world!";</pre>
-
-<p>The compiler generates a class initializer method, called
-<code><clinit></code>, that is executed when the class is first used.
-The method stores the value 42 into <code>intVal</code>, and extracts a
-reference from the classfile string constant table for <code>strVal</code>.
-When these values are referenced later on, they are accessed with field
-lookups.</p>
-
-<p>We can improve matters with the "final" keyword:</p>
-
-<pre>static final int intVal = 42;
-static final String strVal = "Hello, world!";</pre>
-
-<p>The class no longer requires a <code><clinit></code> method,
-because the constants go into static field initializers in the dex file.
-Code that refers to <code>intVal</code> will use
-the integer value 42 directly, and accesses to <code>strVal</code> will
-use a relatively inexpensive "string constant" instruction instead of a
-field lookup. (Note that this optimization only applies to primitive types and
-<code>String</code> constants, not arbitrary reference types. Still, it's good
-practice to declare constants <code>static final</code> whenever possible.)</p>
-
-<a name="foreach" id="foreach"></a>
-<h2>Use Enhanced For Loop Syntax</h2>
-
-<p>The enhanced for loop (also sometimes known as "for-each" loop) can be used
-for collections that implement the Iterable interface and for arrays.
-With collections, an iterator is allocated to make interface calls
-to hasNext() and next(). With an ArrayList, a hand-written counted loop is
-about 3x faster (with or without JIT), but for other collections the enhanced
-for loop syntax will be exactly equivalent to explicit iterator usage.</p>
-
-<p>There are several alternatives for iterating through an array:</p>
-
-<pre> static class Foo {
- int mSplat;
- }
- Foo[] mArray = ...
-
- public void zero() {
- int sum = 0;
- for (int i = 0; i < mArray.length; ++i) {
- sum += mArray[i].mSplat;
- }
- }
-
- public void one() {
- int sum = 0;
- Foo[] localArray = mArray;
- int len = localArray.length;
-
- for (int i = 0; i < len; ++i) {
- sum += localArray[i].mSplat;
- }
- }
-
- public void two() {
- int sum = 0;
- for (Foo a : mArray) {
- sum += a.mSplat;
- }
- }
-</pre>
-
-<p><strong>zero()</strong> is slowest, because the JIT can't yet optimize away
-the cost of getting the array length once for every iteration through the
-loop.</p>
-
-<p><strong>one()</strong> is faster. It pulls everything out into local
-variables, avoiding the lookups. Only the array length offers a performance
-benefit.</p>
-
-<p><strong>two()</strong> is fastest for devices without a JIT, and
-indistinguishable from <strong>one()</strong> for devices with a JIT.
-It uses the enhanced for loop syntax introduced in version 1.5 of the Java
-programming language.</p>
-
-<p>To summarize: use the enhanced for loop by default, but consider a
-hand-written counted loop for performance-critical ArrayList iteration.</p>
-
-<p>(See also <em>Effective Java</em> item 46.)</p>
-
-<a name="package_inner" id="package_inner"></a>
-<h2>Consider Package Instead of Private Access with Private Inner Classes</h2>
-
-<p>Consider the following class definition:</p>
-
-<pre>public class Foo {
- private class Inner {
- void stuff() {
- Foo.this.doStuff(Foo.this.mValue);
- }
- }
-
- private int mValue;
-
- public void run() {
- Inner in = new Inner();
- mValue = 27;
- in.stuff();
- }
-
- private void doStuff(int value) {
- System.out.println("Value is " + value);
- }
-}</pre>
-
-<p>The key things to note here are that we define a private inner class
-(<code>Foo$Inner</code>) that directly accesses a private method and a private
-instance field in the outer class. This is legal, and the code prints "Value is
-27" as expected.</p>
-
-<p>The problem is that the VM considers direct access to <code>Foo</code>'s
-private members from <code>Foo$Inner</code> to be illegal because
-<code>Foo</code> and <code>Foo$Inner</code> are different classes, even though
-the Java language allows an inner class to access an outer class' private
-members. To bridge the gap, the compiler generates a couple of synthetic
-methods:</p>
-
-<pre>/*package*/ static int Foo.access$100(Foo foo) {
- return foo.mValue;
-}
-/*package*/ static void Foo.access$200(Foo foo, int value) {
- foo.doStuff(value);
-}</pre>
-
-<p>The inner class code calls these static methods whenever it needs to
-access the <code>mValue</code> field or invoke the <code>doStuff</code> method
-in the outer class. What this means is that the code above really boils down to
-a case where you're accessing member fields through accessor methods.
-Earlier we talked about how accessors are slower than direct field
-accesses, so this is an example of a certain language idiom resulting in an
-"invisible" performance hit.</p>
-
-<p>If you're using code like this in a performance hotspot, you can avoid the
-overhead by declaring fields and methods accessed by inner classes to have
-package access, rather than private access. Unfortunately this means the fields
-can be accessed directly by other classes in the same package, so you shouldn't
-use this in public API.</p>
-
-<a name="avoidfloat" id="avoidfloat"></a>
-<h2>Use Floating-Point Judiciously</h2>
-
-<p>As a rule of thumb, floating-point is about 2x slower than integer on
-Android devices. This is true on a FPU-less, JIT-less G1 and a Nexus One with
-an FPU and the JIT. (Of course, absolute speed difference between those two
-devices is about 10x for arithmetic operations.)</p>
-
-<p>In speed terms, there's no difference between <code>float</code> and
-<code>double</code> on the more modern hardware. Space-wise, <code>double</code>
-is 2x larger. As with desktop machines, assuming space isn't an issue, you
-should prefer <code>double</code> to <code>float</code>.</p>
-
-<p>Also, even for integers, some chips have hardware multiply but lack
-hardware divide. In such cases, integer division and modulus operations are
-performed in software — something to think about if you're designing a
-hash table or doing lots of math.</p>
-
-<a name="library" id="library"></a>
-<h2>Know And Use The Libraries</h2>
-
-<p>In addition to all the usual reasons to prefer library code over rolling
-your own, bear in mind that the system is at liberty to replace calls
-to library methods with hand-coded assembler, which may be better than the
-best code the JIT can produce for the equivalent Java. The typical example
-here is <code>String.indexOf</code> and friends, which Dalvik replaces with
-an inlined intrinsic. Similarly, the <code>System.arraycopy</code> method
-is about 9x faster than a hand-coded loop on a Nexus One with the JIT.</p>
-
-<p>(See also <em>Effective Java</em> item 47.)</p>
-
-<a name="native_methods" id="native_methods"></a>
-<h2>Use Native Methods Judiciously</h2>
-
-<p>Native code isn't necessarily more efficient than Java. For one thing,
-there's a cost associated with the Java-native transition, and the JIT can't
-optimize across these boundaries. If you're allocating native resources (memory
-on the native heap, file descriptors, or whatever), it can be significantly
-more difficult to arrange timely collection of these resources. You also
-need to compile your code for each architecture you wish to run on (rather
-than rely on it having a JIT). You may even have to compile multiple versions
-for what you consider the same architecture: native code compiled for the ARM
-processor in the G1 can't take full advantage of the ARM in the Nexus One, and
-code compiled for the ARM in the Nexus One won't run on the ARM in the G1.</p>
-
-<p>Native code is primarily useful when you have an existing native codebase
-that you want to port to Android, not for "speeding up" parts of a Java app.</p>
-
-<p>If you do need to use native code, you should read our
-<a href="{@docRoot}guide/practices/jni.html">JNI Tips</a>.</p>
-
-<p>(See also <em>Effective Java</em> item 54.)</p>
-
-<a name="closing_notes" id="closing_notes"></a>
-<h2>Closing Notes</h2>
-
-<p>One last thing: always measure. Before you start optimizing, make sure you
-have a problem. Make sure you can accurately measure your existing performance,
-or you won't be able to measure the benefit of the alternatives you try.</p>
-
-<p>Every claim made in this document is backed up by a benchmark. The source
-to these benchmarks can be found in the <a href="http://code.google.com/p/dalvik/source/browse/#svn/trunk/benchmarks">code.google.com "dalvik" project</a>.</p>
-
-<p>The benchmarks are built with the
-<a href="http://code.google.com/p/caliper/">Caliper</a> microbenchmarking
-framework for Java. Microbenchmarks are hard to get right, so Caliper goes out
-of its way to do the hard work for you, and even detect some cases where you're
-not measuring what you think you're measuring (because, say, the VM has
-managed to optimize all your code away). We highly recommend you use Caliper
-to run your own microbenchmarks.</p>
-
-<p>You may also find
-<a href="{@docRoot}tools/debugging/debugging-tracing.html">Traceview</a> useful
-for profiling, but it's important to realize that it currently disables the JIT,
-which may cause it to misattribute time to code that the JIT may be able to win
-back. It's especially important after making changes suggested by Traceview
-data to ensure that the resulting code actually runs faster when run without
-Traceview.
diff --git a/docs/html/guide/practices/responsiveness.jd b/docs/html/guide/practices/responsiveness.jd
deleted file mode 100644
index a00e3aa..0000000
--- a/docs/html/guide/practices/responsiveness.jd
+++ /dev/null
@@ -1,140 +0,0 @@
-page.title=Designing for Responsiveness
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-
-<h2>In this document</h2>
-<ol>
- <li><a href="#anr">What Triggers ANR?</a></li>
- <li><a href="#avoiding">How to Avoid ANR</a></li>
- <li><a href="#reinforcing">Reinforcing Responsiveness</a></li>
-</ol>
-
-</div>
-</div>
-
-<div class="figure">
-<img src="{@docRoot}images/anr.png" alt="Screenshot of ANR dialog box" width="240" height="320"/>
-<p><strong>Figure 1.</strong> An ANR dialog displayed to the user.</p>
-</div>
-
-<p>It's possible to write code that wins every performance test in the world,
-but still sends users in a fiery rage when they try to use the application.
-These are the applications that aren't <em>responsive</em> enough — the
-ones that feel sluggish, hang or freeze for significant periods, or take too
-long to process input. </p>
-
-<p>In Android, the system guards against applications that are insufficiently
-responsive for a period of time by displaying a dialog to the user, called the
-Application Not Responding (ANR) dialog, shown at right in Figure 1. The user
-can choose to let the application continue, but the user won't appreciate having
-to act on this dialog every time he or she uses your application. It's critical
-to design responsiveness into your application, so that the system never has
-cause to display an ANR dialog to the user. </p>
-
-<p>Generally, the system displays an ANR if an application cannot respond to
-user input. For example, if an application blocks on some I/O operation
-(frequently a network access), then the main application thread won't be able to
-process incoming user input events. After a time, the system concludes that the
-application is frozen, and displays the ANR to give the user the option to kill
-it. </p>
-
-<p>Similarly, if your application spends too much time building an elaborate in-memory
-structure, or perhaps computing the next move in a game, the system will
-conclude that your application has hung. It's always important to make
-sure these computations are efficient using the techniques above, but even the
-most efficient code still takes time to run.</p>
-
-<p>In both of these cases, the recommended approach is to create a child thread and do
-most of your work there. This keeps the main thread (which drives the user
-interface event loop) running and prevents the system from concluding that your code
-has frozen. Since such threading usually is accomplished at the class
-level, you can think of responsiveness as a <em>class</em> problem. (Compare
-this with basic performance, which was described above as a <em>method</em>-level
-concern.)</p>
-
-<p>This document describes how the Android system determines whether an
-application is not responding and provides guidelines for ensuring that your
-application stays responsive. </p>
-
-<h2 id="anr">What Triggers ANR?</h2>
-
-<p>In Android, application responsiveness is monitored by the Activity Manager
-and Window Manager system services. Android will display the ANR dialog
-for a particular application when it detects one of the following
-conditions:</p>
-<ul>
- <li>No response to an input event (e.g. key press, screen touch)
- within 5 seconds</li>
- <li>A {@link android.content.BroadcastReceiver BroadcastReceiver}
- hasn't finished executing within 10 seconds</li>
-</ul>
-
-<h2 id="avoiding">How to Avoid ANR</h2>
-
-<p>Given the above definition for ANR, let's examine why this can occur in
-Android applications and how best to structure your application to avoid ANR.</p>
-
-<p>Android applications normally run entirely on a single (i.e. main) thread.
-This means that anything your application is doing in the main thread that
-takes a long time to complete can trigger the ANR dialog because your
-application is not giving itself a chance to handle the input event or Intent
-broadcast.</p>
-
-<p>Therefore any method that runs in the main thread should do as little work
-as possible. In particular, Activities should do as little as possible to set
-up in key life-cycle methods such as <code>onCreate()</code> and
-<code>onResume()</code>. Potentially long running operations such as network
-or database operations, or computationally expensive calculations such as
-resizing bitmaps should be done in a child thread (or in the case of databases
-operations, via an asynchronous request). However, this does not mean that
-your main thread should block while waiting for the child thread to
-complete — nor should you call <code>Thread.wait()</code> or
-<code>Thread.sleep()</code>. Instead of blocking while waiting for a child
-thread to complete, your main thread should provide a {@link
-android.os.Handler Handler} for child threads to post back to upon completion.
-Designing your application in this way will allow your main thread to remain
-responsive to input and thus avoid ANR dialogs caused by the 5 second input
-event timeout. These same practices should be followed for any other threads
-that display UI, as they are also subject to the same timeouts.</p>
-
-<p>You can use {@link android.os.StrictMode} to help find potentially
-long running operations such as network or database operations that
-you might accidentally be doing your main thread.</p>
-
-<p>The specific constraint on IntentReceiver execution time emphasizes what
-they were meant to do: small, discrete amounts of work in the background such
-as saving a setting or registering a Notification. So as with other methods
-called in the main thread, applications should avoid potentially long-running
-operations or calculations in BroadcastReceivers. But instead of doing intensive
-tasks via child threads (as the life of a BroadcastReceiver is short), your
-application should start a {@link android.app.Service Service} if a
-potentially long running action needs to be taken in response to an Intent
-broadcast. As a side note, you should also avoid starting an Activity from an
-Intent Receiver, as it will spawn a new screen that will steal focus from
-whatever application the user is currently has running. If your application
-has something to show the user in response to an Intent broadcast, it should
-do so using the {@link android.app.NotificationManager Notification
-Manager}.</p>
-
-<h2 id="reinforcing">Reinforcing Responsiveness</h2>
-
-<p>Generally, 100 to 200ms is the threshold beyond which users will perceive
-lag (or lack of "snappiness," if you will) in an application. As such, here
-are some additional tips beyond what you should do to avoid ANR that will help
-make your application seem responsive to users.</p>
-
-<ul>
- <li>If your application is doing work in the background in response to
- user input, show that progress is being made ({@link
- android.widget.ProgressBar ProgressBar} and {@link
- android.app.ProgressDialog ProgressDialog} are useful for this).</li>
- <li>For games specifically, do calculations for moves in a child
- thread.</li>
- <li>If your application has a time-consuming initial setup phase, consider
- showing a splash screen or rendering the main view as quickly as possible
- and filling in the information asynchronously. In either case, you should
- indicate somehow that progress is being made, lest the user perceive that
- the application is frozen.</li>
-</ul>
diff --git a/docs/html/guide/practices/security.jd b/docs/html/guide/practices/security.jd
deleted file mode 100644
index 36eeff8..0000000
--- a/docs/html/guide/practices/security.jd
+++ /dev/null
@@ -1,767 +0,0 @@
-page.title=Designing for Security
-@jd:body
-
-<div id="qv-wrapper">
-<div id="qv">
-<h2>In this document</h2>
-<ol>
-<li><a href="#Dalvik">Using Dalvik Code</a></li>
-<li><a href="#Native">Using Native Code</a></li>
-<li><a href="#Data">Storing Data</a></li>
-<li><a href="#IPC">Using IPC</a></li>
-<li><a href="#Permissions">Using Permissions</a></li>
-<li><a href="#Networking">Using Networking</a></li>
-<li><a href="#DynamicCode">Dynamically Loading Code</a></li>
-<li><a href="#Input">Performing Input Validation</a></li>
-<li><a href="#UserData">Handling User Data</a></li>
-<li><a href="#Crypto">Using Cryptography</a></li>
-</ol>
-<h2>See also</h2>
-<ol>
-<li><a href="http://source.android.com/tech/security/index.html">Android
-Security Overview</a></li>
-<li><a href="{@docRoot}guide/topics/security/permissions.html">Permissions</a></li>
-</ol>
-</div></div>
-<p>Android was designed so that most developers will be able to build
-applications using the default settings and not be confronted with difficult
-decisions about security. Android also has a number of security features built
-into the operating system that significantly reduce the frequency and impact of
-application security issues.</p>
-
-<p>Some of the security features that help developers build secure applications
-include:
-<ul>
-<li>The Android Application Sandbox that isolates data and code execution on a
-per-application basis.</li>
-<li>Android application framework with robust implementations of common
-security functionality such as cryptography, permissions, and secure IPC.</li>
-<li>Technologies like ASLR, NX, ProPolice, safe_iop, OpenBSD dlmalloc, OpenBSD
-calloc, and Linux mmap_min_addr to mitigate risks associated with common memory
-management errors</li>
-<li>An encrypted filesystem that can be enabled to protect data on lost or
-stolen devices.</li>
-</ul></p>
-
-<p>Nevertheless, it is important for developers to be familiar with Android
-security best practices to make sure they take advantage of these capabilities
-and to reduce the likelihood of inadvertently introducing security issues that
-can affect their applications.</p>
-
-<p>This document is organized around common APIs and development techniques
-that can have security implications for your application and its users. As
-these best practices are constantly evolving, we recommend you check back
-occasionally throughout your application development process.</p>
-
-<a name="Dalvik"></a>
-<h2>Using Dalvik Code</h2>
-<p>Writing secure code that runs in virtual machines is a well-studied topic
-and many of the issues are not specific to Android. Rather than attempting to
-rehash these topics, we’d recommend that you familiarize yourself with the
-existing literature. Two of the more popular resources are:
-<ul>
-<li><a href="http://www.securingjava.com/toc.html">
-http://www.securingjava.com/toc.html</a></li>
-<li><a
-href="https://www.owasp.org/index.php/Java_Security_Resources">
-https://www.owasp.org/index.php/Java_Security_Resources</a></li>
-</ul></p>
-
-<p>This document is focused on the areas which are Android specific and/or
-different from other environments. For developers experienced with VM
-programming in other environments, there are two broad issues that may be
-different about writing apps for Android:
-<ul>
-<li>Some virtual machines, such as the JVM or .net runtime, act as a security
-boundary, isolating code from the underlying operating system capabilities. On
-Android, the Dalvik VM is not a security boundary -- the application sandbox is
-implemented at the OS level, so Dalvik can interoperate with native code in the
-same application without any security constraints.</li>
-<li>Given the limited storage on mobile devices, it’s common for developers
-to want to build modular applications and use dynamic class loading. When
-doing this consider both the source where you retrieve your application logic
-and where you store it locally. Do not use dynamic class loading from sources
-that are not verified, such as unsecured network sources or external storage,
-since that code can be modified to include malicious behavior.</li>
-</ul></p>
-
-<a name="Native"></a>
-<h2>Using Native Code</h2>
-
-<p>In general, we encourage developers to use the Android SDK for most
-application development, rather than using native code. Applications built
-with native code are more complex, less portable, and more like to include
-common memory corruption errors such as buffer overflows.</p>
-
-<p>Android is built using the Linux kernel and being familiar with Linux
-development security best practices is especially useful if you are going to
-use native code. This document is too short to discuss all of those best
-practices, but one of the most popular resources is “Secure Programming for
-Linux and Unix HOWTO”, available at <a
-href="http://www.dwheeler.com/secure-programs">
-http://www.dwheeler.com/secure-programs</a>.</p>
-
-<p>An important difference between Android and most Linux environments is the
-Application Sandbox. On Android, all applications run in the Application
-Sandbox, including those written with native code. At the most basic level, a
-good way to think about it for developers familiar with Linux is to know that
-every application is given a unique UID with very limited permissions. This is
-discussed in more detail in the <a
-href="http://source.android.com/tech/security/index.html">Android Security
-Overview</a> and you should be familiar with application permissions even if
-you are using native code.</p>
-
-<a name="Data"></a>
-<h2>Storing Data</h2>
-
-<h3>Using internal files</h3>
-
-<p>By default, files created on <a
-href="{@docRoot}guide/topics/data/data-storage.html#filesInternal">internal
-storage</a> are only accessible to the application that created the file. This
-protection is implemented by Android and is sufficient for most
-applications.</p>
-
-<p>Use of <a
-href="{@docRoot}reference/android/content/Context.html#MODE_WORLD_WRITEABLE">
-world writable</a> or <a
-href="{@docRoot}reference/android/content/Context.html#MODE_WORLD_READABLE">world
-readable</a> files for IPC is discouraged because it does not provide
-the ability to limit data access to particular applications, nor does it
-provide any control on data format. As an alternative, you might consider using
-a ContentProvider which provides read and write permissions, and can make
-dynamic permission grants on a case-by-case basis.</p>
-
-<p>To provide additional protection for sensitive data, some applications
-choose to encrypt local files using a key that is not accessible to the
-application. (For example, a key can be placed in a {@link java.security.KeyStore}
-and protected with a user password that is not stored on the device). While this
-does not protect data from a root compromise that can monitor the user
-inputting the password, it can provide protection for a lost device without <a
-href="http://source.android.com/tech/encryption/index.html">file system
-encryption</a>.</p>
-
-<h3>Using external storage</h3>
-
-<p>Files created on <a
-href="{@docRoot}guide/topics/data/data-storage.html#filesExternal">external
-storage</a>, such as SD Cards, are globally readable and writable. Since
-external storage can be removed by the user and also modified by any
-application, applications should not store sensitive information using
-external storage.</p>
-
-<p>As with data from any untrusted source, applications should perform input
-validation when handling data from external storage (see Input Validation
-section). We strongly recommend that applications not store executables or
-class files on external storage prior to dynamic loading. If an application
-does retrieve executable files from external storage they should be signed and
-cryptographically verified prior to dynamic loading.</p>
-
-<h3>Using content providers</h3>
-
-<p>ContentProviders provide a structured storage mechanism that can be limited
-to your own application, or exported to allow access by other applications. By
-default, a <code>
-<a href="{@docRoot}reference/android/content/ContentProvider.html">
-ContentProvider</a></code> is
-<a href="{@docRoot}guide/topics/manifest/provider-element.html#exported">exported
-</a> for use by other applications. If you do not intend to provide other
-applications with access to your<code>
-<a href="{@docRoot}reference/android/content/ContentProvider.html">
-ContentProvider</a></code>, mark them as <code><a
-href="{@docRoot}guide/topics/manifest/provider-element.html#exported">
-android:exported=false</a></code> in the application manifest.</p>
-
-<p>When creating a <code>
-<a href="{@docRoot}reference/android/content/ContentProvider.html">ContentProvider
-</a></code> that will be exported for use by other applications, you can specify
-a single
-<a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission
-</a> for reading and writing, or distinct permissions for reading and writing
-within the manifest. We recommend that you limit your permissions to those
-required to accomplish the task at hand. Keep in mind that it’s usually
-easier to add permissions later to expose new functionality than it is to take
-them away and break existing users.</p>
-
-<p>If you are using a <code>
-<a href="{@docRoot}reference/android/content/ContentProvider.html">
-ContentProvider</a></code> for sharing data between applications built by the
-same developer, it is preferable to use
-<a href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">signature
-level permissions</a>. Signature permissions do not require user confirmation,
-so they provide a better user experience and more controlled access to the
-<code>
-<a href="{@docRoot}reference/android/content/ContentProvider.html">
-ContentProvider</a></code>.</p>
-
-<p>ContentProviders can also provide more granular access by declaring the <a
-href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">
-grantUriPermissions</a> element and using the <code><a
-href="{@docRoot}reference/android/content/Intent.html#FLAG_GRANT_READ_URI_PERMISSION">FLAG_GRANT_READ_URI_PERMISSION</a></code>
-and <code><a
-href="{@docRoot}reference/android/content/Intent.html#FLAG_GRANT_WRITE_URI_PERMISSION">FLAG_GRANT_WRITE_URI_PERMISSION</a></code>
-flags in the Intent object
-that activates the component. The scope of these permissions can be further
-limited by the <code><a
-href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">
-grant-uri-permission element</a></code>.</p>
-
-<p>When accessing a <code>
-<a href="{@docRoot}reference/android/content/ContentProvider.html">
-ContentProvider</a></code>, use parameterized query methods such as <code>
-<a href="{@docRoot}reference/android/content/ContentProvider.html#query(android.net.Uri,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lang.String)">query()</a></code>, <code><a
-href="{@docRoot}reference/android/content/ContentProvider.html#update(android.net.Uri,%20android.content.ContentValues,%20java.lang.String,%20java.lang.String[])">update()</a></code>, and <code><a
-href="{@docRoot}reference/android/content/ContentProvider.html#delete(android.net.Uri,%20java.lang.String,%20java.lang.String[])">delete()</a></code> to avoid
-potential <a href="http://en.wikipedia.org/wiki/SQL_injection">SQL
-Injection</a> from untrusted data. Note that using parameterized methods is not
-sufficient if the <code>selection</code> is built by concatenating user data
-prior to submitting it to the method.</p>
-
-<p>Do not have a false sense of security about the write permission. Consider
-that the write permission allows SQL statements which make it possible for some
-data to be confirmed using creative <code>WHERE</code> clauses and parsing the
-results. For example, an attacker might probe for presence of a specific phone
-number in a call-log by modifying a row only if that phone number already
-exists. If the content provider data has predictable structure, the write
-permission may be equivalent to providing both reading and writing.</p>
-
-<a name="IPC"></a>
-<h2>Using Interprocess Communication (IPC)</h2>
-
-<p>Some Android applications attempt to implement IPC using traditional Linux
-techniques such as network sockets and shared files. We strongly encourage the
-use of Android system functionality for IPC such as Intents, Binders, Services,
-and Receivers. The Android IPC mechanisms allow you to verify the identity of
-the application connecting to your IPC and set security policy for each IPC
-mechanism.</p>
-
-<p>Many of the security elements are shared across IPC mechanisms. <a
-href="{@docRoot}reference/android/content/BroadcastReceiver.html">
-Broadcast Receivers</a>, <a
-href="{@docRoot}reference/android/R.styleable.html#AndroidManifestActivity">
-Activities</a>, and <a
-href="{@docRoot}reference/android/R.styleable.html#AndroidManifestService">
-Services</a> are all declared in the application manifest. If your IPC mechanism is
-not intended for use by other applications, set the <a
-href="{@docRoot}guide/topics/manifest/service-element.html#exported">{@code android:exported}</a>
-property to false. This is useful for applications that consist of multiple processes
-within the same UID, or if you decide late in development that you do not
-actually want to expose functionality as IPC but you don’t want to rewrite
-the code.</p>
-
-<p>If your IPC is intended to be accessible to other applications, you can
-apply a security policy by using the <a
-href="{@docRoot}reference/android/R.styleable.html#AndroidManifestPermission">
-Permission</a> tag. If IPC is between applications built by the same developer,
-it is preferable to use <a
-href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">signature
-level permissions</a>. Signature permissions do not require user confirmation,
-so they provide a better user experience and more controlled access to the IPC
-mechanism.</p>
-
-<p>One area that can introduce confusion is the use of intent filters. Note
-that Intent filters should not be considered a security feature -- components
-can be invoked directly and may not have data that would conform to the intent
-filter. You should perform input validation within your intent receiver to
-confirm that it is properly formatted for the invoked receiver, service, or
-activity.</p>
-
-<h3>Using intents</h3>
-
-<p>Intents are the preferred mechanism for asynchronous IPC in Android.
-Depending on your application requirements, you might use <code><a
-href="{@docRoot}reference/android/content/Context.html#sendBroadcast(android.content.Intent)">sendBroadcast()</a></code>,
-<code><a
-href="{@docRoot}reference/android/content/Context.html#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)">sendOrderedBroadcast()</a></code>,
-or direct an intent to a specific application component.</p>
-
-<p>Note that ordered broadcasts can be “consumed” by a recipient, so they
-may not be delivered to all applications. If you are sending an Intent where
-delivery to a specific receiver is required, the intent must be delivered
-directly to the receiver.</p>
-
-<p>Senders of an intent can verify that the recipient has a permission
-specifying a non-Null Permission upon sending. Only applications with that
-Permission will receive the intent. If data within a broadcast intent may be
-sensitive, you should consider applying a permission to make sure that
-malicious applications cannot register to receive those messages without
-appropriate permissions. In those circumstances, you may also consider
-invoking the receiver directly, rather than raising a broadcast.</p>
-
-<h3>Using binder and AIDL interfaces</h3>
-
-<p><a href="{@docRoot}reference/android/os/Binder.html">Binders</a> are the
-preferred mechanism for RPC-style IPC in Android. They provide a well-defined
-interface that enables mutual authentication of the endpoints, if required.</p>
-
-<p>We strongly encourage designing interfaces in a manner that does not require
-interface specific permission checks. Binders are not declared within the
-application manifest, and therefore you cannot apply declarative permissions
-directly to a Binder. Binders generally inherit permissions declared in the
-application manifest for the Service or Activity within which they are
-implemented. If you are creating an interface that requires authentication
-and/or access controls on a specific binder interface, those controls must be
-explicitly added as code in the interface.</p>
-
-<p>If providing an interface that does require access controls, use <code><a
-href="{@docRoot}reference/android/content/Context.html#checkCallingPermission(java.lang.String)">checkCallingPermission()</a></code>
-to verify whether the
-caller of the Binder has a required permission. This is especially important
-before accessing a Service on behalf of the caller, as the identify of your
-application is passed to other interfaces. If invoking an interface provided
-by a Service, the <code><a
-href="{@docRoot}reference/android/content/Context.html#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)">bindService()</a></code>
- invocation may fail if you do not have permission to access the given Service.
- If calling an interface provided locally by your own application, it may be
-useful to use the <code><a
-href="{@docRoot}reference/android/os/Binder.html#clearCallingIdentity()">
-clearCallingIdentity()</a></code> to satisfy internal security checks.</p>
-
-<h3>Using broadcast receivers</h3>
-
-<p>Broadcast receivers are used to handle asynchronous requests initiated via
-an intent.</p>
-
-<p>By default, receivers are exported and can be invoked by any other
-application. If your <code><a
-href="{@docRoot}reference/android/content/BroadcastReceiver.html">
-BroadcastReceivers</a></code> is intended for use by other applications, you
-may want to apply security permissions to receivers using the <code><a
-href="{@docRoot}guide/topics/manifest/receiver-element.html">
-<receiver></a></code> element within the application manifest. This will
-prevent applications without appropriate permissions from sending an intent to
-the <code><a
-href="{@docRoot}reference/android/content/BroadcastReceiver.html">
-BroadcastReceivers</a></code>.</p>
-
-<h3>Using Services</h3>
-
-<p>Services are often used to supply functionality for other applications to
-use. Each service class must have a corresponding <service> declaration in its
-package's AndroidManifest.xml.</p>
-
-<p>By default, Services are exported and can be invoked by any other
-application. Services can be protected using the <a
-href="{@docRoot}guide/topics/manifest/service-element.html#prmsn">{@code android:permission}</a>
-attribute
-within the manifest’s <code><a
-href="{@docRoot}guide/topics/manifest/service-element.html">
-<service></a></code> tag. By doing so, other applications will need to declare
-a corresponding <code><a
-href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a>
-</code> element in their own manifest to be
-able to start, stop, or bind to the service.</p>
-
-<p>A Service can protect individual IPC calls into it with permissions, by
-calling <code><a
-href="{@docRoot}reference/android/content/Context.html#checkCallingPermission(java.lang.String)">checkCallingPermission()</a></code>
-before executing
-the implementation of that call. We generally recommend using the
-declarative permissions in the manifest, since those are less prone to
-oversight.</p>
-
-<h3>Using Activities</h3>
-
-<p>Activities are most often used for providing the core user-facing
-functionality of an application. By default, Activities are exported and
-invokable by other applications only if they have an intent filter or binder
-declared. In general, we recommend that you specifically declare a Receiver or
-Service to handle IPC, since this modular approach reduces the risk of exposing
-functionality that is not intended for use by other applications.</p>
-
-<p>If you do expose an Activity for purposes of IPC, the <code><a
-href="{@docRoot}guide/topics/manifest/activity-element.html#prmsn">android:permission</a></code>
-attribute in the <code><a
-href="{@docRoot}guide/topics/manifest/activity-element.html">
-<activity></a></code> declaration in the application manifest can be used to
-restrict access to only those applications which have the stated
-permissions.</p>
-
-<a name="Permissions"></a>
-<h2>Using Permissions</h2>
-
-<h3>Requesting Permissions</h3>
-
-<p>We recommend minimizing the number of permissions requested by an
-application. Not having access to sensitive permissions reduces the risk of
-inadvertently misusing those permissions, can improve user adoption, and makes
-applications less attractive targets for attackers.</p>
-
-<p>If it is possible to design your application in a way that does not require
-a permission, that is preferable. For example, rather than requesting access
-to device information to create an identifier, create a <a
-href="{@docRoot}reference/java/util/UUID.html">GUID</a> for your application.
-(This specific example is also discussed in Handling User Data) Or, rather than
-using external storage, store data in your application directory.</p>
-
-<p>If a permission is not required, do not request it. This sounds simple, but
-there has been quite a bit of research into the frequency of over-requesting
-permissions. If you’re interested in the subject you might start with this
-research paper published by U.C. Berkeley: <a
-href="http://www.eecs.berkeley.edu/Pubs/TechRpts/2011/EECS-2011-48.pdf">
-http://www.eecs.berkeley.edu/Pubs/TechRpts/2011/EECS-2011-48.pdf</a></p>
-
-<p>In addition to requesting permissions, your application can use <a
-href="{@docRoot}guide/topics/manifest/permission-element.html">permissions</a>
-to protect IPC that is security sensitive and will be exposed to other
-applications -- such as a <code><a
-href="{@docRoot}reference/android/content/ContentProvider.html">
-ContentProvider</a></code>. In general, we recommend using access controls
-other than user confirmed permissions where possible since permissions can
-be confusing for users. For example, consider using the <a
-href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">signature
-protection level</a> on permissions for IPC communication between applications
-provided by a single developer.</p>
-
-<p>Do not cause permission re-delegation. This occurs when an app exposes data
-over IPC that is only available because it has a specific permission, but does
-not require that permission of any clients of it’s IPC interface. More
-details on the potential impacts, and frequency of this type of problem is
-provided in this research paper published at USENIX: <a
-href="http://www.cs.berkeley.edu/~afelt/felt_usenixsec2011.pdf">http://www.cs.be
-rkeley.edu/~afelt/felt_usenixsec2011.pdf</a></p>
-
-<h3>Creating Permissions</h3>
-
-<p>Generally, you should strive to create as few permissions as possible while
-satisfying your security requirements. Creating a new permission is relatively
-uncommon for most applications, since <a
-href="{@docRoot}reference/android/Manifest.permission.html">system-defined
-permissions</a> cover many situations. Where appropriate,
-perform access checks using existing permissions.</p>
-
-<p>If you must create a new permission, consider whether you can accomplish
-your task with a Signature permission. Signature permissions are transparent
-to the user and only allow access by applications signed by the same developer
-as application performing the permission check. If you create a Dangerous
-permission, then the user needs to decide whether to install the application.
-This can be confusing for other developers, as well as for users.</p>
-
-<p>If you create a Dangerous permission, there are a number of complexities
-that you need to consider.
-<ul>
-<li>The permission must have a string that concisely expresses to a user the
-security decision they will be required to make.</li>
-<li>The permission string must be localized to many different languages.</li>
-<li>Uses may choose not to install an application because a permission is
-confusing or perceived as risky.</li>
-<li>Applications may request the permission when the creator of the permission
-has not been installed.</li>
-</ul></p>
-
-<p>Each of these poses a significant non-technical challenge for an application
-developer, which is why we discourage the use of Dangerous permission.</p>
-
-<a name="Networking"></a>
-<h2>Using Networking</h2>
-
-<h3>Using IP Networking</h3>
-
-<p>Networking on Android is not significantly different from Linux
-environments. The key consideration is making sure that appropriate protocols
-are used for sensitive data, such as <a
-href="{@docRoot}reference/javax/net/ssl/HttpsURLConnection.html">HTTPS</a> for
-web traffic. We prefer use of HTTPS over HTTP anywhere that HTTPS is
-supported on the server, since mobile devices frequently connect on networks
-that are not secured, such as public WiFi hotspots.</p>
-
-<p>Authenticated, encrypted socket-level communication can be easily
-implemented using the <code><a
-href="{@docRoot}reference/javax/net/ssl/SSLSocket.html">SSLSocket</a></code>
-class. Given the frequency with which Android devices connect to unsecured
-wireless networks using WiFi, the use of secure networking is strongly
-encouraged for all applications.</p>
-
-<p>We have seen some applications use <a
-href="http://en.wikipedia.org/wiki/Localhost">localhost</a> network ports for
-handling sensitive IPC. We discourage this approach since these interfaces are
-accessible by other applications on the device. Instead, use an Android IPC
-mechanism where authentication is possible such as a Service and Binder. (Even
-worse than using loopback is to bind to INADDR_ANY since then your application
-may receive requests from anywhere. We’ve seen that, too.)</p>
-
-<p>Also, one common issue that warrants repeating is to make sure that you do
-not trust data downloaded from HTTP or other insecure protocols. This includes
-validation of input in <code><a
-href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code> and
-any responses to intents issued against HTTP.</p>
-
-<h3>Using Telephony Networking</h3>
-
-<p>SMS is the telephony protocol most frequently used by Android developers.
-Developers should keep in mind that this protocol was primarily designed for
-user-to-user communication and is not well-suited for some application
-purposes. Due to the limitations of SMS, we strongly recommend the use of <a
-href="http://code.google.com/android/c2dm/">C2DM</a> and IP networking for
-sending data messages to devices.</p>
-
-<p>Many developers do not realize that SMS is not encrypted or strongly
-authenticated on the network or on the device. In particular, any SMS receiver
-should expect that a malicious user may have sent the SMS to your application
--- do not rely on unauthenticated SMS data to perform sensitive commands.
-Also, you should be aware that SMS may be subject to spoofing and/or
-interception on the network. On the Android-powered device itself, SMS
-messages are transmitted as Broadcast intents, so they may be read or captured
-by other applications that have the READ_SMS permission.</p>
-
-<a name="DynamicCode"></a>
-<h2>Dynamically Loading Code</h2>
-
-<p>We strongly discourage loading code from outside of the application APK.
-Doing so significantly increases the likelihood of application compromise due
-to code injection or code tampering. It also adds complexity around version
-management and application testing. Finally, it can make it impossible to
-verify the behavior of an application, so it may be prohibited in some
-environments.</p>
-
-<p>If your application does dynamically load code, the most important thing to
-keep in mind about dynamically loaded code is that it runs with the same
-security permissions as the application APK. The user made a decision to
-install your application based on your identity, and they are expecting that
-you provide any code run within the application, including code that is
-dynamically loaded.</p>
-
-<p>The major security risk associated with dynamically loading code is that the
-code needs to come from a verifiable source. If the modules are included
-directly within your APK, then they cannot be modified by other applications.
-This is true whether the code is a native library or a class being loaded using
-<a href="{@docRoot}reference/dalvik/system/DexClassLoader.html">
-<code>DexClassLoader</code></a>. We have seen many instances of applications
-attempting to load code from insecure locations, such as downloaded from the
-network over unencrypted protocols or from world writable locations such as
-external storage. These locations could allow someone on the network to modify
-the content in transit, or another application on a users device to modify the
-content, respectively.</p>
-
-
-<h3>Using WebView</h3>
-
-<p>Since WebView consumes web content that can include HTML and JavaScript,
-improper use can introduce common web security issues such as <a
-href="http://en.wikipedia.org/wiki/Cross_site_scripting">cross-site-scripting</a
-> (JavaScript injection). Android includes a number of mechanisms to reduce
-the scope of these potential issues by limiting the capability of WebView to
-the minimum functionality required by your application.</p>
-
-<p>If your application does not directly use JavaScript within a <code><a
-href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code>, do
-not call
-<a href="{@docRoot}reference/android/webkit/WebSettings.html#setJavaScriptEnabled(boolean)">
-<code>setJavaScriptEnabled()</code></a>. We have seen this method invoked
-in sample code that might be repurposed in production application -- so
-remove it if necessary. By default, <code><a
-href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code> does
-not execute JavaScript so cross-site-scripting is not possible.</p>
-
-<p>Use <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> with
-particular care because it allows JavaScript to invoke operations that are
-normally reserved for Android applications. Only expose <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> to
-sources from which all input is trustworthy. If untrusted input is allowed,
-untrusted JavaScript may be able to invoke Android methods. In general, we
-recommend only exposing <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> to
-JavaScript that is contained within your application APK.</p>
-
-<p>Do not trust information downloaded over HTTP, use HTTPS instead. Even if
-you are connecting only to a single website that you trust or control, HTTP is
-subject to <a
-href="http://en.wikipedia.org/wiki/Man-in-the-middle_attack">MiTM</a> attacks
-and interception of data. Sensitive capabilities using <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code> should
-not ever be exposed to unverified script downloaded over HTTP. Note that even
-with the use of HTTPS,
-<code><a
-href="{@docRoot}reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">addJavaScriptInterface()</a></code>
-increases the attack surface of your application to include the server
-infrastructure and all CAs trusted by the Android-powered device.</p>
-
-<p>If your application accesses sensitive data with a <code><a
-href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code>, you
-may want to use the <code><a
-href="{@docRoot}reference/android/webkit/WebView.html#clearCache(boolean)">
-clearCache()</a></code> method to delete any files stored locally. Server side
-headers like no-cache can also be used to indicate that an application should
-not cache particular content.</p>
-
-<a name="Input"></a>
-<h2>Performing Input Validation</h2>
-
-<p>Insufficient input validation is one of the most common security problems
-affecting applications, regardless of what platform they run on. Android does
-have platform-level countermeasures that reduce the exposure of applications to
-input validation issues, you should use those features where possible. Also
-note that selection of type-safe languages tends to reduce the likelihood of
-input validation issues. We strongly recommend building your applications with
-the Android SDK.</p>
-
-<p>If you are using native code, then any data read from files, received over
-the network, or received from an IPC has the potential to introduce a security
-issue. The most common problems are <a
-href="http://en.wikipedia.org/wiki/Buffer_overflow">buffer overflows</a>, <a
-href="http://en.wikipedia.org/wiki/Double_free#Use_after_free">use after
-free</a>, and <a
-href="http://en.wikipedia.org/wiki/Off-by-one_error">off-by-one errors</a>.
-Android provides a number of technologies like ASLR and DEP that reduce the
-exploitability of these errors, but they do not solve the underlying problem.
-These can be prevented by careful handling of pointers and managing of
-buffers.</p>
-
-<p>Dynamic, string based languages such as JavaScript and SQL are also subject
-to input validation problems due to escape characters and <a
-href="http://en.wikipedia.org/wiki/Code_injection">script injection</a>.</p>
-
-<p>If you are using data within queries that are submitted to SQL Database or a
-Content Provider, SQL Injection may be an issue. The best defense is to use
-parameterized queries, as is discussed in the ContentProviders section.
-Limiting permissions to read-only or write-only can also reduce the potential
-for harm related to SQL Injection.</p>
-
-<p>If you are using <code><a
-href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code>, then
-you must consider the possibility of XSS. If your application does not
-directly use JavaScript within a <code><a
-href="{@docRoot}reference/android/webkit/WebView.html">WebView</a></code>, do
-not call setJavaScriptEnabled() and XSS is no longer possible. If you must
-enable JavaScript then the WebView section provides other security best
-practices.</p>
-
-<p>If you cannot use the security features above, we strongly recommend the use
-of well-structured data formats and verifying that the data conforms to the
-expected format. While blacklisting of characters or character-replacement can
-be an effective strategy, these techniques are error-prone in practice and
-should be avoided when possible.</p>
-
-<a name="UserData"></a>
-<h2>Handling User Data</h2>
-
-<p>In general, the best approach is to minimize use of APIs that access
-sensitive or personal user data. If you have access to data and can avoid
-storing or transmitting the information, do not store or transmit the data.
-Finally, consider if there is a way that your application logic can be
-implemented using a hash or non-reversible form of the data. For example, your
-application might use the hash of an an email address as a primary key, to
-avoid transmitting or storing the email address. This reduces the chances of
-inadvertently exposing data, and it also reduces the chance of attackers
-attempting to exploit your application.</p>
-
-<p>If your application accesses personal information such as passwords or
-usernames, keep in mind that some jurisdictions may require you to provide a
-privacy policy explaining your use and storage of that data. So following the
-security best practice of minimizing access to user data may also simplify
-compliance.</p>
-
-<p>You should also consider whether your application might be inadvertently
-exposing personal information to other parties such as third-party components
-for advertising or third-party services used by your application. If you don't
-know why a component or service requires a personal information, don’t
-provide it. In general, reducing the access to personal information by your
-application will reduce the potential for problems in this area.</p>
-
-<p>If access to sensitive data is required, evaluate whether that information
-must be transmitted to a server, or whether the operation can be performed on
-the client. Consider running any code using sensitive data on the client to
-avoid transmitting user data.</p>
-
-<p>Also, make sure that you do not inadvertently expose user data to other
-application on the device through overly permissive IPC, world writable files,
-or network sockets. This is a special case of permission redelegation,
-discussed in the Requesting Permissions section.</p>
-
-<p>If a GUID is required, create a large, unique number and store it. Do not
-use phone identifiers such as the phone number or IMEI which may be associated
-with personal information. This topic is discussed in more detail in the <a
-href="http://android-developers.blogspot.com/2011/03/identifying-app-installations.html">Android Developer Blog</a>.</p>
-
-<p>Application developers should be careful writing to on-device logs.
-In Android, logs are a shared resource, and are available
-to an application with the
-<a href="{@docRoot}reference/android/Manifest.permission.html#READ_LOGS">
-<code>READ_LOGS</code></a> permission. Even though the phone log data
-is temporary and erased on reboot, inappropriate logging of user information
-could inadvertently leak user data to other applications.</p>
-
-
-<h3>Handling Credentials</h3>
-
-<p>In general, we recommend minimizing the frequency of asking for user
-credentials -- to make phishing attacks more conspicuous, and less likely to be
-successful. Instead use an authorization token and refresh it.</p>
-
-<p>Where possible, username and password should not be stored on the device.
-Instead, perform initial authentication using the username and password
-supplied by the user, and then use a short-lived, service-specific
-authorization token.</p>
-
-<p>Services that will be accessible to multiple applications should be accessed
-using <code>
-<a href="{@docRoot}reference/android/accounts/AccountManager.html">
-AccountManager</a></code>. If possible, use the <code><a
-href="{@docRoot}reference/android/accounts/AccountManager.html">
-AccountManager</a></code> class to invoke a cloud-based service and do not store
-passwords on the device.</p>
-
-<p>After using <code><a
-href="{@docRoot}reference/android/accounts/AccountManager.html">
-AccountManager</a></code> to retrieve an Account, check the <code><a
-href="{@docRoot}reference/android/accounts/Account.html#CREATOR">CREATOR</a>
-</code> before passing in any credentials, so that you do not inadvertently pass
-credentials to the wrong application.</p>
-
-<p>If credentials are to be used only by applications that you create, then you
-can verify the application which accesses the <code><a
-href="{@docRoot}reference/android/accounts/AccountManager.html">
-AccountManager</a></code> using <code><a
-href="{@docRoot}reference/android/content/pm/PackageManager.html#checkSignatures(java.lang.String,%20java.lang.String)">checkSignature()</a></code>.
-Alternatively, if only one application will use the credential, you might use a
-{@link java.security.KeyStore} for
-storage.</p>
-
-<a name="Crypto"></a>
-<h2>Using Cryptography</h2>
-
-<p>In addition to providing data isolation, supporting full-filesystem
-encryption, and providing secure communications channels Android provides a
-wide array of algorithms for protecting data using cryptography.</p>
-
-<p>In general, try to use the highest level of pre-existing framework
-implementation that can support your use case. If you need to securely
-retrieve a file from a known location, a simple HTTPS URI may be adequate and
-require no knowledge of cryptography on your part. If you need a secure
-tunnel, consider using
-<a href="{@docRoot}reference/javax/net/ssl/HttpsURLConnection.html">
-<code>HttpsURLConnection</code></a> or <code><a
-href="{@docRoot}reference/javax/net/ssl/SSLSocket.html">SSLSocket</a></code>,
-rather than writing your own protocol.</p>
-
-<p>If you do find yourself needing to implement your own protocol, we strongly
-recommend that you not implement your own cryptographic algorithms. Use
-existing cryptographic algorithms such as those in the implementation of AES or
-RSA provided in the <code><a
-href="{@docRoot}reference/javax/crypto/Cipher.html">Cipher</a></code> class.</p>
-
-<p>Use a secure random number generator (
-<a href="{@docRoot}reference/java/security/SecureRandom.html">
-<code>SecureRandom</code></a>) to initialize any cryptographic keys (<a
-href="{@docRoot}reference/javax/crypto/KeyGenerator.html">
-<code>KeyGenerator</code></a>). Use of a key that is not generated with a secure random
-number generator significantly weakens the strength of the algorithm, and may
-allow offline attacks.</p>
-
-<p>If you need to store a key for repeated use, use a mechanism like
- {@link java.security.KeyStore} that
-provides a mechanism for long term storage and retrieval of cryptographic
-keys.</p>
-
-<h2>Conclusion</h2>
-
-<p>Android provides developers with the ability to design applications with a
-broad range of security requirements. These best practices will help you make
-sure that your application takes advantage of the security benefits provided by
-the platform.</p>
-
-<p>You can receive more information on these topics and discuss security best
-practices with other developers in the <a
-href="http://groups.google.com/group/android-security-discuss">Android Security
-Discuss</a> Google Group</p>
diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd
index 838ba96..6e6fa28 100644
--- a/docs/html/guide/topics/appwidgets/index.jd
+++ b/docs/html/guide/topics/appwidgets/index.jd
@@ -62,7 +62,7 @@
below shows
the Music App Widget.</p>
-<img src="{@docRoot}images/appwidget.png" alt="" />
+<img src="{@docRoot}images/appwidgets/appwidget.png" alt="" />
<p>This document describes how to publish an App Widget using an App Widget
provider.</p>
@@ -882,7 +882,7 @@
sample</a>:</p>
<p>
-<img src="{@docRoot}resources/images/StackWidget.png" alt="" />
+<img src="{@docRoot}images/appwidgets/StackWidget.png" alt="" />
</p>
<p>This sample consists of a stack of 10 views, which display the values
@@ -1385,7 +1385,7 @@
the {@link android.widget.RemoteViewsService.RemoteViewsFactory
RemoteViewsFactory}, and how you can trigger updates:</p>
-<img src="{@docRoot}images/appwidget_collections.png" alt="" />
+<img src="{@docRoot}images/appwidgets/appwidget_collections.png" alt="" />
<p>One feature of App Widgets that use collections is the ability to provide
users with up-to-date content. For example, consider the Android 3.0 Gmail
diff --git a/docs/html/guide/topics/resources/more-resources.jd b/docs/html/guide/topics/resources/more-resources.jd
index d37b9f8..9fa1a2d 100644
--- a/docs/html/guide/topics/resources/more-resources.jd
+++ b/docs/html/guide/topics/resources/more-resources.jd
@@ -540,7 +540,7 @@
<dt>resource reference:</dt>
<dd>
-In Java: <code>R.array.<em>string_array_name</em></code><br/>
+In Java: <code>R.array.<em>integer_array_name</em></code><br/>
In XML: <code>@[<em>package</em>:]array.<em>integer_array_name</em></code>
</dd>
@@ -565,7 +565,7 @@
<dd><strong>Required.</strong> This must be the root node.
<p>No attributes.</p>
</dd>
- <dt id="integer-array-element"><code><string-array></code></dt>
+ <dt id="integer-array-element"><code><integer-array></code></dt>
<dd>Defines an array of integers. Contains one or more child {@code <item>} elements.
<p class="caps">attributes:</p>
<dl class="atn-list">
diff --git a/docs/html/images/anr.png b/docs/html/images/anr.png
index f6e16ef..46520ef 100644
--- a/docs/html/images/anr.png
+++ b/docs/html/images/anr.png
Binary files differ
diff --git a/docs/html/images/appwidgets/StackWidget.png b/docs/html/images/appwidgets/StackWidget.png
new file mode 100644
index 0000000..f2f83a0
--- /dev/null
+++ b/docs/html/images/appwidgets/StackWidget.png
Binary files differ
diff --git a/docs/html/images/appwidget.png b/docs/html/images/appwidgets/appwidget.png
similarity index 100%
rename from docs/html/images/appwidget.png
rename to docs/html/images/appwidgets/appwidget.png
Binary files differ
diff --git a/docs/html/images/appwidget_collections.png b/docs/html/images/appwidgets/appwidget_collections.png
similarity index 100%
rename from docs/html/images/appwidget_collections.png
rename to docs/html/images/appwidgets/appwidget_collections.png
Binary files differ
diff --git a/docs/html/images/gps-analytics.png b/docs/html/images/gps-analytics.png
new file mode 100644
index 0000000..7da0be1
--- /dev/null
+++ b/docs/html/images/gps-analytics.png
Binary files differ
diff --git a/docs/html/images/gps-maps.png b/docs/html/images/gps-maps.png
new file mode 100644
index 0000000..2e2a716
--- /dev/null
+++ b/docs/html/images/gps-maps.png
Binary files differ
diff --git a/docs/html/images/gps-plus.png b/docs/html/images/gps-plus.png
new file mode 100644
index 0000000..630ba0ae
--- /dev/null
+++ b/docs/html/images/gps-plus.png
Binary files differ
diff --git a/docs/html/images/gps-small.png b/docs/html/images/gps-small.png
new file mode 100644
index 0000000..790e483
--- /dev/null
+++ b/docs/html/images/gps-small.png
Binary files differ
diff --git a/docs/html/images/gps.png b/docs/html/images/gps.png
new file mode 100644
index 0000000..84d761d
--- /dev/null
+++ b/docs/html/images/gps.png
Binary files differ
diff --git a/docs/html/images/play-services-diagram.graffle/data.plist b/docs/html/images/play-services-diagram.graffle/data.plist
new file mode 100644
index 0000000..837341c
--- /dev/null
+++ b/docs/html/images/play-services-diagram.graffle/data.plist
@@ -0,0 +1,1020 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>ActiveLayerIndex</key>
+ <integer>0</integer>
+ <key>ApplicationVersion</key>
+ <array>
+ <string>com.omnigroup.OmniGrafflePro</string>
+ <string>138.33.0.157554</string>
+ </array>
+ <key>AutoAdjust</key>
+ <true/>
+ <key>BackgroundGraphic</key>
+ <dict>
+ <key>Bounds</key>
+ <string>{{0, 0}, {576, 733}}</string>
+ <key>Class</key>
+ <string>SolidGraphic</string>
+ <key>ID</key>
+ <integer>2</integer>
+ <key>Style</key>
+ <dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ </dict>
+ <key>CanvasOrigin</key>
+ <string>{0, 0}</string>
+ <key>ColumnAlign</key>
+ <integer>1</integer>
+ <key>ColumnSpacing</key>
+ <real>36</real>
+ <key>CreationDate</key>
+ <string>2012-11-14 22:20:40 +0000</string>
+ <key>Creator</key>
+ <string>Robert Ly</string>
+ <key>DisplayScale</key>
+ <string>1 0/72 in = 1 0/72 in</string>
+ <key>FileType</key>
+ <string>auto</string>
+ <key>GraphDocumentVersion</key>
+ <integer>8</integer>
+ <key>GraphicsList</key>
+ <array>
+ <dict>
+ <key>Bounds</key>
+ <string>{{206.5, 311.05804}, {55, 24}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FitText</key>
+ <string>YES</string>
+ <key>Flow</key>
+ <string>Resize</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.65</string>
+ <key>w</key>
+ <string>0</string>
+ </dict>
+ <key>Font</key>
+ <string>DroidSans</string>
+ <key>Size</key>
+ <real>10</real>
+ </dict>
+ <key>ID</key>
+ <integer>199</integer>
+ <key>Line</key>
+ <dict>
+ <key>ID</key>
+ <integer>198</integer>
+ <key>Offset</key>
+ <real>-2</real>
+ <key>Position</key>
+ <real>0.59412848949432373</real>
+ <key>RotationType</key>
+ <integer>0</integer>
+ </dict>
+ <key>Magnets</key>
+ <array>
+ <string>{0, 1}</string>
+ <string>{0, -1}</string>
+ <string>{1, 0}</string>
+ <string>{-1, 0}</string>
+ </array>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>RTFD</key>
+ <data>
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+ ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+ bmcBlIQBKwdVcGRhdGVzhoQCaUkBB5KEhIQMTlNEaWN0
+ aW9uYXJ5AJSEAWkDkoSWlgdOU0NvbG9yhpKEhIQHTlND
+ b2xvcgCUhAFjA4QCZmYAg2ZmJj+GkoSWlgZOU0ZvbnSG
+ koSEhAZOU0ZvbnQelJkchAVbMjhjXQYAAAAUAAAA//5I
+ AGUAbAB2AGUAdABpAGMAYQCEAWYMmwCbAZsAmwCGkoSW
+ lhBOU1BhcmFncmFwaFN0eWxlhpKEhIQQTlNQYXJhZ3Jh
+ cGhTdHlsZQCUhARDQ0BTAgCEhIQHTlNBcnJheQCUmQyS
+ hISECU5TVGV4dFRhYgCUhAJDZgAchpKEpaQAOIaShKWk
+ AFSGkoSlpABwhpKEpaQAgYwAhpKEpaQAgagAhpKEpaQA
+ gcQAhpKEpaQAgeAAhpKEpaQAgfwAhpKEpaQAgRgBhpKE
+ paQAgTQBhpKEpaQAgVABhoYAhoaG
+ </data>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
+
+\f0\fs24 \cf2 Updates}</string>
+ <key>alpha</key>
+ <array>
+ <array>
+ <integer>0</integer>
+ <integer>7</integer>
+ <real>0.64999997615814209</real>
+ </array>
+ </array>
+ </dict>
+ <key>Wrap</key>
+ <string>NO</string>
+ </dict>
+ <dict>
+ <key>Class</key>
+ <string>LineGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Font</key>
+ <string>DroidSans</string>
+ <key>Size</key>
+ <real>11</real>
+ </dict>
+ <key>ID</key>
+ <integer>198</integer>
+ <key>OrthogonalBarAutomatic</key>
+ <false/>
+ <key>OrthogonalBarPoint</key>
+ <string>{0, 0}</string>
+ <key>OrthogonalBarPosition</key>
+ <real>4.1290435791015625</real>
+ <key>Points</key>
+ <array>
+ <string>{165.58636, 347.00049}</string>
+ <string>{232, 325}</string>
+ <string>{271, 300}</string>
+ </array>
+ <key>Style</key>
+ <dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.7</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>4</real>
+ <key>HeadArrow</key>
+ <string>0</string>
+ <key>LineType</key>
+ <integer>2</integer>
+ <key>TailArrow</key>
+ <string>FilledArrow</string>
+ </dict>
+ </dict>
+ <key>Tail</key>
+ <dict>
+ <key>ID</key>
+ <integer>1800</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{282.74756, 257.67365}, {273.33658, 82.000977}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>1806</integer>
+ <key>ImageID</key>
+ <integer>8</integer>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ </dict>
+ <dict>
+ <key>Class</key>
+ <string>LineGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Font</key>
+ <string>DroidSans</string>
+ <key>Size</key>
+ <real>11</real>
+ </dict>
+ <key>Head</key>
+ <dict>
+ <key>ID</key>
+ <integer>1800</integer>
+ <key>Info</key>
+ <integer>4</integer>
+ </dict>
+ <key>ID</key>
+ <integer>196</integer>
+ <key>OrthogonalBarAutomatic</key>
+ <false/>
+ <key>OrthogonalBarPoint</key>
+ <string>{0, 0}</string>
+ <key>OrthogonalBarPosition</key>
+ <real>4.1290435791015625</real>
+ <key>Points</key>
+ <array>
+ <string>{57.379539, 223}</string>
+ <string>{43.586342, 347.00049}</string>
+ </array>
+ <key>Style</key>
+ <dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.7</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>4</real>
+ <key>HeadArrow</key>
+ <string>FilledArrow</string>
+ <key>LineType</key>
+ <integer>2</integer>
+ <key>TailArrow</key>
+ <string>0</string>
+ </dict>
+ </dict>
+ <key>Tail</key>
+ <dict>
+ <key>ID</key>
+ <integer>203</integer>
+ <key>Info</key>
+ <integer>4</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{57.379539, 207}, {94.413635, 32}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.65</string>
+ <key>w</key>
+ <string>0</string>
+ </dict>
+ <key>Font</key>
+ <string>DroidSans</string>
+ <key>Size</key>
+ <real>10</real>
+ </dict>
+ <key>ID</key>
+ <integer>203</integer>
+ <key>Magnets</key>
+ <array>
+ <string>{0, 1}</string>
+ <string>{0, -1}</string>
+ <string>{1, 0}</string>
+ <string>{-1, 0}</string>
+ </array>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.578326</string>
+ <key>g</key>
+ <string>0.578615</string>
+ <key>r</key>
+ <string>0.578453</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>15</real>
+ <key>Pattern</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>RTFD</key>
+ <data>
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+ ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+ bmcBlIQBKw5DbGllbnQgTGlicmFyeYaEAmlJAQ6ShISE
+ DE5TRGljdGlvbmFyeQCUhAFpBJKElpYOTlNPcmlnaW5h
+ bEZvbnSGkoSEhAZOU0ZvbnQelJkchAVbMjhjXQYAAAAU
+ AAAA//5IAGUAbAB2AGUAdABpAGMAYQCEAWYMhAFjAJ0B
+ nQCdAIaShJaWEE5TUGFyYWdyYXBoU3R5bGWGkoSEhBdO
+ U011dGFibGVQYXJhZ3JhcGhTdHlsZQCEhBBOU1BhcmFn
+ cmFwaFN0eWxlAJSEBENDQFMCAIUAhpKElpYGTlNGb250
+ hpKakoSWlgdOU0NvbG9yhpKEhIQHTlNDb2xvcgCUnQOE
+ AmZmAINmZiY/hoaG
+ </data>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
+
+\f0\fs24 \cf2 Client Library}</string>
+ <key>VerticalPad</key>
+ <integer>10</integer>
+ <key>alpha</key>
+ <array>
+ <array>
+ <integer>0</integer>
+ <integer>14</integer>
+ <real>0.64999997615814209</real>
+ </array>
+ </array>
+ </dict>
+ <key>TextPlacement</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{43.586342, 306}, {122.00003, 82.000977}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.65</string>
+ <key>w</key>
+ <string>0</string>
+ </dict>
+ <key>Font</key>
+ <string>DroidSans-Bold</string>
+ <key>NSKern</key>
+ <real>0.0</real>
+ <key>Size</key>
+ <real>12</real>
+ </dict>
+ <key>ID</key>
+ <integer>1800</integer>
+ <key>Magnets</key>
+ <array>
+ <string>{0, 1}</string>
+ <string>{0, -1}</string>
+ <string>{1, 0}</string>
+ <string>{-1, 0}</string>
+ </array>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.938075</string>
+ <key>g</key>
+ <string>0.938269</string>
+ <key>r</key>
+ <string>0.938154</string>
+ </dict>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.45</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>Draws</key>
+ <string>NO</string>
+ <key>Fuzziness</key>
+ <real>0.0</real>
+ <key>ShadowVector</key>
+ <string>{0.5, 2}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.700224</string>
+ <key>g</key>
+ <string>0.700574</string>
+ <key>r</key>
+ <string>0.700377</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>3</real>
+ <key>Width</key>
+ <real>3</real>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>RTFD</key>
+ <data>
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+ ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+ bmcBlIQBKxlHb29nbGUgUGxheQpzZXJ2aWNlcyBBUEsK
+ hoQCaUkBGZKEhIQMTlNEaWN0aW9uYXJ5AJSEAWkDkoSW
+ lgdOU0NvbG9yhpKEhIQHTlNDb2xvcgCUhAFjA4QCZmYA
+ g2ZmJj+GkoSWlgZOU0ZvbnSGkoSEhAZOU0ZvbnQelJkc
+ hAVbMjhjXQYAAAAUAAAA//5IAGUAbAB2AGUAdABpAGMA
+ YQCEAWYMmwCbAZsAmwCGkoSWlhBOU1BhcmFncmFwaFN0
+ eWxlhpKEhIQQTlNQYXJhZ3JhcGhTdHlsZQCUhARDQ0BT
+ AgCEhIQHTlNBcnJheQCUmQyShISECU5TVGV4dFRhYgCU
+ hAJDZgAchpKEpaQAOIaShKWkAFSGkoSlpABwhpKEpaQA
+ gYwAhpKEpaQAgagAhpKEpaQAgcQAhpKEpaQAgeAAhpKE
+ paQAgfwAhpKEpaQAgRgBhpKEpaQAgTQBhpKEpaQAgVAB
+ hoYAhoaG
+ </data>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
+
+\f0\fs24 \cf2 Google Play\
+services APK\
+}</string>
+ <key>VerticalPad</key>
+ <integer>10</integer>
+ <key>alpha</key>
+ <array>
+ <array>
+ <integer>0</integer>
+ <integer>25</integer>
+ <real>0.64999997615814209</real>
+ </array>
+ </array>
+ </dict>
+ <key>TextPlacement</key>
+ <integer>2</integer>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{43.586342, 195}, {122.00003, 82.000977}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.65</string>
+ <key>w</key>
+ <string>0</string>
+ </dict>
+ <key>Font</key>
+ <string>DroidSans-Bold</string>
+ <key>NSKern</key>
+ <real>0.0</real>
+ <key>Size</key>
+ <real>12</real>
+ </dict>
+ <key>ID</key>
+ <integer>249</integer>
+ <key>Magnets</key>
+ <array>
+ <string>{0, 1}</string>
+ <string>{0, -1}</string>
+ <string>{1, 0}</string>
+ <string>{-1, 0}</string>
+ </array>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.938075</string>
+ <key>g</key>
+ <string>0.938269</string>
+ <key>r</key>
+ <string>0.938154</string>
+ </dict>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.45</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>Draws</key>
+ <string>NO</string>
+ <key>Fuzziness</key>
+ <real>0.0</real>
+ <key>ShadowVector</key>
+ <string>{0.5, 2}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.700224</string>
+ <key>g</key>
+ <string>0.700574</string>
+ <key>r</key>
+ <string>0.700377</string>
+ </dict>
+ <key>CornerRadius</key>
+ <real>3</real>
+ <key>Width</key>
+ <real>3</real>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>RTFD</key>
+ <data>
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+ ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+ bmcBlIQBKwhZb3VyIEFwcIaEAmlJAQiShISEDE5TRGlj
+ dGlvbmFyeQCUhAFpBJKElpYOTlNPcmlnaW5hbEZvbnSG
+ koSEhAZOU0ZvbnQelJkchAVbMjhjXQYAAAAUAAAA//5I
+ AGUAbAB2AGUAdABpAGMAYQCEAWYMhAFjAJ0BnQCdAIaS
+ hJaWEE5TUGFyYWdyYXBoU3R5bGWGkoSEhBdOU011dGFi
+ bGVQYXJhZ3JhcGhTdHlsZQCEhBBOU1BhcmFncmFwaFN0
+ eWxlAJSEBENDQFMCAIUAhpKElpYGTlNGb250hpKakoSW
+ lgdOU0NvbG9yhpKEhIQHTlNDb2xvcgCUnQOEAmZmAINm
+ ZiY/hoaG
+ </data>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
+
+\f0\fs24 \cf2 Your App}</string>
+ <key>VerticalPad</key>
+ <integer>10</integer>
+ <key>alpha</key>
+ <array>
+ <array>
+ <integer>0</integer>
+ <integer>8</integer>
+ <real>0.64999997615814209</real>
+ </array>
+ </array>
+ </dict>
+ <key>TextPlacement</key>
+ <integer>2</integer>
+ </dict>
+ <dict>
+ <key>Class</key>
+ <string>Group</string>
+ <key>Graphics</key>
+ <array>
+ <dict>
+ <key>Bounds</key>
+ <string>{{25.847038, 415.18762}, {157.43497, 20.991331}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>1795</integer>
+ <key>ImageID</key>
+ <integer>4</integer>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{167.76729, 156.73196}, {15.743497, 10.058347}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>FontInfo</key>
+ <dict>
+ <key>Font</key>
+ <string>Helvetica</string>
+ <key>Size</key>
+ <real>9</real>
+ </dict>
+ <key>ID</key>
+ <integer>1796</integer>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ <key>Text</key>
+ <dict>
+ <key>Align</key>
+ <integer>2</integer>
+ <key>Pad</key>
+ <integer>2</integer>
+ <key>RTFD</key>
+ <data>
+ BAtzdHJlYW10eXBlZIHoA4QBQISE
+ hBJOU0F0dHJpYnV0ZWRTdHJpbmcA
+ hIQITlNPYmplY3QAhZKEhIQITlNT
+ dHJpbmcBlIQBKwQyOjMwhoQCaUkB
+ BJKEhIQMTlNEaWN0aW9uYXJ5AJSE
+ AWkDkoSWlgdOU0NvbG9yhpKEhIQH
+ TlNDb2xvcgCUhAFjAoQEZmZmZoPO
+ zEw+g7a1NT+D5+VlPwGGkoSWlhBO
+ U1BhcmFncmFwaFN0eWxlhpKEhIQQ
+ TlNQYXJhZ3JhcGhTdHlsZQCUhARD
+ Q0BTAQCEhIQHTlNBcnJheQCUmQyS
+ hISECU5TVGV4dFRhYgCUhAJDZgAc
+ hpKEoqEAOIaShKKhAFSGkoSioQBw
+ hpKEoqEAgYwAhpKEoqEAgagAhpKE
+ oqEAgcQAhpKEoqEAgeAAhpKEoqEA
+ gfwAhpKEoqEAgRgBhpKEoqEAgTQB
+ hpKEoqEAgVABhoYAhpKElpYGTlNG
+ b250hpKEhIQGTlNGb250HpSZHIQF
+ WzI4Y10GAAAAFAAAAP/+SABlAGwA
+ dgBlAHQAaQBjAGEAhAFmCJsAmwGb
+ AJsAhoaG
+ </data>
+ <key>Text</key>
+ <string>{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red45\green166\blue222;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qr
+
+\f0\fs16 \cf2 2:30}</string>
+ <key>VerticalPad</key>
+ <integer>2</integer>
+ </dict>
+ <key>Wrap</key>
+ <string>NO</string>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{25.847008, 156.29468}, {157.47868, 10.932985}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>1797</integer>
+ <key>ImageID</key>
+ <integer>3</integer>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{10.999992, 113}, {187.17274, 367.34827}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>1798</integer>
+ <key>ImageID</key>
+ <integer>5</integer>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{25.847038, 156.29462}, {157.43497, 279.8844}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>1799</integer>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ </dict>
+ </array>
+ <key>ID</key>
+ <integer>1794</integer>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{269.83173, 246.96591}, {299.16827, 99.416443}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>4</integer>
+ <key>Shape</key>
+ <string>Rectangle</string>
+ <key>Style</key>
+ <dict>
+ <key>stroke</key>
+ <dict>
+ <key>CornerRadius</key>
+ <real>9</real>
+ </dict>
+ </dict>
+ </dict>
+ </array>
+ <key>GridInfo</key>
+ <dict/>
+ <key>GuidesLocked</key>
+ <string>NO</string>
+ <key>GuidesVisible</key>
+ <string>YES</string>
+ <key>HPages</key>
+ <integer>1</integer>
+ <key>ImageCounter</key>
+ <integer>9</integer>
+ <key>ImageLinkBack</key>
+ <array>
+ <dict/>
+ <dict/>
+ <dict/>
+ <dict/>
+ </array>
+ <key>ImageList</key>
+ <array>
+ <string>image8.tiff</string>
+ <string>image5.pdf</string>
+ <string>image4.png</string>
+ <string>image3.png</string>
+ </array>
+ <key>KeepToScale</key>
+ <false/>
+ <key>Layers</key>
+ <array>
+ <dict>
+ <key>Lock</key>
+ <string>NO</string>
+ <key>Name</key>
+ <string>Layer 1</string>
+ <key>Print</key>
+ <string>YES</string>
+ <key>View</key>
+ <string>YES</string>
+ </dict>
+ </array>
+ <key>LayoutInfo</key>
+ <dict>
+ <key>Animate</key>
+ <string>NO</string>
+ <key>circoMinDist</key>
+ <real>18</real>
+ <key>circoSeparation</key>
+ <real>0.0</real>
+ <key>layoutEngine</key>
+ <string>dot</string>
+ <key>neatoSeparation</key>
+ <real>0.0</real>
+ <key>twopiSeparation</key>
+ <real>0.0</real>
+ </dict>
+ <key>LinksVisible</key>
+ <string>NO</string>
+ <key>MagnetsVisible</key>
+ <string>NO</string>
+ <key>MasterSheets</key>
+ <array/>
+ <key>ModificationDate</key>
+ <string>2012-11-14 23:00:27 +0000</string>
+ <key>Modifier</key>
+ <string>Robert Ly</string>
+ <key>NotesVisible</key>
+ <string>NO</string>
+ <key>Orientation</key>
+ <integer>2</integer>
+ <key>OriginVisible</key>
+ <string>NO</string>
+ <key>PageBreaks</key>
+ <string>YES</string>
+ <key>PrintInfo</key>
+ <dict>
+ <key>NSBottomMargin</key>
+ <array>
+ <string>float</string>
+ <string>41</string>
+ </array>
+ <key>NSHorizonalPagination</key>
+ <array>
+ <string>int</string>
+ <string>0</string>
+ </array>
+ <key>NSLeftMargin</key>
+ <array>
+ <string>float</string>
+ <string>18</string>
+ </array>
+ <key>NSPaperSize</key>
+ <array>
+ <string>coded</string>
+ <string>BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAx7X05TU2l6ZT1mZn2WgWQCgRgDhg==</string>
+ </array>
+ <key>NSPrintReverseOrientation</key>
+ <array>
+ <string>int</string>
+ <string>0</string>
+ </array>
+ <key>NSRightMargin</key>
+ <array>
+ <string>float</string>
+ <string>18</string>
+ </array>
+ <key>NSTopMargin</key>
+ <array>
+ <string>float</string>
+ <string>18</string>
+ </array>
+ </dict>
+ <key>PrintOnePage</key>
+ <false/>
+ <key>ReadOnly</key>
+ <string>NO</string>
+ <key>RowAlign</key>
+ <integer>1</integer>
+ <key>RowSpacing</key>
+ <real>36</real>
+ <key>SheetTitle</key>
+ <string>Canvas 1</string>
+ <key>SmartAlignmentGuidesActive</key>
+ <string>YES</string>
+ <key>SmartDistanceGuidesActive</key>
+ <string>YES</string>
+ <key>UniqueID</key>
+ <integer>1</integer>
+ <key>UseEntirePage</key>
+ <false/>
+ <key>VPages</key>
+ <integer>1</integer>
+ <key>WindowInfo</key>
+ <dict>
+ <key>CurrentSheet</key>
+ <integer>0</integer>
+ <key>ExpandedCanvases</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>Canvas 1</string>
+ </dict>
+ </array>
+ <key>ListView</key>
+ <true/>
+ <key>OutlineWidth</key>
+ <integer>142</integer>
+ <key>RightSidebar</key>
+ <false/>
+ <key>ShowRuler</key>
+ <true/>
+ <key>Sidebar</key>
+ <true/>
+ <key>SidebarWidth</key>
+ <integer>120</integer>
+ <key>VisibleRegion</key>
+ <string>{{-392, -138}, {1359, 1010}}</string>
+ <key>Zoom</key>
+ <real>1</real>
+ <key>ZoomValues</key>
+ <array>
+ <array>
+ <string>Canvas 1</string>
+ <real>1</real>
+ <real>1</real>
+ </array>
+ </array>
+ </dict>
+ <key>saveQuickLookFiles</key>
+ <string>NO</string>
+</dict>
+</plist>
diff --git a/docs/html/images/play-services-diagram.graffle/image3.png b/docs/html/images/play-services-diagram.graffle/image3.png
new file mode 100644
index 0000000..87e38f9
--- /dev/null
+++ b/docs/html/images/play-services-diagram.graffle/image3.png
Binary files differ
diff --git a/docs/html/images/play-services-diagram.graffle/image4.png b/docs/html/images/play-services-diagram.graffle/image4.png
new file mode 100644
index 0000000..89a8bb3
--- /dev/null
+++ b/docs/html/images/play-services-diagram.graffle/image4.png
Binary files differ
diff --git a/docs/html/images/play-services-diagram.graffle/image5.pdf b/docs/html/images/play-services-diagram.graffle/image5.pdf
new file mode 100644
index 0000000..c2baa60
--- /dev/null
+++ b/docs/html/images/play-services-diagram.graffle/image5.pdf
Binary files differ
diff --git a/docs/html/images/play-services-diagram.graffle/image8.tiff b/docs/html/images/play-services-diagram.graffle/image8.tiff
new file mode 100644
index 0000000..c934b78
--- /dev/null
+++ b/docs/html/images/play-services-diagram.graffle/image8.tiff
Binary files differ
diff --git a/docs/html/images/play-services-diagram.png b/docs/html/images/play-services-diagram.png
new file mode 100644
index 0000000..09b9a69
--- /dev/null
+++ b/docs/html/images/play-services-diagram.png
Binary files differ
diff --git a/docs/html/images/training/notifications-bigview.png b/docs/html/images/training/notifications-bigview.png
new file mode 100644
index 0000000..83a5610
--- /dev/null
+++ b/docs/html/images/training/notifications-bigview.png
Binary files differ
diff --git a/docs/html/images/training/notifications-normalview.png b/docs/html/images/training/notifications-normalview.png
new file mode 100644
index 0000000..06ea970
--- /dev/null
+++ b/docs/html/images/training/notifications-normalview.png
Binary files differ
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 63dbed7..23c102e 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -2,17 +2,25 @@
header.hide=1
page.metaDescription=Download the official Android SDK to develop apps for Android-powered devices.
-sdk.win_bundle_download=adt-bundle-windows.zip
-sdk.win_bundle_bytes=417851515
-sdk.win_bundle_checksum=73bdd1168fce0e36a27255a4335c865d
+sdk.win32_bundle_download=adt-bundle-windows-x86.zip
+sdk.win32_bundle_bytes=417851015
+sdk.win32_bundle_checksum=42d9a6c15113d405a97eed05e6d42e2b
-sdk.mac_bundle_download=adt-bundle-mac.zip
-sdk.mac_bundle_bytes=382957959
-sdk.mac_bundle_checksum=a320f8bbaee8572a36e68c434564bdd0
+sdk.win64_bundle_download=adt-bundle-windows-x86_64.zip
+sdk.win64_bundle_bytes=417851515
+sdk.win64_bundle_checksum=73bdd1168fce0e36a27255a4335c865d
-sdk.linux_bundle_download=adt-bundle-linux.zip
-sdk.linux_bundle_bytes=411217430
-sdk.linux_bundle_checksum=b0590fe9c1533da9b20ea65525b77677
+sdk.mac64_bundle_download=adt-bundle-mac-x86_64.zip
+sdk.mac64_bundle_bytes=382957959
+sdk.mac64_bundle_checksum=a320f8bbaee8572a36e68c434564bdd0
+
+sdk.linux32_bundle_download=adt-bundle-linux-x86.zip
+sdk.linux32_bundle_bytes=411065882
+sdk.linux32_bundle_checksum=39687b06fedfea7487ff0824a4d32ee8
+
+sdk.linux64_bundle_download=adt-bundle-linux-x86_64.zip
+sdk.linux64_bundle_bytes=411217430
+sdk.linux64_bundle_checksum=b0590fe9c1533da9b20ea65525b77677
@@ -43,6 +51,8 @@
</style>
+
+
<div style="position:relative;height:660px;">
@@ -208,6 +218,12 @@
<input id="agree" type="checkbox" name="agree" value="1" onclick="onAgreeChecked()" />
<label id="agreeLabel" for="agree">I have read and agree with the above terms and conditions</label>
</p>
+<p id="bitpicker" style="display:none">
+ <input id="32" onclick="onAgreeChecked()" type="radio" name="bit" value="32">
+ <label for="32">32-bit</label>
+ <input id="64" onclick="onAgreeChecked()" type="radio" name="bit" value="64">
+ <label for="64">64-bit</label>
+</p>
<p><a href="" class="button disabled" id="downloadForRealz" onclick="return onDownloadForRealz(this);"></a></p>
</div>
@@ -256,9 +272,8 @@
-
<div class="col-7" style="margin-right:0;">
- <img src="{@docRoot}images/sdk-cube.png" alt="" />
+ <img src="{@docRoot}images/sdk-cube.png" alt="" height=264 />
<!-- this appears when viewing the online docs -->
<div class="online">
diff --git a/docs/html/tools/help/uiautomator/UiDevice.jd b/docs/html/tools/help/uiautomator/UiDevice.jd
index 0c0c7d9..1c8805b 100644
--- a/docs/html/tools/help/uiautomator/UiDevice.jd
+++ b/docs/html/tools/help/uiautomator/UiDevice.jd
@@ -1606,7 +1606,10 @@
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>product name of the device</li></ul>
</div>
-
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Since</h5>
+ <ul class="nolist"><li>Android API Level 17</li></ul>
+</div>
</div>
</div>
@@ -1715,7 +1718,10 @@
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>true if it is in natural orientation</li></ul>
</div>
-
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Since</h5>
+ <ul class="nolist"><li>Android API Level 17</li></ul>
+</div>
</div>
</div>
@@ -2493,7 +2499,10 @@
</tr>
</table>
</div>
-
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Since</h5>
+ <ul class="nolist"><li>Android API Level 17</li></ul>
+</div>
</div>
</div>
@@ -2541,7 +2550,10 @@
</tr>
</table>
</div>
-
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Since</h5>
+ <ul class="nolist"><li>Android API Level 17</li></ul>
+</div>
</div>
</div>
@@ -2589,7 +2601,10 @@
</tr>
</table>
</div>
-
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Since</h5>
+ <ul class="nolist"><li>Android API Level 17</li></ul>
+</div>
</div>
</div>
diff --git a/docs/html/tools/help/uiautomator/UiObject.jd b/docs/html/tools/help/uiautomator/UiObject.jd
index 799ac82..a22df50 100644
--- a/docs/html/tools/help/uiautomator/UiObject.jd
+++ b/docs/html/tools/help/uiautomator/UiObject.jd
@@ -1376,7 +1376,6 @@
</tr>
</table>
</div>
-
</div>
</div>
@@ -1753,6 +1752,10 @@
</tr>
</table>
</div>
+ <div class="jd-tagdata">
+ <h5 class="jd-tagtitle">Since</h5>
+ <ul class="nolist"><li>Android API Level 17</li></ul>
+</div>
</div>
</div>
diff --git a/docs/html/tools/sdk/ndk/index.jd b/docs/html/tools/sdk/ndk/index.jd
index 8b26032..ad4fd7c 100644
--- a/docs/html/tools/sdk/ndk/index.jd
+++ b/docs/html/tools/sdk/ndk/index.jd
@@ -24,8 +24,8 @@
<div class="ndk" style="
z-index: 99;
width: 720px;
-position: fixed;
-margin: -20px 0;
+position: absolute;
+margin: -70px 0;
padding: 14px;
background: white;
border: 1px solid #999;
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
index c5388d0..50fc24a 100644
--- a/docs/html/tools/sdk/tools-notes.jd
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -87,6 +87,8 @@
standard size and Nexus virtual devices.</li>
<li>Improved emulators so that they launch with a skin that is dynamically generated and
reflects the actual hardware configured in the AVD Manager.</li>
+ <li>Improved support for developing Android apps on MIPS-based devices with new MIPS
+ System Images for Android Virtual Devices.</li>
</ul>
</li>
<li>Added {@code jobb} tool for creating and encrypting
diff --git a/docs/html/training/articles/perf-anr.jd b/docs/html/training/articles/perf-anr.jd
new file mode 100644
index 0000000..864fb34
--- /dev/null
+++ b/docs/html/training/articles/perf-anr.jd
@@ -0,0 +1,196 @@
+page.title=Keeping Your App Responsive
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#anr">What Triggers ANR?</a></li>
+ <li><a href="#Avoiding">How to Avoid ANRs</a></li>
+ <li><a href="#Reinforcing">Reinforcing Responsiveness</a></li>
+</ol>
+
+</div>
+</div>
+
+<div class="figure" style="width:280px">
+<img src="{@docRoot}images/anr.png" alt=""/>
+<p class="img-caption"><strong>Figure 1.</strong> An ANR dialog displayed to the user.</p>
+</div>
+
+<p>It's possible to write code that wins every performance test in the world,
+but still feels sluggish, hang or freeze for significant periods, or take too
+long to process input. The worst thing that can happen to your app's responsiveness
+is an "Application Not Responding" (ANR) dialog.</p>
+
+<p>In Android, the system guards against applications that are insufficiently
+responsive for a period of time by displaying a dialog that says your app has
+stopped responding, such as the dialog
+in Figure 1. At this point, your app has been unresponsive for a considerable
+period of time so the system offers the user an option to quit the app. It's critical
+to design responsiveness into your application so the system never displays
+an ANR dialog to the user. </p>
+
+<p>This document describes how the Android system determines whether an
+application is not responding and provides guidelines for ensuring that your
+application stays responsive. </p>
+
+
+<h2 id="anr">What Triggers ANR?</h2>
+
+<p>Generally, the system displays an ANR if an application cannot respond to
+user input. For example, if an application blocks on some I/O operation
+(frequently a network access) on the UI thread so the system can't
+process incoming user input events. Or perhaps the app
+spends too much time building an elaborate in-memory
+structure or computing the next move in a game on the UI thread. It's always important to make
+sure these computations are efficient, but even the
+most efficient code still takes time to run.</p>
+
+<p>In any situation in which your app performs a potentially lengthy operation,
+<strong>you should not perform the work on the UI thread</strong>, but instead create a
+worker thread and do most of the work there. This keeps the UI thread (which drives the user
+interface event loop) running and prevents the system from concluding that your code
+has frozen. Because such threading usually is accomplished at the class
+level, you can think of responsiveness as a <em>class</em> problem. (Compare
+this with basic code performance, which is a <em>method</em>-level
+concern.)</p>
+
+<p>In Android, application responsiveness is monitored by the Activity Manager
+and Window Manager system services. Android will display the ANR dialog
+for a particular application when it detects one of the following
+conditions:</p>
+<ul>
+ <li>No response to an input event (such as key press or screen touch events)
+ within 5 seconds.</li>
+ <li>A {@link android.content.BroadcastReceiver BroadcastReceiver}
+ hasn't finished executing within 10 seconds.</li>
+</ul>
+
+
+
+<h2 id="Avoiding">How to Avoid ANRs</h2>
+
+<p>Android applications normally run entirely on a single thread by default
+the "UI thread" or "main thread").
+This means anything your application is doing in the UI thread that
+takes a long time to complete can trigger the ANR dialog because your
+application is not giving itself a chance to handle the input event or intent
+broadcasts.</p>
+
+<p>Therefore, any method that runs in the UI thread should do as little work
+as possible on that thread. In particular, activities should do as little as possible to set
+up in key life-cycle methods such as {@link android.app.Activity#onCreate onCreate()}
+and {@link android.app.Activity#onResume onResume()}.
+Potentially long running operations such as network
+or database operations, or computationally expensive calculations such as
+resizing bitmaps should be done in a worker thread (or in the case of databases
+operations, via an asynchronous request).</p>
+
+<p>The most effecive way to create a worker thread for longer
+operations is with the {@link android.os.AsyncTask}
+class. Simply extend {@link android.os.AsyncTask} and implement the
+{@link android.os.AsyncTask#doInBackground doInBackground()} method to perform the work.
+To post progress changes to the user, you can call
+ {@link android.os.AsyncTask#publishProgress publishProgress()}, which invokes the
+ {@link android.os.AsyncTask#onProgressUpdate onProgressUpdate()} callback method. From your
+ implementation of {@link android.os.AsyncTask#onProgressUpdate onProgressUpdate()} (which
+ runs on the UI thread), you can notify the user. For example:</p>
+
+<pre>
+private class DownloadFilesTask extends AsyncTask<URL, Integer, Long> {
+ // Do the long-running work in here
+ protected Long doInBackground(URL... urls) {
+ int count = urls.length;
+ long totalSize = 0;
+ for (int i = 0; i < count; i++) {
+ totalSize += Downloader.downloadFile(urls[i]);
+ publishProgress((int) ((i / (float) count) * 100));
+ // Escape early if cancel() is called
+ if (isCancelled()) break;
+ }
+ return totalSize;
+ }
+
+ // This is called each time you call publishProgress()
+ protected void onProgressUpdate(Integer... progress) {
+ setProgressPercent(progress[0]);
+ }
+
+ // This is called when doInBackground() is finished
+ protected void onPostExecute(Long result) {
+ showNotification("Downloaded " + result + " bytes");
+ }
+}
+</pre>
+
+ <p>To execute this worker thread, simply create an instance and
+ call {@link android.os.AsyncTask#execute execute()}:</p>
+
+<pre>
+new DownloadFilesTask().execute(url1, url2, url3);
+</pre>
+
+
+<p>Although it's more complicated than {@link android.os.AsyncTask}, you might want to instead
+create your own {@link java.lang.Thread} or {@link android.os.HandlerThread} class. If you do,
+you should set the thread priority to "background" priority by calling {@link
+android.os.Process#setThreadPriority Process.setThreadPriority()} and passing {@link
+android.os.Process#THREAD_PRIORITY_BACKGROUND}. If you don't set the thread to a lower priority
+this way, then the thread could still slow down your app because it operates at the same priority
+as the UI thread by default.</p>
+
+<p>If you implement {@link java.lang.Thread} or {@link android.os.HandlerThread},
+be sure that your UI thread does not block while waiting for the worker thread to
+complete—do not call {@link java.lang.Thread#wait Thread.wait()} or
+{@link java.lang.Thread#sleep Thread.sleep()}. Instead of blocking while waiting for a worker
+thread to complete, your main thread should provide a {@link
+android.os.Handler} for the other threads to post back to upon completion.
+Designing your application in this way will allow your app's UI thread to remain
+responsive to input and thus avoid ANR dialogs caused by the 5 second input
+event timeout.</p>
+
+<p>The specific constraint on {@link android.content.BroadcastReceiver} execution time
+emphasizes what broadcast receivers are meant to do:
+small, discrete amounts of work in the background such
+as saving a setting or registering a {@link android.app.Notification}. So as with other methods
+called in the UI thread, applications should avoid potentially long-running
+operations or calculations in a broadcast receiver. But instead of doing intensive
+tasks via worker threads, your
+application should start an {@link android.app.IntentService} if a
+potentially long running action needs to be taken in response to an intent
+broadcast.</p>
+
+<p class="note"><strong>Tip:</strong>
+You can use {@link android.os.StrictMode} to help find potentially
+long running operations such as network or database operations that
+you might accidentally be doing your main thread.</p>
+
+
+
+<h2 id="Reinforcing">Reinforce Responsiveness</h2>
+
+<p>Generally, 100 to 200ms is the threshold beyond which users will perceive
+slowness in an application. As such, here
+are some additional tips beyond what you should do to avoid ANR and
+make your application seem responsive to users:</p>
+
+<ul>
+ <li>If your application is doing work in the background in response to
+ user input, show that progress is being made (such as with a {@link
+ android.widget.ProgressBar} in your UI).</li>
+
+ <li>For games specifically, do calculations for moves in a worker
+ thread.</li>
+
+ <li>If your application has a time-consuming initial setup phase, consider
+ showing a splash screen or rendering the main view as quickly as possible, indicate that
+ loading is in progress and fill the information asynchronously. In either case, you should
+ indicate somehow that progress is being made, lest the user perceive that
+ the application is frozen.</li>
+
+ <li>Use performance tools such as <a href="{@docRoot}tools/help/systrace.html">Systrace</a>
+ and <a href="{@docRoot}tools/help/traceview.html">Traceview</a> to determine bottlenecks
+ in your app's responsiveness.</li>
+</ul>
diff --git a/docs/html/guide/practices/jni.jd b/docs/html/training/articles/perf-jni.jd
similarity index 99%
rename from docs/html/guide/practices/jni.jd
rename to docs/html/training/articles/perf-jni.jd
index ddfa0e3..26b06b4 100644
--- a/docs/html/guide/practices/jni.jd
+++ b/docs/html/training/articles/perf-jni.jd
@@ -1,8 +1,8 @@
page.title=JNI Tips
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>In this document</h2>
<ol>
diff --git a/docs/html/training/articles/perf-tips.jd b/docs/html/training/articles/perf-tips.jd
new file mode 100644
index 0000000..33b4b87
--- /dev/null
+++ b/docs/html/training/articles/perf-tips.jd
@@ -0,0 +1,433 @@
+page.title=Performance Tips
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#ObjectCreation">Avoid Creating Unnecessary Objects</a></li>
+ <li><a href="#PreferStatic">Prefer Static Over Virtual</a></li>
+ <li><a href="#UseFinal">Use Static Final For Constants</a></li>
+ <li><a href="#GettersSetters">Avoid Internal Getters/Setters</a></li>
+ <li><a href="#Loops">Use Enhanced For Loop Syntax</a></li>
+ <li><a href="#PackageInner">Consider Package Instead of Private Access with Private Inner Classes</a></li>
+ <li><a href="#AvoidFloat">Avoid Using Floating-Point</a></li>
+ <li><a href="#UseLibraries">Know and Use the Libraries</a></li>
+ <li><a href="#NativeMethods">Use Native Methods Carefully</a></li>
+ <li><a href="#library">Know And Use The Libraries</a></li>
+ <li><a href="#native_methods">Use Native Methods Judiciously</a></li>
+ <li><a href="#closing_notes">Closing Notes</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>This document primarily covers micro-optimizations that can improve overall app performance
+when combined, but it's unlikely that these changes will result in dramatic
+performance effects. Choosing the right algorithms and data structures should always be your
+priority, but is outside the scope of this document. You should use the tips in this document
+as general coding practices that you can incorporate into your habits for general code
+efficiency.</p>
+
+<p>There are two basic rules for writing efficient code:</p>
+<ul>
+ <li>Don't do work that you don't need to do.</li>
+ <li>Don't allocate memory if you can avoid it.</li>
+</ul>
+
+<p>One of the trickiest problems you'll face when micro-optimizing an Android
+app is that your app is certain to be running on multiple types of
+hardware. Different versions of the VM running on different
+processors running at different speeds. It's not even generally the case
+that you can simply say "device X is a factor F faster/slower than device Y",
+and scale your results from one device to others. In particular, measurement
+on the emulator tells you very little about performance on any device. There
+are also huge differences between devices with and without a
+<acronym title="Just In Time compiler">JIT</acronym>: the best
+code for a device with a JIT is not always the best code for a device
+without.</p>
+
+<p>To ensure your app performs well across a wide variety of devices, ensure
+your code is efficient at all levels and agressively optimize your performance.</p>
+
+
+<h2 id="ObjectCreation">Avoid Creating Unnecessary Objects</h2>
+
+<p>Object creation is never free. A generational garbage collector with per-thread allocation
+pools for temporary objects can make allocation cheaper, but allocating memory
+is always more expensive than not allocating memory.</p>
+
+<p>As you allocate more objects in your app, you will force a periodic
+garbage collection, creating little "hiccups" in the user experience. The
+concurrent garbage collector introduced in Android 2.3 helps, but unnecessary work
+should always be avoided.</p>
+
+<p>Thus, you should avoid creating object instances you don't need to. Some
+examples of things that can help:</p>
+
+<ul>
+ <li>If you have a method returning a string, and you know that its result
+ will always be appended to a {@link java.lang.StringBuffer} anyway, change your signature
+ and implementation so that the function does the append directly,
+ instead of creating a short-lived temporary object.</li>
+ <li>When extracting strings from a set of input data, try
+ to return a substring of the original data, instead of creating a copy.
+ You will create a new {@link java.lang.String} object, but it will share the {@code char[]}
+ with the data. (The trade-off being that if you're only using a small
+ part of the original input, you'll be keeping it all around in memory
+ anyway if you go this route.)</li>
+</ul>
+
+<p>A somewhat more radical idea is to slice up multidimensional arrays into
+parallel single one-dimension arrays:</p>
+
+<ul>
+ <li>An array of {@code int}s is a much better than an array of {@link java.lang.Integer}
+ objects,
+ but this also generalizes to the fact that two parallel arrays of ints
+ are also a <strong>lot</strong> more efficient than an array of {@code (int,int)}
+ objects. The same goes for any combination of primitive types.</li>
+
+ <li>If you need to implement a container that stores tuples of {@code (Foo,Bar)}
+ objects, try to remember that two parallel {@code Foo[]} and {@code Bar[]} arrays are
+ generally much better than a single array of custom {@code (Foo,Bar)} objects.
+ (The exception to this, of course, is when you're designing an API for
+ other code to access. In those cases, it's usually better to make a small
+ compromise to the speed in order to achieve a good API design. But in your own internal
+ code, you should try and be as efficient as possible.)</li>
+</ul>
+
+<p>Generally speaking, avoid creating short-term temporary objects if you
+can. Fewer objects created mean less-frequent garbage collection, which has
+a direct impact on user experience.</p>
+
+
+
+
+<h2 id="PreferStatic">Prefer Static Over Virtual</h2>
+
+<p>If you don't need to access an object's fields, make your method static.
+Invocations will be about 15%-20% faster.
+It's also good practice, because you can tell from the method
+signature that calling the method can't alter the object's state.</p>
+
+
+
+
+
+<h2 id="UseFinal">Use Static Final For Constants</h2>
+
+<p>Consider the following declaration at the top of a class:</p>
+
+<pre>
+static int intVal = 42;
+static String strVal = "Hello, world!";
+</pre>
+
+<p>The compiler generates a class initializer method, called
+<code><clinit></code>, that is executed when the class is first used.
+The method stores the value 42 into <code>intVal</code>, and extracts a
+reference from the classfile string constant table for <code>strVal</code>.
+When these values are referenced later on, they are accessed with field
+lookups.</p>
+
+<p>We can improve matters with the "final" keyword:</p>
+
+<pre>
+static final int intVal = 42;
+static final String strVal = "Hello, world!";
+</pre>
+
+<p>The class no longer requires a <code><clinit></code> method,
+because the constants go into static field initializers in the dex file.
+Code that refers to <code>intVal</code> will use
+the integer value 42 directly, and accesses to <code>strVal</code> will
+use a relatively inexpensive "string constant" instruction instead of a
+field lookup.</p>
+
+<p class="note"><strong>Note:</strong> This optimization applies only to primitive types and
+{@link java.lang.String} constants, not arbitrary reference types. Still, it's good
+practice to declare constants <code>static final</code> whenever possible.</p>
+
+
+
+
+
+<h2 id="GettersSetters">Avoid Internal Getters/Setters</h2>
+
+<p>In native languages like C++ it's common practice to use getters
+(<code>i = getCount()</code>) instead of accessing the field directly (<code>i
+= mCount</code>). This is an excellent habit for C++ and is often practiced in other
+object oriented languages like C# and Java, because the compiler can
+usually inline the access, and if you need to restrict or debug field access
+you can add the code at any time.</p>
+
+<p>However, this is a bad idea on Android. Virtual method calls are expensive,
+much more so than instance field lookups. It's reasonable to follow
+common object-oriented programming practices and have getters and setters
+in the public interface, but within a class you should always access
+fields directly.</p>
+
+<p>Without a <acronym title="Just In Time compiler">JIT</acronym>,
+direct field access is about 3x faster than invoking a
+trivial getter. With the JIT (where direct field access is as cheap as
+accessing a local), direct field access is about 7x faster than invoking a
+trivial getter.</p>
+
+<p>Note that if you're using <a href="{@docRoot}tools/help/proguard.html">ProGuard</a>,
+you can have the best of both worlds because ProGuard can inline accessors for you.</p>
+
+
+
+
+
+<h2 id="Loops">Use Enhanced For Loop Syntax</h2>
+
+<p>The enhanced <code>for</code> loop (also sometimes known as "for-each" loop) can be used
+for collections that implement the {@link java.lang.Iterable} interface and for arrays.
+With collections, an iterator is allocated to make interface calls
+to {@code hasNext()} and {@code next()}. With an {@link java.util.ArrayList},
+a hand-written counted loop is
+about 3x faster (with or without JIT), but for other collections the enhanced
+for loop syntax will be exactly equivalent to explicit iterator usage.</p>
+
+<p>There are several alternatives for iterating through an array:</p>
+
+<pre>
+static class Foo {
+ int mSplat;
+}
+
+Foo[] mArray = ...
+
+public void zero() {
+ int sum = 0;
+ for (int i = 0; i < mArray.length; ++i) {
+ sum += mArray[i].mSplat;
+ }
+}
+
+public void one() {
+ int sum = 0;
+ Foo[] localArray = mArray;
+ int len = localArray.length;
+
+ for (int i = 0; i < len; ++i) {
+ sum += localArray[i].mSplat;
+ }
+}
+
+public void two() {
+ int sum = 0;
+ for (Foo a : mArray) {
+ sum += a.mSplat;
+ }
+}
+</pre>
+
+<p><code>zero()</code> is slowest, because the JIT can't yet optimize away
+the cost of getting the array length once for every iteration through the
+loop.</p>
+
+<p><code>one()</code> is faster. It pulls everything out into local
+variables, avoiding the lookups. Only the array length offers a performance
+benefit.</p>
+
+<p><code>two()</code> is fastest for devices without a JIT, and
+indistinguishable from <strong>one()</strong> for devices with a JIT.
+It uses the enhanced for loop syntax introduced in version 1.5 of the Java
+programming language.</p>
+
+<p>So, you should use the enhanced <code>for</code> loop by default, but consider a
+hand-written counted loop for performance-critical {@link java.util.ArrayList} iteration.</p>
+
+<p class="note"><strong>Tip:</strong>
+Also see Josh Bloch's <em>Effective Java</em>, item 46.</p>
+
+
+
+<h2 id="PackageInner">Consider Package Instead of Private Access with Private Inner Classes</h2>
+
+<p>Consider the following class definition:</p>
+
+<pre>
+public class Foo {
+ private class Inner {
+ void stuff() {
+ Foo.this.doStuff(Foo.this.mValue);
+ }
+ }
+
+ private int mValue;
+
+ public void run() {
+ Inner in = new Inner();
+ mValue = 27;
+ in.stuff();
+ }
+
+ private void doStuff(int value) {
+ System.out.println("Value is " + value);
+ }
+}</pre>
+
+<p>What's important here is that we define a private inner class
+(<code>Foo$Inner</code>) that directly accesses a private method and a private
+instance field in the outer class. This is legal, and the code prints "Value is
+27" as expected.</p>
+
+<p>The problem is that the VM considers direct access to <code>Foo</code>'s
+private members from <code>Foo$Inner</code> to be illegal because
+<code>Foo</code> and <code>Foo$Inner</code> are different classes, even though
+the Java language allows an inner class to access an outer class' private
+members. To bridge the gap, the compiler generates a couple of synthetic
+methods:</p>
+
+<pre>
+/*package*/ static int Foo.access$100(Foo foo) {
+ return foo.mValue;
+}
+/*package*/ static void Foo.access$200(Foo foo, int value) {
+ foo.doStuff(value);
+}</pre>
+
+<p>The inner class code calls these static methods whenever it needs to
+access the <code>mValue</code> field or invoke the <code>doStuff()</code> method
+in the outer class. What this means is that the code above really boils down to
+a case where you're accessing member fields through accessor methods.
+Earlier we talked about how accessors are slower than direct field
+accesses, so this is an example of a certain language idiom resulting in an
+"invisible" performance hit.</p>
+
+<p>If you're using code like this in a performance hotspot, you can avoid the
+overhead by declaring fields and methods accessed by inner classes to have
+package access, rather than private access. Unfortunately this means the fields
+can be accessed directly by other classes in the same package, so you shouldn't
+use this in public API.</p>
+
+
+
+
+<h2 id="AvoidFloat">Avoid Using Floating-Point</h2>
+
+<p>As a rule of thumb, floating-point is about 2x slower than integer on
+Android-powered devices.</p>
+
+<p>In speed terms, there's no difference between <code>float</code> and
+<code>double</code> on the more modern hardware. Space-wise, <code>double</code>
+is 2x larger. As with desktop machines, assuming space isn't an issue, you
+should prefer <code>double</code> to <code>float</code>.</p>
+
+<p>Also, even for integers, some processors have hardware multiply but lack
+hardware divide. In such cases, integer division and modulus operations are
+performed in software—something to think about if you're designing a
+hash table or doing lots of math.</p>
+
+
+
+
+<h2 id="UseLibraries">Know and Use the Libraries</h2>
+
+<p>In addition to all the usual reasons to prefer library code over rolling
+your own, bear in mind that the system is at liberty to replace calls
+to library methods with hand-coded assembler, which may be better than the
+best code the JIT can produce for the equivalent Java. The typical example
+here is {@link java.lang.String#indexOf String.indexOf()} and
+related APIs, which Dalvik replaces with
+an inlined intrinsic. Similarly, the {@link java.lang.System#arraycopy
+System.arraycopy()} method
+is about 9x faster than a hand-coded loop on a Nexus One with the JIT.</p>
+
+
+<p class="note"><strong>Tip:</strong>
+Also see Josh Bloch's <em>Effective Java</em>, item 47.</p>
+
+
+
+
+<h2 id="NativeMethods">Use Native Methods Carefully</h2>
+
+<p>Developing your app with native code using the
+<a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK</a>
+isn't necessarily more efficient than programming with the
+Java language. For one thing,
+there's a cost associated with the Java-native transition, and the JIT can't
+optimize across these boundaries. If you're allocating native resources (memory
+on the native heap, file descriptors, or whatever), it can be significantly
+more difficult to arrange timely collection of these resources. You also
+need to compile your code for each architecture you wish to run on (rather
+than rely on it having a JIT). You may even have to compile multiple versions
+for what you consider the same architecture: native code compiled for the ARM
+processor in the G1 can't take full advantage of the ARM in the Nexus One, and
+code compiled for the ARM in the Nexus One won't run on the ARM in the G1.</p>
+
+<p>Native code is primarily useful when you have an existing native codebase
+that you want to port to Android, not for "speeding up" parts of your Android app
+written with the Java language.</p>
+
+<p>If you do need to use native code, you should read our
+<a href="{@docRoot}guide/practices/jni.html">JNI Tips</a>.</p>
+
+<p class="note"><strong>Tip:</strong>
+Also see Josh Bloch's <em>Effective Java</em>, item 54.</p>
+
+
+
+
+
+<h2 id="Myths">Performance Myths</h2>
+
+
+<p>On devices without a JIT, it is true that invoking methods via a
+variable with an exact type rather than an interface is slightly more
+efficient. (So, for example, it was cheaper to invoke methods on a
+<code>HashMap map</code> than a <code>Map map</code>, even though in both
+cases the map was a <code>HashMap</code>.) It was not the case that this
+was 2x slower; the actual difference was more like 6% slower. Furthermore,
+the JIT makes the two effectively indistinguishable.</p>
+
+<p>On devices without a JIT, caching field accesses is about 20% faster than
+repeatedly accesssing the field. With a JIT, field access costs about the same
+as local access, so this isn't a worthwhile optimization unless you feel it
+makes your code easier to read. (This is true of final, static, and static
+final fields too.)
+
+
+
+<h2 id="Measure">Always Measure</h2>
+
+<p>Before you start optimizing, make sure you have a problem that you
+need to solve. Make sure you can accurately measure your existing performance,
+or you won't be able to measure the benefit of the alternatives you try.</p>
+
+<p>Every claim made in this document is backed up by a benchmark. The source
+to these benchmarks can be found in the <a
+href="http://code.google.com/p/dalvik/source/browse/#svn/trunk/benchmarks">code.google.com
+"dalvik" project</a>.</p>
+
+<p>The benchmarks are built with the
+<a href="http://code.google.com/p/caliper/">Caliper</a> microbenchmarking
+framework for Java. Microbenchmarks are hard to get right, so Caliper goes out
+of its way to do the hard work for you, and even detect some cases where you're
+not measuring what you think you're measuring (because, say, the VM has
+managed to optimize all your code away). We highly recommend you use Caliper
+to run your own microbenchmarks.</p>
+
+<p>You may also find
+<a href="{@docRoot}tools/debugging/debugging-tracing.html">Traceview</a> useful
+for profiling, but it's important to realize that it currently disables the JIT,
+which may cause it to misattribute time to code that the JIT may be able to win
+back. It's especially important after making changes suggested by Traceview
+data to ensure that the resulting code actually runs faster when run without
+Traceview.</p>
+
+<p>For more help profiling and debugging your apps, see the following documents:</p>
+
+<ul>
+ <li><a href="{@docRoot}tools/debugging/debugging-tracing.html">Profiling with
+ Traceview and dmtracedump</a></li>
+ <li><a href="{@docRoot}tools/debugging/systrace.html">Analysing Display and Performance
+ with Systrace</a></li>
+</ul>
+
diff --git a/docs/html/training/articles/security-tips.jd b/docs/html/training/articles/security-tips.jd
new file mode 100644
index 0000000..88d6017
--- /dev/null
+++ b/docs/html/training/articles/security-tips.jd
@@ -0,0 +1,759 @@
+page.title=Security Tips
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#StoringData">Storing Data</a></li>
+ <li><a href="#Permissions">Using Permissions</a></li>
+ <li><a href="#Networking">Using Networking</a></li>
+ <li><a href="#InputValidation">Performing Input Validation</a></li>
+ <li><a href="#UserData">Handling User Data</a></li>
+ <li><a href="#WebView">Using WebView</a></li>
+ <li><a href="#Crypto">Using Cryptography</a></li>
+ <li><a href="#IPC">Using Interprocess Communication</a></li>
+ <li><a href="#DynamicCode">Dynamically Loading Code</a></li>
+ <li><a href="#Dalvik">Security in a Virtual Machine</a></li>
+ <li><a href="#Native">Security in Native Code</a></li>
+</ol>
+<h2>See also</h2>
+<ol>
+<li><a href="http://source.android.com/tech/security/index.html">Android
+Security Overview</a></li>
+<li><a href="{@docRoot}guide/topics/security/permissions.html">Permissions</a></li>
+</ol>
+</div></div>
+
+
+<p>Android has security features built
+into the operating system that significantly reduce the frequency and impact of
+application security issues. The system is designed so you can typically build your apps with
+default system and file permissions and avoid difficult decisions about security.</p>
+
+<p>Some of the core security features that help you build secure apps
+include:
+<ul>
+<li>The Android Application Sandbox, which isolates your app data and code execution
+from other apps.</li>
+<li>An application framework with robust implementations of common
+security functionality such as cryptography, permissions, and secure
+<acronym title="Interprocess Communication">IPC</acronym>.</li>
+<li>Technologies like ASLR, NX, ProPolice, safe_iop, OpenBSD dlmalloc, OpenBSD
+calloc, and Linux mmap_min_addr to mitigate risks associated with common memory
+management errors.</li>
+<li>An encrypted filesystem that can be enabled to protect data on lost or
+stolen devices.</li>
+<li>User-granted permissions to restrict access to system features and user data.</li>
+<li>Application-defined permissions to control application data on a per-app basis.</li>
+</ul>
+
+<p>Nevertheless, it is important that you be familiar with the Android
+security best practices in this document. Following these practices as general coding habits
+will reduce the likelihood of inadvertently introducing security issues that
+adversely affect your users.</p>
+
+
+
+<h2 id="StoringData">Storing Data</h2>
+
+<p>The most common security concern for an application on Android is whether the data
+that you save on the device is accessible to other apps. There are three fundamental
+ways to save data on the device:</p>
+
+<h3 id="InternalStorage">Using internal storage</h3>
+
+<p>By default, files that you create on <a
+href="{@docRoot}guide/topics/data/data-storage.html#filesInternal">internal
+storage</a> are accessible only to your app. This
+protection is implemented by Android and is sufficient for most
+applications.</p>
+
+<p>You should generally avoid using the {@link android.content.Context#MODE_WORLD_WRITEABLE} or
+{@link android.content.Context#MODE_WORLD_READABLE} modes for
+<acronym title="Interprocess Communication">IPC</acronym> files because they do not provide
+the ability to limit data access to particular applications, nor do they
+provide any control on data format. If you want to share your data with other
+app processes, you might instead consider using a
+<a href="{@docRoot}guide/topics/providers/content-providers.html">content provider</a>, which
+offers read and write permissions to other apps and can make
+dynamic permission grants on a case-by-case basis.</p>
+
+<p>To provide additional protection for sensitive data, you might
+choose to encrypt local files using a key that is not directly accessible to the
+application. For example, a key can be placed in a {@link java.security.KeyStore}
+and protected with a user password that is not stored on the device. While this
+does not protect data from a root compromise that can monitor the user
+inputting the password, it can provide protection for a lost device without <a
+href="http://source.android.com/tech/encryption/index.html">file system
+encryption</a>.</p>
+
+
+<h3 id="ExternalStorage">Using external storage</h3>
+
+<p>Files created on <a
+href="{@docRoot}guide/topics/data/data-storage.html#filesExternal">external
+storage</a>, such as SD Cards, are globally readable and writable. Because
+external storage can be removed by the user and also modified by any
+application, you should not store sensitive information using
+external storage.</p>
+
+<p>As with data from any untrusted source, you should <a href="#InputValidation">perform input
+validation</a> when handling data from external storage.
+We strongly recommend that you not store executables or
+class files on external storage prior to dynamic loading. If your app
+does retrieve executable files from external storage, the files should be signed and
+cryptographically verified prior to dynamic loading.</p>
+
+
+<h3 id="ContentProviders">Using content providers</h3>
+
+<p><a href="{@docRoot}guide/topics/providers/content-providers.html">Content providers</a>
+offer a structured storage mechanism that can be limited
+to your own application or exported to allow access by other applications.
+If you do not intend to provide other
+applications with access to your {@link android.content.ContentProvider}, mark them as <code><a
+href="{@docRoot}guide/topics/manifest/provider-element.html#exported">
+android:exported=false</a></code> in the application manifest. Otherwise, set the <code><a
+href="{@docRoot}guide/topics/manifest/provider-element.html#exported">android:exported</a></code>
+attribute {@code "true"} to allow other apps to access the stored data.
+</p>
+
+<p>When creating a {@link android.content.ContentProvider}
+that will be exported for use by other applications, you can specify a single
+<a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission
+</a> for reading and writing, or distinct permissions for reading and writing
+within the manifest. We recommend that you limit your permissions to those
+required to accomplish the task at hand. Keep in mind that it’s usually
+easier to add permissions later to expose new functionality than it is to take
+them away and break existing users.</p>
+
+<p>If you are using a content provider
+for sharing data between only your own apps, it is preferable to use the
+<a href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">{@code
+android:protectionLevel}</a> attribute set to {@code "signature"} protection.
+Signature permissions do not require user confirmation,
+so they provide a better user experience and more controlled access to the
+content provider data when the apps accessing the data are
+<a href="{@docRoot}tools/publishing/app-signing.html">signed</a> with
+the same key.</p>
+
+<p>Content providers can also provide more granular access by declaring the <a
+href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">{@code
+android:grantUriPermissions}</a> attribute and using the {@link
+android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION} and {@link
+android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION} flags in the
+{@link android.content.Intent} object
+that activates the component. The scope of these permissions can be further
+limited by the <code><a
+href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">
+<grant-uri-permission element></a></code>.</p>
+
+<p>When accessing a content provider, use parameterized query methods such as
+{@link android.content.ContentProvider#query(Uri,String[],String,String[],String) query()},
+{@link android.content.ContentProvider#update(Uri,ContentValues,String,String[]) update()}, and
+{@link android.content.ContentProvider#delete(Uri,String,String[]) delete()} to avoid
+potential SQL injection from untrusted sources. Note that using parameterized methods is not
+sufficient if the <code>selection</code> argument is built by concatenating user data
+prior to submitting it to the method.</p>
+
+<p>Do not have a false sense of security about the write permission. Consider
+that the write permission allows SQL statements which make it possible for some
+data to be confirmed using creative <code>WHERE</code> clauses and parsing the
+results. For example, an attacker might probe for presence of a specific phone
+number in a call-log by modifying a row only if that phone number already
+exists. If the content provider data has predictable structure, the write
+permission may be equivalent to providing both reading and writing.</p>
+
+
+
+
+
+
+
+<h2 id="Permissions">Using Permissions</h2>
+
+<p>Because Android sandboxes applications from each other, applications must explicitly
+share resources and data. They do this by declaring the permissions they need for additional
+capabilities not provided by the basic sandbox, including access to device features such as
+the camera.</p>
+
+
+<h3 id="RequestingPermissions">Requesting Permissions</h3>
+
+<p>We recommend minimizing the number of permissions that your app requests
+Not having access to sensitive permissions reduces the risk of
+inadvertently misusing those permissions, can improve user adoption, and makes
+your app less for attackers. Generally,
+if a permission is not required for your app to function, do not request it.</p>
+
+<p>If it's possible to design your application in a way that does not require
+any permissions, that is preferable. For example, rather than requesting access
+to device information to create a unique identifier, create a <a
+href="{@docRoot}reference/java/util/UUID.html">GUID</a> for your application
+(see the section about <a href="#UserData">Handling User Data</a>). Or, rather than
+using external storage (which requires permission), store data
+on the internal storage.</p>
+
+<p>In addition to requesting permissions, your application can use the <a
+href="{@docRoot}guide/topics/manifest/permission-element.html">{@code <permissions>}</a>
+to protect IPC that is security sensitive and will be exposed to other
+applications, such as a {@link android.content.ContentProvider}.
+In general, we recommend using access controls
+other than user confirmed permissions where possible because permissions can
+be confusing for users. For example, consider using the <a
+href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">signature
+protection level</a> on permissions for IPC communication between applications
+provided by a single developer.</p>
+
+<p>Do not leak permission-protected data. This occurs when your app exposes data
+over IPC that is only available because it has a specific permission, but does
+not require that permission of any clients of it’s IPC interface. More
+details on the potential impacts, and frequency of this type of problem is
+provided in this research paper published at USENIX: <a
+href="http://www.cs.berkeley.edu/~afelt/felt_usenixsec2011.pdf">http://www.cs.be
+rkeley.edu/~afelt/felt_usenixsec2011.pdf</a></p>
+
+
+
+<h3 id="CreatingPermissions">Creating Permissions</h3>
+
+<p>Generally, you should strive to define as few permissions as possible while
+satisfying your security requirements. Creating a new permission is relatively
+uncommon for most applications, because the <a
+href="{@docRoot}reference/android/Manifest.permission.html">system-defined
+permissions</a> cover many situations. Where appropriate,
+perform access checks using existing permissions.</p>
+
+<p>If you must create a new permission, consider whether you can accomplish
+your task with a <a
+href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">"signature"
+protection level</a>. Signature permissions are transparent
+to the user and only allow access by applications signed by the same developer
+as application performing the permission check.</p>
+
+<p>If you create a permission with the <a
+href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">"dangerous"
+protection level</a>, there are a number of complexities
+that you need to consider:
+<ul>
+<li>The permission must have a string that concisely expresses to a user the
+security decision they will be required to make.</li>
+<li>The permission string must be localized to many different languages.</li>
+<li>Users may choose not to install an application because a permission is
+confusing or perceived as risky.</li>
+<li>Applications may request the permission when the creator of the permission
+has not been installed.</li>
+</ul>
+
+<p>Each of these poses a significant non-technical challenge for you as the developer
+while also confusing your users,
+which is why we discourage the use of the "dangerous" permission level.</p>
+
+
+
+
+
+<h2 id="Networking">Using Networking</h2>
+
+<p>Network transactions are inherently risky for security, because it involves transmitting
+data that is potentially private to the user. People are increasingly aware of the privacy
+concerns of a mobile device, especially when the device performs network transactions,
+so it's very important that your app implement all best practices toward keeping the user's
+data secure at all times.</p>
+
+<h3 id="IPNetworking">Using IP Networking</h3>
+
+<p>Networking on Android is not significantly different from other Linux
+environments. The key consideration is making sure that appropriate protocols
+are used for sensitive data, such as {@link javax.net.ssl.HttpsURLConnection} for
+secure web traffic. We prefer use of HTTPS over HTTP anywhere that HTTPS is
+supported on the server, because mobile devices frequently connect on networks
+that are not secured, such as public Wi-Fi hotspots.</p>
+
+<p>Authenticated, encrypted socket-level communication can be easily
+implemented using the {@link javax.net.ssl.SSLSocket}
+class. Given the frequency with which Android devices connect to unsecured
+wireless networks using Wi-Fi, the use of secure networking is strongly
+encouraged for all applications that communicate over the network.</p>
+
+<p>We have seen some applications use <a
+href="http://en.wikipedia.org/wiki/Localhost">localhost</a> network ports for
+handling sensitive IPC. We discourage this approach since these interfaces are
+accessible by other applications on the device. Instead, you should use an Android IPC
+mechanism where authentication is possible such as with a {@link android.app.Service}. (Even
+worse than using loopback is to bind to INADDR_ANY since then your application
+may receive requests from anywhere.)</p>
+
+<p>Also, one common issue that warrants repeating is to make sure that you do
+not trust data downloaded from HTTP or other insecure protocols. This includes
+validation of input in {@link android.webkit.WebView} and
+any responses to intents issued against HTTP.</p>
+
+
+<h3>Using Telephony Networking</h3>
+
+<p>The <acronym title="Short Message Service">SMS</acronym> protocol was primarily designed for
+user-to-user communication and is not well-suited for apps that want to transfer data.
+Due to the limitations of SMS, we strongly recommend the use of <a
+href="{@docRoot}guide/google/gcm/index.html">Google Cloud Messaging</a> (GCM)
+and IP networking for sending data messages from a web server to your app on a user device.</p>
+
+<p>Beware that SMS is neither encrypted nor strongly
+authenticated on either the network or the device. In particular, any SMS receiver
+should expect that a malicious user may have sent the SMS to your application—Do
+not rely on unauthenticated SMS data to perform sensitive commands.
+Also, you should be aware that SMS may be subject to spoofing and/or
+interception on the network. On the Android-powered device itself, SMS
+messages are transmitted as broadcast intents, so they may be read or captured
+by other applications that have the {@link android.Manifest.permission#READ_SMS}
+permission.</p>
+
+
+
+
+
+<h2 id="InputValidation">Performing Input Validation</h2>
+
+<p>Insufficient input validation is one of the most common security problems
+affecting applications, regardless of what platform they run on. Android does
+have platform-level countermeasures that reduce the exposure of applications to
+input validation issues and you should use those features where possible. Also
+note that selection of type-safe languages tends to reduce the likelihood of
+input validation issues.</p>
+
+<p>If you are using native code, then any data read from files, received over
+the network, or received from an IPC has the potential to introduce a security
+issue. The most common problems are <a
+href="http://en.wikipedia.org/wiki/Buffer_overflow">buffer overflows</a>, <a
+href="http://en.wikipedia.org/wiki/Double_free#Use_after_free">use after
+free</a>, and <a
+href="http://en.wikipedia.org/wiki/Off-by-one_error">off-by-one errors</a>.
+Android provides a number of technologies like <acronym
+title="Address Space Layout Randomization">ASLR</acronym> and <acronym
+title="Data Execution Prevention">DEP</acronym> that reduce the
+exploitability of these errors, but they do not solve the underlying problem.
+You can prevent these vulneratbilities by careful handling pointers and managing
+buffers.</p>
+
+<p>Dynamic, string based languages such as JavaScript and SQL are also subject
+to input validation problems due to escape characters and <a
+href="http://en.wikipedia.org/wiki/Code_injection">script injection</a>.</p>
+
+<p>If you are using data within queries that are submitted to an SQL database or a
+content provider, SQL injection may be an issue. The best defense is to use
+parameterized queries, as is discussed in the above section about <a
+href="#ContentProviders">content providers</a>.
+Limiting permissions to read-only or write-only can also reduce the potential
+for harm related to SQL injection.</p>
+
+<p>If you cannot use the security features above, we strongly recommend the use
+of well-structured data formats and verifying that the data conforms to the
+expected format. While blacklisting of characters or character-replacement can
+be an effective strategy, these techniques are error-prone in practice and
+should be avoided when possible.</p>
+
+
+
+
+
+<h2 id="UserData">Handling User Data</h2>
+
+<p>In general, the best approach for user data security is to minimize the use of APIs that access
+sensitive or personal user data. If you have access to user data and can avoid
+storing or transmitting the information, do not store or transmit the data.
+Finally, consider if there is a way that your application logic can be
+implemented using a hash or non-reversible form of the data. For example, your
+application might use the hash of an an email address as a primary key, to
+avoid transmitting or storing the email address. This reduces the chances of
+inadvertently exposing data, and it also reduces the chance of attackers
+attempting to exploit your application.</p>
+
+<p>If your application accesses personal information such as passwords or
+usernames, keep in mind that some jurisdictions may require you to provide a
+privacy policy explaining your use and storage of that data. So following the
+security best practice of minimizing access to user data may also simplify
+compliance.</p>
+
+<p>You should also consider whether your application might be inadvertently
+exposing personal information to other parties such as third-party components
+for advertising or third-party services used by your application. If you don't
+know why a component or service requires a personal information, don’t
+provide it. In general, reducing the access to personal information by your
+application will reduce the potential for problems in this area.</p>
+
+<p>If access to sensitive data is required, evaluate whether that information
+must be transmitted to a server, or whether the operation can be performed on
+the client. Consider running any code using sensitive data on the client to
+avoid transmitting user data.</p>
+
+<p>Also, make sure that you do not inadvertently expose user data to other
+application on the device through overly permissive IPC, world writable files,
+or network sockets. This is a special case of leaking permission-protected data,
+discussed in the <a href="#RequestingPermissions">Requesting Permissions</a> section.</p>
+
+<p>If a <acronym title="Globally Unique Identifier">GUID</acronym>
+is required, create a large, unique number and store it. Do not
+use phone identifiers such as the phone number or IMEI which may be associated
+with personal information. This topic is discussed in more detail in the <a
+href="http://android-developers.blogspot.com/2011/03/identifying-app-installations.html">Android
+Developer Blog</a>.</p>
+
+<p>Be careful when writing to on-device logs.
+In Android, logs are a shared resource, and are available
+to an application with the {@link android.Manifest.permission#READ_LOGS} permission.
+Even though the phone log data
+is temporary and erased on reboot, inappropriate logging of user information
+could inadvertently leak user data to other applications.</p>
+
+
+
+
+
+
+<h2 id="WebView">Using WebView</h2>
+
+<p>Because {@link android.webkit.WebView} consumes web content that can include HTML and JavaScript,
+improper use can introduce common web security issues such as <a
+href="http://en.wikipedia.org/wiki/Cross_site_scripting">cross-site-scripting</a>
+(JavaScript injection). Android includes a number of mechanisms to reduce
+the scope of these potential issues by limiting the capability of {@link android.webkit.WebView} to
+the minimum functionality required by your application.</p>
+
+<p>If your application does not directly use JavaScript within a {@link android.webkit.WebView}, do
+<em>not</em> call {@link android.webkit.WebSettings#setJavaScriptEnabled setJavaScriptEnabled()}.
+Some sample code uses this method, which you might repurpose in production
+application, so remove that method call if it's not required. By default,
+{@link android.webkit.WebView} does
+not execute JavaScript so cross-site-scripting is not possible.</p>
+
+<p>Use {@link android.webkit.WebView#addJavascriptInterface
+addJavaScriptInterface()} with
+particular care because it allows JavaScript to invoke operations that are
+normally reserved for Android applications. If you use it, expose
+{@link android.webkit.WebView#addJavascriptInterface addJavaScriptInterface()} only to
+web pages from which all input is trustworthy. If untrusted input is allowed,
+untrusted JavaScript may be able to invoke Android methods within your app. In general, we
+recommend exposing {@link android.webkit.WebView#addJavascriptInterface
+addJavaScriptInterface()} only to JavaScript that is contained within your application APK.</p>
+
+<p>If your application accesses sensitive data with a
+{@link android.webkit.WebView}, you may want to use the
+{@link android.webkit.WebView#clearCache clearCache()} method to delete any files stored
+locally. Server-side
+headers like <code>no-cache</code> can also be used to indicate that an application should
+not cache particular content.</p>
+
+
+
+
+<h3 id="Credentials">Handling Credentials</h3>
+
+<p>In general, we recommend minimizing the frequency of asking for user
+credentials—to make phishing attacks more conspicuous, and less likely to be
+successful. Instead use an authorization token and refresh it.</p>
+
+<p>Where possible, username and password should not be stored on the device.
+Instead, perform initial authentication using the username and password
+supplied by the user, and then use a short-lived, service-specific
+authorization token.</p>
+
+<p>Services that will be accessible to multiple applications should be accessed
+using {@link android.accounts.AccountManager}. If possible, use the
+{@link android.accounts.AccountManager} class to invoke a cloud-based service and do not store
+passwords on the device.</p>
+
+<p>After using {@link android.accounts.AccountManager} to retrieve an
+{@link android.accounts.Account}, {@link android.accounts.Account#CREATOR}
+before passing in any credentials, so that you do not inadvertently pass
+credentials to the wrong application.</p>
+
+<p>If credentials are to be used only by applications that you create, then you
+can verify the application which accesses the {@link android.accounts.AccountManager} using
+{@link android.content.pm.PackageManager#checkSignatures checkSignature()}.
+Alternatively, if only one application will use the credential, you might use a
+{@link java.security.KeyStore} for storage.</p>
+
+
+
+
+
+<h2 id="Crypto">Using Cryptography</h2>
+
+<p>In addition to providing data isolation, supporting full-filesystem
+encryption, and providing secure communications channels, Android provides a
+wide array of algorithms for protecting data using cryptography.</p>
+
+<p>In general, try to use the highest level of pre-existing framework
+implementation that can support your use case. If you need to securely
+retrieve a file from a known location, a simple HTTPS URI may be adequate and
+requires no knowledge of cryptography. If you need a secure
+tunnel, consider using {@link javax.net.ssl.HttpsURLConnection} or
+{@link javax.net.ssl.SSLSocket}, rather than writing your own protocol.</p>
+
+<p>If you do find yourself needing to implement your own protocol, we strongly
+recommend that you <em>not</em> implement your own cryptographic algorithms. Use
+existing cryptographic algorithms such as those in the implementation of AES or
+RSA provided in the {@link javax.crypto.Cipher} class.</p>
+
+<p>Use a secure random number generator, {@link java.security.SecureRandom},
+to initialize any cryptographic keys, {@link javax.crypto.KeyGenerator}.
+Use of a key that is not generated with a secure random
+number generator significantly weakens the strength of the algorithm, and may
+allow offline attacks.</p>
+
+<p>If you need to store a key for repeated use, use a mechanism like
+ {@link java.security.KeyStore} that
+provides a mechanism for long term storage and retrieval of cryptographic
+keys.</p>
+
+
+
+
+
+<h2 id="IPC">Using Interprocess Communication</h2>
+
+<p>Some apps attempt to implement IPC using traditional Linux
+techniques such as network sockets and shared files. We strongly encourage you to instead
+use Android system functionality for IPC such as {@link android.content.Intent},
+{@link android.os.Binder} or {@link android.os.Messenger} with a {@link
+android.app.Service}, and {@link android.content.BroadcastReceiver}.
+The Android IPC mechanisms allow you to verify the identity of
+the application connecting to your IPC and set security policy for each IPC
+mechanism.</p>
+
+<p>Many of the security elements are shared across IPC mechanisms.
+If your IPC mechanism is not intended for use by other applications, set the
+{@code android:exported} attribute to {@code "false"} in the component's manifest element,
+such as for the <a
+href="{@docRoot}guide/topics/manifest/service-element.html#exported">{@code <service>}</a>
+element. This is useful for applications that consist of multiple processes
+within the same UID, or if you decide late in development that you do not
+actually want to expose functionality as IPC but you don’t want to rewrite
+the code.</p>
+
+<p>If your IPC is intended to be accessible to other applications, you can
+apply a security policy by using the <a
+href="{@docRoot}guide/topics/manifest/permission-element.html">{@code <permission>}</a>
+element. If IPC is between your own separate apps that are signed with the same key,
+it is preferable to use {@code "signature"} level permission in the <a
+href="{@docRoot}guide/topics/manifest/permission-element.html#plevel">{@code
+android:protectionLevel}</a>.</p>
+
+
+
+
+<h3>Using intents</h3>
+
+<p>Intents are the preferred mechanism for asynchronous IPC in Android.
+Depending on your application requirements, you might use {@link
+android.content.Context#sendBroadcast sendBroadcast()}, {@link
+android.content.Context#sendOrderedBroadcast sendOrderedBroadcast()},
+or an explicit intent to a specific application component.</p>
+
+<p>Note that ordered broadcasts can be “consumed” by a recipient, so they
+may not be delivered to all applications. If you are sending an intent that muse be delivered
+to a specific receiver, then you must use an explicit intent that declares the receiver
+by nameintent.</p>
+
+<p>Senders of an intent can verify that the recipient has a permission
+specifying a non-Null permission with the method call. Only applications with that
+permission will receive the intent. If data within a broadcast intent may be
+sensitive, you should consider applying a permission to make sure that
+malicious applications cannot register to receive those messages without
+appropriate permissions. In those circumstances, you may also consider
+invoking the receiver directly, rather than raising a broadcast.</p>
+
+<p class="note"><strong>Note:</strong> Intent filters should not be considered
+a security feature—components
+can be invoked with explicit intents and may not have data that would conform to the intent
+filter. You should perform input validation within your intent receiver to
+confirm that it is properly formatted for the invoked receiver, service, or
+activity.</p>
+
+
+
+
+<h3 id="Services">Using services</h3>
+
+<p>A {@link android.app.Service} is often used to supply functionality for other applications to
+use. Each service class must have a corresponding <a
+href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> declaration in its
+manifest file.</p>
+
+<p>By default, services are not exported and cannot be invoked by any other
+application. However, if you add any intent filters to the service declaration, then it is exported
+by default. It's best if you explicitly declare the <a
+href="{@docRoot}guide/topics/manifest/service-element.html#exported">{@code
+android:exported}</a> attribute to be sure it behaves as you'd like.
+Services can also be protected using the <a
+href="{@docRoot}guide/topics/manifest/service-element.html#prmsn">{@code android:permission}</a>
+attribute. By doing so, other applications will need to declare
+a corresponding <code><a
+href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a>
+</code> element in their own manifest to be
+able to start, stop, or bind to the service.</p>
+
+<p>A service can protect individual IPC calls into it with permissions, by
+calling {@link android.content.Context#checkCallingPermission
+checkCallingPermission()} before executing
+the implementation of that call. We generally recommend using the
+declarative permissions in the manifest, since those are less prone to
+oversight.</p>
+
+
+
+<h3>Using binder and messenger interfaces</h3>
+
+<p>Using {@link android.os.Binder} or {@link android.os.Messenger} is the
+preferred mechanism for RPC-style IPC in Android. They provide a well-defined
+interface that enables mutual authentication of the endpoints, if required.</p>
+
+<p>We strongly encourage designing interfaces in a manner that does not require
+interface specific permission checks. {@link android.os.Binder} and
+{@link android.os.Messenger} objects are not declared within the
+application manifest, and therefore you cannot apply declarative permissions
+directly to them. They generally inherit permissions declared in the
+application manifest for the {@link android.app.Service} or {@link
+android.app.Activity} within which they are
+implemented. If you are creating an interface that requires authentication
+and/or access controls, those controls must be
+explicitly added as code in the {@link android.os.Binder} or {@link android.os.Messenger}
+interface.</p>
+
+<p>If providing an interface that does require access controls, use {@link
+android.content.Context#checkCallingPermission checkCallingPermission()}
+to verify whether the
+caller has a required permission. This is especially important
+before accessing a service on behalf of the caller, as the identify of your
+application is passed to other interfaces. If invoking an interface provided
+by a {@link android.app.Service}, the {@link
+android.content.Context#bindService bindService()}
+ invocation may fail if you do not have permission to access the given service.
+ If calling an interface provided locally by your own application, it may be
+useful to use the {@link android.os.Binder#clearCallingIdentity clearCallingIdentity()}
+to satisfy internal security checks.</p>
+
+<p>For more information about performing IPC with a service, see
+<a href="{@docRoot}guide/components/bound-services.html">Bound Services</a>.</p>
+
+
+
+<h3 id="BroadcastReceivers">Using broadcast receivers</h3>
+
+<p>A {@link android.content.BroadcastReceiver} handles asynchronous requests initiated by
+an {@link android.content.Intent}.</p>
+
+<p>By default, receivers are exported and can be invoked by any other
+application. If your {@link android.content.BroadcastReceiver}
+is intended for use by other applications, you
+may want to apply security permissions to receivers using the <code><a
+href="{@docRoot}guide/topics/manifest/receiver-element.html">
+<receiver></a></code> element within the application manifest. This will
+prevent applications without appropriate permissions from sending an intent to
+the {@link android.content.BroadcastReceiver}.</p>
+
+
+
+
+
+
+
+
+<h2 id="DynamicCode">Dynamically Loading Code</h2>
+
+<p>We strongly discourage loading code from outside of your application APK.
+Doing so significantly increases the likelihood of application compromise due
+to code injection or code tampering. It also adds complexity around version
+management and application testing. Finally, it can make it impossible to
+verify the behavior of an application, so it may be prohibited in some
+environments.</p>
+
+<p>If your application does dynamically load code, the most important thing to
+keep in mind about dynamically loaded code is that it runs with the same
+security permissions as the application APK. The user made a decision to
+install your application based on your identity, and they are expecting that
+you provide any code run within the application, including code that is
+dynamically loaded.</p>
+
+<p>The major security risk associated with dynamically loading code is that the
+code needs to come from a verifiable source. If the modules are included
+directly within your APK, then they cannot be modified by other applications.
+This is true whether the code is a native library or a class being loaded using
+{@link dalvik.system.DexClassLoader}. We have seen many instances of applications
+attempting to load code from insecure locations, such as downloaded from the
+network over unencrypted protocols or from world writable locations such as
+external storage. These locations could allow someone on the network to modify
+the content in transit, or another application on a users device to modify the
+content on the device, respectively.</p>
+
+
+
+
+
+<h2 id="Dalvik">Security in a Virtual Machine</h2>
+
+<p>Dalvik is Android's runtime virtual machine (VM). Dalvik was built specifically for Android,
+but many of the concerns regarding secure code in other virtual machines also apply to Android.
+In general, you shouldn't concern yourself with security issues relating to the virtual machine.
+Your application runs in a secure sandbox environment, so other processes on the system cannnot
+access your code or private data.</p>
+
+<p>If you're interested in diving deeper on the subject of virtual machine security,
+we recommend that you familiarize yourself with some
+existing literature on the subject. Two of the more popular resources are:
+<ul>
+<li><a href="http://www.securingjava.com/toc.html">
+http://www.securingjava.com/toc.html</a></li>
+<li><a
+href="https://www.owasp.org/index.php/Java_Security_Resources">
+https://www.owasp.org/index.php/Java_Security_Resources</a></li>
+</ul></p>
+
+<p>This document is focused on the areas which are Android specific or
+different from other VM environments. For developers experienced with VM
+programming in other environments, there are two broad issues that may be
+different about writing apps for Android:
+<ul>
+<li>Some virtual machines, such as the JVM or .net runtime, act as a security
+boundary, isolating code from the underlying operating system capabilities. On
+Android, the Dalvik VM is not a security boundary—the application sandbox is
+implemented at the OS level, so Dalvik can interoperate with native code in the
+same application without any security constraints.</li>
+
+<li>Given the limited storage on mobile devices, it’s common for developers
+to want to build modular applications and use dynamic class loading. When
+doing this, consider both the source where you retrieve your application logic
+and where you store it locally. Do not use dynamic class loading from sources
+that are not verified, such as unsecured network sources or external storage,
+because that code might be modified to include malicious behavior.</li>
+</ul>
+
+
+
+<h2 id="Native">Security in Native Code</h2>
+
+<p>In general, we encourage developers to use the Android SDK for
+application development, rather than using native code with the
+<a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK</a>. Applications built
+with native code are more complex, less portable, and more like to include
+common memory corruption errors such as buffer overflows.</p>
+
+<p>Android is built using the Linux kernel and being familiar with Linux
+development security best practices is especially useful if you are going to
+use native code. Linux security practices are beyond the scope of this document,
+but one of the most popular resources is “Secure Programming for
+Linux and Unix HOWTO”, available at <a
+href="http://www.dwheeler.com/secure-programs">
+http://www.dwheeler.com/secure-programs</a>.</p>
+
+<p>An important difference between Android and most Linux environments is the
+Application Sandbox. On Android, all applications run in the Application
+Sandbox, including those written with native code. At the most basic level, a
+good way to think about it for developers familiar with Linux is to know that
+every application is given a unique <acronym title="User Identifier">UID</acronym>
+with very limited permissions. This is discussed in more detail in the <a
+href="http://source.android.com/tech/security/index.html">Android Security
+Overview</a> and you should be familiar with application permissions even if
+you are using native code.</p>
+
diff --git a/docs/html/training/best-performance.jd b/docs/html/training/best-performance.jd
new file mode 100644
index 0000000..8ea6fd5
--- /dev/null
+++ b/docs/html/training/best-performance.jd
@@ -0,0 +1,8 @@
+page.title=Best Practices for Performance
+page.trainingcourse=true
+
+@jd:body
+
+
+<p>These classes and articles help you build an app that's smooth, responsive,
+and uses as little battery as possible.</p>
\ No newline at end of file
diff --git a/docs/html/training/best-security.jd b/docs/html/training/best-security.jd
new file mode 100644
index 0000000..ddd0cf6
--- /dev/null
+++ b/docs/html/training/best-security.jd
@@ -0,0 +1,9 @@
+page.title=Best Practices for Security & Privacy
+page.trainingcourse=true
+
+@jd:body
+
+
+
+<p>These classes and articles provide information about how to
+keep your app's data secure.</p>
\ No newline at end of file
diff --git a/docs/html/training/best-ux.jd b/docs/html/training/best-ux.jd
new file mode 100644
index 0000000..5f109f6
--- /dev/null
+++ b/docs/html/training/best-ux.jd
@@ -0,0 +1,12 @@
+page.title=Best Practices for User Experience & UI
+page.trainingcourse=true
+
+@jd:body
+
+
+
+<p>These classes focus on the best Android user experience for your app.
+In some cases, the success of your app on Android is heavily
+affected by whether your app conforms to the user's expectations for
+UI and navigation on an Android device. Follow these recommendations to ensure that
+your app looks and behaves in a way that satisfies Android users.</p>
\ No newline at end of file
diff --git a/docs/html/training/building-connectivity.jd b/docs/html/training/building-connectivity.jd
new file mode 100644
index 0000000..8b145ad
--- /dev/null
+++ b/docs/html/training/building-connectivity.jd
@@ -0,0 +1,10 @@
+page.title=Building Apps with Connectivity & the Cloud
+page.trainingcourse=true
+
+@jd:body
+
+
+
+<p>These classes teach you how to connect your app to the world beyond the user's device.
+You'll learn how to connect to other devices in the area, connect to the Internet, backup and
+sync your app's data, and more.</p>
\ No newline at end of file
diff --git a/docs/html/training/building-graphics.jd b/docs/html/training/building-graphics.jd
new file mode 100644
index 0000000..ee79a5b
--- /dev/null
+++ b/docs/html/training/building-graphics.jd
@@ -0,0 +1,11 @@
+page.title=Building Apps with Graphics & Animation
+page.trainingcourse=true
+
+@jd:body
+
+
+
+<p>These classes teach you how to accomplish tasks with graphics
+that can give your app an edge on the competition.
+If you want to go beyond the basic user interface to create a beautiful visual experience,
+these classes will help you get there.</p>
\ No newline at end of file
diff --git a/docs/html/training/building-multimedia.jd b/docs/html/training/building-multimedia.jd
new file mode 100644
index 0000000..95e7811
--- /dev/null
+++ b/docs/html/training/building-multimedia.jd
@@ -0,0 +1,9 @@
+page.title=Building Apps with Multimedia
+page.trainingcourse=true
+
+@jd:body
+
+
+
+<p>These classes teach you how to
+create rich multimedia apps that behave the way users expect.</p>
\ No newline at end of file
diff --git a/docs/html/training/building-userinfo.jd b/docs/html/training/building-userinfo.jd
new file mode 100644
index 0000000..f9d77f7
--- /dev/null
+++ b/docs/html/training/building-userinfo.jd
@@ -0,0 +1,9 @@
+page.title=Building Apps with User Info & Location
+page.trainingcourse=true
+
+@jd:body
+
+
+<p>These classes teach you how to add user personalization to your app. Some of the ways
+you can do this is by identifying users, providing
+information that's relevant to them, and providing information about the world around them.</p>
\ No newline at end of file
diff --git a/docs/html/training/distribute.jd b/docs/html/training/distribute.jd
new file mode 100644
index 0000000..4b21020
--- /dev/null
+++ b/docs/html/training/distribute.jd
@@ -0,0 +1,9 @@
+page.title=Using Google Play to Distribute & Monetize
+page.trainingcourse=true
+
+@jd:body
+
+
+
+<p>These classes focus on the business aspects of your app strategy, including techniques
+for distributing your app on Google Play and techniques for building revenue.</p>
\ No newline at end of file
diff --git a/docs/html/training/index.jd b/docs/html/training/index.jd
index 3c67af9..72ad018 100644
--- a/docs/html/training/index.jd
+++ b/docs/html/training/index.jd
@@ -1,14 +1,14 @@
-page.title=Android Training
+page.title=Getting Started
+page.trainingcourse=true
page.metaDescription=Android Training provides a collection of classes that aim to help you build great apps for Android. Each class explains the steps required to solve a problem or implement a feature using code snippets and sample code for you to use in your apps.
@jd:body
-<p>Welcome to Android Training. Here you'll find a collection of classes that aim to help you
-build great apps for Android, using best practices in a variety of framework topics.</p>
-<p>Each class explains the steps required to solve a problem or implement a feature using code
-snippets and sample code for you to use in your apps.</p>
+<p>Welcome to Training for Android developers. Here you'll find sets of lessons within classes
+that describe how to accomplish a specific task with code samples you can re-use in your app.
+Classes are organized into several groups you can see at the top-level of the left navigation.</p>
-<p>This first section is focused on teaching you the bare essentials. If you're a new developer
-on Android, you should walk through each of these classes, beginning with
-<a href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a>.</p></a>
+<p>This first group, <em>Getting Started</em>, teaches you the bare
+essentials for Android app development.
+If you're a new Android app developer, you should complete each of these classes in order:</p>
\ No newline at end of file
diff --git a/docs/html/training/notify-user/build-notification.jd b/docs/html/training/notify-user/build-notification.jd
new file mode 100644
index 0000000..ba66028
--- /dev/null
+++ b/docs/html/training/notify-user/build-notification.jd
@@ -0,0 +1,160 @@
+page.title=Building a Notification
+parent.title=Notifying the User
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Preserving Navigation when Starting an Activity
+next.link=navigation.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<!-- table of contents -->
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#builder">Create a Notification Builder</a></li>
+ <li><a href="#action">Define the Notification's Action</a></li>
+ <li><a href="#click">Set the Notification's Click Behavior</a></li>
+ <li><a href="#notify">Issue the Notification</a></li>
+</ol>
+
+<!-- other docs (NOT javadocs) -->
+<h2>You should also read</h2>
+
+<ul>
+ <li>
+ <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Notifications</a> API Guide
+ </li>
+ <li>
+ <a href="{@docRoot}guide/components/intents-filters.html">
+ Intents and Intent Filters
+ </a>
+ </li>
+ <li>
+ <a href="{@docRoot}design/patterns/notifications.html">Notifications</a> Design Guide
+ </li>
+</ul>
+
+
+</div>
+</div>
+
+
+<p>This lesson explains how to create and issue a notification.</p>
+
+<p>The examples in this class are based on the
+{@link android.support.v4.app.NotificationCompat.Builder} class.
+{@link android.support.v4.app.NotificationCompat.Builder}
+is in the <a href="{@docRoot}">Support Library</a>. You should use
+{@link android.support.v4.app.NotificationCompat} and its subclasses,
+particularly {@link android.support.v4.app.NotificationCompat.Builder}, to
+provide the best notification support for a wide range of platforms. </p>
+
+<h2 id="builder">Create a Notification Builder</h2>
+
+<p>When creating a notification, specify the UI content and actions with a
+{@link android.support.v4.app.NotificationCompat.Builder} object. At bare minimum,
+a {@link android.support.v4.app.NotificationCompat.Builder Builder}
+object must include the following:</p>
+
+<ul>
+ <li>
+ A small icon, set by
+ {@link android.support.v4.app.NotificationCompat.Builder#setSmallIcon setSmallIcon()}
+ </li>
+ <li>
+ A title, set by
+ {@link android.support.v4.app.NotificationCompat.Builder#setContentTitle setContentTitle()}
+ </li>
+ <li>
+ Detail text, set by
+ {@link android.support.v4.app.NotificationCompat.Builder#setContentText setContentText()}
+ </li>
+</ul>
+<p> For example: </p>
+<pre>
+NotificationCompat.Builder mBuilder =
+ new NotificationCompat.Builder(this)
+ .setSmallIcon(R.drawable.notification_icon)
+ .setContentTitle("My notification")
+ .setContentText("Hello World!");
+</pre>
+
+<h2 id="action">Define the Notification's Action</h2>
+
+
+<p>Although actions are optional, you should add at least one action to your
+notification. An action takes users directly from the notification to an
+{@link android.app.Activity} in your application, where they can look at the
+event that caused the notification or do further work. Inside a notification, the action itself is
+defined by a {@link android.app.PendingIntent} containing an {@link
+android.content.Intent} that starts an {@link android.app.Activity} in your
+application.</p>
+
+<p>How you construct the {@link android.app.PendingIntent} depends on what type
+of {@link android.app.Activity} you're starting. When you start an {@link
+android.app.Activity} from a notification, you must preserve the user's expected
+navigation experience. In the snippet below, clicking the notification opens a
+new activity that effectively extends the behavior of the notification. In this
+case there is no need to create an artificial back stack (see
+<a href="navigation.html">Preserving Navigation when Starting an Activity</a> for
+more information):</p>
+
+<pre>Intent resultIntent = new Intent(this, ResultActivity.class);
+...
+// Because clicking the notification opens a new ("special") activity, there's
+// no need to create an artificial back stack.
+PendingIntent resultPendingIntent =
+ PendingIntent.getActivity(
+ this,
+ 0,
+ resultIntent,
+ PendingIntent.FLAG_UPDATE_CURRENT
+);
+</pre>
+
+<h2 id="click">Set the Notification's Click Behavior</h2>
+
+<p>
+To associate the {@link android.app.PendingIntent} created in the previous
+step with a gesture, call the appropriate method of {@link
+android.support.v4.app.NotificationCompat.Builder}. For example, to start an
+activity when the user clicks the notification text in the notification drawer,
+add the {@link android.app.PendingIntent} by calling {@link
+android.support.v4.app.NotificationCompat.Builder#setContentIntent
+setContentIntent()}. For example:</p>
+
+<pre>PendingIntent resultPendingIntent;
+...
+mBuilder.setContentIntent(resultPendingIntent);</pre>
+
+<h2 id="notify">Issue the Notification</h2>
+
+<p>To issue the notification:</p>
+<ul>
+<li>Get an instance of {@link android.app.NotificationManager}.</li>
+
+<li>Use the {@link android.app.NotificationManager#notify notify()} method to issue the
+notification. When you call {@link android.app.NotificationManager#notify notify()}, specify a notification ID.
+You can use this ID to update the notification later on. This is described in more detail in
+<a href="managing.html">Managing Notifications</a>.</li>
+
+<li>Call {@link
+android.support.v4.app.NotificationCompat.Builder#build() build()}, which
+returns a {@link android.app.Notification} object containing your
+specifications.</li>
+
+<p>For example:</p>
+
+<pre>
+// Sets an ID for the notification
+int mNotificationId = 001;
+// Gets an instance of the NotificationManager service
+NotificationManager mNotifyMgr =
+ (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
+// Builds the notification and issues it.
+mNotifyMgr.notify(mNotificationId, builder.build());
+</pre>
+
diff --git a/docs/html/training/notify-user/display-progress.jd b/docs/html/training/notify-user/display-progress.jd
new file mode 100644
index 0000000..2b2b3ae
--- /dev/null
+++ b/docs/html/training/notify-user/display-progress.jd
@@ -0,0 +1,182 @@
+page.title=Displaying Progress in a Notification
+parent.title=Notifying the User
+parent.link=index.html
+
+trainingnavtop=true
+previous.title=Using Expanded Notification Styles
+previous.link=expanded.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<!-- table of contents -->
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#FixedProgress">Display a Fixed-duration progress Indicator</a></li>
+ <li><a href="#ActivityIndicator">Display a Continuing Activity Indicator</a></li>
+</ol>
+
+<!-- other docs (NOT javadocs) -->
+<h2>You should also read</h2>
+
+<ul>
+ <li>
+ <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Notifications</a> API Guide
+ </li>
+ <li>
+ <a href="{@docRoot}guide/components/intents-filters.html">
+ Intents and Intent Filters
+ </a>
+ </li>
+ <li>
+ <a href="{@docRoot}design/patterns/notifications.html">Notifications</a> Design Guide
+ </li>
+</ul>
+
+
+</div>
+</div>
+
+
+
+<p>
+ Notifications can include an animated progress indicator that shows users the status
+ of an ongoing operation. If you can estimate how long the operation takes and how much of it
+ is complete at any time, use the "determinate" form of the indicator
+ (a progress bar). If you can't estimate the length of the operation, use the
+ "indeterminate" form of the indicator (an activity indicator).
+</p>
+<p>
+ Progress indicators are displayed with the platform's implementation of the
+ {@link android.widget.ProgressBar} class.
+</p>
+<p>
+ To use a progress indicator, call
+ {@link android.support.v4.app.NotificationCompat.Builder#setProgress setProgress()}. The
+ determinate and indeterminate forms are described in the following sections.
+</p>
+<!-- ------------------------------------------------------------------------------------------ -->
+<h2 id="FixedProgress">Display a Fixed-duration Progress Indicator</h2>
+<p>
+ To display a determinate progress bar, add the bar to your notification by calling
+ {@link android.support.v4.app.NotificationCompat.Builder#setProgress
+ setProgress(max, progress, false)} and then issue the notification.
+ The third argument is a boolean that indicates whether the
+ progress bar is indeterminate (<strong>true</strong>) or determinate (<strong>false</strong>).
+ As your operation proceeds,
+ increment <code>progress</code>, and update the notification. At the end of the operation,
+ <code>progress</code> should equal <code>max</code>. A common way to call
+ {@link android.support.v4.app.NotificationCompat.Builder#setProgress setProgress()}
+ is to set <code>max</code> to 100 and then increment <code>progress</code> as a
+ "percent complete" value for the operation.
+</p>
+<p>
+ You can either leave the progress bar showing when the operation is done, or remove it. In
+ either case, remember to update the notification text to show that the operation is complete.
+ To remove the progress bar, call
+ {@link android.support.v4.app.NotificationCompat.Builder#setProgress
+ setProgress(0, 0, false)}. For example:
+</p>
+<pre>
+...
+mNotifyManager =
+ (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+mBuilder = new NotificationCompat.Builder(this);
+mBuilder.setContentTitle("Picture Download")
+ .setContentText("Download in progress")
+ .setSmallIcon(R.drawable.ic_notification);
+// Start a lengthy operation in a background thread
+new Thread(
+ new Runnable() {
+ @Override
+ public void run() {
+ int incr;
+ // Do the "lengthy" operation 20 times
+ for (incr = 0; incr <= 100; incr+=5) {
+ // Sets the progress indicator to a max value, the
+ // current completion percentage, and "determinate"
+ // state
+ mBuilder.setProgress(100, incr, false);
+ // Displays the progress bar for the first time.
+ mNotifyManager.notify(0, mBuilder.build());
+ // Sleeps the thread, simulating an operation
+ // that takes time
+ try {
+ // Sleep for 5 seconds
+ Thread.sleep(5*1000);
+ } catch (InterruptedException e) {
+ Log.d(TAG, "sleep failure");
+ }
+ }
+ // When the loop is finished, updates the notification
+ mBuilder.setContentText("Download complete")
+ // Removes the progress bar
+ .setProgress(0,0,false);
+ mNotifyManager.notify(ID, mBuilder.build());
+ }
+ }
+// Starts the thread by calling the run() method in its Runnable
+).start();
+</pre>
+<p>
+ The resulting notifications are shown in figure 1. On the left side is a snapshot of the
+ notification during the operation; on the right side is a snapshot of it after the operation
+ has finished.
+</p>
+<img
+ id="figure1"
+ src="{@docRoot}images/ui/notifications/progress_bar_summary.png"
+ height="84"
+ alt="" />
+<p class="img-caption">
+<strong>Figure 1.</strong> The progress bar during and after the operation.</p>
+<!-- ------------------------------------------------------------------------------------------ -->
+<h2 id="ActivityIndicator">Display a Continuing Activity Indicator</h2>
+<p>
+ To display a continuing (indeterminate) activity indicator, add it to your notification with
+ {@link android.support.v4.app.NotificationCompat.Builder#setProgress setProgress(0, 0, true)}
+ and issue the notification. The first two arguments are ignored, and the third argument
+ declares that the indicator is indeterminate. The result is an indicator
+ that has the same style as a progress bar, except that its animation is ongoing.
+</p>
+<p>
+ Issue the notification at the beginning of the operation. The animation will run until you
+ modify your notification. When the operation is done, call
+ {@link android.support.v4.app.NotificationCompat.Builder#setProgress
+ setProgress(0, 0, false)} and then update the notification to remove the activity indicator.
+ Always do this; otherwise, the animation will run even when the operation is complete. Also
+ remember to change the notification text to indicate that the operation is complete.
+</p>
+<p>
+ To see how continuing activity indicators work, refer to the preceding snippet. Locate the following lines:
+</p>
+<pre>
+// Sets the progress indicator to a max value, the current completion
+// percentage, and "determinate" state
+mBuilder.setProgress(100, incr, false);
+// Issues the notification
+mNotifyManager.notify(0, mBuilder.build());
+</pre>
+<p>
+ Replace the lines you've found with the following lines. Notice that the third parameter
+ in the {@link android.support.v4.app.NotificationCompat.Builder#setProgress setProgress()}
+ call is set to {@code true} to indicate that the progress bar is
+ indeterminate:
+</p>
+<pre>
+ // Sets an activity indicator for an operation of indeterminate length
+mBuilder.setProgress(0, 0, true);
+// Issues the notification
+mNotifyManager.notify(0, mBuilder.build());
+</pre>
+<p>
+ The resulting indicator is shown in figure 2:
+</p>
+<img
+ id="figure2"
+ src="{@docRoot}images/ui/notifications/activity_indicator.png"
+ height="99"
+ alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> An ongoing activity indicator.</p>
diff --git a/docs/html/training/notify-user/expanded.jd b/docs/html/training/notify-user/expanded.jd
new file mode 100644
index 0000000..a3cc6ad
--- /dev/null
+++ b/docs/html/training/notify-user/expanded.jd
@@ -0,0 +1,167 @@
+page.title=Using Big View Styles
+Styles parent.title=Notifying the User
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Displaying Progress in a Notification
+next.link=display-progress.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<!-- table of contents -->
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#activity">Set Up the Notification to Launch a New Activity</a></li>
+ <li><a href="#big-view">Construct the Big View</a></li>
+</ol>
+
+<!-- other docs (NOT javadocs) -->
+<h2>You should also read</h2>
+
+<ul>
+ <li>
+ <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Notifications</a> API Guide
+ </li>
+ <li>
+ <a href="{@docRoot}guide/components/intents-filters.html">
+ Intents and Intent Filters
+ </a>
+ </li>
+ <li>
+ <a href="{@docRoot}design/patterns/notifications.html">Notifications</a> Design Guide
+ </li>
+</ul>
+
+
+</div>
+</div>
+
+<p>Notifications in the notification drawer appear in two main visual styles,
+normal view and big view. The big view of a notification only appears when the
+notification is expanded. This happens when the notification is at the top of
+the drawer, or the user clicks the notification. </p>
+
+<p>Big views were introduced in
+Android 4.1, and they're not supported on older devices. This lesson describes
+how to incorporate big view notifications into your app while still providing
+full functionality via the normal view. See the <a
+href="{@docRoot}guide/topics/ui/notifiers/notifications.html#BigNotify">
+Notifications API guide</a> for more discussion of big views.</p>
+
+<p>Here is an example of a normal view: </p>
+
+<img src="{@docRoot}images/training/notifications-normalview.png" width="300" height="58" alt="normal view" />
+
+<p class="img-caption">
+ <strong>Figure 1.</strong> Normal view notification.
+</p>
+
+
+<p>Here is an example of a big view:</p>
+
+<img src="{@docRoot}images/training/notifications-bigview.png" width="300" height="143" alt="big view" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> Big view notification.
+</p>
+
+
+<p> In the sample application shown in this lesson, both the normal view and the
+big view give users access to same functionality:</p>
+
+<ul>
+ <li>The ability to snooze or dismiss the notification.</li>
+ <li>A way to view the reminder text the user set as part of the timer.</li>
+</ul>
+
+<p>The normal view provides these features through a new activity that launches
+when the user clicks the notification. Keep this in mind as you design your notifications—first
+provide the functionality in the normal view, since
+this is how many users will interact with the notification.</p>
+
+<h2 id="activity">Set Up the Notification to Launch a New Activity</h2>
+
+<p>The sample application uses an {@link android.app.IntentService} subclass ({@code PingService})
+to construct and issue the notification.</p>
+
+
+<p>In this snippet, the
+{@link android.app.IntentService} method
+{@link android.app.IntentService#onHandleIntent onHandleIntent()} specifies the new activity
+that will be launched if the user
+clicks the notification itself. The method
+{@link android.support.v4.app.NotificationCompat.Builder#setContentIntent setContentIntent()}
+defines a pending intent that should be fired when the user
+clicks the notification, thereby launching the activity.</p>
+
+<pre>Intent resultIntent = new Intent(this, ResultActivity.class);
+resultIntent.putExtra(CommonConstants.EXTRA_MESSAGE, msg);
+resultIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
+ Intent.FLAG_ACTIVITY_CLEAR_TASK);
+
+// Because clicking the notification launches a new ("special") activity,
+// there's no need to create an artificial back stack.
+PendingIntent resultPendingIntent =
+ PendingIntent.getActivity(
+ this,
+ 0,
+ resultIntent,
+ PendingIntent.FLAG_UPDATE_CURRENT
+);
+
+// This sets the pending intent that should be fired when the user clicks the
+// notification. Clicking the notification launches a new activity.
+builder.setContentIntent(resultPendingIntent);
+</pre>
+
+<h2 id="big-view">Construct the Big View</h2>
+
+<p>This snippet shows how to set up the buttons that will appear in the big view:</p>
+
+<pre>
+// Sets up the Snooze and Dismiss action buttons that will appear in the
+// big view of the notification.
+Intent dismissIntent = new Intent(this, PingService.class);
+dismissIntent.setAction(CommonConstants.ACTION_DISMISS);
+PendingIntent piDismiss = PendingIntent.getService(this, 0, dismissIntent, 0);
+
+Intent snoozeIntent = new Intent(this, PingService.class);
+snoozeIntent.setAction(CommonConstants.ACTION_SNOOZE);
+PendingIntent piSnooze = PendingIntent.getService(this, 0, snoozeIntent, 0);
+</pre>
+
+<p>This snippet shows how to construct the
+{@link android.support.v4.app.NotificationCompat.Builder Builder} object.
+It sets the style for the big
+view to be "big text," and sets its content to be the reminder message. It uses
+{@link android.support.v4.app.NotificationCompat.Builder#addAction addAction()}
+to add the <strong>Snooze</strong> and <strong>Dismiss</strong> buttons (and
+their associated pending intents) that will appear in the notification's
+big view:</p>
+
+<pre>// Constructs the Builder object.
+NotificationCompat.Builder builder =
+ new NotificationCompat.Builder(this)
+ .setSmallIcon(R.drawable.ic_stat_notification)
+ .setContentTitle(getString(R.string.notification))
+ .setContentText(getString(R.string.ping))
+ .setDefaults(Notification.DEFAULT_ALL) // requires VIBRATE permission
+ /*
+ * Sets the big view "big text" style and supplies the
+ * text (the user's reminder message) that will be displayed
+ * in the detail area of the expanded notification.
+ * These calls are ignored by the support library for
+ * pre-4.1 devices.
+ */
+ .setStyle(new NotificationCompat.BigTextStyle()
+ .bigText(msg))
+ .addAction (R.drawable.ic_stat_dismiss,
+ getString(R.string.dismiss), piDismiss)
+ .addAction (R.drawable.ic_stat_snooze,
+ getString(R.string.snooze), piSnooze);
+</pre>
+
+
+
diff --git a/docs/html/training/notify-user/index.jd b/docs/html/training/notify-user/index.jd
new file mode 100644
index 0000000..510f2c4
--- /dev/null
+++ b/docs/html/training/notify-user/index.jd
@@ -0,0 +1,102 @@
+page.title=Notifying the User
+trainingnavtop=true
+startpage=true
+next.title=Build a Notification
+next.link=build-notification.html
+
+
+@jd:body
+<div id="tb-wrapper">
+<div id="tb">
+
+<!-- Required platform, tools, add-ons, devices, knowledge, etc. -->
+<h2>Dependencies and prerequisites</h2>
+
+<ul>
+ <li>Android 1.6 (API Level 4) or higher</li>
+</ul>
+<h2>You should also read</h2>
+<ul>
+ <li>
+ <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Notifications</a> API Guide
+ </li>
+ <li>
+ <a href="{@docRoot}guide/components/intents-filters.html">
+ Intents and Intent Filters
+ </a>
+ </li>
+ <li>
+ <a href="{@docRoot}design/patterns/notifications.html">Notifications</a> Design Guide
+ </li>
+</ul>
+
+<h2>Try it out</h2>
+
+<div class="download-box">
+ <a href="{@docRoot}shareables/training/NotifyUser.zip"
+class="button">Download the sample</a>
+ <p class="filename">NotifyUser.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>
+ A notification is a user interface element that you display outside your app's normal UI to indicate
+ that an event has occurred. Users can choose to view the notification while using other apps and respond
+ to it when it's convenient for them.
+
+</p>
+
+<p>
+ The <a href="{@docRoot}design/patterns/notifications.html">Notifications design guide</a> shows
+ you how to design effective notifications and when to use them. This class shows you how to
+ implement the most common notification designs.
+</p>
+<h2>Lessons</h2>
+
+<dl>
+ <dt>
+ <strong><a href="build-notification.html">Building a Notification</a></strong>
+ </dt>
+ <dd>
+ Learn how to create a notification
+ {@link android.support.v4.app.NotificationCompat.Builder Builder}, set the
+ required features, and issue the notification.
+ </dd>
+ <dt>
+ <strong><a href="navigation.html">Preserving Navigation when Starting an Activity</a></strong>
+ </dt>
+ <dd>
+ Learn how to enforce the proper
+ navigation for an {@link android.app.Activity} started from a notification.
+ </dd>
+ <dt>
+ <strong>
+ <a href="managing.html">Updating Notifications</a>
+ </strong>
+ </dt>
+ <dd>
+ Learn how to update and remove notifications.
+ </dd>
+ <dt>
+ <strong>
+ <a href="expanded.html">Using Big View Styles</a>
+ </strong>
+ </dt>
+ <dd>
+ Learn how to create a big view within an expanded notification, while still maintaining
+ backward compatibility.
+ </dd>
+
+ <dt>
+ <strong>
+ <a href="display-progress.html">Displaying Progress in a Notification</a>
+ </strong>
+ </dt>
+ <dd>
+ Learn how to display the progress of an operation in a notification, both for
+ operations where you can estimate how much has been completed (determinate progress) and
+ operations where you don't know how much has been completed (indefinite progress).
+ </dd>
+</dl>
diff --git a/docs/html/training/notify-user/managing.jd b/docs/html/training/notify-user/managing.jd
new file mode 100644
index 0000000..4782734
--- /dev/null
+++ b/docs/html/training/notify-user/managing.jd
@@ -0,0 +1,107 @@
+page.title=Updating Notifications
+parent.title=Notifying the User
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Creating Expanded Notifications
+next.link=expanded.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<!-- table of contents -->
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#Updating">Modify a Notification</a></li>
+ <li><a href="#Removing">Remove Notifications</a></li>
+</ol>
+
+<!-- other docs (NOT javadocs) -->
+<h2>You should also read</h2>
+
+<ul>
+ <li>
+ <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Notifications</a> API Guide
+ </li>
+ <li>
+ <a href="{@docRoot}guide/components/intents-filters.html">
+ Intents and Intent Filters
+ </a>
+ </li>
+ <li>
+ <a href="{@docRoot}design/patterns/notifications.html">Notifications</a> Design Guide
+ </li>
+</ul>
+
+
+</div>
+</div>
+<p>
+ When you need to issue a notification multiple times for the same type of event, you
+ should avoid making a completely new notification. Instead, you should consider updating a
+ previous notification, either by changing some of its values or by adding to it, or both.
+</p>
+
+<p>
+ The following section describes how to update notifications and also how to remove them.
+</p>
+<h2 id="Updating">Modify a Notification</h2>
+<p>
+ To set up a notification so it can be updated, issue it with a notification ID by
+ calling {@link android.app.NotificationManager#notify(int, Notification)
+ NotificationManager.notify(ID, notification)}. To update this notification once you've issued
+ it, update or create a {@link android.support.v4.app.NotificationCompat.Builder} object,
+ build a {@link android.app.Notification} object from it, and issue the
+ {@link android.app.Notification} with the same ID you used previously.
+</p>
+<p>
+ The following snippet demonstrates a notification that is updated to reflect the
+ number of events that have occurred. It stacks the notification, showing a summary:
+</p>
+<pre>
+mNotificationManager =
+ (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+// Sets an ID for the notification, so it can be updated
+int notifyID = 1;
+mNotifyBuilder = new NotificationCompat.Builder(this)
+ .setContentTitle("New Message")
+ .setContentText("You've received new messages.")
+ .setSmallIcon(R.drawable.ic_notify_status)
+numMessages = 0;
+// Start of a loop that processes data and then notifies the user
+...
+ mNotifyBuilder.setContentText(currentText)
+ .setNumber(++numMessages);
+ // Because the ID remains unchanged, the existing notification is
+ // updated.
+ mNotificationManager.notify(
+ notifyID,
+ mNotifyBuilder.build());
+...
+</pre>
+
+<!-- ------------------------------------------------------------------------------------------ -->
+<h2 id="Removing">Remove Notifications</h2>
+<p>
+ Notifications remain visible until one of the following happens:
+</p>
+<ul>
+ <li>
+ The user dismisses the notification either individually or by using "Clear All" (if
+ the notification can be cleared).
+ </li>
+ <li>
+ The user touches the notification, and you called
+ {@link android.support.v4.app.NotificationCompat.Builder#setAutoCancel setAutoCancel()} when
+ you created the notification.
+ </li>
+ <li>
+ You call {@link android.app.NotificationManager#cancel(int) cancel()} for a specific
+ notification ID. This method also deletes ongoing notifications.
+ </li>
+ <li>
+ You call {@link android.app.NotificationManager#cancelAll() cancelAll()}, which removes
+ all of the notifications you previously issued.
+ </li>
diff --git a/docs/html/training/notify-user/navigation.jd b/docs/html/training/notify-user/navigation.jd
new file mode 100644
index 0000000..ac4689a
--- /dev/null
+++ b/docs/html/training/notify-user/navigation.jd
@@ -0,0 +1,228 @@
+page.title=Preserving Navigation when Starting an Activity
+parent.title=Notifying the User
+parent.link=index.html
+
+trainingnavtop=true
+next.title=Updating Notifications
+next.link=managing.html
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<!-- table of contents -->
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#DirectEntry">Set up a regular activity PendingIntent</a></li>
+ <li><a href="#ExtendedNotification">Set up a special activity PendingIntent</a></li>
+</ol>
+
+<!-- other docs (NOT javadocs) -->
+<h2>You should also read</h2>
+
+<ul>
+ <li>
+ <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Notifications</a> API Guide
+ </li>
+ <li>
+ <a href="{@docRoot}guide/components/intents-filters.html">
+ Intents and Intent Filters
+ </a>
+ </li>
+ <li>
+ <a href="{@docRoot}design/patterns/notifications.html">Notifications</a> Design Guide
+ </li>
+</ul>
+
+
+</div>
+</div>
+<p>
+ Part of designing a notification is preserving the user's expected navigation experience.
+ For a detailed discussion of this topic, see the
+ <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html#NotificationResponse">Notifications</a>
+ API guide.
+ There are two general situations:
+</p>
+<dl>
+ <dt>
+ Regular activity
+ </dt>
+ <dd>
+ You're starting an {@link android.app.Activity} that's part of the application's normal
+ workflow.
+ </dd>
+ <dt>
+ Special activity
+ </dt>
+ <dd>
+ The user only sees this {@link android.app.Activity} if it's started from a notification.
+ In a sense, the {@link android.app.Activity} extends the notification by providing
+ information that would be hard to display in the notification itself.
+ </dd>
+</dl>
+<!-- ------------------------------------------------------------------------------------------ -->
+<h2 id="DirectEntry">Set Up a Regular Activity PendingIntent</h2>
+<p>
+ To set up a {@link android.app.PendingIntent} that starts a direct entry
+ {@link android.app.Activity}, follow these steps:
+</p>
+<ol>
+ <li>
+ Define your application's {@link android.app.Activity} hierarchy in the manifest. The final XML should look like this:
+ </p>
+<pre>
+<activity
+ android:name=".MainActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+</activity>
+<activity
+ android:name=".ResultActivity"
+ android:parentActivityName=".MainActivity">
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value=".MainActivity"/>
+</activity>
+</pre>
+ </li>
+ <li>
+ Create a back stack based on the {@link android.content.Intent} that starts the
+ {@link android.app.Activity}. For example:
+</p>
+<pre>
+...
+Intent resultIntent = new Intent(this, ResultActivity.class);
+TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
+// Adds the back stack
+stackBuilder.addParentStack(ResultActivity.class);
+// Adds the Intent to the top of the stack
+stackBuilder.addNextIntent(resultIntent);
+// Gets a PendingIntent containing the entire back stack
+PendingIntent resultPendingIntent =
+ stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
+...
+NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
+builder.setContentIntent(resultPendingIntent);
+NotificationManager mNotificationManager =
+ (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+mNotificationManager.notify(id, builder.build());
+</pre>
+<!-- ------------------------------------------------------------------------------------------ -->
+<h2 id="ExtendedNotification">Set Up a Special Activity PendingIntent</h2>
+
+<p>
+ A special {@link android.app.Activity} doesn't need a back stack, so you don't have to
+ define its {@link android.app.Activity} hierarchy in the manifest, and you don't have
+ to call
+ {@link android.support.v4.app.TaskStackBuilder#addParentStack addParentStack()} to build a
+ back stack. Instead, use the manifest to set up the {@link android.app.Activity} task options,
+ and create the {@link android.app.PendingIntent} by calling
+ {@link android.app.PendingIntent#getActivity getActivity()}:
+</p>
+<ol>
+ <li>
+ In your manifest, add the following attributes to the
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>
+ element for the {@link android.app.Activity}:
+ <dl>
+ <dt>
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#nm">android:name</a>="<i>activityclass</i>"</code>
+ </dt>
+ <dd>
+ The activity's fully-qualified class name.
+ </dd>
+ <dt>
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">android:taskAffinity</a>=""</code>
+ </dt>
+ <dd>
+ Combined with the
+ {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK FLAG_ACTIVITY_NEW_TASK} flag
+ that you set in code, this ensures that this {@link android.app.Activity} doesn't
+ go into the application's default task. Any existing tasks that have the
+ application's default affinity are not affected.
+ </dd>
+ <dt>
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#exclude">android:excludeFromRecents</a>="true"</code>
+ </dt>
+ <dd>
+ Excludes the new task from <i>Recents</i>, so that the user can't accidentally
+ navigate back to it.
+ </dd>
+ </dl>
+ <p>
+ This snippet shows the element:
+ </p>
+<pre>
+<activity
+ android:name=".ResultActivity"
+...
+ android:launchMode="singleTask"
+ android:taskAffinity=""
+ android:excludeFromRecents="true">
+</activity>
+...
+</pre>
+ </li>
+ <li>
+ Build and issue the notification:
+ <ol style="list-style-type: lower-alpha;">
+ <li>
+ Create an {@link android.content.Intent} that starts the
+ {@link android.app.Activity}.
+ </li>
+ <li>
+ Set the {@link android.app.Activity} to start in a new, empty task by calling
+ {@link android.content.Intent#setFlags setFlags()} with the flags
+ {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK FLAG_ACTIVITY_NEW_TASK}
+ and
+ {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TASK FLAG_ACTIVITY_CLEAR_TASK}.
+ </li>
+ <li>
+ Set any other options you need for the {@link android.content.Intent}.
+ </li>
+ <li>
+ Create a {@link android.app.PendingIntent} from the {@link android.content.Intent}
+ by calling {@link android.app.PendingIntent#getActivity getActivity()}.
+ You can then use this {@link android.app.PendingIntent} as the argument to
+ {@link android.support.v4.app.NotificationCompat.Builder#setContentIntent
+ setContentIntent()}.
+ </li>
+ </ol>
+ <p>
+ The following code snippet demonstrates the process:
+ </p>
+<pre>
+// Instantiate a Builder object.
+NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
+// Creates an Intent for the Activity
+Intent notifyIntent =
+ new Intent(new ComponentName(this, ResultActivity.class));
+// Sets the Activity to start in a new, empty task
+notifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
+ Intent.FLAG_ACTIVITY_CLEAR_TASK);
+// Creates the PendingIntent
+PendingIntent notifyIntent =
+ PendingIntent.getActivity(
+ this,
+ 0,
+ notifyIntent,
+ PendingIntent.FLAG_UPDATE_CURRENT
+);
+
+// Puts the PendingIntent into the notification builder
+builder.setContentIntent(notifyIntent);
+// Notifications are issued by sending them to the
+// NotificationManager system service.
+NotificationManager mNotificationManager =
+ (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+// Builds an anonymous Notification object from the builder, and
+// passes it to the NotificationManager
+mNotificationManager.notify(id, builder.build());
+</pre>
+ </li>
+</ol>
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
index 1c85ae8..88ecaec 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -4,741 +4,999 @@
<li class="nav-section">
<div class="nav-section-header">
<a href="<?cs var:toroot ?>training/index.html">
- <span class="en">Get Started</span>
+ Getting Started
</a>
</div>
<ul>
<li class="nav-section">
<div class="nav-section-header">
- <a href="<?cs var:toroot ?>training/basics/firstapp/index.html">
- <span class="en">Building Your First App</span>
- </a>
+ <a href="<?cs var:toroot ?>training/basics/firstapp/index.html"
+ description=
+ "After you've installed the Android SDK, start with this class
+ to learn the basics about Android app development."
+ >Building Your First App</a>
</div>
<ul>
<li><a href="<?cs var:toroot ?>training/basics/firstapp/creating-project.html">
- <span class="en">Creating an Android Project</span>
+ Creating an Android Project
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/firstapp/running-app.html">
- <span class="en">Running Your Application</span>
+ Running Your Application
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/firstapp/building-ui.html">
- <span class="en">Building a Simple User Interface</span>
+ Building a Simple User Interface
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/firstapp/starting-activity.html">
- <span class="en">Starting Another Activity</span>
+ Starting Another Activity
</a>
</li>
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/index.html">
- <span class="en">Managing the Activity Lifecycle</span>
- </a></div>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/basics/activity-lifecycle/index.html"
+ description=
+ "How Android activities live and die and how to create
+ a seamless user experience by implementing lifecycle callback methods."
+ >Managing the Activity Lifecycle</a>
+ </div>
<ul>
<li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/starting.html">
- <span class="en">Starting an Activity</span>
+ Starting an Activity
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/pausing.html">
- <span class="en">Pausing and Resuming an Activity</span>
+ Pausing and Resuming an Activity
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/stopping.html">
- <span class="en">Stopping and Restarting an Activity</span>
+ Stopping and Restarting an Activity
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/recreating.html">
- <span class="en">Recreating an Activity</span>
+ Recreating an Activity
</a>
</li>
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/supporting-devices/index.html">
- <span class="en">Supporting Different Devices</span>
- </a></div>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/basics/supporting-devices/index.html"
+ description=
+ "How to build your app with alternative resources that provide an
+ optimized user experience on multiple device form factors using a single APK."
+ >Supporting Different Devices</a>
+ </div>
<ul>
<li><a href="<?cs var:toroot ?>training/basics/supporting-devices/languages.html">
- <span class="en">Supporting Different Languages</span>
+ Supporting Different Languages
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/supporting-devices/screens.html">
- <span class="en">Supporting Different Screens</span>
+ Supporting Different Screens
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/supporting-devices/platforms.html">
- <span class="en">Supporting Different Platform Versions</span>
+ Supporting Different Platform Versions
</a>
</li>
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/fragments/index.html">
- <span class="en">Building a Dynamic UI with Fragments</span>
- </a></div>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/basics/fragments/index.html"
+ description=
+ "How to build a user interface for your app that is flexible enough
+ to present multiple UI components on large screens and a more constrained set of
+ UI components on smaller screens—essential for building a single APK for both
+ phones and tablets."
+ >Building a Dynamic UI with Fragments</a>
+ </div>
<ul>
<li><a href="<?cs var:toroot ?>training/basics/fragments/support-lib.html">
- <span class="en">Using the Support Library</span>
+ Using the Support Library
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/fragments/creating.html">
- <span class="en">Creating a Fragment</span>
+ Creating a Fragment
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/fragments/fragment-ui.html">
- <span class="en">Building a Flexible UI</span>
+ Building a Flexible UI
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/fragments/communicating.html">
- <span class="en">Communicating with Other Fragments</span>
+ Communicating with Other Fragments
</a>
</li>
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot?>training/basics/data-storage/index.html">
- <span class="en">Saving Data</span>
- </a></div>
+ <div class="nav-section-header"><a href="<?cs var:toroot?>training/basics/data-storage/index.html"
+ description=
+ "How to save data on the device, whether it's temporary files, downloaded
+ app assets, user media, structured data, or something else."
+ >Saving Data</a>
+ </div>
<ul>
<li><a href="<?cs var:toroot ?>training/basics/data-storage/shared-preferences.html">
- <span class="en">Saving Key-Value Sets</span>
+ Saving Key-Value Sets
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/data-storage/files.html">
- <span class="en">Saving Files</span>
+ Saving Files
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/data-storage/databases.html">
- <span class="en">Saving Data in SQL Databases</span>
+ Saving Data in SQL Databases
</a>
</li>
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/intents/index.html">
- <span class="en">Interacting with Other Apps</span>
- </a></div>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/basics/intents/index.html"
+ description=
+ "How to build a user experience that leverages other apps available
+ on the device to perform advanced user tasks, such as capture a photo or view
+ an address on a map."
+ >Interacting with Other Apps</a>
+ </div>
<ul>
<li><a href="<?cs var:toroot ?>training/basics/intents/sending.html">
- <span class="en">Sending the User to Another App</span>
+ Sending the User to Another App
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/intents/result.html">
- <span class="en">Getting a Result from the Activity</span>
+ Getting a Result from the Activity
</a>
</li>
<li><a href="<?cs var:toroot ?>training/basics/intents/filters.html">
- <span class="en">Allowing Other Apps to Start Your Activity</span>
+ Allowing Other Apps to Start Your Activity
</a>
</li>
</ul>
</li>
-
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/sharing/index.html"
+ description=
+ "How to take your app interaction to the next level by sharing
+ information with other apps, receive information back, and provide a simple and
+ scalable way to perform Share actions with user content."
+ >Sharing Content</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/sharing/send.html">
+ Sending Content to Other Apps
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/sharing/receive.html">
+ Receiving Content from Other Apps
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/sharing/shareaction.html">
+ Adding an Easy Share Action
+ </a>
+ </li>
+ </ul>
+ </li>
</ul>
- </li><!-- end basic training -->
+ </li><!-- end getting started -->
+
+
<li class="nav-section">
<div class="nav-section-header">
- <a href="<?cs var:toroot ?>training/advanced.html">
- <span class="en">Advanced Training</span>
+ <a href="<?cs var:toroot ?>training/building-multimedia.html">
+ <span class="small">Building Apps with</span><br/>Multimedia
+ </a>
+ </div>
+ <ul>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/managing-audio/index.html"
+ description=
+ "How to respond to hardware audio key presses, request audio focus
+ when playing audio, and respond appropriately to changes in audio focus."
+ >Managing Audio Playback</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/managing-audio/volume-playback.html">
+ Controlling Your App's Volume and Playback
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/managing-audio/audio-focus.html">
+ Managing Audio Focus
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/managing-audio/audio-output.html">
+ Dealing with Audio Output Hardware
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/camera/index.html"
+ description=
+ "How to leverage existing camera apps on the user's device to capture
+ photos or control the camera hardware directly and build your own camera app."
+ >Capturing Photos</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/camera/photobasics.html">
+ Taking Photos Simply
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/camera/videobasics.html">
+ Recording Videos Simply
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/camera/cameradirect.html">
+ Controlling the Camera
+ </a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <!-- End multimedia -->
+
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/building-graphics.html">
+ <span class="small">Building Apps with</span><br/>Graphics & Animation
+ </a>
+ </div>
+ <ul>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/displaying-bitmaps/index.html"
+ description=
+ "How to load and process bitmaps while keeping your user interface
+ responsive and avoid exceeding memory limits."
+ >Displaying Bitmaps Efficiently</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/load-bitmap.html">
+ Loading Large Bitmaps Efficiently
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/process-bitmap.html">
+ Processing Bitmaps Off the UI Thread
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/cache-bitmap.html">
+ Caching Bitmaps
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/display-bitmap.html">
+ Displaying Bitmaps in Your UI
+ </a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot?>training/graphics/opengl/index.html"
+ description=
+ "How to create OpenGL graphics within the Android app framework
+ and respond to touch input."
+ >Displaying Graphics with OpenGL ES</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/environment.html">
+ Building an OpenGL ES Environment
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/shapes.html">
+ Defining Shapes
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/draw.html">
+ Drawing Shapes
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/projection.html">
+ Applying Projection and Camera Views
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/motion.html">
+ Adding Motion
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/graphics/opengl/touch.html">
+ Responding to Touch Events
+ </a>
+ </li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/animation/index.html"
+ description=
+ "How to add transitional animations to your user interface.">
+ Adding Animations
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/animation/crossfade.html">
+ Crossfading Two Views
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/animation/screen-slide.html">
+ Using ViewPager for Screen Slide
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/animation/cardflip.html">
+ Displaying Card Flip Animations
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/animation/zoom.html">
+ Zooming a View
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/animation/layout.html">
+ Animating Layout Changes
+ </a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <!-- End graphics and animation -->
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/building-connectivity.html">
+ <span class="small">Building Apps with</span><br/>
+ Connectivity & the Cloud
+ </a>
+ </div>
+ <ul>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/connect-devices-wirelessly/index.html"
+ description=
+ "How to find and connect to local devices using Network Service
+ Discovery and Wi-Fi Direct in order to create peer-to-peer connections."
+ >Connecting Devices Wirelessly</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/nsd.html">
+ Using Network Service Discovery
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/wifi-direct.html">
+ Connecting with Wi-Fi Direct
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/nsd-wifi-direct.html">
+ Using Wi-Fi Direct for Service Discovery
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/basics/network-ops/index.html"
+ description=
+ "How to create a network connection, monitor the connection for changes
+ in connectivity, and perform transactions with XML data."
+ >Performing Network Operations</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/basics/network-ops/connecting.html">
+ Connecting to the Network
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/network-ops/managing.html">
+ Managing Network Usage
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/network-ops/xml.html">
+ Parsing XML Data
+ </a>
+ </li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/efficient-downloads/index.html"
+ description=
+ "How to minimize your app's impact on the battery when performing downloads
+ and other network transactions."
+ >Transferring Data Without Draining the Battery</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/efficient-network-access.html">
+ Optimizing Downloads for Efficient Network Access
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/regular_updates.html">
+ Minimizing the Effect of Regular Updates
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/redundant_redundant.html">
+ Redundant Downloads are Redundant
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/efficient-downloads/connectivity_patterns.html">
+ Modifying Patterns Based on the Connectivity Type
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/cloudsync/index.html"
+ description=
+ "How to sync and back up app and user data to remote web services in the
+ cloud and how to restore the data back to multiple devices."
+ >Syncing to the Cloud</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/cloudsync/backupapi.html">
+ Using the Backup API
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/cloudsync/gcm.html">
+ Making the Most of Google Cloud Messaging
+ </a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <!-- End connectivity and cloud -->
+
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/building-userinfo.html">
+ <span class="small">Building Apps with</span><br/>
+ User Info & Location
+ </a>
+ </div>
+ <ul>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/id-auth/index.html"
+ description=
+ "How to remember the user by account, authenticate the user, acquire user permission
+ for the user's online data, and create custom accounts on the device."
+ >Remembering Users</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/id-auth/identify.html">
+ Remembering Your User
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/id-auth/authenticate.html">
+ Authenticating to OAuth2 Services
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/id-auth/custom_auth.html">
+ Creating a Custom Account Type
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/basics/location/index.html"
+ description=
+ "How to add location-aware features to your app by aqcuiring the user's current
+ location."
+ >Making Your App Location Aware</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/basics/location/locationmanager.html">
+ Using the Location Manager
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/location/currentlocation.html">
+ Obtaining the Current Location
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/basics/location/geocoding.html">
+ Displaying a Location Address
+ </a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <!-- End privacy and location -->
+
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/best-ux.html">
+ <span class="small">Best Practices for</span><br/>
+ User Experience & UI
</a>
</div>
<ul>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/location/index.html">
- <span class="en">Making Your App Location Aware</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/basics/location/locationmanager.html">
- <span class="en">Using the Location Manager</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/location/currentlocation.html">
- <span class="en">Obtaining the Current Location</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/location/geocoding.html">
- <span class="en">Displaying a Location Address</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/basics/network-ops/index.html">
- <span class="en">Performing Network Operations</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/basics/network-ops/connecting.html">
- <span class="en">Connecting to the Network</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/network-ops/managing.html">
- <span class="en">Managing Network Usage</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/basics/network-ops/xml.html">
- <span class="en">Parsing XML Data</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/efficient-downloads/index.html">
- <span class="en">Transferring Data Without Draining the Battery</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/efficient-downloads/efficient-network-access.html">
- <span class="en">Optimizing Downloads for Efficient Network Access</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/efficient-downloads/regular_updates.html">
- <span class="en">Minimizing the Effect of Regular Updates</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/efficient-downloads/redundant_redundant.html">
- <span class="en">Redundant Downloads are Redundant</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/efficient-downloads/connectivity_patterns.html">
- <span class="en">Modifying Patterns Based on the Connectivity Type</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/cloudsync/index.html">
- <span class="en">Syncing to the Cloud</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/cloudsync/backupapi.html">
- <span class="en">Using the Backup API</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/cloudsync/gcm.html">
- <span class="en">Making the Most of Google Cloud Messaging</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/multiscreen/index.html"
- zh-CN-lang="针对多种屏幕进行设计"
- ja-lang="複数画面のデザイン"
- es-lang="Cómo diseñar aplicaciones para varias pantallas"
- >Designing for Multiple Screens</a>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/design-navigation/index.html"
+ description=
+ "How to plan your app's screen hierarchy and forms of navigation so users can
+ effectively and intuitively traverse your app content using various navigation
+ patterns."
+ >Designing Effective Navigation</a>
</div>
<ul>
- <li><a href="<?cs var:toroot ?>training/multiscreen/screensizes.html"
+ <li><a href="<?cs var:toroot ?>training/design-navigation/screen-planning.html">
+ Planning Screens and Their Relationships
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/design-navigation/multiple-sizes.html">
+ Planning for Multiple Touchscreen Sizes
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/design-navigation/descendant-lateral.html">
+ Providing Descendant and Lateral Navigation
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/design-navigation/ancestral-temporal.html">
+ Providing Ancestral and Temporal Navigation
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/design-navigation/wireframing.html">
+ Putting it All Together: Wireframing the Example App
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/implementing-navigation/index.html"
+ description=
+ "How to implement various navigation patterns such as swipe views and up navigation."
+ >Implementing Effective Navigation</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/lateral.html">
+ Implementing Lateral Navigation
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/ancestral.html">
+ Implementing Ancestral Navigation
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/temporal.html">
+ Implementing Temporal Navigation
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/implementing-navigation/descendant.html">
+ Implementing Descendant Navigation
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/notify-user/index.html"
+ description=
+ "How to display messages called notifications outside of
+ your application's UI."
+ >Notifying the User</a>
+ </div>
+ <ul>
+ <li>
+ <a href="<?cs var:toroot ?>training/notify-user/build-notification.html">
+ Building a Notification
+ </a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>training/notify-user/navigation.html">
+ Preserving Navigation when Starting an Activity
+ </a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>training/notify-user/managing.html">
+ Updating Notifications
+ </a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>training/notify-user/expanded.html">
+ Using Big View Styles
+ </a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>training/notify-user/display-progress.html">
+ Displaying Progress in a Notification
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/search/index.html"
+ description=
+ "How to properly add a search interface to your app and create a searchable database."
+ >Adding Search Functionality</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/search/setup.html">
+ Setting up the Search Interface
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/search/search.html">
+ Storing and Searching for Data
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/search/backward-compat.html">
+ Remaining Backward Compatible
+ </a>
+ </li>
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="/training/multiscreen/index.html"
+ zh-CN-lang="针对多种屏幕进行设计"
+ ja-lang="複数画面のデザイン"
+ es-lang="Cómo diseñar aplicaciones para varias pantallas"
+ description=
+ "How to build a user interface that's flexible enough to
+ fit perfectly on any screen and how to create different interaction
+ patterns that are optimized for different screen sizes."
+ >Designing for Multiple Screens</a>
+ </div>
+ <ul>
+ <li><a href="/training/multiscreen/screensizes.html"
zh-CN-lang="支持各种屏幕尺寸"
ko-lang="다양한 화면 크기 지원"
ja-lang="さまざまな画面サイズのサポート"
- es-lang="Cómo admitir varios tamaños de pantalla"
- >Designing for Multiple Screens</a>
+ es-lang="Cómo admitir varios tamaños de pantalla"
+ >Supporting Different Screen Sizes</a>
</li>
- <li><a href="<?cs var:toroot ?>training/multiscreen/screendensities.html"
+ <li><a href="/training/multiscreen/screendensities.html"
zh-CN-lang="支持各种屏幕密度"
ja-lang="さまざまな画面密度のサポート"
- es-lang="Cómo admitir varias densidades de pantalla"
+ es-lang="Cómo admitir varias densidades de pantalla"
>Supporting Different Screen Densities</a>
</li>
- <li><a href="<?cs var:toroot ?>training/multiscreen/adaptui.html"
+ <li><a href="/training/multiscreen/adaptui.html"
zh-CN-lang="实施自适应用户界面流程"
ja-lang="順応性のある UI フローの実装"
- es-lang="Cómo implementar interfaces de usuario adaptables"
+ es-lang="Cómo implementar interfaces de usuario adaptables"
>Implementing Adaptive UI Flows</a>
</li>
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/improving-layouts/index.html">
- <span class="en">Improving Layout Performance</span>
- </a></div>
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>training/tv/index.html"
+ description=
+ "How to optimize your app's user interface and user input for
+ the "ten foot experience" of a TV screen."
+ >Designing for TV</a>
+ </div>
<ul>
- <li><a href="<?cs var:toroot ?>training/improving-layouts/optimizing-layout.html">
- <span class="en">Optimizing Layout Hierarchies</span>
+ <li><a href="<?cs var:toroot ?>training/tv/optimizing-layouts-tv.html">
+ Optimizing Layouts for TV
</a>
</li>
- <li><a href="<?cs var:toroot ?>training/improving-layouts/reusing-layouts.html">
- <span class="en">Re-using Layouts with <include/></span>
+ <li><a href="<?cs var:toroot ?>training/tv/optimizing-navigation-tv.html">
+ Optimizing Navigation for TV
</a>
</li>
- <li><a href="<?cs var:toroot ?>training/improving-layouts/loading-ondemand.html">
- <span class="en">Loading Views On Demand</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/improving-layouts/smooth-scrolling.html">
- <span class="en">Making ListView Scrolling Smooth</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/animation/index.html">
- <span class="en">Adding Animations</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/animation/crossfade.html">
- <span class="en">Crossfading Two Views</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/animation/screen-slide.html">
- <span class="en">Using ViewPager for Screen Slide</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/animation/cardflip.html">
- <span class="en">Displaying Card Flip Animations</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/animation/zoom.html">
- <span class="en">Zooming a View</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/animation/layout.html">
- <span class="en">Animating Layout Changes</span>
+ <li><a href="<?cs var:toroot ?>training/tv/unsupported-features-tv.html">
+ Handling Features Not Supported on TV
</a>
</li>
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/managing-audio/index.html">
- <span class="en">Managing Audio Playback</span>
- </a></div>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/custom-views/index.html"
+ description=
+ "How to build custom UI widgets that are interactive and smooth."
+ >Creating Custom Views</a>
+ </div>
<ul>
- <li><a href="<?cs var:toroot ?>training/managing-audio/volume-playback.html">
- <span class="en">Controlling Your App?s Volume and Playback</span>
+ <li><a href="<?cs var:toroot ?>training/custom-views/create-view.html">
+ Creating a Custom View Class
</a>
</li>
- <li><a href="<?cs var:toroot ?>training/managing-audio/audio-focus.html">
- <span class="en">Managing Audio Focus</span>
+ <li><a href="<?cs var:toroot ?>training/custom-views/custom-drawing.html">
+ Implementing Custom Drawing
</a>
</li>
- <li><a href="<?cs var:toroot ?>training/managing-audio/audio-output.html">
- <span class="en">Dealing with Audio Output Hardware</span>
+ <li><a href="<?cs var:toroot ?>training/custom-views/making-interactive.html">
+ Making the View Interactive
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/custom-views/optimizing-view.html">
+ Optimizing the View
</a>
</li>
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/monitoring-device-state/index.html"
- zh-CN-lang="优化电池使用时间"
- ja-lang="電池消費量の最適化"
- es-lang="Cómo optimizar la duración de la batería"
- >Optimizing Battery Life</a>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/backward-compatible-ui/index.html"
+ description=
+ "How to use UI components and other APIs from the more recent versions of Android
+ while remaining compatible with older versions of the platform."
+ >Creating Backward-Compatible UIs</a>
</div>
<ul>
- <li><a href="<?cs var:toroot ?>training/monitoring-device-state/battery-monitoring.html"
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/abstracting.html">
+ Abstracting the New APIs
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/new-implementation.html">
+ Proxying to the New APIs
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/older-implementation.html">
+ Creating an Implementation with Older APIs
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/using-component.html">
+ Using the Version-Aware Component
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/accessibility/index.html"
+ description=
+ "How to make your app accessible to users with vision
+ impairment or other physical disabilities."
+ >Implementing Accessibility</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/accessibility/accessible-app.html">
+ Developing Accessible Applications
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/accessibility/service.html">
+ Developing Accessibility Services
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ </ul>
+ </li>
+ <!-- End best UX and UI -->
+
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/best-performance.html">
+ <span class="small">Best Practices for</span><br/>
+ Performance
+ </a>
+ </div>
+ <ul>
+
+ <li>
+ <a href="<?cs var:toroot ?>training/articles/perf-tips.html"
+ description=
+ "How to optimize your app's performance in various ways to improve its
+ responsiveness and battery efficiency."
+ >Performance Tips</a>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/improving-layouts/index.html"
+ description=
+ "How to identify problems in your app's layout performance and improve the UI
+ responsiveness."
+ >Improving Layout Performance</a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>training/improving-layouts/optimizing-layout.html">
+ Optimizing Layout Hierarchies
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/improving-layouts/reusing-layouts.html">
+ Re-using Layouts with <include/>
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/improving-layouts/loading-ondemand.html">
+ Loading Views On Demand
+ </a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/improving-layouts/smooth-scrolling.html">
+ Making ListView Scrolling Smooth
+ </a>
+ </li>
+ </ul>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="/training/monitoring-device-state/index.html"
+ zh-CN-lang="优化电池使用时间"
+ ja-lang="電池消費量の最適化"
+ es-lang="Cómo optimizar la duración de la batería"
+ description=
+ "How to minimize the amount of power your app requires by adapting to current
+ power conditions and performing power-hungry tasks at proper intervals."
+ >Optimizing Battery Life</a>
+ </div>
+ <ul>
+ <li><a href="/training/monitoring-device-state/battery-monitoring.html"
zh-CN-lang="监控电池电量和充电状态"
ja-lang="電池残量と充電状態の監視"
- es-lang="Cómo controlar el nivel de batería y el estado de carga"
+ es-lang="Cómo controlar el nivel de batería y el estado de carga"
>Monitoring the Battery Level and Charging State</a>
</li>
- <li><a href="<?cs var:toroot ?>training/monitoring-device-state/docking-monitoring.html"
+ <li><a href="/training/monitoring-device-state/docking-monitoring.html"
zh-CN-lang="确定和监控基座对接状态和类型"
ja-lang="ホルダーの装着状態とタイプの特定と監視"
- es-lang="Cómo determinar y controlar el tipo de conector y el estado de la conexión"
+ es-lang="Cómo determinar y controlar el tipo de conector y el estado de la conexión"
>Determining and Monitoring the Docking State and Type</a>
</li>
- <li><a href="<?cs var:toroot ?>training/monitoring-device-state/connectivity-monitoring.html"
+ <li><a href="/training/monitoring-device-state/connectivity-monitoring.html"
zh-CN-lang="确定和监控网络连接状态"
ja-lang="接続状態の特定と監視"
- es-lang="Cómo determinar y controlar el estado de la conectividad"
+ es-lang="Cómo determinar y controlar el estado de la conectividad"
>Determining and Monitoring the Connectivity Status</a>
</li>
- <li><a href="<?cs var:toroot ?>training/monitoring-device-state/manifest-receivers.html"
+ <li><a href="/training/monitoring-device-state/manifest-receivers.html"
zh-CN-lang="根据需要操作广播接收器"
ja-lang="オンデマンドでのブロードキャスト レシーバ操作"
- es-lang="Cómo manipular los receptores de emisión bajo demanda"
+ es-lang="Cómo manipular los receptores de emisión bajo demanda"
>Manipulating Broadcast Receivers On Demand</a>
</li>
</ul>
</li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/custom-views/index.html">
- <span class="en">Creating Custom Views</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/custom-views/create-view.html">
- <span class="en">Creating a Custom View Class</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/custom-views/custom-drawing.html">
- <span class="en">Implementing Custom Drawing</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/custom-views/making-interactive.html">
- <span class="en">Making the View Interactive</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/custom-views/optimizing-view.html">
- <span class="en">Optimizing the View</span>
- </a>
- </li>
- </ul>
+
+ <li>
+ <a href="<?cs var:toroot ?>training/articles/perf-anr.html"
+ description=
+ "How to keep your app responsive to user interaction so the UI does not lock-up and
+ display an "Application Not Responding" dialog."
+ >Keeping Your App Responsive</a>
</li>
+
+ <li>
+ <a href="<?cs var:toroot ?>training/articles/perf-jni.html"
+ description=
+ "How to efficiently use the Java Native Interface with the Android NDK."
+ >JNI Tips</a>
+ </li>
+ </ul>
+ </li> <!-- end of Performance -->
+
+
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/best-security.html">
+ <span class="small">Best Practices for</span><br/>
+ Security & Privacy
+ </a>
+ </div>
+ <ul>
+
+ <li>
+ <a href="<?cs var:toroot ?>training/articles/security-tips.html"
+ description=
+ "How to perform various tasks and keep your app's data and your user's data secure."
+ >Security Tips</a>
+ </li>
+
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/search/index.html">
- <span class="en">Adding Search Functionality</span>
- </a>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/enterprise/index.html"
+ description=
+ "How to implement device management policies for enterprise-oriented apps."
+ >Developing for Enterprise</a>
</div>
<ul>
- <li><a href="<?cs var:toroot ?>training/search/setup.html">
- <span class="en">Setting up the Search Interface</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/search/search.html">
- <span class="en">Storing and Searching for Data</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/search/backward-compat.html">
- <span class="en">Remaining Backward Compatible</span>
+ <li><a href="<?cs var:toroot ?>training/enterprise/device-management-policy.html">
+ Enhancing Security with Device Management Policies
</a>
</li>
</ul>
</li>
+ </ul>
+ </li>
+ <!-- End security and user info -->
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/id-auth/index.html">
- <span class="en">Remembering Users</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/id-auth/identify.html">
- <span class="en">Remembering Your User</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/id-auth/authenticate.html">
- <span class="en">Authenticating to OAuth2 Services</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/id-auth/custom_auth.html">
- <span class="en">Creating a Custom Account Type</span>
- </a>
- </li>
- </ul>
- </li>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/distribute.html">
+ <span class="small">Using Google Play to</span><br/>
+ Distribute & Monetize
+ </a>
+ </div>
+ <ul>
+
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/sharing/index.html">
- <span class="en">Sharing Content</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/sharing/send.html">
- <span class="en">Sending Content to Other Apps</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/sharing/receive.html">
- <span class="en">Receiving Content from Other Apps</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/sharing/shareaction.html">
- <span class="en">Adding an Easy Share Action</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/camera/index.html">
- <span class="en">Capturing Photos</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/camera/photobasics.html">
- <span class="en">Taking Photos Simply</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/camera/videobasics.html">
- <span class="en">Recording Videos Simply</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/camera/cameradirect.html">
- <span class="en">Controlling the Camera</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/multiple-apks/index.html">
- <span class="en">Maintaining Multiple APKs</span>
- </a></div>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/multiple-apks/index.html"
+ description=
+ "How to publish your app on Google Play with separate APKs that target
+ different devices, while using a single app listing."
+ >Maintaining Multiple APKs</a>
+ </div>
<ul>
<li><a href="<?cs var:toroot ?>training/multiple-apks/api.html">
- <span class="en">Creating Multiple APKs for Different API Levels</span>
+ Creating Multiple APKs for Different API Levels
</a>
</li>
<li><a href="<?cs var:toroot ?>training/multiple-apks/screensize.html">
- <span class="en">Creating Multiple APKs for Different Screen Sizes</span>
+ Creating Multiple APKs for Different Screen Sizes
</a>
</li>
<li><a href="<?cs var:toroot ?>training/multiple-apks/texture.html">
- <span class="en">Creating Multiple APKs for Different GL Textures</span>
+ Creating Multiple APKs for Different GL Textures
</a>
</li>
<li><a href="<?cs var:toroot ?>training/multiple-apks/multiple.html">
- <span class="en">Creating Multiple APKs with 2+ Dimensions</span>
+ Creating Multiple APKs with 2+ Dimensions
</a>
</li>
</ul>
</li>
-
+
+
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/backward-compatible-ui/index.html">
- <span class="en">Creating Backward-Compatible UIs</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/abstracting.html">
- <span class="en">Abstracting the New APIs</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/new-implementation.html">
- <span class="en">Proxying to the New APIs</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/older-implementation.html">
- <span class="en">Creating an Implementation with Older APIs</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/backward-compatible-ui/using-component.html">
- <span class="en">Using the Version-Aware Component</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/enterprise/index.html">
- <span class="en">Developing for Enterprise</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/enterprise/device-management-policy.html">
- <span class="en">Enhancing Security with Device Management Policies</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/monetization/index.html">
- <span class="en">Monetizing Your App</span>
- </a></div>
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/monetization/index.html"
+ description=
+ "How to implement monetization strategies for your app without compromising
+ the user experience."
+ >Monetizing Your App</a>
+ </div>
<ul>
<li><a href="<?cs var:toroot ?>training/monetization/ads-and-ux.html">
- <span class="en">Advertising without Compromising User Experience</span>
+ Advertising without Compromising User Experience
</a>
</li>
</ul>
</li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/design-navigation/index.html">
- <span class="en">Designing Effective Navigation</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/design-navigation/screen-planning.html">
- <span class="en">Planning Screens and Their Relationships</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/design-navigation/multiple-sizes.html">
- <span class="en">Planning for Multiple Touchscreen Sizes</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/design-navigation/descendant-lateral.html">
- <span class="en">Providing Descendant and Lateral Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/design-navigation/ancestral-temporal.html">
- <span class="en">Providing Ancestral and Temporal Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/design-navigation/wireframing.html">
- <span class="en">Putting it All Together: Wireframing the Example App</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/implementing-navigation/index.html">
- <span class="en">Implementing Effective Navigation</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/implementing-navigation/lateral.html">
- <span class="en">Implementing Lateral Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/implementing-navigation/ancestral.html">
- <span class="en">Implementing Ancestral Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/implementing-navigation/temporal.html">
- <span class="en">Implementing Temporal Navigation</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/implementing-navigation/descendant.html">
- <span class="en">Implementing Descendant Navigation</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/tv/index.html">
- <span class="en">Designing for TV</span>
- </a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/tv/optimizing-layouts-tv.html">
- <span class="en">Optimizing Layouts for TV</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/tv/optimizing-navigation-tv.html">
- <span class="en">Optimizing Navigation for TV</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/tv/unsupported-features-tv.html">
- <span class="en">Handling Features Not Supported on TV</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/displaying-bitmaps/index.html">
- <span class="en">Displaying Bitmaps Efficiently</span>
- </a>
- </div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/load-bitmap.html">
- <span class="en">Loading Large Bitmaps Efficiently</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/process-bitmap.html">
- <span class="en">Processing Bitmaps Off the UI Thread</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/cache-bitmap.html">
- <span class="en">Caching Bitmaps</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/displaying-bitmaps/display-bitmap.html">
- <span class="en">Displaying Bitmaps in Your UI</span>
- </a></li>
- </ul>
- </li>
-
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/accessibility/index.html">
- <span class="en">Implementing Accessibility</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/accessibility/accessible-app.html">
- <span class="en">Developing Accessible Applications</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/accessibility/service.html">
- <span class="en">Developing Accessibility Services</span>
- </a>
- </li>
- </ul>
- </li>
-
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot
-?>training/graphics/opengl/index.html">
- <span class="en">Displaying Graphics with OpenGL ES</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/graphics/opengl/environment.html">
- <span class="en">Building an OpenGL ES Environment</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/graphics/opengl/shapes.html">
- <span class="en">Defining Shapes</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/graphics/opengl/draw.html">
- <span class="en">Drawing Shapes</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/graphics/opengl/projection.html">
- <span class="en">Applying Projection and Camera Views</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/graphics/opengl/motion.html">
- <span class="en">Adding Motion</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/graphics/opengl/touch.html">
- <span class="en">Responding to Touch Events</span>
- </a>
- </li>
- </ul>
- </li>
-
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/index.html">
- <span class="en">Connecting Devices Wirelessly</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/nsd.html">
- <span class="en">Using Network Service Discovery</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/wifi-direct.html">
- <span class="en">Connecting with Wi-Fi Direct</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/nsd-wifi-direct.html">
- <span class="en">Using Wi-Fi Direct for Service Discovery</span>
- </a>
- </li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>training/load-data-background/index.html">
- <span class="en">Loading Data in the Background</span>
- </a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>training/load-data-background/setup-loader.html">
- <span class="en">Setting Up the Loader</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/load-data-background/define-launch-query.html">
- <span class="en">Defining and Launching the Query</span>
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/load-data-background/handle-results.html">
- <span class="en">Handling the Results</span>
- </a>
- </li>
- </ul>
- </li>
-
</ul>
</li>
+ <!-- End best Publishing -->
+
</ul><!-- nav -->
<script type="text/javascript">
diff --git a/graphics/java/android/graphics/Path.java b/graphics/java/android/graphics/Path.java
index b4f1e84d..f6b5ffc 100644
--- a/graphics/java/android/graphics/Path.java
+++ b/graphics/java/android/graphics/Path.java
@@ -59,6 +59,10 @@
int valNative = 0;
if (src != null) {
valNative = src.mNativePath;
+ isSimplePath = src.isSimplePath;
+ if (src.rects != null) {
+ rects = new Region(src.rects);
+ }
}
mNativePath = init2(valNative);
mDetectSimplePaths = HardwareRenderer.isAvailable();
@@ -544,6 +548,7 @@
int dstNative = 0;
if (dst != null) {
dstNative = dst.mNativePath;
+ dst.isSimplePath = false;
}
native_offset(mNativePath, dx, dy, dstNative);
}
@@ -555,6 +560,7 @@
* @param dy The amount in the Y direction to offset the entire path
*/
public void offset(float dx, float dy) {
+ isSimplePath = false;
native_offset(mNativePath, dx, dy);
}
@@ -580,6 +586,7 @@
public void transform(Matrix matrix, Path dst) {
int dstNative = 0;
if (dst != null) {
+ dst.isSimplePath = false;
dstNative = dst.mNativePath;
}
native_transform(mNativePath, matrix.native_instance, dstNative);
@@ -591,6 +598,7 @@
* @param matrix The matrix to apply to the path
*/
public void transform(Matrix matrix) {
+ isSimplePath = false;
native_transform(mNativePath, matrix.native_instance);
}
diff --git a/graphics/java/android/graphics/Point.java b/graphics/java/android/graphics/Point.java
index 338e880a..e0d8ccc 100644
--- a/graphics/java/android/graphics/Point.java
+++ b/graphics/java/android/graphics/Point.java
@@ -70,20 +70,29 @@
return this.x == x && this.y == y;
}
- @Override public boolean equals(Object o) {
- if (o instanceof Point) {
- Point p = (Point) o;
- return this.x == p.x && this.y == p.y;
- }
- return false;
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Point point = (Point) o;
+
+ if (x != point.x) return false;
+ if (y != point.y) return false;
+
+ return true;
}
- @Override public int hashCode() {
- return x * 32713 + y;
+ @Override
+ public int hashCode() {
+ int result = x;
+ result = 31 * result + y;
+ return result;
}
- @Override public String toString() {
- return "Point(" + x + ", " + y+ ")";
+ @Override
+ public String toString() {
+ return "Point(" + x + ", " + y + ")";
}
/**
diff --git a/graphics/java/android/graphics/PointF.java b/graphics/java/android/graphics/PointF.java
index e00271f..ee38dbb 100644
--- a/graphics/java/android/graphics/PointF.java
+++ b/graphics/java/android/graphics/PointF.java
@@ -73,6 +73,31 @@
return this.x == x && this.y == y;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ PointF pointF = (PointF) o;
+
+ if (Float.compare(pointF.x, x) != 0) return false;
+ if (Float.compare(pointF.y, y) != 0) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = (x != +0.0f ? Float.floatToIntBits(x) : 0);
+ result = 31 * result + (y != +0.0f ? Float.floatToIntBits(y) : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "PointF(" + x + ", " + y + ")";
+ }
+
/**
* Return the euclidian distance from (0,0) to the point
*/
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index 41b272d..8280d2d 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -491,6 +491,8 @@
mComputedConstantSize = orig.mComputedConstantSize;
mConstantWidth = orig.mConstantWidth;
mConstantHeight = orig.mConstantHeight;
+ mConstantMinimumWidth = orig.mConstantMinimumWidth;
+ mConstantMinimumHeight = orig.mConstantMinimumHeight;
mOpacity = orig.mOpacity;
mHaveStateful = orig.mHaveStateful;
diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java
index 0623a9e..b966bb4 100644
--- a/graphics/java/android/graphics/drawable/GradientDrawable.java
+++ b/graphics/java/android/graphics/drawable/GradientDrawable.java
@@ -479,7 +479,7 @@
mFillPaint.setDither(mDither);
mFillPaint.setColorFilter(mColorFilter);
if (mColorFilter != null && !mGradientState.mHasSolidColor) {
- mFillPaint.setColor(0xff000000);
+ mFillPaint.setColor(mAlpha << 24);
}
if (haveStroke) {
mStrokePaint.setAlpha(currStrokeAlpha);
@@ -743,7 +743,7 @@
mFillPaint.setShader(new LinearGradient(x0, y0, x1, y1,
colors, st.mPositions, Shader.TileMode.CLAMP));
if (!mGradientState.mHasSolidColor) {
- mFillPaint.setColor(0xff000000);
+ mFillPaint.setColor(mAlpha << 24);
}
} else if (st.mGradient == RADIAL_GRADIENT) {
x0 = r.left + (r.right - r.left) * st.mCenterX;
@@ -755,7 +755,7 @@
level * st.mGradientRadius, colors, null,
Shader.TileMode.CLAMP));
if (!mGradientState.mHasSolidColor) {
- mFillPaint.setColor(0xff000000);
+ mFillPaint.setColor(mAlpha << 24);
}
} else if (st.mGradient == SWEEP_GRADIENT) {
x0 = r.left + (r.right - r.left) * st.mCenterX;
@@ -788,7 +788,7 @@
}
mFillPaint.setShader(new SweepGradient(x0, y0, tempColors, tempPositions));
if (!mGradientState.mHasSolidColor) {
- mFillPaint.setColor(0xff000000);
+ mFillPaint.setColor(mAlpha << 24);
}
}
}
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 22f699f..56abed4 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -5088,18 +5088,23 @@
// top of the stack for the media button event receivers : simply using the top of the
// stack would make the entry disappear from the RemoteControlDisplay in conditions such as
// notifications playing during music playback.
- // crawl the AudioFocus stack until an entry is found with the following characteristics:
+ // Crawl the AudioFocus stack from the top until an entry is found with the following
+ // characteristics:
// - focus gain on STREAM_MUSIC stream
// - non-transient focus gain on a stream other than music
FocusStackEntry af = null;
- Iterator<FocusStackEntry> stackIterator = mFocusStack.iterator();
- while(stackIterator.hasNext()) {
- FocusStackEntry fse = (FocusStackEntry)stackIterator.next();
- if ((fse.mStreamType == AudioManager.STREAM_MUSIC)
- || (fse.mFocusChangeType == AudioManager.AUDIOFOCUS_GAIN)) {
- af = fse;
- break;
+ try {
+ for (int index = mFocusStack.size()-1; index >= 0; index--) {
+ FocusStackEntry fse = mFocusStack.elementAt(index);
+ if ((fse.mStreamType == AudioManager.STREAM_MUSIC)
+ || (fse.mFocusChangeType == AudioManager.AUDIOFOCUS_GAIN)) {
+ af = fse;
+ break;
+ }
}
+ } catch (ArrayIndexOutOfBoundsException e) {
+ Log.e(TAG, "Wrong index accessing audio focus stack when updating RCD: " + e);
+ af = null;
}
if (af == null) {
clearRemoteControlDisplay_syncAfRcs();
@@ -5120,6 +5125,7 @@
clearRemoteControlDisplay_syncAfRcs();
return;
}
+
// refresh conditions were verified: update the remote controls
// ok to call: synchronized mAudioFocusLock then on mRCStack, mRCStack is not empty
updateRemoteControlDisplay_syncAfRcs(infoChangedFlags);
diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java
index 4414191..169502b 100644
--- a/media/java/android/media/MediaFormat.java
+++ b/media/java/android/media/MediaFormat.java
@@ -50,7 +50,7 @@
* <tr><th>Name</th><th>Value Type</th><th>Description</th></tr>
* <tr><td>{@link #KEY_CHANNEL_COUNT}</td><td>Integer</td><td></td></tr>
* <tr><td>{@link #KEY_SAMPLE_RATE}</td><td>Integer</td><td></td></tr>
- * <tr><td>{@link #KEY_IS_ADTS}</td><td>Integer</td><td>optional, if content is AAC audio, setting this key to 1 indicates that each audio frame is prefixed by the ADTS header.</td></tr>
+ * <tr><td>{@link #KEY_IS_ADTS}</td><td>Integer</td><td>optional, if <em>decoding</em> AAC audio content, setting this key to 1 indicates that each audio frame is prefixed by the ADTS header.</td></tr>
* <tr><td>{@link #KEY_AAC_PROFILE}</td><td>Integer</td><td><b>encoder-only</b>, optional, if content is AAC audio, specifies the desired profile.</td></tr>
* <tr><td>{@link #KEY_CHANNEL_MASK}</td><td>Integer</td><td>A mask of audio channel assignments</td></tr>
* <tr><td>{@link #KEY_FLAC_COMPRESSION_LEVEL}</td><td>Integer</td><td><b>encoder-only</b>, optional, if content is FLAC audio, specifies the desired compression level.</td></tr>
@@ -140,6 +140,8 @@
* A key mapping to a value of 1 if the content is AAC audio and
* audio frames are prefixed with an ADTS header.
* The associated value is an integer (0 or 1).
+ * This key is only supported when _decoding_ content, it cannot
+ * be used to configure an encoder to emit ADTS output.
*/
public static final String KEY_IS_ADTS = "is-adts";
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index abe6082..dae50a3 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -180,7 +180,7 @@
<string name="ethernet_label" msgid="7967563676324087464">"Ethernet"</string>
<string name="quick_settings_airplane_mode_label" msgid="5510520633448831350">"Λειτουργία πτήσης"</string>
<string name="quick_settings_battery_charging_label" msgid="490074774465309209">"Φόρτιση, <xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g>"</string>
- <string name="quick_settings_battery_charged_label" msgid="8865413079414246081">"Χρεώθηκε"</string>
+ <string name="quick_settings_battery_charged_label" msgid="8865413079414246081">"Μπαταρία πλήρης"</string>
<string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"Bluetooth"</string>
<string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"Bluetooth (<xliff:g id="NUMBER">%d</xliff:g> συσκευές)"</string>
<string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"Απενεργοποιημένο Bluetooth"</string>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 7bf9d4c..91214d1 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -181,7 +181,7 @@
<string name="quick_settings_battery_charged_label" msgid="8865413079414246081">"Laddat"</string>
<string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"Bluetooth"</string>
<string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"Bluetooth (<xliff:g id="NUMBER">%d</xliff:g> enheter)"</string>
- <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"Inaktivera Bluetooth"</string>
+ <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"Bluetooth inaktivt"</string>
<string name="quick_settings_brightness_label" msgid="6968372297018755815">"Ljusstyrka"</string>
<string name="quick_settings_rotation_unlocked_label" msgid="336054930362580584">"Rotera automatiskt"</string>
<string name="quick_settings_rotation_locked_label" msgid="8058646447242565486">"Rotationen har låsts"</string>
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java
index 4338fa0..9281c75 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java
@@ -138,6 +138,10 @@
return mLoadedTasks;
}
+ public void remove(TaskDescription td) {
+ mLoadedTasks.remove(td);
+ }
+
public boolean isFirstScreenful() {
return mFirstScreenful;
}
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
index 6cb7dec..3330301 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
@@ -336,19 +336,6 @@
});
}
- @Override
- protected void onVisibilityChanged(View changedView, int visibility) {
- super.onVisibilityChanged(changedView, visibility);
- // scroll to bottom after reloading
- if (visibility == View.VISIBLE && changedView == this) {
- post(new Runnable() {
- public void run() {
- update();
- }
- });
- }
- }
-
public void setAdapter(TaskDescriptionAdapter adapter) {
mAdapter = adapter;
mAdapter.registerDataSetObserver(new DataSetObserver() {
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index cd3bc42..9a1e38d 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -77,9 +77,10 @@
private boolean mShowing;
private boolean mWaitingToShow;
- private int mNumItemsWaitingForThumbnailsAndIcons;
private ViewHolder mItemToAnimateInWhenWindowAnimationIsFinished;
+ private boolean mAnimateIconOfFirstTask;
private boolean mWaitingForWindowAnimation;
+ private long mWindowAnimationStartTime;
private RecentTasksLoader mRecentTasksLoader;
private ArrayList<TaskDescription> mRecentTaskDescriptions;
@@ -174,10 +175,9 @@
if (td.isLoaded()) {
updateThumbnail(holder, td.getThumbnail(), true, false);
updateIcon(holder, td.getIcon(), true, false);
- mNumItemsWaitingForThumbnailsAndIcons--;
}
if (index == 0) {
- if (mWaitingForWindowAnimation) {
+ if (mAnimateIconOfFirstTask) {
if (mItemToAnimateInWhenWindowAnimationIsFinished != null) {
holder.iconView.setAlpha(1f);
holder.iconView.setTranslationX(0f);
@@ -206,6 +206,9 @@
holder.iconView.setAlpha(0f);
holder.iconView.setTranslationY(translation);
}
+ if (!mWaitingForWindowAnimation) {
+ animateInIconOfFirstTask();
+ }
}
}
@@ -220,7 +223,9 @@
updateThumbnail(holder, mRecentTasksLoader.getDefaultThumbnail(), false, false);
holder.iconView.setImageBitmap(mRecentTasksLoader.getDefaultIcon());
holder.iconView.setVisibility(INVISIBLE);
+ holder.iconView.animate().cancel();
holder.labelView.setText(null);
+ holder.labelView.animate().cancel();
holder.thumbnailView.setContentDescription(null);
holder.thumbnailView.setTag(null);
holder.thumbnailView.setOnLongClickListener(null);
@@ -235,6 +240,7 @@
holder.calloutLine.setAlpha(1f);
holder.calloutLine.setTranslationX(0f);
holder.calloutLine.setTranslationY(0f);
+ holder.calloutLine.animate().cancel();
}
holder.taskDescription = null;
holder.loadedThumbnailAndIcon = false;
@@ -291,8 +297,9 @@
}
public void show(boolean show, ArrayList<TaskDescription> recentTaskDescriptions,
- boolean firstScreenful, boolean waitingForWindowAnimation) {
- mWaitingForWindowAnimation = waitingForWindowAnimation;
+ boolean firstScreenful, boolean animateIconOfFirstTask) {
+ mAnimateIconOfFirstTask = animateIconOfFirstTask;
+ mWaitingForWindowAnimation = animateIconOfFirstTask;
if (show) {
mWaitingToShow = true;
refreshRecentTasksList(recentTaskDescriptions, firstScreenful);
@@ -527,7 +534,6 @@
updateIcon(h, td.getIcon(), true, animateShow);
updateThumbnail(h, td.getThumbnail(), true, animateShow);
h.loadedThumbnailAndIcon = true;
- mNumItemsWaitingForThumbnailsAndIcons--;
}
}
}
@@ -536,9 +542,14 @@
showIfReady();
}
- public void onWindowAnimationStart() {
- if (mItemToAnimateInWhenWindowAnimationIsFinished != null) {
- final int startDelay = 150;
+ private void animateInIconOfFirstTask() {
+ if (mItemToAnimateInWhenWindowAnimationIsFinished != null &&
+ !mRecentTasksLoader.isFirstScreenful()) {
+ int timeSinceWindowAnimation =
+ (int) (System.currentTimeMillis() - mWindowAnimationStartTime);
+ final int minStartDelay = 150;
+ final int startDelay = Math.max(0, Math.min(
+ minStartDelay - timeSinceWindowAnimation, minStartDelay));
final int duration = 250;
final ViewHolder holder = mItemToAnimateInWhenWindowAnimationIsFinished;
final TimeInterpolator cubic = new DecelerateInterpolator(1.5f);
@@ -550,10 +561,16 @@
}
}
mItemToAnimateInWhenWindowAnimationIsFinished = null;
- mWaitingForWindowAnimation = false;
+ mAnimateIconOfFirstTask = false;
}
}
+ public void onWindowAnimationStart() {
+ mWaitingForWindowAnimation = false;
+ mWindowAnimationStartTime = System.currentTimeMillis();
+ animateInIconOfFirstTask();
+ }
+
public void clearRecentTasksList() {
// Clear memory used by screenshots
if (mRecentTaskDescriptions != null) {
@@ -590,9 +607,6 @@
}
public void onTasksLoaded(ArrayList<TaskDescription> tasks, boolean firstScreenful) {
- mNumItemsWaitingForThumbnailsAndIcons = firstScreenful
- ? tasks.size() : mRecentTaskDescriptions == null
- ? 0 : mRecentTaskDescriptions.size();
if (mRecentTaskDescriptions == null) {
mRecentTaskDescriptions = new ArrayList<TaskDescription>(tasks);
} else {
@@ -689,6 +703,7 @@
}
if (DEBUG) Log.v(TAG, "Jettison " + ad.getLabel());
mRecentTaskDescriptions.remove(ad);
+ mRecentTasksLoader.remove(ad);
// Handled by widget containers to enable LayoutTransitions properly
// mListAdapter.notifyDataSetChanged();
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
index 47b0113..b3adbaf 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
@@ -345,19 +345,6 @@
});
}
- @Override
- protected void onVisibilityChanged(View changedView, int visibility) {
- super.onVisibilityChanged(changedView, visibility);
- // scroll to bottom after reloading
- if (visibility == View.VISIBLE && changedView == this) {
- post(new Runnable() {
- public void run() {
- update();
- }
- });
- }
- }
-
public void setAdapter(TaskDescriptionAdapter adapter) {
mAdapter = adapter;
mAdapter.registerDataSetObserver(new DataSetObserver() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
index cc9c601..9b0a320 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
@@ -55,6 +55,7 @@
import android.graphics.drawable.LevelListDrawable;
import android.hardware.display.DisplayManager;
import android.hardware.display.WifiDisplayStatus;
+import android.net.wifi.WifiManager;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.RemoteException;
@@ -85,6 +86,8 @@
private static final String TAG = "QuickSettings";
public static final boolean SHOW_IME_TILE = false;
+ public static final boolean LONG_PRESS_TOGGLES = true;
+
private Context mContext;
private PanelBar mBar;
private QuickSettingsModel mModel;
@@ -94,6 +97,8 @@
private WifiDisplayStatus mWifiDisplayStatus;
private PhoneStatusBar mStatusBarService;
private BluetoothState mBluetoothState;
+ private BluetoothAdapter mBluetoothAdapter;
+ private WifiManager mWifiManager;
private BrightnessController mBrightnessController;
private BluetoothController mBluetoothController;
@@ -131,6 +136,9 @@
mModel = new QuickSettingsModel(context);
mWifiDisplayStatus = new WifiDisplayStatus();
mBluetoothState = new QuickSettingsModel.BluetoothState();
+ mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
+
mHandler = new Handler();
Resources r = mContext.getResources();
@@ -297,8 +305,7 @@
(UserManager) mContext.getSystemService(Context.USER_SERVICE);
if (um.getUsers(true).size() > 1) {
try {
- WindowManagerGlobal.getWindowManagerService().lockNow(
- LockPatternUtils.USER_SWITCH_LOCK_OPTIONS);
+ WindowManagerGlobal.getWindowManagerService().lockNow(null);
} catch (RemoteException e) {
Log.e(TAG, "Couldn't show user switcher", e);
}
@@ -391,7 +398,7 @@
private void addSystemTiles(ViewGroup parent, LayoutInflater inflater) {
// Wi-fi
- QuickSettingsTileView wifiTile = (QuickSettingsTileView)
+ final QuickSettingsTileView wifiTile = (QuickSettingsTileView)
inflater.inflate(R.layout.quick_settings_tile, parent, false);
wifiTile.setContent(R.layout.quick_settings_tile_wifi, inflater);
wifiTile.setOnClickListener(new View.OnClickListener() {
@@ -400,6 +407,30 @@
startSettingsActivity(android.provider.Settings.ACTION_WIFI_SETTINGS);
}
});
+ if (LONG_PRESS_TOGGLES) {
+ wifiTile.setOnLongClickListener(new View.OnLongClickListener() {
+ @Override
+ public boolean onLongClick(View v) {
+ final boolean enable =
+ (mWifiManager.getWifiState() != WifiManager.WIFI_STATE_ENABLED);
+ new AsyncTask<Void, Void, Void>() {
+ @Override
+ protected Void doInBackground(Void... args) {
+ // Disable tethering if enabling Wifi
+ final int wifiApState = mWifiManager.getWifiApState();
+ if (enable && ((wifiApState == WifiManager.WIFI_AP_STATE_ENABLING) ||
+ (wifiApState == WifiManager.WIFI_AP_STATE_ENABLED))) {
+ mWifiManager.setWifiApEnabled(null, false);
+ }
+
+ mWifiManager.setWifiEnabled(enable);
+ return null;
+ }
+ }.execute();
+ wifiTile.setPressed(false);
+ return true;
+ }} );
+ }
mModel.addWifiTile(wifiTile, new QuickSettingsModel.RefreshCallback() {
@Override
public void refreshView(QuickSettingsTileView view, State state) {
@@ -415,7 +446,7 @@
});
parent.addView(wifiTile);
- if (mModel.deviceSupportsTelephony()) {
+ if (mModel.deviceHasMobileData()) {
// RSSI
QuickSettingsTileView rssiTile = (QuickSettingsTileView)
inflater.inflate(R.layout.quick_settings_tile, parent, false);
@@ -538,7 +569,7 @@
// Bluetooth
if (mModel.deviceSupportsBluetooth()) {
- QuickSettingsTileView bluetoothTile = (QuickSettingsTileView)
+ final QuickSettingsTileView bluetoothTile = (QuickSettingsTileView)
inflater.inflate(R.layout.quick_settings_tile, parent, false);
bluetoothTile.setContent(R.layout.quick_settings_tile_bluetooth, inflater);
bluetoothTile.setOnClickListener(new View.OnClickListener() {
@@ -547,6 +578,19 @@
startSettingsActivity(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);
}
});
+ if (LONG_PRESS_TOGGLES) {
+ bluetoothTile.setOnLongClickListener(new View.OnLongClickListener() {
+ @Override
+ public boolean onLongClick(View v) {
+ if (mBluetoothAdapter.isEnabled()) {
+ mBluetoothAdapter.disable();
+ } else {
+ mBluetoothAdapter.enable();
+ }
+ bluetoothTile.setPressed(false);
+ return true;
+ }});
+ }
mModel.addBluetoothTile(bluetoothTile, new QuickSettingsModel.RefreshCallback() {
@Override
public void refreshView(QuickSettingsTileView view, State state) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
index 4513dcb..ec42883 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
@@ -29,6 +29,7 @@
import android.database.ContentObserver;
import android.graphics.drawable.Drawable;
import android.hardware.display.WifiDisplayStatus;
+import android.net.ConnectivityManager;
import android.os.Handler;
import android.os.UserHandle;
import android.provider.Settings;
@@ -171,6 +172,8 @@
private final BugreportObserver mBugreportObserver;
private final BrightnessObserver mBrightnessObserver;
+ private final boolean mHasMobileData;
+
private QuickSettingsTileView mUserTile;
private RefreshCallback mUserCallback;
private UserState mUserState = new UserState();
@@ -249,6 +252,10 @@
mBrightnessObserver = new BrightnessObserver(mHandler);
mBrightnessObserver.startObserving();
+ ConnectivityManager cm = (ConnectivityManager)
+ context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ mHasMobileData = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
+
IntentFilter alarmIntentFilter = new IntentFilter();
alarmIntentFilter.addAction(Intent.ACTION_ALARM_CHANGED);
context.registerReceiver(mAlarmIntentReceiver, alarmIntentFilter);
@@ -403,22 +410,22 @@
mWifiCallback.refreshView(mWifiTile, mWifiState);
}
+ boolean deviceHasMobileData() {
+ return mHasMobileData;
+ }
+
// RSSI
void addRSSITile(QuickSettingsTileView view, RefreshCallback cb) {
mRSSITile = view;
mRSSICallback = cb;
mRSSICallback.refreshView(mRSSITile, mRSSIState);
}
- boolean deviceSupportsTelephony() {
- PackageManager pm = mContext.getPackageManager();
- return pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
- }
// NetworkSignalChanged callback
@Override
public void onMobileDataSignalChanged(
boolean enabled, int mobileSignalIconId, String signalContentDescription,
int dataTypeIconId, String dataContentDescription, String enabledDesc) {
- if (deviceSupportsTelephony()) {
+ if (deviceHasMobileData()) {
// TODO: If view is in awaiting state, disable
Resources r = mContext.getResources();
mRSSIState.signalIconId = enabled && (mobileSignalIconId > 0)
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 ffc18c7..8f2a4eb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
@@ -45,8 +45,7 @@
import com.android.internal.R;
/**
- * This widget display an analogic clock with two hands for hours and
- * minutes.
+ * Digital clock for the status bar.
*/
public class Clock extends TextView {
private boolean mAttached;
@@ -84,6 +83,7 @@
filter.addAction(Intent.ACTION_TIME_CHANGED);
filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
+ filter.addAction(Intent.ACTION_USER_SWITCHED);
getContext().registerReceiver(mIntentReceiver, filter, null, getHandler());
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java b/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java
index dbd9999..762711d 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/CameraWidgetFrame.java
@@ -18,10 +18,9 @@
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Point;
+import android.graphics.Rect;
import android.os.Handler;
import android.os.SystemClock;
import android.util.Log;
@@ -53,17 +52,20 @@
private final Handler mHandler = new Handler();
private final KeyguardActivityLauncher mActivityLauncher;
private final Callbacks mCallbacks;
+ private final CameraWidgetInfo mWidgetInfo;
private final WindowManager mWindowManager;
private final Point mRenderedSize = new Point();
- private final int[] mScreenLocation = new int[2];
+ private final int[] mTmpLoc = new int[2];
+ private final Rect mTmpRect = new Rect();
- private View mWidgetView;
private long mLaunchCameraStart;
private boolean mActive;
private boolean mTransitioning;
- private boolean mRecovering;
private boolean mDown;
+ private FixedSizeFrameLayout mPreview;
+ private View mFullscreenPreview;
+
private final Runnable mTransitionToCameraRunnable = new Runnable() {
@Override
public void run() {
@@ -81,21 +83,18 @@
mActivityLauncher.launchCamera(worker, mSecureCameraActivityStartedRunnable);
}};
+ private final Runnable mPostTransitionToCameraEndAction = new Runnable() {
+ @Override
+ public void run() {
+ mHandler.post(mTransitionToCameraEndAction);
+ }};
+
private final Runnable mRecoverRunnable = new Runnable() {
@Override
public void run() {
recover();
}};
- private final Runnable mRecoverEndAction = new Runnable() {
- @Override
- public void run() {
- if (!mRecovering)
- return;
- mCallbacks.onCameraLaunchedUnsuccessfully();
- reset();
- }};
-
private final Runnable mRenderRunnable = new Runnable() {
@Override
public void run() {
@@ -119,13 +118,43 @@
};
};
+ private static final class FixedSizeFrameLayout extends FrameLayout {
+ int width;
+ int height;
+
+ FixedSizeFrameLayout(Context context) {
+ super(context);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ measureChildren(
+ MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
+ setMeasuredDimension(width, height);
+ }
+ }
+
private CameraWidgetFrame(Context context, Callbacks callbacks,
- KeyguardActivityLauncher activityLauncher) {
+ KeyguardActivityLauncher activityLauncher,
+ CameraWidgetInfo widgetInfo, View previewWidget) {
super(context);
mCallbacks = callbacks;
mActivityLauncher = activityLauncher;
+ mWidgetInfo = widgetInfo;
mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
KeyguardUpdateMonitor.getInstance(context).registerCallback(mCallback);
+
+ mPreview = new FixedSizeFrameLayout(context);
+ mPreview.addView(previewWidget);
+ addView(mPreview);
+
+ View clickBlocker = new View(context);
+ clickBlocker.setBackgroundColor(Color.TRANSPARENT);
+ clickBlocker.setOnClickListener(this);
+ addView(clickBlocker);
+
+ setContentDescription(context.getString(R.string.keyguard_accessibility_camera));
if (DEBUG) Log.d(TAG, "new CameraWidgetFrame instance " + instanceId());
}
@@ -137,24 +166,17 @@
CameraWidgetInfo widgetInfo = launcher.getCameraWidgetInfo();
if (widgetInfo == null)
return null;
- View widgetView = widgetInfo.layoutId > 0 ?
- inflateWidgetView(context, widgetInfo) :
- inflateGenericWidgetView(context);
- if (widgetView == null)
+ View previewWidget = getPreviewWidget(context, widgetInfo);
+ if (previewWidget == null)
return null;
- ImageView preview = new ImageView(context);
- preview.setLayoutParams(new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT));
- preview.setScaleType(ScaleType.FIT_CENTER);
- preview.setContentDescription(preview.getContext().getString(
- R.string.keyguard_accessibility_camera));
- CameraWidgetFrame cameraWidgetFrame = new CameraWidgetFrame(context, callbacks, launcher);
- cameraWidgetFrame.addView(preview);
- cameraWidgetFrame.mWidgetView = widgetView;
- preview.setOnClickListener(cameraWidgetFrame);
- return cameraWidgetFrame;
+ return new CameraWidgetFrame(context, callbacks, launcher, widgetInfo, previewWidget);
+ }
+
+ private static View getPreviewWidget(Context context, CameraWidgetInfo widgetInfo) {
+ return widgetInfo.layoutId > 0 ?
+ inflateWidgetView(context, widgetInfo) :
+ inflateGenericWidgetView(context);
}
private static View inflateWidgetView(Context context, CameraWidgetInfo widgetInfo) {
@@ -188,63 +210,45 @@
return iv;
}
- public void render() {
- final Throwable[] thrown = new Throwable[1];
- final Bitmap[] offscreen = new Bitmap[1];
- try {
- final int width = getRootView().getWidth();
- final int height = getRootView().getHeight();
- if (mRenderedSize.x == width && mRenderedSize.y == height) {
- if (DEBUG) Log.d(TAG, String.format("Already rendered at size=%sx%s",
- width, height));
- return;
- }
- if (width == 0 || height == 0) {
- return;
- }
- final long start = SystemClock.uptimeMillis();
- offscreen[0] = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
- final Canvas c = new Canvas(offscreen[0]);
- mWidgetView.measure(
- MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
- mWidgetView.layout(0, 0, width, height);
- mWidgetView.draw(c);
-
- final long end = SystemClock.uptimeMillis();
- if (DEBUG) Log.d(TAG, String.format(
- "Rendered camera widget in %sms size=%sx%s instance=%s at %s",
- end - start,
- width, height,
- instanceId(),
- end));
- mRenderedSize.set(width, height);
- } catch (Throwable t) {
- thrown[0] = t;
+ private void render() {
+ final View root = getRootView();
+ final int width = root.getWidth();
+ final int height = root.getHeight();
+ if (mRenderedSize.x == width && mRenderedSize.y == height) {
+ if (DEBUG) Log.d(TAG, String.format("Already rendered at size=%sx%s", width, height));
+ return;
+ }
+ if (width == 0 || height == 0) {
+ return;
}
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- if (thrown[0] == null) {
- try {
- ((ImageView) getChildAt(0)).setImageBitmap(offscreen[0]);
- } catch (Throwable t) {
- thrown[0] = t;
- }
- }
- if (thrown[0] == null)
- return;
+ mPreview.width = width;
+ mPreview.height = height;
+ mPreview.requestLayout();
- Log.w(TAG, "Error rendering camera widget", thrown[0]);
- try {
- removeAllViews();
- final View genericView = inflateGenericWidgetView(mContext);
- addView(genericView);
- } catch (Throwable t) {
- Log.w(TAG, "Error inflating generic camera widget", t);
- }
- }});
+ final int thisWidth = getWidth() - getPaddingLeft() - getPaddingRight();
+ final int thisHeight = getHeight() - getPaddingTop() - getPaddingBottom();
+
+ final float pvScaleX = (float) thisWidth / width;
+ final float pvScaleY = (float) thisHeight / height;
+ final float pvScale = Math.min(pvScaleX, pvScaleY);
+
+ final int pvWidth = (int) (pvScale * width);
+ final int pvHeight = (int) (pvScale * height);
+
+ final float pvTransX = pvWidth < thisWidth ? (thisWidth - pvWidth) / 2 : 0;
+ final float pvTransY = pvHeight < thisHeight ? (thisHeight - pvHeight) / 2 : 0;
+
+ mPreview.setPivotX(0);
+ mPreview.setPivotY(0);
+ mPreview.setScaleX(pvScale);
+ mPreview.setScaleY(pvScale);
+ mPreview.setTranslationX(pvTransX);
+ mPreview.setTranslationY(pvTransY);
+
+ mRenderedSize.set(width, height);
+ if (DEBUG) Log.d(TAG, String.format("Rendered camera widget size=%sx%s instance=%s",
+ width, height, instanceId()));
}
private void transitionToCamera() {
@@ -252,55 +256,53 @@
mTransitioning = true;
- final View child = getChildAt(0);
- final View root = getRootView();
-
- final int startWidth = child.getWidth();
- final int startHeight = child.getHeight();
-
- final int finishWidth = root.getWidth();
- final int finishHeight = root.getHeight();
-
- final float scaleX = (float) finishWidth / startWidth;
- final float scaleY = (float) finishHeight / startHeight;
- final float scale = Math.round( Math.max(scaleX, scaleY) * 100) / 100f;
-
- final int[] loc = new int[2];
- root.getLocationInWindow(loc);
- final int finishCenter = loc[1] + finishHeight / 2;
-
- child.getLocationInWindow(loc);
- final int startCenter = loc[1] + startHeight / 2;
-
- if (DEBUG) Log.d(TAG, String.format("Transitioning to camera. " +
- "(start=%sx%s, finish=%sx%s, scale=%s,%s, startCenter=%s, finishCenter=%s)",
- startWidth, startHeight,
- finishWidth, finishHeight,
- scaleX, scaleY,
- startCenter, finishCenter));
-
enableWindowExitAnimation(false);
- animate()
- .scaleX(scale)
- .scaleY(scale)
- .translationY(finishCenter - startCenter)
- .setDuration(WIDGET_ANIMATION_DURATION)
- .withEndAction(mTransitionToCameraEndAction)
- .start();
+ mPreview.getLocationInWindow(mTmpLoc);
+ final float pvHeight = mPreview.getHeight() * mPreview.getScaleY();
+ final float pvCenter = mTmpLoc[1] + pvHeight / 2f;
+
+ final ViewGroup root = (ViewGroup) getRootView();
+ if (mFullscreenPreview == null) {
+ mFullscreenPreview = getPreviewWidget(mContext, mWidgetInfo);
+ mFullscreenPreview.setClickable(false);
+ root.addView(mFullscreenPreview);
+ }
+
+ root.getWindowVisibleDisplayFrame(mTmpRect);
+ final float fsHeight = mTmpRect.height();
+ final float fsCenter = mTmpRect.top + fsHeight / 2;
+
+ final float fsScaleY = pvHeight / fsHeight;
+ final float fsTransY = pvCenter - fsCenter;
+ final float fsScaleX = mPreview.getScaleX();
+
+ mPreview.setVisibility(View.GONE);
+ mFullscreenPreview.setVisibility(View.VISIBLE);
+ mFullscreenPreview.setTranslationY(fsTransY);
+ mFullscreenPreview.setScaleX(fsScaleX);
+ mFullscreenPreview.setScaleY(fsScaleY);
+ mFullscreenPreview
+ .animate()
+ .scaleX(1)
+ .scaleY(1)
+ .translationX(0)
+ .translationY(0)
+ .setDuration(WIDGET_ANIMATION_DURATION)
+ .withEndAction(mPostTransitionToCameraEndAction)
+ .start();
mCallbacks.onLaunchingCamera();
}
private void recover() {
if (DEBUG) Log.d(TAG, "recovering at " + SystemClock.uptimeMillis());
- mRecovering = true;
- animate()
- .scaleX(1)
- .scaleY(1)
- .translationY(0)
- .setDuration(WIDGET_ANIMATION_DURATION)
- .withEndAction(mRecoverEndAction)
- .start();
+ mCallbacks.onCameraLaunchedUnsuccessfully();
+ reset();
+ }
+
+ @Override
+ public void setOnLongClickListener(OnLongClickListener l) {
+ // ignore
}
@Override
@@ -340,8 +342,8 @@
return true;
}
- getLocationOnScreen(mScreenLocation);
- int rawBottom = mScreenLocation[1] + getHeight();
+ getLocationOnScreen(mTmpLoc);
+ int rawBottom = mTmpLoc[1] + getHeight();
if (event.getRawY() > rawBottom) {
if (DEBUG) Log.d(TAG, "onUserInteraction eaten: below widget");
return true;
@@ -388,14 +390,14 @@
if (DEBUG) Log.d(TAG, "reset at " + SystemClock.uptimeMillis());
mLaunchCameraStart = 0;
mTransitioning = false;
- mRecovering = false;
mDown = false;
cancelTransitionToCamera();
mHandler.removeCallbacks(mRecoverRunnable);
- animate().cancel();
- setScaleX(1);
- setScaleY(1);
- setTranslationY(0);
+ mPreview.setVisibility(View.VISIBLE);
+ if (mFullscreenPreview != null) {
+ mFullscreenPreview.animate().cancel();
+ mFullscreenPreview.setVisibility(View.GONE);
+ }
enableWindowExitAnimation(true);
}
@@ -403,11 +405,18 @@
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
if (DEBUG) Log.d(TAG, String.format("onSizeChanged new=%sx%s old=%sx%s at %s",
w, h, oldw, oldh, SystemClock.uptimeMillis()));
- final Handler worker = getWorkerHandler();
- (worker != null ? worker : mHandler).post(mRenderRunnable);
+ mHandler.post(mRenderRunnable);
super.onSizeChanged(w, h, oldw, oldh);
}
+ @Override
+ public void onBouncerShowing(boolean showing) {
+ if (showing) {
+ mTransitioning = false;
+ mHandler.post(mRecoverRunnable);
+ }
+ }
+
private void enableWindowExitAnimation(boolean isEnabled) {
View root = getRootView();
ViewGroup.LayoutParams lp = root.getLayoutParams();
@@ -427,15 +436,14 @@
if (DEBUG) Log.d(TAG, "onKeyguardVisibilityChanged " + showing
+ " at " + SystemClock.uptimeMillis());
if (mTransitioning && !showing) {
- mTransitioning = false;
- mRecovering = false;
- mHandler.removeCallbacks(mRecoverRunnable);
- if (mLaunchCameraStart > 0) {
- long launchTime = SystemClock.uptimeMillis() - mLaunchCameraStart;
- if (DEBUG) Log.d(TAG, String.format("Camera took %sms to launch", launchTime));
- mLaunchCameraStart = 0;
- onCameraLaunched();
- }
+ mTransitioning = false;
+ mHandler.removeCallbacks(mRecoverRunnable);
+ if (mLaunchCameraStart > 0) {
+ long launchTime = SystemClock.uptimeMillis() - mLaunchCameraStart;
+ if (DEBUG) Log.d(TAG, String.format("Camera took %sms to launch", launchTime));
+ mLaunchCameraStart = 0;
+ onCameraLaunched();
+ }
}
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
index de19bd5..11ed5bc 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
@@ -26,7 +26,6 @@
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
-import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -82,6 +81,7 @@
private int mAppWidgetToShow;
private boolean mCheckAppWidgetConsistencyOnBootCompleted = false;
+ private boolean mCleanupAppWidgetsOnBootCompleted = false;
protected OnDismissAction mDismissAction;
@@ -128,6 +128,8 @@
mLockPatternUtils = new LockPatternUtils(context);
mAppWidgetHost = new AppWidgetHost(
context, APPWIDGET_HOST_ID, mOnClickHandler, Looper.myLooper());
+ cleanupAppWidgetIds();
+
mAppWidgetManager = AppWidgetManager.getInstance(mContext);
mSecurityModel = new KeyguardSecurityModel(context);
@@ -153,6 +155,39 @@
}
}
+ private void cleanupAppWidgetIds() {
+ // Since this method may delete a widget (which we can't do until boot completed) we
+ // may have to defer it until after boot complete.
+ if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) {
+ mCleanupAppWidgetsOnBootCompleted = true;
+ return;
+ }
+ // Clean up appWidgetIds that are bound to lockscreen, but not actually used
+ // This is only to clean up after another bug: we used to not call
+ // deleteAppWidgetId when a user manually deleted a widget in keyguard. This code
+ // shouldn't have to run more than once per user. AppWidgetProviders rely on callbacks
+ // that are triggered by deleteAppWidgetId, which is why we're doing this
+ int[] appWidgetIdsInKeyguardSettings = mLockPatternUtils.getAppWidgets();
+ int[] appWidgetIdsBoundToHost = mAppWidgetHost.getAppWidgetIds();
+ for (int i = 0; i < appWidgetIdsBoundToHost.length; i++) {
+ int appWidgetId = appWidgetIdsBoundToHost[i];
+ if (!contains(appWidgetIdsInKeyguardSettings, appWidgetId)) {
+ Log.d(TAG, "Found a appWidgetId that's not being used by keyguard, deleting id "
+ + appWidgetId);
+ mAppWidgetHost.deleteAppWidgetId(appWidgetId);
+ }
+ }
+ }
+
+ private static boolean contains(int[] array, int target) {
+ for (int value : array) {
+ if (value == target) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private KeyguardUpdateMonitorCallback mUpdateMonitorCallbacks =
new KeyguardUpdateMonitorCallback() {
@Override
@@ -162,6 +197,10 @@
mSwitchPageRunnable.run();
mCheckAppWidgetConsistencyOnBootCompleted = false;
}
+ if (mCleanupAppWidgetsOnBootCompleted) {
+ cleanupAppWidgetIds();
+ mCleanupAppWidgetsOnBootCompleted = false;
+ }
}
};
@@ -232,7 +271,7 @@
addWidgetsFromSettings();
if (numWidgets() >= MAX_WIDGETS) {
- setAddWidgetEnabled(false);
+ mAppWidgetContainer.setAddWidgetEnabled(false);
}
checkAppWidgetConsistency();
mSwitchPageRunnable.run();
@@ -326,14 +365,25 @@
@Override
public void onAddView(View v) {
if (numWidgets() >= MAX_WIDGETS) {
- setAddWidgetEnabled(false);
+ mAppWidgetContainer.setAddWidgetEnabled(false);
}
- };
+ }
@Override
- public void onRemoveView(View v) {
+ public void onRemoveView(View v, boolean deletePermanently) {
+ if (deletePermanently) {
+ final int appWidgetId = ((KeyguardWidgetFrame) v).getContentAppWidgetId();
+ if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID &&
+ appWidgetId != LockPatternUtils.ID_DEFAULT_STATUS_WIDGET) {
+ mAppWidgetHost.deleteAppWidgetId(appWidgetId);
+ }
+ }
+ }
+
+ @Override
+ public void onRemoveViewAnimationCompleted() {
if (numWidgets() < MAX_WIDGETS) {
- setAddWidgetEnabled(true);
+ mAppWidgetContainer.setAddWidgetEnabled(true);
}
}
};
@@ -1009,15 +1059,6 @@
return widgetCount;
}
-
- private void setAddWidgetEnabled(boolean clickable) {
- View addWidget = mAppWidgetContainer.findViewById(R.id.keyguard_add_widget);
- if (addWidget != null) {
- View addWidgetButton = addWidget.findViewById(R.id.keyguard_add_widget_view);
- addWidgetButton.setEnabled(clickable);
- }
- }
-
private void addDefaultWidgets() {
LayoutInflater inflater = LayoutInflater.from(mContext);
inflater.inflate(R.layout.keyguard_transport_control_view, this, true);
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
index 4e8aba7..9bc0111 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
@@ -243,12 +243,6 @@
}
if (options != null) {
- if (options.getBoolean(LockPatternUtils.KEYGUARD_SHOW_USER_SWITCHER)) {
- mKeyguardView.goToUserSwitcher();
- }
- if (options.getBoolean(LockPatternUtils.KEYGUARD_SHOW_SECURITY_CHALLENGE)) {
- mKeyguardView.showNextSecurityScreenIfPresent();
- }
int widgetToShow = options.getInt(LockPatternUtils.KEYGUARD_SHOW_APPWIDGET,
AppWidgetManager.INVALID_APPWIDGET_ID);
if (widgetToShow != AppWidgetManager.INVALID_APPWIDGET_ID) {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
index c227619..7d757ff 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
@@ -315,10 +315,7 @@
// We need to force a reset of the views, since lockNow (called by
// ActivityManagerService) will not reconstruct the keyguard if it is already showing.
synchronized (KeyguardViewMediator.this) {
- Bundle options = new Bundle();
- options.putBoolean(LockPatternUtils.KEYGUARD_SHOW_USER_SWITCHER, true);
- options.putBoolean(LockPatternUtils.KEYGUARD_SHOW_SECURITY_CHALLENGE, true);
- resetStateLocked(options);
+ resetStateLocked(null);
adjustStatusBarLocked();
// Disable face unlock when the user switches.
KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(false);
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java
index debf765..257fd27 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java
@@ -16,7 +16,6 @@
package com.android.internal.policy.impl.keyguard;
import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
@@ -27,10 +26,10 @@
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
-import java.util.ArrayList;
-
import com.android.internal.R;
+import java.util.ArrayList;
+
public class KeyguardWidgetCarousel extends KeyguardWidgetPager {
private float mAdjacentPagesAngle;
@@ -56,17 +55,30 @@
return MAX_SCROLL_PROGRESS;
}
- public float getAlphaForPage(int screenCenter, int index) {
+ public float getAlphaForPage(int screenCenter, int index, boolean showSidePages) {
View child = getChildAt(index);
if (child == null) return 0f;
+ boolean inVisibleRange = index >= getNextPage() - 1 && index <= getNextPage() + 1;
float scrollProgress = getScrollProgress(screenCenter, child, index);
- if (!isOverScrollChild(index, scrollProgress)) {
+
+ if (isOverScrollChild(index, scrollProgress)) {
+ return 1.0f;
+ } else if ((showSidePages && inVisibleRange) || index == getNextPage()) {
scrollProgress = getBoundedScrollProgress(screenCenter, child, index);
float alpha = 1.0f - 1.0f * Math.abs(scrollProgress / MAX_SCROLL_PROGRESS);
return alpha;
} else {
- return 1.0f;
+ return 0f;
+ }
+ }
+
+ public float getOutlineAlphaForPage(int screenCenter, int index, boolean showSidePages) {
+ boolean inVisibleRange = index >= getNextPage() - 1 && index <= getNextPage() + 1;
+ if (inVisibleRange) {
+ return super.getOutlineAlphaForPage(screenCenter, index, showSidePages);
+ } else {
+ return 0f;
}
}
@@ -75,24 +87,32 @@
mChildrenOutlineFadeAnimation.cancel();
mChildrenOutlineFadeAnimation = null;
}
+ boolean showSidePages = mShowingInitialHints || isPageMoving();
if (!isReordering(false)) {
for (int i = 0; i < getChildCount(); i++) {
KeyguardWidgetFrame child = getWidgetPageAt(i);
if (child != null) {
- child.setBackgroundAlpha(getOutlineAlphaForPage(screenCenter, i));
- child.setContentAlpha(getAlphaForPage(screenCenter, i));
+ float outlineAlpha = getOutlineAlphaForPage(screenCenter, i, showSidePages);
+ float contentAlpha = getAlphaForPage(screenCenter, i,showSidePages);
+ child.setBackgroundAlpha(outlineAlpha);
+ child.setContentAlpha(contentAlpha);
}
}
}
}
public void showInitialPageHints() {
+ mShowingInitialHints = true;
int count = getChildCount();
for (int i = 0; i < count; i++) {
+ boolean inVisibleRange = i >= getNextPage() - 1 && i <= getNextPage() + 1;
KeyguardWidgetFrame child = getWidgetPageAt(i);
- if (i >= mCurrentPage - 1 && i <= mCurrentPage + 1) {
- child.fadeFrame(this, true, KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER,
- CHILDREN_OUTLINE_FADE_IN_DURATION);
+ if (inVisibleRange) {
+ child.setBackgroundAlpha(KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER);
+ child.setContentAlpha(1f);
+ } else {
+ child.setBackgroundAlpha(0f);
+ child.setContentAlpha(0f);
}
}
}
@@ -220,8 +240,8 @@
for (int i = 0; i < count; i++) {
KeyguardWidgetFrame child = getWidgetPageAt(i);
- float finalAlpha = getAlphaForPage(mScreenCenter, i);
- float finalOutlineAlpha = getOutlineAlphaForPage(mScreenCenter, i);
+ float finalAlpha = getAlphaForPage(mScreenCenter, i, true);
+ float finalOutlineAlpha = getOutlineAlphaForPage(mScreenCenter, i, true);
getTransformForPage(mScreenCenter, i, mTmpTransform);
boolean inVisibleRange = (i >= mCurrentPage - 1 && i <= mCurrentPage + 1);
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java
index 3c79206..babb9cb 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetFrame.java
@@ -424,7 +424,9 @@
mBgAlphaController = caller;
}
- if (mBgAlphaController != caller) return;
+ if (mBgAlphaController != caller && mBgAlphaController != null) {
+ return;
+ }
if (mFrameFade != null) {
mFrameFade.cancel();
@@ -512,6 +514,10 @@
return false;
}
+ public void onBouncerShowing(boolean showing) {
+ // hook for subclasses
+ }
+
public void setWorkerHandler(Handler workerHandler) {
mWorkerHandler = workerHandler;
}
@@ -519,4 +525,5 @@
public Handler getWorkerHandler() {
return mWorkerHandler;
}
+
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
index 25e2781..b4fe0c7 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
@@ -70,6 +70,12 @@
private Callbacks mCallbacks;
private int mWidgetToResetAfterFadeOut;
+ protected boolean mShowingInitialHints = false;
+
+ // A temporary handle to the Add-Widget view
+ private View mAddWidgetView;
+ private int mLastWidthMeasureSpec;
+ private int mLastHeightMeasureSpec;
// Bouncer
private int mBouncerZoomInOutDuration = 250;
@@ -237,18 +243,18 @@
public void userActivity();
public void onUserActivityTimeoutChanged();
public void onAddView(View v);
- public void onRemoveView(View v);
+ public void onRemoveView(View v, boolean deletePermanently);
+ public void onRemoveViewAnimationCompleted();
}
public void addWidget(View widget) {
addWidget(widget, -1);
}
-
- public void onRemoveView(View v) {
+ public void onRemoveView(View v, final boolean deletePermanently) {
final int appWidgetId = ((KeyguardWidgetFrame) v).getContentAppWidgetId();
if (mCallbacks != null) {
- mCallbacks.onRemoveView(v);
+ mCallbacks.onRemoveView(v, deletePermanently);
}
mBackgroundWorkerHandler.post(new Runnable() {
@Override
@@ -258,6 +264,13 @@
});
}
+ @Override
+ public void onRemoveViewAnimationCompleted() {
+ if (mCallbacks != null) {
+ mCallbacks.onRemoveViewAnimationCompleted();
+ }
+ }
+
public void onAddView(View v, final int index) {
final int appWidgetId = ((KeyguardWidgetFrame) v).getContentAppWidgetId();
final int[] pagesRange = new int[mTempVisiblePagesRange.length];
@@ -458,12 +471,21 @@
private void updatePageAlphaValues(int screenCenter) {
}
- public float getAlphaForPage(int screenCenter, int index) {
- return 1f;
+ public float getAlphaForPage(int screenCenter, int index, boolean showSidePages) {
+ if (showSidePages) {
+ return 1f;
+ } else {
+ return index == mCurrentPage ? 1.0f : 0f;
+ }
}
- public float getOutlineAlphaForPage(int screenCenter, int index) {
- return getAlphaForPage(screenCenter, index) * KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER;
+ public float getOutlineAlphaForPage(int screenCenter, int index, boolean showSidePages) {
+ if (showSidePages) {
+ return getAlphaForPage(screenCenter, index, showSidePages)
+ * KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER;
+ } else {
+ return 0f;
+ }
}
protected boolean isOverScrollChild(int index, float scrollProgress) {
@@ -562,12 +584,12 @@
}
public void showInitialPageHints() {
+ mShowingInitialHints = true;
int count = getChildCount();
for (int i = 0; i < count; i++) {
KeyguardWidgetFrame child = getWidgetPageAt(i);
if (i != mCurrentPage) {
- child.fadeFrame(this, true, KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER,
- CHILDREN_OUTLINE_FADE_IN_DURATION);
+ child.setBackgroundAlpha(KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER);
child.setContentAlpha(0f);
} else {
child.setBackgroundAlpha(0f);
@@ -576,10 +598,6 @@
}
}
- public void showSidePageHints() {
- animateOutlinesAndSidePages(true, -1);
- }
-
@Override
void setCurrentPage(int currentPage) {
super.setCurrentPage(currentPage);
@@ -592,12 +610,10 @@
mHasMeasure = false;
}
- @Override
- protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
- super.onLayout(changed, left, top, right, bottom);
- }
-
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ mLastWidthMeasureSpec = widthMeasureSpec;
+ mLastHeightMeasureSpec = heightMeasureSpec;
+
int maxChallengeTop = -1;
View parent = (View) getParent();
boolean challengeShowing = false;
@@ -658,7 +674,7 @@
for (int i = 0; i < count; i++) {
float finalContentAlpha;
if (show) {
- finalContentAlpha = getAlphaForPage(mScreenCenter, i);
+ finalContentAlpha = getAlphaForPage(mScreenCenter, i, true);
} else if (!show && i == curPage) {
finalContentAlpha = 1f;
} else {
@@ -670,7 +686,7 @@
ObjectAnimator a = ObjectAnimator.ofPropertyValuesHolder(child, alpha);
anims.add(a);
- float finalOutlineAlpha = show ? getOutlineAlphaForPage(mScreenCenter, i) : 0f;
+ float finalOutlineAlpha = show ? getOutlineAlphaForPage(mScreenCenter, i, true) : 0f;
child.fadeFrame(this, show, finalOutlineAlpha, duration);
}
@@ -696,6 +712,7 @@
frame.resetSize();
}
mWidgetToResetAfterFadeOut = -1;
+ mShowingInitialHints = false;
}
updateWidgetFramesImportantForAccessibility();
}
@@ -775,6 +792,9 @@
mZoomInOutAnim.setInterpolator(new DecelerateInterpolator(1.5f));
mZoomInOutAnim.start();
}
+ if (currentPage instanceof KeyguardWidgetFrame) {
+ ((KeyguardWidgetFrame)currentPage).onBouncerShowing(false);
+ }
}
// Zoom out after the bouncer is initiated
@@ -800,6 +820,27 @@
mZoomInOutAnim.setInterpolator(new DecelerateInterpolator(1.5f));
mZoomInOutAnim.start();
}
+ if (currentPage instanceof KeyguardWidgetFrame) {
+ ((KeyguardWidgetFrame)currentPage).onBouncerShowing(true);
+ }
+ }
+
+ void setAddWidgetEnabled(boolean enabled) {
+ if (mAddWidgetView != null && enabled) {
+ addView(mAddWidgetView, 0);
+ // We need to force measure the PagedView so that the calls to update the scroll
+ // position below work
+ measure(mLastWidthMeasureSpec, mLastHeightMeasureSpec);
+ // Bump up the current page to account for the addition of the new page
+ setCurrentPage(mCurrentPage + 1);
+ mAddWidgetView = null;
+ } else if (mAddWidgetView == null && !enabled) {
+ View addWidget = findViewById(com.android.internal.R.id.keyguard_add_widget);
+ if (addWidget != null) {
+ mAddWidgetView = addWidget;
+ removeView(addWidget);
+ }
+ }
}
boolean isAddPage(int pageIndex) {
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java b/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
index 3900ab4..33c24561 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
@@ -1457,7 +1457,7 @@
}
removeView(mDragView);
- onRemoveView(mDragView);
+ onRemoveView(mDragView, false);
addView(mDragView, pageUnderPointIndex);
onAddView(mDragView, pageUnderPointIndex);
mSidePageHoverIndex = -1;
@@ -1587,7 +1587,8 @@
}
//public abstract void onFlingToDelete(View v);
- public abstract void onRemoveView(View v);
+ public abstract void onRemoveView(View v, boolean deletePermanently);
+ public abstract void onRemoveViewAnimationCompleted();
public abstract void onAddView(View v, int index);
private void resetTouchState() {
@@ -2383,6 +2384,7 @@
public void run() {
mDeferringForDelete = false;
onEndReordering();
+ onRemoveViewAnimationCompleted();
}
};
zoomIn(onCompleteRunnable);
@@ -2391,7 +2393,7 @@
slideAnimations.start();
removeView(dragView);
- onRemoveView(dragView);
+ onRemoveView(dragView, true);
}
};
}
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java
index 440f8e1..cbd00f3 100644
--- a/services/java/com/android/server/AlarmManagerService.java
+++ b/services/java/com/android/server/AlarmManagerService.java
@@ -22,6 +22,7 @@
import android.app.IAlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -38,6 +39,7 @@
import android.os.WorkSource;
import android.text.TextUtils;
import android.text.format.Time;
+import android.util.Pair;
import android.util.Slog;
import android.util.TimeUtils;
@@ -45,16 +47,18 @@
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.Map;
import java.util.TimeZone;
+import com.android.internal.util.LocalLog;
+
class AlarmManagerService extends IAlarmManager.Stub {
// The threshold for how long an alarm can be late before we print a
// warning message. The time duration is in milliseconds.
@@ -79,7 +83,9 @@
= new Intent().addFlags(Intent.FLAG_FROM_BACKGROUND);
private final Context mContext;
-
+
+ private final LocalLog mLog = new LocalLog(TAG);
+
private Object mLock = new Object();
private final ArrayList<Alarm> mRtcWakeupAlarms = new ArrayList<Alarm>();
@@ -91,7 +97,7 @@
private int mDescriptor;
private int mBroadcastRefCount = 0;
private PowerManager.WakeLock mWakeLock;
- private LinkedList<PendingIntent> mInFlight = new LinkedList<PendingIntent>();
+ private ArrayList<InFlight> mInFlight = new ArrayList<InFlight>();
private final AlarmThread mWaitThread = new AlarmThread();
private final AlarmHandler mHandler = new AlarmHandler();
private ClockReceiver mClockReceiver;
@@ -99,18 +105,59 @@
private final ResultReceiver mResultReceiver = new ResultReceiver();
private final PendingIntent mTimeTickSender;
private final PendingIntent mDateChangeSender;
-
- private static final class FilterStats {
- int count;
+
+ private static final class InFlight extends Intent {
+ final PendingIntent mPendingIntent;
+ final Pair<String, ComponentName> mTarget;
+ final BroadcastStats mBroadcastStats;
+ final FilterStats mFilterStats;
+
+ InFlight(AlarmManagerService service, PendingIntent pendingIntent) {
+ mPendingIntent = pendingIntent;
+ Intent intent = pendingIntent.getIntent();
+ mTarget = intent != null
+ ? new Pair<String, ComponentName>(intent.getAction(), intent.getComponent())
+ : null;
+ mBroadcastStats = service.getStatsLocked(pendingIntent);
+ FilterStats fs = mBroadcastStats.filterStats.get(mTarget);
+ if (fs == null) {
+ fs = new FilterStats(mBroadcastStats, mTarget);
+ mBroadcastStats.filterStats.put(mTarget, fs);
+ }
+ mFilterStats = fs;
+ }
}
-
- private static final class BroadcastStats {
+
+ private static final class FilterStats {
+ final BroadcastStats mBroadcastStats;
+ final Pair<String, ComponentName> mTarget;
+
long aggregateTime;
+ int count;
int numWakeup;
long startTime;
int nesting;
- HashMap<Intent.FilterComparison, FilterStats> filterStats
- = new HashMap<Intent.FilterComparison, FilterStats>();
+
+ FilterStats(BroadcastStats broadcastStats, Pair<String, ComponentName> target) {
+ mBroadcastStats = broadcastStats;
+ mTarget = target;
+ }
+ }
+
+ private static final class BroadcastStats {
+ final String mPackageName;
+
+ long aggregateTime;
+ int count;
+ int numWakeup;
+ long startTime;
+ int nesting;
+ final HashMap<Pair<String, ComponentName>, FilterStats> filterStats
+ = new HashMap<Pair<String, ComponentName>, FilterStats>();
+
+ BroadcastStats(String packageName) {
+ mPackageName = packageName;
+ }
}
private final HashMap<String, BroadcastStats> mBroadcastStats
@@ -496,24 +543,104 @@
dumpAlarmList(pw, mElapsedRealtimeAlarms, " ", "ELAPSED", now);
}
}
-
- pw.println(" ");
+
+ pw.println();
pw.print(" Broadcast ref count: "); pw.println(mBroadcastRefCount);
-
- pw.println(" ");
- pw.println(" Alarm Stats:");
+ pw.println();
+
+ if (mLog.dump(pw, " Recent problems", " ")) {
+ pw.println();
+ }
+
+ final FilterStats[] topFilters = new FilterStats[10];
+ final Comparator<FilterStats> comparator = new Comparator<FilterStats>() {
+ @Override
+ public int compare(FilterStats lhs, FilterStats rhs) {
+ if (lhs.aggregateTime < rhs.aggregateTime) {
+ return 1;
+ } else if (lhs.aggregateTime > rhs.aggregateTime) {
+ return -1;
+ }
+ return 0;
+ }
+ };
+ int len = 0;
for (Map.Entry<String, BroadcastStats> be : mBroadcastStats.entrySet()) {
BroadcastStats bs = be.getValue();
- pw.print(" "); pw.println(be.getKey());
- pw.print(" "); pw.print(bs.aggregateTime);
- pw.print("ms running, "); pw.print(bs.numWakeup);
- pw.println(" wakeups");
- for (Map.Entry<Intent.FilterComparison, FilterStats> fe
+ for (Map.Entry<Pair<String, ComponentName>, FilterStats> fe
: bs.filterStats.entrySet()) {
- pw.print(" "); pw.print(fe.getValue().count);
- pw.print(" alarms: ");
- pw.println(fe.getKey().getIntent().toShortString(
- false, true, false, true));
+ FilterStats fs = fe.getValue();
+ int pos = len > 0
+ ? Arrays.binarySearch(topFilters, 0, len, fs, comparator) : 0;
+ if (pos < 0) {
+ pos = -pos - 1;
+ }
+ if (pos < topFilters.length) {
+ int copylen = topFilters.length - pos - 1;
+ if (copylen > 0) {
+ System.arraycopy(topFilters, pos, topFilters, pos+1, copylen);
+ }
+ topFilters[pos] = fs;
+ if (len < topFilters.length) {
+ len++;
+ }
+ }
+ }
+ }
+ if (len > 0) {
+ pw.println(" Top Alarms:");
+ for (int i=0; i<len; i++) {
+ FilterStats fs = topFilters[i];
+ pw.print(" ");
+ if (fs.nesting > 0) pw.print("*ACTIVE* ");
+ TimeUtils.formatDuration(fs.aggregateTime, pw);
+ pw.print(" running, "); pw.print(fs.numWakeup);
+ pw.print(" wakeups, "); pw.print(fs.count);
+ pw.print(" alarms: "); pw.print(fs.mBroadcastStats.mPackageName);
+ pw.println();
+ pw.print(" ");
+ if (fs.mTarget.first != null) {
+ pw.print(" act="); pw.print(fs.mTarget.first);
+ }
+ if (fs.mTarget.second != null) {
+ pw.print(" cmp="); pw.print(fs.mTarget.second.toShortString());
+ }
+ pw.println();
+ }
+ }
+
+ pw.println(" ");
+ pw.println(" Alarm Stats:");
+ final ArrayList<FilterStats> tmpFilters = new ArrayList<FilterStats>();
+ for (Map.Entry<String, BroadcastStats> be : mBroadcastStats.entrySet()) {
+ BroadcastStats bs = be.getValue();
+ pw.print(" ");
+ if (bs.nesting > 0) pw.print("*ACTIVE* ");
+ pw.print(be.getKey());
+ pw.print(" "); TimeUtils.formatDuration(bs.aggregateTime, pw);
+ pw.print(" running, "); pw.print(bs.numWakeup);
+ pw.println(" wakeups:");
+ tmpFilters.clear();
+ for (Map.Entry<Pair<String, ComponentName>, FilterStats> fe
+ : bs.filterStats.entrySet()) {
+ tmpFilters.add(fe.getValue());
+ }
+ Collections.sort(tmpFilters, comparator);
+ for (int i=0; i<tmpFilters.size(); i++) {
+ FilterStats fs = tmpFilters.get(i);
+ pw.print(" ");
+ if (fs.nesting > 0) pw.print("*ACTIVE* ");
+ TimeUtils.formatDuration(fs.aggregateTime, pw);
+ pw.print(" "); pw.print(fs.numWakeup);
+ pw.print(" wakes " ); pw.print(fs.count);
+ pw.print(" alarms:");
+ if (fs.mTarget.first != null) {
+ pw.print(" act="); pw.print(fs.mTarget.first);
+ }
+ if (fs.mTarget.second != null) {
+ pw.print(" cmp="); pw.print(fs.mTarget.second.toShortString());
+ }
+ pw.println();
}
}
}
@@ -708,18 +835,31 @@
setWakelockWorkSource(alarm.operation);
mWakeLock.acquire();
}
- mInFlight.add(alarm.operation);
+ final InFlight inflight = new InFlight(AlarmManagerService.this,
+ alarm.operation);
+ mInFlight.add(inflight);
mBroadcastRefCount++;
-
- BroadcastStats bs = getStatsLocked(alarm.operation);
+
+ final BroadcastStats bs = inflight.mBroadcastStats;
+ bs.count++;
if (bs.nesting == 0) {
+ bs.nesting = 1;
bs.startTime = nowELAPSED;
} else {
bs.nesting++;
}
+ final FilterStats fs = inflight.mFilterStats;
+ fs.count++;
+ if (fs.nesting == 0) {
+ fs.nesting = 1;
+ fs.startTime = nowELAPSED;
+ } else {
+ fs.nesting++;
+ }
if (alarm.type == AlarmManager.ELAPSED_REALTIME_WAKEUP
|| alarm.type == AlarmManager.RTC_WAKEUP) {
bs.numWakeup++;
+ fs.numWakeup++;
ActivityManagerNative.noteWakeupAlarm(
alarm.operation);
}
@@ -908,44 +1048,58 @@
String pkg = pi.getTargetPackage();
BroadcastStats bs = mBroadcastStats.get(pkg);
if (bs == null) {
- bs = new BroadcastStats();
+ bs = new BroadcastStats(pkg);
mBroadcastStats.put(pkg, bs);
}
return bs;
}
-
+
class ResultReceiver implements PendingIntent.OnFinished {
public void onSendFinished(PendingIntent pi, Intent intent, int resultCode,
String resultData, Bundle resultExtras) {
synchronized (mLock) {
- BroadcastStats bs = getStatsLocked(pi);
- if (bs != null) {
+ InFlight inflight = null;
+ for (int i=0; i<mInFlight.size(); i++) {
+ if (mInFlight.get(i).mPendingIntent == pi) {
+ inflight = mInFlight.remove(i);
+ break;
+ }
+ }
+ if (inflight != null) {
+ final long nowELAPSED = SystemClock.elapsedRealtime();
+ BroadcastStats bs = inflight.mBroadcastStats;
bs.nesting--;
if (bs.nesting <= 0) {
bs.nesting = 0;
- bs.aggregateTime += SystemClock.elapsedRealtime()
- - bs.startTime;
- Intent.FilterComparison fc = new Intent.FilterComparison(intent);
- FilterStats fs = bs.filterStats.get(fc);
- if (fs == null) {
- fs = new FilterStats();
- bs.filterStats.put(fc, fs);
- }
- fs.count++;
+ bs.aggregateTime += nowELAPSED - bs.startTime;
}
+ FilterStats fs = inflight.mFilterStats;
+ fs.nesting--;
+ if (fs.nesting <= 0) {
+ fs.nesting = 0;
+ fs.aggregateTime += nowELAPSED - fs.startTime;
+ }
+ } else {
+ mLog.w("No in-flight alarm for " + pi + " " + intent);
}
- mInFlight.removeFirst();
mBroadcastRefCount--;
if (mBroadcastRefCount == 0) {
mWakeLock.release();
+ if (mInFlight.size() > 0) {
+ mLog.w("Finished all broadcasts with " + mInFlight.size()
+ + " remaining inflights");
+ for (int i=0; i<mInFlight.size(); i++) {
+ mLog.w(" Remaining #" + i + ": " + mInFlight.get(i));
+ }
+ mInFlight.clear();
+ }
} else {
// the next of our alarms is now in flight. reattribute the wakelock.
- final PendingIntent nowInFlight = mInFlight.peekFirst();
- if (nowInFlight != null) {
- setWakelockWorkSource(nowInFlight);
+ if (mInFlight.size() > 0) {
+ setWakelockWorkSource(mInFlight.get(0).mPendingIntent);
} else {
// should never happen
- Slog.e(TAG, "Alarm wakelock still held but sent queue empty");
+ mLog.w("Alarm wakelock still held but sent queue empty");
mWakeLock.setWorkSource(null);
}
}
diff --git a/services/java/com/android/server/AppWidgetService.java b/services/java/com/android/server/AppWidgetService.java
index 06d37dc..9590712 100644
--- a/services/java/com/android/server/AppWidgetService.java
+++ b/services/java/com/android/server/AppWidgetService.java
@@ -26,6 +26,8 @@
import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.Bundle;
+import android.os.Handler;
+import android.os.HandlerThread;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -54,13 +56,19 @@
Locale mLocale;
PackageManager mPackageManager;
boolean mSafeMode;
+ private final Handler mSaveStateHandler;
private final SparseArray<AppWidgetServiceImpl> mAppWidgetServices;
AppWidgetService(Context context) {
mContext = context;
+
+ HandlerThread handlerThread = new HandlerThread("AppWidgetService -- Save state");
+ handlerThread.start();
+ mSaveStateHandler = new Handler(handlerThread.getLooper());
+
mAppWidgetServices = new SparseArray<AppWidgetServiceImpl>(5);
- AppWidgetServiceImpl primary = new AppWidgetServiceImpl(context, 0);
+ AppWidgetServiceImpl primary = new AppWidgetServiceImpl(context, 0, mSaveStateHandler);
mAppWidgetServices.append(0, primary);
}
@@ -138,6 +146,11 @@
return getImplForUser(getCallingOrCurrentUserId()).allocateAppWidgetId(
packageName, hostId);
}
+
+ @Override
+ public int[] getAppWidgetIdsForHost(int hostId) throws RemoteException {
+ return getImplForUser(getCallingOrCurrentUserId()).getAppWidgetIdsForHost(hostId);
+ }
@Override
public void deleteAppWidgetId(int appWidgetId) throws RemoteException {
@@ -229,7 +242,7 @@
if (service == null) {
Slog.i(TAG, "Unable to find AppWidgetServiceImpl for user " + userId + ", adding");
// TODO: Verify that it's a valid user
- service = new AppWidgetServiceImpl(mContext, userId);
+ service = new AppWidgetServiceImpl(mContext, userId, mSaveStateHandler);
service.systemReady(mSafeMode);
// Assume that BOOT_COMPLETED was received, as this is a non-primary user.
mAppWidgetServices.append(userId, service);
diff --git a/services/java/com/android/server/AppWidgetServiceImpl.java b/services/java/com/android/server/AppWidgetServiceImpl.java
index daa82f2..bba5192 100644
--- a/services/java/com/android/server/AppWidgetServiceImpl.java
+++ b/services/java/com/android/server/AppWidgetServiceImpl.java
@@ -41,7 +41,10 @@
import android.os.Binder;
import android.os.Bundle;
import android.os.Environment;
+import android.os.Handler;
+import android.os.HandlerThread;
import android.os.IBinder;
+import android.os.Looper;
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
@@ -180,15 +183,18 @@
boolean mStateLoaded;
int mMaxWidgetBitmapMemory;
+ private final Handler mSaveStateHandler;
+
// These are for debugging only -- widgets are going missing in some rare instances
ArrayList<Provider> mDeletedProviders = new ArrayList<Provider>();
ArrayList<Host> mDeletedHosts = new ArrayList<Host>();
- AppWidgetServiceImpl(Context context, int userId) {
+ AppWidgetServiceImpl(Context context, int userId, Handler saveStateHandler) {
mContext = context;
mPm = AppGlobals.getPackageManager();
mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
mUserId = userId;
+ mSaveStateHandler = saveStateHandler;
computeMaximumWidgetBitmapMemory();
}
@@ -236,7 +242,7 @@
updateProvidersForPackageLocked(cn.getPackageName(), removedProviders);
}
}
- saveStateLocked();
+ saveStateAsync();
}
}
}
@@ -286,7 +292,7 @@
providersModified |= addProvidersForPackageLocked(pkgName);
}
}
- saveStateLocked();
+ saveStateAsync();
}
} else {
Bundle extras = intent.getExtras();
@@ -297,7 +303,7 @@
ensureStateLoadedLocked();
for (String pkgName : pkgList) {
providersModified |= removeProvidersForPackageLocked(pkgName);
- saveStateLocked();
+ saveStateAsync();
}
}
}
@@ -330,6 +336,7 @@
pw.print(info.autoAdvanceViewId);
pw.print(" initialLayout=#");
pw.print(Integer.toHexString(info.initialLayout));
+ pw.print(" uid="); pw.print(p.uid);
pw.print(" zombie="); pw.println(p.zombie);
}
@@ -410,7 +417,7 @@
private void ensureStateLoadedLocked() {
if (!mStateLoaded) {
- loadAppWidgetList();
+ loadAppWidgetListLocked();
loadStateLocked();
mStateLoaded = true;
}
@@ -431,7 +438,7 @@
host.instances.add(id);
mAppWidgetIds.add(id);
- saveStateLocked();
+ saveStateAsync();
if (DBG) log("Allocating AppWidgetId for " + packageName + " host=" + hostId
+ " id=" + appWidgetId);
return appWidgetId;
@@ -444,7 +451,7 @@
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
if (id != null) {
deleteAppWidgetLocked(id);
- saveStateLocked();
+ saveStateAsync();
}
}
}
@@ -456,7 +463,7 @@
Host host = lookupHostLocked(callingUid, hostId);
if (host != null) {
deleteHostLocked(host);
- saveStateLocked();
+ saveStateAsync();
}
}
}
@@ -475,7 +482,7 @@
}
}
if (changed) {
- saveStateLocked();
+ saveStateAsync();
}
}
}
@@ -591,7 +598,7 @@
// schedule the future updates
registerForBroadcastsLocked(p, getAppWidgetIds(p));
- saveStateLocked();
+ saveStateAsync();
}
} finally {
Binder.restoreCallingIdentity(ident);
@@ -655,8 +662,8 @@
} else {
mPackagesWithBindWidgetPermission.remove(packageName);
}
+ saveStateAsync();
}
- saveStateLocked();
}
// Binds to a specific RemoteViewsService
@@ -693,6 +700,10 @@
}
int userId = UserHandle.getUserId(id.provider.uid);
+ if (userId != mUserId) {
+ Slog.w(TAG, "AppWidgetServiceImpl of user " + mUserId
+ + " binding to provider on user " + userId);
+ }
// Bind to the RemoteViewsService (which will trigger a callback to the
// RemoteViewsAdapter.onServiceConnected())
final long token = Binder.clearCallingIdentity();
@@ -849,13 +860,17 @@
}
public List<AppWidgetProviderInfo> getInstalledProviders() {
+ return getInstalledProviders(AppWidgetProviderInfo.WIDGET_CATEGORY_HOME_SCREEN);
+ }
+
+ private List<AppWidgetProviderInfo> getInstalledProviders(int categoryFilter) {
synchronized (mAppWidgetIds) {
ensureStateLoadedLocked();
final int N = mInstalledProviders.size();
ArrayList<AppWidgetProviderInfo> result = new ArrayList<AppWidgetProviderInfo>(N);
for (int i = 0; i < N; i++) {
Provider p = mInstalledProviders.get(i);
- if (!p.zombie) {
+ if (!p.zombie && (p.info.widgetCategory & categoryFilter) != 0) {
result.add(cloneIfLocalBinder(p.info));
}
}
@@ -893,6 +908,20 @@
}
}
+ private void saveStateAsync() {
+ mSaveStateHandler.post(mSaveStateRunnable);
+ }
+
+ private final Runnable mSaveStateRunnable = new Runnable() {
+ @Override
+ public void run() {
+ synchronized (mAppWidgetIds) {
+ ensureStateLoadedLocked();
+ saveStateLocked();
+ }
+ }
+ };
+
public void updateAppWidgetOptions(int appWidgetId, Bundle options) {
synchronized (mAppWidgetIds) {
options = cloneIfLocalBinder(options);
@@ -913,7 +942,7 @@
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, id.appWidgetId);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS, id.options);
mContext.sendBroadcastAsUser(intent, new UserHandle(mUserId));
- saveStateLocked();
+ saveStateAsync();
}
}
@@ -942,6 +971,13 @@
ensureStateLoadedLocked();
for (int i = 0; i < N; i++) {
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetIds[i]);
+ if (id == null) {
+ String message = "AppWidgetId NPE: mUserId=" + mUserId
+ + ", callingUid=" + Binder.getCallingUid()
+ + ", appWidgetIds[i]=" + appWidgetIds[i]
+ + "\n mAppWidgets:\n" + getUserWidgets();
+ throw new NullPointerException(message);
+ }
if (id.views != null) {
// Only trigger a partial update for a widget if it has received a full update
updateAppWidgetInstanceLocked(id, views, true);
@@ -950,6 +986,18 @@
}
}
+ private String getUserWidgets() {
+ StringBuffer sb = new StringBuffer();
+ for (AppWidgetId widget: mAppWidgetIds) {
+ sb.append(" id="); sb.append(widget.appWidgetId);
+ sb.append(", hostUid="); sb.append(widget.host.uid);
+ sb.append(", provider="); sb.append(widget.provider.info.provider.toString());
+ sb.append("\n");
+ }
+ sb.append("\n");
+ return sb.toString();
+ }
+
public void notifyAppWidgetViewDataChanged(int[] appWidgetIds, int viewId) {
if (appWidgetIds == null) {
return;
@@ -1214,7 +1262,7 @@
}
}
- void loadAppWidgetList() {
+ void loadAppWidgetListLocked() {
Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
try {
List<ResolveInfo> broadcastReceivers = mPm.queryIntentReceivers(intent,
@@ -1334,6 +1382,28 @@
}
}
+ static int[] getAppWidgetIds(Host h) {
+ int instancesSize = h.instances.size();
+ int appWidgetIds[] = new int[instancesSize];
+ for (int i = 0; i < instancesSize; i++) {
+ appWidgetIds[i] = h.instances.get(i).appWidgetId;
+ }
+ return appWidgetIds;
+ }
+
+ public int[] getAppWidgetIdsForHost(int hostId) {
+ synchronized (mAppWidgetIds) {
+ ensureStateLoadedLocked();
+ int callingUid = Binder.getCallingUid();
+ Host host = lookupHostLocked(callingUid, hostId);
+ if (host != null) {
+ return getAppWidgetIds(host);
+ } else {
+ return new int[0];
+ }
+ }
+ }
+
private Provider parseProviderInfoXml(ComponentName component, ResolveInfo ri) {
Provider p = null;
diff --git a/services/java/com/android/server/DevicePolicyManagerService.java b/services/java/com/android/server/DevicePolicyManagerService.java
index a5e26a8..5ba71a4 100644
--- a/services/java/com/android/server/DevicePolicyManagerService.java
+++ b/services/java/com/android/server/DevicePolicyManagerService.java
@@ -1875,28 +1875,32 @@
DeviceAdminInfo.USES_POLICY_WIPE_DATA);
long ident = Binder.clearCallingIdentity();
try {
- if (userHandle == UserHandle.USER_OWNER) {
- wipeDataLocked(flags);
- } else {
- lockNowUnchecked();
- mHandler.post(new Runnable() {
- public void run() {
- try {
- ActivityManagerNative.getDefault().switchUser(0);
- ((UserManager) mContext.getSystemService(Context.USER_SERVICE))
- .removeUser(userHandle);
- } catch (RemoteException re) {
- // Shouldn't happen
- }
- }
- });
- }
+ wipeDeviceOrUserLocked(flags, userHandle);
} finally {
Binder.restoreCallingIdentity(ident);
}
}
}
+ private void wipeDeviceOrUserLocked(int flags, final int userHandle) {
+ if (userHandle == UserHandle.USER_OWNER) {
+ wipeDataLocked(flags);
+ } else {
+ lockNowUnchecked();
+ mHandler.post(new Runnable() {
+ public void run() {
+ try {
+ ActivityManagerNative.getDefault().switchUser(0);
+ ((UserManager) mContext.getSystemService(Context.USER_SERVICE))
+ .removeUser(userHandle);
+ } catch (RemoteException re) {
+ // Shouldn't happen
+ }
+ }
+ });
+ }
+ }
+
public void getRemoveWarning(ComponentName comp, final RemoteCallback result, int userHandle) {
enforceCrossUserPermission(userHandle);
mContext.enforceCallingOrSelfPermission(
@@ -1996,7 +2000,7 @@
saveSettingsLocked(userHandle);
int max = getMaximumFailedPasswordsForWipe(null, userHandle);
if (max > 0 && policy.mFailedPasswordAttempts >= max) {
- wipeDataLocked(0);
+ wipeDeviceOrUserLocked(0, userHandle);
}
sendAdminCommandLocked(DeviceAdminReceiver.ACTION_PASSWORD_FAILED,
DeviceAdminInfo.USES_POLICY_WATCH_LOGIN, userHandle);
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index c9ff595..8eb532d 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -386,6 +386,7 @@
private Locale mLastSystemLocale;
private final MyPackageMonitor mMyPackageMonitor = new MyPackageMonitor();
private final IPackageManager mIPackageManager;
+ private boolean mInputBoundToKeyguard;
class SettingsObserver extends ContentObserver {
SettingsObserver(Handler handler) {
@@ -877,10 +878,12 @@
final boolean hardKeyShown = haveHardKeyboard
&& conf.hardKeyboardHidden
!= Configuration.HARDKEYBOARDHIDDEN_YES;
- final boolean isScreenLocked = mKeyguardManager != null
- && mKeyguardManager.isKeyguardLocked()
- && mKeyguardManager.isKeyguardSecure();
- mImeWindowVis = (!isScreenLocked && (mInputShown || hardKeyShown)) ?
+ final boolean isScreenLocked =
+ mKeyguardManager != null && mKeyguardManager.isKeyguardLocked();
+ final boolean isScreenSecurelyLocked =
+ isScreenLocked && mKeyguardManager.isKeyguardSecure();
+ final boolean inputShown = mInputShown && (!isScreenLocked || mInputBoundToKeyguard);
+ mImeWindowVis = (!isScreenSecurelyLocked && (inputShown || hardKeyShown)) ?
(InputMethodService.IME_ACTIVE | InputMethodService.IME_VISIBLE) : 0;
updateImeWindowStatusLocked();
}
@@ -1124,6 +1127,13 @@
return mNoBinding;
}
+ if (mCurClient == null) {
+ mInputBoundToKeyguard = mKeyguardManager != null && mKeyguardManager.isKeyguardLocked();
+ if (DEBUG) {
+ Slog.v(TAG, "New bind. keyguard = " + mInputBoundToKeyguard);
+ }
+ }
+
if (mCurClient != cs) {
// If the client is changing, we need to switch over to the new
// one.
@@ -1814,9 +1824,9 @@
public InputBindResult windowGainedFocus(IInputMethodClient client, IBinder windowToken,
int controlFlags, int softInputMode, int windowFlags,
EditorInfo attribute, IInputContext inputContext) {
- if (!calledFromValidUser()) {
- return null;
- }
+ // Needs to check the validity before clearing calling identity
+ final boolean calledFromValidUser = calledFromValidUser();
+
InputBindResult res = null;
long ident = Binder.clearCallingIdentity();
try {
@@ -1846,6 +1856,14 @@
} catch (RemoteException e) {
}
+ if (!calledFromValidUser) {
+ Slog.w(TAG, "A background user is requesting window. Hiding IME.");
+ Slog.w(TAG, "If you want to interect with IME, you need "
+ + "android.permission.INTERACT_ACROSS_USERS_FULL");
+ hideCurrentInputLocked(0, null);
+ return null;
+ }
+
if (mCurFocusedWindow == windowToken) {
Slog.w(TAG, "Window already focused, ignoring focus gain of: " + client
+ " attribute=" + attribute + ", token = " + windowToken);
@@ -2486,10 +2504,8 @@
map.put(id, p);
// Valid system default IMEs and IMEs that have English subtypes are enabled
- // by default, unless there's a hard keyboard and the system IME was explicitly
- // disabled
- if ((isValidSystemDefaultIme(p, mContext) || isSystemImeThatHasEnglishSubtype(p))
- && (!haveHardKeyboard || disabledSysImes.indexOf(id) < 0)) {
+ // by default
+ if ((isValidSystemDefaultIme(p, mContext) || isSystemImeThatHasEnglishSubtype(p))) {
setInputMethodEnabledLocked(id, true);
}
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index 89fa6d0..7a55497c 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -506,7 +506,7 @@
}
} else {
Intent statusChanged = new Intent();
- statusChanged.putExtras(extras);
+ statusChanged.putExtras(new Bundle(extras));
statusChanged.putExtra(LocationManager.KEY_STATUS_CHANGED, status);
try {
synchronized (this) {
@@ -541,7 +541,7 @@
}
} else {
Intent locationChanged = new Intent();
- locationChanged.putExtra(LocationManager.KEY_LOCATION_CHANGED, location);
+ locationChanged.putExtra(LocationManager.KEY_LOCATION_CHANGED, new Location(location));
try {
synchronized (this) {
// synchronize to ensure incrementPendingBroadcastsLocked()
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java
index c512bc1..ad28a36 100644
--- a/services/java/com/android/server/MountService.java
+++ b/services/java/com/android/server/MountService.java
@@ -57,6 +57,8 @@
import android.util.Slog;
import android.util.Xml;
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.app.IMediaContainerService;
import com.android.internal.util.Preconditions;
import com.android.internal.util.XmlUtils;
@@ -181,13 +183,13 @@
/** When defined, base template for user-specific {@link StorageVolume}. */
private StorageVolume mEmulatedTemplate;
- // @GuardedBy("mVolumesLock")
+ @GuardedBy("mVolumesLock")
private final ArrayList<StorageVolume> mVolumes = Lists.newArrayList();
/** Map from path to {@link StorageVolume} */
- // @GuardedBy("mVolumesLock")
+ @GuardedBy("mVolumesLock")
private final HashMap<String, StorageVolume> mVolumesByPath = Maps.newHashMap();
/** Map from path to state */
- // @GuardedBy("mVolumesLock")
+ @GuardedBy("mVolumesLock")
private final HashMap<String, String> mVolumeStates = Maps.newHashMap();
private volatile boolean mSystemReady = false;
@@ -198,8 +200,8 @@
// Used as a lock for methods that register/unregister listeners.
final private ArrayList<MountServiceBinderListener> mListeners =
new ArrayList<MountServiceBinderListener>();
- private CountDownLatch mConnectedSignal = new CountDownLatch(1);
- private CountDownLatch mAsecsScanned = new CountDownLatch(1);
+ private final CountDownLatch mConnectedSignal = new CountDownLatch(1);
+ private final CountDownLatch mAsecsScanned = new CountDownLatch(1);
private boolean mSendUmsConnectedOnBoot = false;
/**
@@ -495,10 +497,6 @@
}
private void waitForLatch(CountDownLatch latch) {
- if (latch == null) {
- return;
- }
-
for (;;) {
try {
if (latch.await(5000, TimeUnit.MILLISECONDS)) {
@@ -738,14 +736,12 @@
* the hounds!
*/
mConnectedSignal.countDown();
- mConnectedSignal = null;
// Let package manager load internal ASECs.
mPms.scanAvailableAsecs();
// Notify people waiting for ASECs to be scanned that it's done.
mAsecsScanned.countDown();
- mAsecsScanned = null;
}
}.start();
}
@@ -2571,7 +2567,7 @@
}
}
- // @VisibleForTesting
+ @VisibleForTesting
public static String buildObbPath(final String canonicalPath, int userId, boolean forVold) {
// TODO: allow caller to provide Environment for full testing
diff --git a/services/java/com/android/server/NativeDaemonConnector.java b/services/java/com/android/server/NativeDaemonConnector.java
index 92af9a9..5e94a9f 100644
--- a/services/java/com/android/server/NativeDaemonConnector.java
+++ b/services/java/com/android/server/NativeDaemonConnector.java
@@ -25,6 +25,7 @@
import android.util.LocalLog;
import android.util.Slog;
+import com.android.internal.annotations.VisibleForTesting;
import com.google.android.collect.Lists;
import java.nio.charset.Charsets;
@@ -400,7 +401,7 @@
* Append the given argument to {@link StringBuilder}, escaping as needed,
* and surrounding with quotes when it contains spaces.
*/
- // @VisibleForTesting
+ @VisibleForTesting
static void appendEscaped(StringBuilder builder, String arg) {
final boolean hasSpaces = arg.indexOf(' ') >= 0;
if (hasSpaces) {
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index fa84f486..e2be577 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -1128,13 +1128,13 @@
final boolean hasCustomVibrate = notification.vibrate != null;
// new in 4.2: if there was supposed to be a sound and we're in vibrate mode,
- // and no other vibration is specified, we apply the default vibration anyway
+ // and no other vibration is specified, we fall back to vibration
final boolean convertSoundToVibration =
!hasCustomVibrate
&& hasValidSound
&& (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE);
- // The DEFAULT_VIBRATE flag trumps any custom vibration.
+ // The DEFAULT_VIBRATE flag trumps any custom vibration AND the fallback.
final boolean useDefaultVibrate =
(notification.defaults & Notification.DEFAULT_VIBRATE) != 0;
@@ -1147,8 +1147,8 @@
// does not have the VIBRATE permission.
long identity = Binder.clearCallingIdentity();
try {
- mVibrator.vibrate(convertSoundToVibration ? mFallbackVibrationPattern
- : mDefaultVibrationPattern,
+ mVibrator.vibrate(useDefaultVibrate ? mDefaultVibrationPattern
+ : mFallbackVibrationPattern,
((notification.flags & Notification.FLAG_INSISTENT) != 0) ? 0: -1);
} finally {
Binder.restoreCallingIdentity(identity);
diff --git a/services/java/com/android/server/am/ActiveServices.java b/services/java/com/android/server/am/ActiveServices.java
index 35999ea..5c24e67 100644
--- a/services/java/com/android/server/am/ActiveServices.java
+++ b/services/java/com/android/server/am/ActiveServices.java
@@ -1090,11 +1090,8 @@
boolean created = false;
try {
- mAm.mStringBuilder.setLength(0);
- r.intent.getIntent().toShortString(mAm.mStringBuilder, true, false, true, false);
- EventLog.writeEvent(EventLogTags.AM_CREATE_SERVICE,
- r.userId, System.identityHashCode(r), r.shortName,
- mAm.mStringBuilder.toString(), r.app.pid);
+ EventLogTags.writeAmCreateService(
+ r.userId, System.identityHashCode(r), r.shortName, r.app.pid);
synchronized (r.stats.getBatteryStats()) {
r.stats.startLaunchedLocked();
}
@@ -1242,9 +1239,8 @@
}
if (DEBUG_SERVICE) Slog.v(TAG, "Bringing down " + r + " " + r.intent);
- EventLog.writeEvent(EventLogTags.AM_DESTROY_SERVICE,
- r.userId, System.identityHashCode(r), r.shortName,
- (r.app != null) ? r.app.pid : -1);
+ EventLogTags.writeAmDestroyService(
+ r.userId, System.identityHashCode(r), (r.app != null) ? r.app.pid : -1);
mServiceMap.removeServiceByName(r.name, r.userId);
mServiceMap.removeServiceByIntent(r.intent, r.userId);
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index db64a9a..82c9030 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -4764,6 +4764,18 @@
return false;
}
+ public Intent getIntentForIntentSender(IIntentSender pendingResult) {
+ if (!(pendingResult instanceof PendingIntentRecord)) {
+ return null;
+ }
+ try {
+ PendingIntentRecord res = (PendingIntentRecord)pendingResult;
+ return res.key.requestIntent != null ? new Intent(res.key.requestIntent) : null;
+ } catch (ClassCastException e) {
+ }
+ return null;
+ }
+
public void setProcessLimit(int max) {
enforceCallingPermission(android.Manifest.permission.SET_PROCESS_LIMIT,
"setProcessLimit()");
@@ -14168,7 +14180,7 @@
// Once the internal notion of the active user has switched, we lock the device
// with the option to show the user switcher on the keyguard.
- mWindowManager.lockNow(LockPatternUtils.USER_SWITCH_LOCK_OPTIONS);
+ mWindowManager.lockNow(null);
final UserStartedState uss = mStartedUsers.get(userId);
diff --git a/services/java/com/android/server/am/EventLogTags.logtags b/services/java/com/android/server/am/EventLogTags.logtags
index 88c0c03..f784861 100644
--- a/services/java/com/android/server/am/EventLogTags.logtags
+++ b/services/java/com/android/server/am/EventLogTags.logtags
@@ -63,9 +63,9 @@
30024 am_broadcast_discard_filter (User|1|5),(Broadcast|1|5),(Action|3),(Receiver Number|1|1),(BroadcastFilter|1|5)
30025 am_broadcast_discard_app (User|1|5),(Broadcast|1|5),(Action|3),(Receiver Number|1|1),(App|3)
# A service is being created
-30030 am_create_service (User|1|5),(Service Record|1|5),(Name|3),(Intent|3),(PID|1|5)
+30030 am_create_service (User|1|5),(Service Record|1|5),(Name|3),(PID|1|5)
# A service is being destroyed
-30031 am_destroy_service (User|1|5),(Service Record|1|5),(Name|3),(PID|1|5)
+30031 am_destroy_service (User|1|5),(Service Record|1|5),(PID|1|5)
# A process has crashed too many times, it is being cleared
30032 am_process_crashed_too_much (User|1|5),(Name|3),(PID|1|5)
# An unknown process is trying to attach to the activity manager
diff --git a/services/java/com/android/server/net/NetworkPolicyManagerService.java b/services/java/com/android/server/net/NetworkPolicyManagerService.java
index 43ddf8d..b839331 100644
--- a/services/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -131,6 +131,7 @@
import android.util.Xml;
import com.android.internal.R;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.Objects;
@@ -184,9 +185,11 @@
private static final int VERSION_SWITCH_UID = 10;
private static final int VERSION_LATEST = VERSION_SWITCH_UID;
- // @VisibleForTesting
+ @VisibleForTesting
public static final int TYPE_WARNING = 0x1;
+ @VisibleForTesting
public static final int TYPE_LIMIT = 0x2;
+ @VisibleForTesting
public static final int TYPE_LIMIT_SNOOZED = 0x3;
private static final String TAG_POLICY_LIST = "policy-list";
@@ -214,10 +217,9 @@
private static final String TAG_ALLOW_BACKGROUND = TAG + ":allowBackground";
- // @VisibleForTesting
- public static final String ACTION_ALLOW_BACKGROUND =
+ private static final String ACTION_ALLOW_BACKGROUND =
"com.android.server.net.action.ALLOW_BACKGROUND";
- public static final String ACTION_SNOOZE_WARNING =
+ private static final String ACTION_SNOOZE_WARNING =
"com.android.server.net.action.SNOOZE_WARNING";
private static final long TIME_CACHE_MAX_AGE = DAY_IN_MILLIS;
@@ -2063,7 +2065,7 @@
return intent;
}
- // @VisibleForTesting
+ @VisibleForTesting
public void addIdleHandler(IdleHandler handler) {
mHandler.getLooper().getQueue().addIdleHandler(handler);
}
diff --git a/services/java/com/android/server/net/NetworkStatsService.java b/services/java/com/android/server/net/NetworkStatsService.java
index 0efdead..7101520 100644
--- a/services/java/com/android/server/net/NetworkStatsService.java
+++ b/services/java/com/android/server/net/NetworkStatsService.java
@@ -115,6 +115,7 @@
import android.util.SparseIntArray;
import android.util.TrustedTime;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.FileRotator;
import com.android.internal.util.IndentingPrintWriter;
@@ -165,7 +166,7 @@
private IConnectivityManager mConnManager;
- // @VisibleForTesting
+ @VisibleForTesting
public static final String ACTION_NETWORK_STATS_POLL =
"com.android.server.action.NETWORK_STATS_POLL";
public static final String ACTION_NETWORK_STATS_UPDATED =
diff --git a/services/java/com/android/server/pm/UserManagerService.java b/services/java/com/android/server/pm/UserManagerService.java
index 66c3ce9..dbfe34d 100644
--- a/services/java/com/android/server/pm/UserManagerService.java
+++ b/services/java/com/android/server/pm/UserManagerService.java
@@ -88,7 +88,7 @@
private static final int MIN_USER_ID = 10;
- private static final int USER_VERSION = 1;
+ private static final int USER_VERSION = 2;
private static final long EPOCH_PLUS_30_YEARS = 30L * 365 * 24 * 60 * 60 * 1000L; // ms
@@ -484,8 +484,7 @@
}
/**
- * This fixes an incorrect initialization of user name for the owner.
- * TODO: Remove in the next release.
+ * Upgrade steps between versions, either for fixing bugs or changing the data format.
*/
private void upgradeIfNecessary() {
int userVersion = mUserVersion;
@@ -499,6 +498,16 @@
userVersion = 1;
}
+ if (userVersion < 2) {
+ // Owner should be marked as initialized
+ UserInfo user = mUsers.get(UserHandle.USER_OWNER);
+ if ((user.flags & UserInfo.FLAG_INITIALIZED) == 0) {
+ user.flags |= UserInfo.FLAG_INITIALIZED;
+ writeUserLocked(user);
+ }
+ userVersion = 2;
+ }
+
if (userVersion < USER_VERSION) {
Slog.w(LOG_TAG, "User version " + mUserVersion + " didn't upgrade as expected to "
+ USER_VERSION);
diff --git a/services/java/com/android/server/power/PowerManagerService.java b/services/java/com/android/server/power/PowerManagerService.java
index 8650192..2690442 100644
--- a/services/java/com/android/server/power/PowerManagerService.java
+++ b/services/java/com/android/server/power/PowerManagerService.java
@@ -618,8 +618,19 @@
}
}
+ private static boolean isScreenLock(final WakeLock wakeLock) {
+ switch (wakeLock.mFlags & PowerManager.WAKE_LOCK_LEVEL_MASK) {
+ case PowerManager.FULL_WAKE_LOCK:
+ case PowerManager.SCREEN_BRIGHT_WAKE_LOCK:
+ case PowerManager.SCREEN_DIM_WAKE_LOCK:
+ return true;
+ }
+ return false;
+ }
+
private void applyWakeLockFlagsOnAcquireLocked(WakeLock wakeLock) {
- if ((wakeLock.mFlags & PowerManager.ACQUIRE_CAUSES_WAKEUP) != 0) {
+ if ((wakeLock.mFlags & PowerManager.ACQUIRE_CAUSES_WAKEUP) != 0 &&
+ isScreenLock(wakeLock)) {
wakeUpNoUpdateLocked(SystemClock.uptimeMillis());
}
}
diff --git a/services/java/com/android/server/usb/UsbDeviceManager.java b/services/java/com/android/server/usb/UsbDeviceManager.java
index f34a52d..c7c2c62 100644
--- a/services/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/java/com/android/server/usb/UsbDeviceManager.java
@@ -47,6 +47,8 @@
import android.util.Pair;
import android.util.Slog;
+import com.android.internal.annotations.GuardedBy;
+
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileNotFoundException;
@@ -105,7 +107,7 @@
private final Context mContext;
private final ContentResolver mContentResolver;
- // @GuardedBy("mLock")
+ @GuardedBy("mLock")
private UsbSettingsManager mCurrentSettings;
private NotificationManager mNotificationManager;
private final boolean mHasUsbAccessory;
diff --git a/services/java/com/android/server/usb/UsbHostManager.java b/services/java/com/android/server/usb/UsbHostManager.java
index 175ae6f..10272f2 100644
--- a/services/java/com/android/server/usb/UsbHostManager.java
+++ b/services/java/com/android/server/usb/UsbHostManager.java
@@ -26,6 +26,8 @@
import android.os.Parcelable;
import android.util.Slog;
+import com.android.internal.annotations.GuardedBy;
+
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.HashMap;
@@ -46,7 +48,7 @@
private final Context mContext;
private final Object mLock = new Object();
- // @GuardedBy("mLock")
+ @GuardedBy("mLock")
private UsbSettingsManager mCurrentSettings;
public UsbHostManager(Context context) {
diff --git a/services/java/com/android/server/usb/UsbService.java b/services/java/com/android/server/usb/UsbService.java
index 629f5fa..3918d15 100644
--- a/services/java/com/android/server/usb/UsbService.java
+++ b/services/java/com/android/server/usb/UsbService.java
@@ -30,6 +30,7 @@
import android.os.UserHandle;
import android.util.SparseArray;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.IndentingPrintWriter;
import java.io.File;
@@ -52,7 +53,7 @@
private final Object mLock = new Object();
/** Map from {@link UserHandle} to {@link UsbSettingsManager} */
- // @GuardedBy("mLock")
+ @GuardedBy("mLock")
private final SparseArray<UsbSettingsManager>
mSettingsByUser = new SparseArray<UsbSettingsManager>();
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 51edb44..c3fc19c 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -2848,7 +2848,7 @@
}
if (win.isConfigChanged()) {
if (DEBUG_CONFIGURATION) Slog.i(TAG, "Window " + win
- + " visible with new config: " + win.mConfiguration);
+ + " visible with new config: " + mCurConfiguration);
outConfig.setTo(mCurConfiguration);
}
}
@@ -3808,22 +3808,23 @@
final WindowList windows = getDefaultWindowListLocked();
int pos = windows.size() - 1;
while (pos >= 0) {
- WindowState wtoken = windows.get(pos);
+ WindowState win = windows.get(pos);
pos--;
- if (wtoken.mAppToken != null) {
+ if (win.mAppToken != null) {
// We hit an application window. so the orientation will be determined by the
// app window. No point in continuing further.
return (mLastWindowForcedOrientation=ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
}
- if (!wtoken.isVisibleLw() || !wtoken.mPolicyVisibilityAfterAnim) {
+ if (!win.isVisibleLw() || !win.mPolicyVisibilityAfterAnim) {
continue;
}
- int req = wtoken.mAttrs.screenOrientation;
+ int req = win.mAttrs.screenOrientation;
if((req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) ||
(req == ActivityInfo.SCREEN_ORIENTATION_BEHIND)){
continue;
}
+ if (DEBUG_ORIENTATION) Slog.v(TAG, win + " forcing orientation to " + req);
return (mLastWindowForcedOrientation=req);
}
return (mLastWindowForcedOrientation=ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
@@ -9407,7 +9408,7 @@
+ " / " + mCurConfiguration + " / 0x"
+ Integer.toHexString(diff));
}
- win.mConfiguration = mCurConfiguration;
+ win.setConfiguration(mCurConfiguration);
if (DEBUG_ORIENTATION &&
winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING) Slog.i(
TAG, "Resizing " + win + " WITH DRAW PENDING");
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 35bebbe..3dce939 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -21,6 +21,7 @@
import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG;
+import static android.view.WindowManager.LayoutParams.TYPE_KEYGUARD;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
import com.android.server.input.InputWindowHandle;
@@ -112,6 +113,9 @@
int mLayoutSeq = -1;
Configuration mConfiguration = null;
+ // Sticky answer to isConfigChanged(), remains true until new Configuration is assigned.
+ // Used only on {@link #TYPE_KEYGUARD}.
+ private boolean mConfigHasChanged;
/**
* Actual frame shown on-screen (may be modified by animation). These
@@ -627,6 +631,7 @@
: WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
}
+ @Override
public boolean hasAppShownWindows() {
return mAppToken != null && (mAppToken.firstWindowDrawn || mAppToken.startingDisplayed);
}
@@ -857,9 +862,17 @@
}
boolean isConfigChanged() {
- return mConfiguration != mService.mCurConfiguration
+ boolean configChanged = mConfiguration != mService.mCurConfiguration
&& (mConfiguration == null
|| (mConfiguration.diff(mService.mCurConfiguration) != 0));
+
+ if (mAttrs.type == TYPE_KEYGUARD) {
+ // Retain configuration changed status until resetConfiguration called.
+ mConfigHasChanged |= configChanged;
+ configChanged = mConfigHasChanged;
+ }
+
+ return configChanged;
}
boolean isConfigDiff(int mask) {
@@ -886,6 +899,11 @@
}
}
+ void setConfiguration(final Configuration newConfig) {
+ mConfiguration = newConfig;
+ mConfigHasChanged = false;
+ }
+
void setInputChannel(InputChannel inputChannel) {
if (mInputChannel != null) {
throw new IllegalStateException("Window already has an input channel.");
@@ -907,6 +925,7 @@
}
private class DeathRecipient implements IBinder.DeathRecipient {
+ @Override
public void binderDied() {
try {
synchronized(mService.mWindowMap) {
diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java
index 7b30c89..e33b7b7 100644
--- a/services/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/java/com/android/server/wm/WindowStateAnimator.java
@@ -803,7 +803,7 @@
mSurfaceShown = false;
mSurface = null;
- mWin.mHasSurface =false;
+ mWin.mHasSurface = false;
mDrawState = NO_SURFACE;
}
}
diff --git a/tests/AppLaunch/Android.mk b/tests/AppLaunch/Android.mk
new file mode 100644
index 0000000..c0560fd
--- /dev/null
+++ b/tests/AppLaunch/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+
+# Only compile source java files in this apk.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := AppLaunch
+
+LOCAL_CERTIFICATE := platform
+LOCAL_JAVA_LIBRARIES := android.test.runner
+
+include $(BUILD_PACKAGE)
+
+# Use the following include to make our test apk.
+include $(call all-makefiles-under,$(LOCAL_PATH))
\ No newline at end of file
diff --git a/tests/AppLaunch/AndroidManifest.xml b/tests/AppLaunch/AndroidManifest.xml
new file mode 100644
index 0000000..ac6760b
--- /dev/null
+++ b/tests/AppLaunch/AndroidManifest.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.tests.applaunch"
+ android:sharedUserId="android.uid.system" >
+ <instrumentation android:label="Measure app start up time"
+ android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.android.tests.applaunch" />
+
+ <application android:label="App Launch Test">
+ <uses-library android:name="android.test.runner" />
+ </application>
+</manifest>
\ No newline at end of file
diff --git a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
new file mode 100644
index 0000000..e9374e0
--- /dev/null
+++ b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
@@ -0,0 +1,216 @@
+/*
+ * 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.tests.applaunch;
+
+import android.app.ActivityManager;
+import android.app.ActivityManager.ProcessErrorStateInfo;
+import android.app.ActivityManagerNative;
+import android.app.IActivityManager;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.ResolveInfo;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.os.UserHandle;
+import android.test.InstrumentationTestCase;
+import android.test.InstrumentationTestRunner;
+import android.util.Log;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This test is intended to measure the time it takes for the apps to start.
+ * Names of the applications are passed in command line, and the
+ * test starts each application, and reports the start up time in milliseconds.
+ * The instrumentation expects the following key to be passed on the command line:
+ * apps - A list of applications to start and their corresponding result keys
+ * in the following format:
+ * -e apps <app name>^<result key>|<app name>^<result key>
+ */
+public class AppLaunch extends InstrumentationTestCase {
+
+ private static final int JOIN_TIMEOUT = 10000;
+ private static final String TAG = "AppLaunch";
+ private static final String KEY_APPS = "apps";
+
+ private Map<String, Intent> mNameToIntent;
+ private Map<String, String> mNameToProcess;
+ private Map<String, String> mNameToResultKey;
+
+ private IActivityManager mAm;
+
+ public void testMeasureStartUpTime() throws RemoteException {
+ InstrumentationTestRunner instrumentation =
+ (InstrumentationTestRunner)getInstrumentation();
+ Bundle args = instrumentation.getBundle();
+ mAm = ActivityManagerNative.getDefault();
+
+ createMappings();
+ parseArgs(args);
+
+ Bundle results = new Bundle();
+ for (String app : mNameToResultKey.keySet()) {
+ try {
+ startApp(app, results);
+ closeApp();
+ } catch (NameNotFoundException e) {
+ Log.i(TAG, "Application " + app + " not found");
+ }
+
+ }
+ instrumentation.sendStatus(0, results);
+ }
+
+ private void parseArgs(Bundle args) {
+ mNameToResultKey = new HashMap<String, String>();
+ String appList = args.getString(KEY_APPS);
+
+ if (appList == null)
+ return;
+
+ String appNames[] = appList.split("\\|");
+ for (String pair : appNames) {
+ String[] parts = pair.split("\\^");
+ if (parts.length != 2) {
+ Log.e(TAG, "The apps key is incorectly formatted");
+ fail();
+ }
+
+ mNameToResultKey.put(parts[0], parts[1]);
+ }
+ }
+
+ private void createMappings() {
+ mNameToIntent = new HashMap<String, Intent>();
+ mNameToProcess = new HashMap<String, String>();
+
+ PackageManager pm = getInstrumentation().getContext()
+ .getPackageManager();
+ Intent intentToResolve = new Intent(Intent.ACTION_MAIN);
+ intentToResolve.addCategory(Intent.CATEGORY_LAUNCHER);
+ List<ResolveInfo> ris = pm.queryIntentActivities(intentToResolve, 0);
+ if (ris == null || ris.isEmpty()) {
+ Log.i(TAG, "Could not find any apps");
+ } else {
+ for (ResolveInfo ri : ris) {
+ Intent startIntent = new Intent(intentToResolve);
+ startIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+ | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+ startIntent.setClassName(ri.activityInfo.packageName,
+ ri.activityInfo.name);
+ mNameToIntent.put(ri.loadLabel(pm).toString(), startIntent);
+ mNameToProcess.put(ri.loadLabel(pm).toString(),
+ ri.activityInfo.processName);
+ }
+ }
+ }
+
+ private void startApp(String appName, Bundle results)
+ throws NameNotFoundException, RemoteException {
+ Log.i(TAG, "Starting " + appName);
+
+ Intent startIntent = mNameToIntent.get(appName);
+ AppLaunchRunnable runnable = new AppLaunchRunnable(startIntent);
+ Thread t = new Thread(runnable);
+ long startTime = System.currentTimeMillis();
+ t.start();
+ try {
+ t.join(JOIN_TIMEOUT);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ if(t.isAlive() || (runnable.getResult() != null &&
+ runnable.getResult().result != ActivityManager.START_SUCCESS)) {
+ Log.w(TAG, "Assuming app " + appName + " crashed.");
+ reportError(appName, mNameToProcess.get(appName), results);
+ return;
+ }
+ long startUpTime = System.currentTimeMillis() - startTime;
+ results.putString(mNameToResultKey.get(appName), String.valueOf(startUpTime));
+ sleep(5000);
+ }
+
+ private void closeApp() {
+ Intent homeIntent = new Intent(Intent.ACTION_MAIN);
+ homeIntent.addCategory(Intent.CATEGORY_HOME);
+ homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+ | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+ getInstrumentation().getContext().startActivity(homeIntent);
+ sleep(3000);
+ }
+
+ private void sleep(int time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ }
+
+ private void reportError(String appName, String processName, Bundle results) {
+ ActivityManager am = (ActivityManager) getInstrumentation()
+ .getContext().getSystemService(Context.ACTIVITY_SERVICE);
+ List<ProcessErrorStateInfo> crashes = am.getProcessesInErrorState();
+ if (crashes != null) {
+ for (ProcessErrorStateInfo crash : crashes) {
+ if (!crash.processName.equals(processName))
+ continue;
+
+ Log.w(TAG, appName + " crashed: " + crash.shortMsg);
+ results.putString(mNameToResultKey.get(appName), crash.shortMsg);
+ return;
+ }
+ }
+
+ results.putString(mNameToResultKey.get(appName),
+ "Crashed for unknown reason");
+ Log.w(TAG, appName
+ + " not found in process list, most likely it is crashed");
+ }
+
+ private class AppLaunchRunnable implements Runnable {
+ private Intent mLaunchIntent;
+ private IActivityManager.WaitResult mResult;
+ public AppLaunchRunnable(Intent intent) {
+ mLaunchIntent = intent;
+ }
+
+ public IActivityManager.WaitResult getResult() {
+ return mResult;
+ }
+
+ public void run() {
+ try {
+ String mimeType = mLaunchIntent.getType();
+ if (mimeType == null && mLaunchIntent.getData() != null
+ && "content".equals(mLaunchIntent.getData().getScheme())) {
+ mimeType = mAm.getProviderMimeType(mLaunchIntent.getData(),
+ UserHandle.USER_CURRENT);
+ }
+
+ mResult = mAm.startActivityAndWait(null, mLaunchIntent, mimeType,
+ null, null, 0, mLaunchIntent.getFlags(), null, null, null,
+ UserHandle.USER_CURRENT);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Error launching app", e);
+ }
+ }
+ }
+}
diff --git a/tests/MemoryUsage/Android.mk b/tests/MemoryUsage/Android.mk
index e7bfb4f..0ab793b 100644
--- a/tests/MemoryUsage/Android.mk
+++ b/tests/MemoryUsage/Android.mk
@@ -8,7 +8,8 @@
LOCAL_PACKAGE_NAME := MemoryUsage
-LOCAL_SDK_VERSION := 7
+LOCAL_CERTIFICATE := platform
+LOCAL_JAVA_LIBRARIES := android.test.runner
include $(BUILD_PACKAGE)
diff --git a/tests/MemoryUsage/src/com/android/tests/memoryusage/MemoryUsageTest.java b/tests/MemoryUsage/src/com/android/tests/memoryusage/MemoryUsageTest.java
index 5e27ba7..b550957 100644
--- a/tests/MemoryUsage/src/com/android/tests/memoryusage/MemoryUsageTest.java
+++ b/tests/MemoryUsage/src/com/android/tests/memoryusage/MemoryUsageTest.java
@@ -18,14 +18,17 @@
import android.app.ActivityManager;
import android.app.ActivityManager.ProcessErrorStateInfo;
import android.app.ActivityManager.RunningAppProcessInfo;
+import android.app.ActivityManagerNative;
+import android.app.IActivityManager;
import android.content.Context;
import android.content.Intent;
-import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.os.Debug.MemoryInfo;
+import android.os.RemoteException;
+import android.os.UserHandle;
import android.test.InstrumentationTestCase;
import android.util.Log;
@@ -48,8 +51,9 @@
private static final int SLEEP_TIME = 1000;
private static final int THRESHOLD = 1024;
- private static final int MAX_ITERATIONS = 10;
- private static final int MIN_ITERATIONS = 4;
+ private static final int MAX_ITERATIONS = 20;
+ private static final int MIN_ITERATIONS = 6;
+ private static final int JOIN_TIMEOUT = 10000;
private static final String TAG = "MemoryUsageInstrumentation";
private static final String KEY_APPS = "apps";
@@ -58,10 +62,13 @@
private Map<String, String> mNameToProcess;
private Map<String, String> mNameToResultKey;
+ private IActivityManager mAm;
+
public void testMemory() {
MemoryUsageInstrumentation instrumentation =
- (MemoryUsageInstrumentation) getInstrumentation();
+ (MemoryUsageInstrumentation) getInstrumentation();
Bundle args = instrumentation.getBundle();
+ mAm = ActivityManagerNative.getDefault();
createMappings();
parseArgs(args);
@@ -136,7 +143,16 @@
String process = mNameToProcess.get(appName);
Intent startIntent = mNameToIntent.get(appName);
- getInstrumentation().getContext().startActivity(startIntent);
+
+ AppLaunchRunnable runnable = new AppLaunchRunnable(startIntent);
+ Thread t = new Thread(runnable);
+ t.start();
+ try {
+ t.join(JOIN_TIMEOUT);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+
return process;
}
@@ -234,7 +250,7 @@
}
int[] pids = {
- proc.pid };
+ proc.pid };
MemoryInfo meminfo = am.getProcessMemoryInfo(pids)[0];
return meminfo.getTotalPss();
@@ -242,4 +258,29 @@
}
return -1;
}
+
+ private class AppLaunchRunnable implements Runnable {
+ private Intent mLaunchIntent;
+
+ public AppLaunchRunnable(Intent intent) {
+ mLaunchIntent = intent;
+ }
+
+ public void run() {
+ try {
+ String mimeType = mLaunchIntent.getType();
+ if (mimeType == null && mLaunchIntent.getData() != null
+ && "content".equals(mLaunchIntent.getData().getScheme())) {
+ mimeType = mAm.getProviderMimeType(mLaunchIntent.getData(),
+ UserHandle.USER_CURRENT);
+ }
+
+ mAm.startActivityAndWait(null, mLaunchIntent, mimeType,
+ null, null, 0, mLaunchIntent.getFlags(), null, null, null,
+ UserHandle.USER_CURRENT_OR_SELF);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Error launching app", e);
+ }
+ }
+ }
}