Merge "Fix finishing activity in non-focused stack" into nyc-mr1-dev
diff --git a/core/java/android/app/ITransientNotification.aidl b/core/java/android/app/ITransientNotification.aidl
index 35b53a4..d5b3ed0 100644
--- a/core/java/android/app/ITransientNotification.aidl
+++ b/core/java/android/app/ITransientNotification.aidl
@@ -19,7 +19,7 @@
/** @hide */
oneway interface ITransientNotification {
- void show();
+ void show(IBinder windowToken);
void hide();
}
diff --git a/core/java/android/net/ConnectivityMetricsLogger.java b/core/java/android/net/ConnectivityMetricsLogger.java
index 946bed2..9a2d4e0 100644
--- a/core/java/android/net/ConnectivityMetricsLogger.java
+++ b/core/java/android/net/ConnectivityMetricsLogger.java
@@ -109,6 +109,12 @@
// Log number of skipped events
Bundle b = new Bundle();
b.putInt(DATA_KEY_EVENTS_COUNT, mNumSkippedEvents);
+
+ // Log the skipped event.
+ // TODO: Note that some of the clients push all states events into the server,
+ // If we lose some states logged here, we might mess up the statistics happened at the
+ // backend. One of the options is to introduce a non-skippable flag for important events
+ // that are logged.
skippedEventsEvent = new ConnectivityMetricsEvent(mServiceUnblockedTimestampMillis,
componentTag, TAG_SKIPPED_EVENTS, b);
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index 4818910..b6955a8 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -233,6 +233,7 @@
mSession = getWindowSession();
mLayout.token = getWindowToken();
mLayout.setTitle("SurfaceView - " + getViewRootImpl().getTitle());
+ mLayout.packageName = mContext.getOpPackageName();
mViewVisibility = getVisibility() == VISIBLE;
if (!mGlobalListenersAdded) {
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index fe24230..4a20619 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -1734,14 +1734,18 @@
public CharSequence accessibilityTitle;
/**
- * Sets a timeout in milliseconds before which the window will be removed
+ * Sets a timeout in milliseconds before which the window will be hidden
* by the window manager. Useful for transient notifications like toasts
* so we don't have to rely on client cooperation to ensure the window
- * is removed. Must be specified at window creation time.
+ * is hidden. Must be specified at window creation time. Note that apps
+ * are not prepared to handle their windows being removed without their
+ * explicit request and may try to interact with the removed window
+ * resulting in undefined behavior and crashes. Therefore, we do hide
+ * such windows to prevent them from overlaying other apps.
*
* @hide
*/
- public long removeTimeoutMilliseconds = -1;
+ public long hideTimeoutMilliseconds = -1;
public LayoutParams() {
super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
@@ -1877,7 +1881,7 @@
out.writeInt(needsMenuKey);
out.writeInt(accessibilityIdOfAnchor);
TextUtils.writeToParcel(accessibilityTitle, out, parcelableFlags);
- out.writeLong(removeTimeoutMilliseconds);
+ out.writeLong(hideTimeoutMilliseconds);
}
public static final Parcelable.Creator<LayoutParams> CREATOR
@@ -1931,7 +1935,7 @@
needsMenuKey = in.readInt();
accessibilityIdOfAnchor = in.readInt();
accessibilityTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
- removeTimeoutMilliseconds = in.readLong();
+ hideTimeoutMilliseconds = in.readLong();
}
@SuppressWarnings({"PointlessBitwiseExpression"})
@@ -2153,7 +2157,7 @@
}
// This can't change, it's only set at window creation time.
- removeTimeoutMilliseconds = o.removeTimeoutMilliseconds;
+ hideTimeoutMilliseconds = o.hideTimeoutMilliseconds;
return changes;
}
diff --git a/core/java/android/widget/RatingBar.java b/core/java/android/widget/RatingBar.java
index 2230961..3ad05b5 100644
--- a/core/java/android/widget/RatingBar.java
+++ b/core/java/android/widget/RatingBar.java
@@ -110,8 +110,8 @@
}
// A touch inside a star fill up to that fractional area (slightly more
- // than 1 so boundaries round up).
- mTouchProgressOffset = 1.1f;
+ // than 0.5 so boundaries round up).
+ mTouchProgressOffset = 0.6f;
}
public RatingBar(Context context, AttributeSet attrs) {
diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java
index 7762675..eca10cb 100644
--- a/core/java/android/widget/Toast.java
+++ b/core/java/android/widget/Toast.java
@@ -25,6 +25,8 @@
import android.content.res.Resources;
import android.graphics.PixelFormat;
import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Log;
@@ -326,13 +328,6 @@
}
private static class TN extends ITransientNotification.Stub {
- final Runnable mShow = new Runnable() {
- @Override
- public void run() {
- handleShow();
- }
- };
-
final Runnable mHide = new Runnable() {
@Override
public void run() {
@@ -343,7 +338,13 @@
};
private final WindowManager.LayoutParams mParams = new WindowManager.LayoutParams();
- final Handler mHandler = new Handler();
+ final Handler mHandler = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ IBinder token = (IBinder) msg.obj;
+ handleShow(token);
+ }
+ };
int mGravity;
int mX, mY;
@@ -379,9 +380,9 @@
* schedule handleShow into the right thread
*/
@Override
- public void show() {
+ public void show(IBinder windowToken) {
if (localLOGV) Log.v(TAG, "SHOW: " + this);
- mHandler.post(mShow);
+ mHandler.obtainMessage(0, windowToken).sendToTarget();
}
/**
@@ -393,7 +394,7 @@
mHandler.post(mHide);
}
- public void handleShow() {
+ public void handleShow(IBinder windowToken) {
if (localLOGV) Log.v(TAG, "HANDLE SHOW: " + this + " mView=" + mView
+ " mNextView=" + mNextView);
if (mView != mNextView) {
@@ -422,8 +423,9 @@
mParams.verticalMargin = mVerticalMargin;
mParams.horizontalMargin = mHorizontalMargin;
mParams.packageName = packageName;
- mParams.removeTimeoutMilliseconds = mDuration ==
+ mParams.hideTimeoutMilliseconds = mDuration ==
Toast.LENGTH_LONG ? LONG_DURATION_TIMEOUT : SHORT_DURATION_TIMEOUT;
+ mParams.token = windowToken;
if (mView.getParent() != null) {
if (localLOGV) Log.v(TAG, "REMOVE! " + mView + " in " + this);
mWM.removeView(mView);
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index b174e33..17635ae 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -1791,11 +1791,17 @@
public abstract class OverflowArrayMap<T> {
private static final String OVERFLOW_NAME = "*overflow*";
+ final int mUid;
final ArrayMap<String, T> mMap = new ArrayMap<>();
T mCurOverflow;
ArrayMap<String, MutableInt> mActiveOverflow;
+ long mLastOverflowTime;
+ long mLastOverflowFinishTime;
+ long mLastClearTime;
+ long mLastCleanupTime;
- public OverflowArrayMap() {
+ public OverflowArrayMap(int uid) {
+ mUid = uid;
}
public ArrayMap<String, T> getMap() {
@@ -1803,6 +1809,7 @@
}
public void clear() {
+ mLastClearTime = SystemClock.elapsedRealtime();
mMap.clear();
mCurOverflow = null;
mActiveOverflow = null;
@@ -1819,6 +1826,7 @@
}
public void cleanup() {
+ mLastCleanupTime = SystemClock.elapsedRealtime();
if (mActiveOverflow != null) {
if (mActiveOverflow.size() == 0) {
mActiveOverflow = null;
@@ -1885,6 +1893,7 @@
mActiveOverflow = new ArrayMap<>();
}
mActiveOverflow.put(name, new MutableInt(1));
+ mLastOverflowTime = SystemClock.elapsedRealtime();
return obj;
}
@@ -1914,6 +1923,7 @@
over.value--;
if (over.value <= 0) {
mActiveOverflow.remove(name);
+ mLastOverflowFinishTime = SystemClock.elapsedRealtime();
}
return obj;
}
@@ -1922,9 +1932,35 @@
// Huh, they are stopping an active operation but we can't find one!
// That's not good.
- Slog.wtf(TAG, "Unable to find object for " + name + " mapsize="
- + mMap.size() + " activeoverflow=" + mActiveOverflow
- + " curoverflow=" + mCurOverflow);
+ StringBuilder sb = new StringBuilder();
+ sb.append("Unable to find object for ");
+ sb.append(name);
+ sb.append(" in uid ");
+ sb.append(mUid);
+ sb.append(" mapsize=");
+ sb.append(mMap.size());
+ sb.append(" activeoverflow=");
+ sb.append(mActiveOverflow);
+ sb.append(" curoverflow=");
+ sb.append(mCurOverflow);
+ long now = SystemClock.elapsedRealtime();
+ if (mLastOverflowTime != 0) {
+ sb.append(" lastOverflowTime=");
+ TimeUtils.formatDuration(mLastOverflowTime-now, sb);
+ }
+ if (mLastOverflowFinishTime != 0) {
+ sb.append(" lastOverflowFinishTime=");
+ TimeUtils.formatDuration(mLastOverflowFinishTime-now, sb);
+ }
+ if (mLastClearTime != 0) {
+ sb.append(" lastClearTime=");
+ TimeUtils.formatDuration(mLastClearTime-now, sb);
+ }
+ if (mLastCleanupTime != 0) {
+ sb.append(" lastCleanupTime=");
+ TimeUtils.formatDuration(mLastCleanupTime-now, sb);
+ }
+ Slog.wtf(TAG, sb.toString());
return null;
}
@@ -5084,18 +5120,18 @@
mSystemCpuTime = new LongSamplingCounter(mBsi.mOnBatteryTimeBase);
mCpuPower = new LongSamplingCounter(mBsi.mOnBatteryTimeBase);
- mWakelockStats = mBsi.new OverflowArrayMap<Wakelock>() {
+ mWakelockStats = mBsi.new OverflowArrayMap<Wakelock>(uid) {
@Override public Wakelock instantiateObject() {
return new Wakelock(mBsi, Uid.this);
}
};
- mSyncStats = mBsi.new OverflowArrayMap<StopwatchTimer>() {
+ mSyncStats = mBsi.new OverflowArrayMap<StopwatchTimer>(uid) {
@Override public StopwatchTimer instantiateObject() {
return new StopwatchTimer(mBsi.mClocks, Uid.this, SYNC, null,
mBsi.mOnBatteryTimeBase);
}
};
- mJobStats = mBsi.new OverflowArrayMap<StopwatchTimer>() {
+ mJobStats = mBsi.new OverflowArrayMap<StopwatchTimer>(uid) {
@Override public StopwatchTimer instantiateObject() {
return new StopwatchTimer(mBsi.mClocks, Uid.this, JOB, null,
mBsi.mOnBatteryTimeBase);
diff --git a/core/res/res/color/watch_switch_thumb_color_material.xml b/core/res/res/color/watch_switch_thumb_color_material.xml
index a931724..d4796a0 100644
--- a/core/res/res/color/watch_switch_thumb_color_material.xml
+++ b/core/res/res/color/watch_switch_thumb_color_material.xml
@@ -12,6 +12,7 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="?android:colorAccent" android:state_checked="true" />
- <item android:color="?android:colorButtonNormal" android:state_checked="false" />
+ <item android:color="?android:colorButtonNormal" android:state_enabled="false" />
+ <item android:color="?android:colorControlActivated" android:state_checked="true" />
+ <item android:color="?android:colorButtonNormal" />
</selector>
\ No newline at end of file
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index dcec07d..8d3cd48 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2793,8 +2793,8 @@
<!-- [CHAR LIMIT=NONE] Message shown in upgrading dialog when doing an fstrim. -->
<string name="android_upgrading_fstrim">Optimizing storage.</string>
- <!-- [CHAR LIMIT=40] Title of notification that is shown when performing a system upgrade. -->
- <string name="android_upgrading_notification_title">Android is upgrading</string>
+ <!-- [CHAR LIMIT=40] Title of notification that is shown when finishing a system upgrade. -->
+ <string name="android_upgrading_notification_title">Finishing Android update\u2026</string>
<!-- [CHAR LIMIT=200] Body of notification that is shown when performing a system upgrade. -->
<string name="android_upgrading_notification_body">Some apps may not work properly until the upgrade finishes</string>
@@ -4165,7 +4165,7 @@
<!-- [CHAR_LIMIT=NONE] Data saver: Feature description -->
<string name="data_saver_description">To help reduce data usage, Data Saver prevents some apps from sending or receiving data in the background. An app you’re currently using can access data, but may do so less frequently. This may mean, for example, that images don’t display until you tap them.</string>
- <!-- [CHAR_LIMIT=30] Data saver: Title on first-time dialogFeature description -->
+ <!-- [CHAR_LIMIT=35] Data saver: Title on first-time dialog -->
<string name="data_saver_enable_title">Turn on Data Saver?</string>
<!-- [CHAR_LIMIT=16] Data saver: Button to turn it on on first-time dialog -->
<string name="data_saver_enable_button">Turn on</string>
diff --git a/docs/html-intl/intl/es/training/articles/direct-boot.jd b/docs/html-intl/intl/es/training/articles/direct-boot.jd
index e1d99e9..0ce3f5b 100644
--- a/docs/html-intl/intl/es/training/articles/direct-boot.jd
+++ b/docs/html-intl/intl/es/training/articles/direct-boot.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>En este documento</h2>
<ol>
<li><a href="#run">Solicitar acceso para ejecutar durante el inicio directo</a></li>
diff --git a/docs/html-intl/intl/es/training/articles/scoped-directory-access.jd b/docs/html-intl/intl/es/training/articles/scoped-directory-access.jd
index 67f9ad6..194bfd7 100644
--- a/docs/html-intl/intl/es/training/articles/scoped-directory-access.jd
+++ b/docs/html-intl/intl/es/training/articles/scoped-directory-access.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>En este documento</h2>
<ol>
<li><a href="#accessing">Acceder a un directorio de almacenamiento externo</a></li>
diff --git a/docs/html-intl/intl/es/training/tv/playback/picture-in-picture.jd b/docs/html-intl/intl/es/training/tv/playback/picture-in-picture.jd
index 0aa46dc..30c9e8b 100644
--- a/docs/html-intl/intl/es/training/tv/playback/picture-in-picture.jd
+++ b/docs/html-intl/intl/es/training/tv/playback/picture-in-picture.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>En este documento</h2>
<ol>
diff --git a/docs/html-intl/intl/es/training/tv/tif/content-recording.jd b/docs/html-intl/intl/es/training/tv/tif/content-recording.jd
index 855db8d..9e8a346 100644
--- a/docs/html-intl/intl/es/training/tv/tif/content-recording.jd
+++ b/docs/html-intl/intl/es/training/tv/tif/content-recording.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>En este documento</h2>
<ol>
<li><a href="#supporting">Indicar la compatibilidad para la grabación</a></li>
diff --git a/docs/html-intl/intl/in/training/articles/direct-boot.jd b/docs/html-intl/intl/in/training/articles/direct-boot.jd
index b06a7dd..a7e3cf3 100644
--- a/docs/html-intl/intl/in/training/articles/direct-boot.jd
+++ b/docs/html-intl/intl/in/training/articles/direct-boot.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Dalam dokumen ini</h2>
<ol>
<li><a href="#run">Meminta Akses untuk Berjalan Selama Direct Boot</a></li>
diff --git a/docs/html-intl/intl/in/training/articles/scoped-directory-access.jd b/docs/html-intl/intl/in/training/articles/scoped-directory-access.jd
index 855993f..30aed6f 100644
--- a/docs/html-intl/intl/in/training/articles/scoped-directory-access.jd
+++ b/docs/html-intl/intl/in/training/articles/scoped-directory-access.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Dalam dokumen ini</h2>
<ol>
<li><a href="#accessing">Mengakses Direktori Penyimpanan Eksternal</a></li>
diff --git a/docs/html-intl/intl/in/training/tv/playback/picture-in-picture.jd b/docs/html-intl/intl/in/training/tv/playback/picture-in-picture.jd
index 1cad955..41af6de 100644
--- a/docs/html-intl/intl/in/training/tv/playback/picture-in-picture.jd
+++ b/docs/html-intl/intl/in/training/tv/playback/picture-in-picture.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Dalam dokumen ini</h2>
<ol>
diff --git a/docs/html-intl/intl/in/training/tv/tif/content-recording.jd b/docs/html-intl/intl/in/training/tv/tif/content-recording.jd
index afedf8f..3389dbf 100644
--- a/docs/html-intl/intl/in/training/tv/tif/content-recording.jd
+++ b/docs/html-intl/intl/in/training/tv/tif/content-recording.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Dalam dokumen ini</h2>
<ol>
<li><a href="#supporting">Menunjukkan Dukungan untuk Perekaman</a></li>
diff --git a/docs/html-intl/intl/ja/training/articles/direct-boot.jd b/docs/html-intl/intl/ja/training/articles/direct-boot.jd
index 933e682..eaa684c7 100644
--- a/docs/html-intl/intl/ja/training/articles/direct-boot.jd
+++ b/docs/html-intl/intl/ja/training/articles/direct-boot.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>このドキュメントの内容</h2>
<ol>
<li><a href="#run">ダイレクト ブート中に実行するためのアクセスを要求する</a></li>
diff --git a/docs/html-intl/intl/ja/training/articles/scoped-directory-access.jd b/docs/html-intl/intl/ja/training/articles/scoped-directory-access.jd
index 32681a0..0767689 100644
--- a/docs/html-intl/intl/ja/training/articles/scoped-directory-access.jd
+++ b/docs/html-intl/intl/ja/training/articles/scoped-directory-access.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>このドキュメントの内容</h2>
<ol>
<li><a href="#accessing">外部ストレージのディレクトリへのアクセス</a></li>
diff --git a/docs/html-intl/intl/ja/training/tv/playback/picture-in-picture.jd b/docs/html-intl/intl/ja/training/tv/playback/picture-in-picture.jd
index 7593670..1df16cd 100644
--- a/docs/html-intl/intl/ja/training/tv/playback/picture-in-picture.jd
+++ b/docs/html-intl/intl/ja/training/tv/playback/picture-in-picture.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>このドキュメントの内容</h2>
<ol>
diff --git a/docs/html-intl/intl/ja/training/tv/tif/content-recording.jd b/docs/html-intl/intl/ja/training/tv/tif/content-recording.jd
index bf5f9a9..3c58cfd 100644
--- a/docs/html-intl/intl/ja/training/tv/tif/content-recording.jd
+++ b/docs/html-intl/intl/ja/training/tv/tif/content-recording.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>このドキュメントの内容</h2>
<ol>
<li><a href="#supporting">録画のサポートを示す</a></li>
diff --git a/docs/html-intl/intl/ko/training/articles/direct-boot.jd b/docs/html-intl/intl/ko/training/articles/direct-boot.jd
index 2674481..e58a4f9 100644
--- a/docs/html-intl/intl/ko/training/articles/direct-boot.jd
+++ b/docs/html-intl/intl/ko/training/articles/direct-boot.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>이 문서의 내용</h2>
<ol>
<li><a href="#run">직접 부팅 시 실행하기 위한 액세스 요청</a></li>
diff --git a/docs/html-intl/intl/ko/training/articles/scoped-directory-access.jd b/docs/html-intl/intl/ko/training/articles/scoped-directory-access.jd
index efd05f3..f2ce650 100644
--- a/docs/html-intl/intl/ko/training/articles/scoped-directory-access.jd
+++ b/docs/html-intl/intl/ko/training/articles/scoped-directory-access.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>이 문서의 내용</h2>
<ol>
<li><a href="#accessing">외부 저장소 디렉터리 액세스</a></li>
diff --git a/docs/html-intl/intl/ko/training/tv/playback/picture-in-picture.jd b/docs/html-intl/intl/ko/training/tv/playback/picture-in-picture.jd
index 15d85fa..96129ce 100644
--- a/docs/html-intl/intl/ko/training/tv/playback/picture-in-picture.jd
+++ b/docs/html-intl/intl/ko/training/tv/playback/picture-in-picture.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>이 문서의 내용</h2>
<ol>
diff --git a/docs/html-intl/intl/ko/training/tv/tif/content-recording.jd b/docs/html-intl/intl/ko/training/tv/tif/content-recording.jd
index fa557bc..ed8b6e0 100644
--- a/docs/html-intl/intl/ko/training/tv/tif/content-recording.jd
+++ b/docs/html-intl/intl/ko/training/tv/tif/content-recording.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>이 문서의 내용</h2>
<ol>
<li><a href="#supporting">녹화 지원 나타내기</a></li>
diff --git a/docs/html-intl/intl/pt-br/training/articles/direct-boot.jd b/docs/html-intl/intl/pt-br/training/articles/direct-boot.jd
index 8f58841..d95f4cd 100644
--- a/docs/html-intl/intl/pt-br/training/articles/direct-boot.jd
+++ b/docs/html-intl/intl/pt-br/training/articles/direct-boot.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Neste documento</h2>
<ol>
<li><a href="#run">Solicitar acesso para executar durante a inicialização direta</a></li>
diff --git a/docs/html-intl/intl/pt-br/training/articles/scoped-directory-access.jd b/docs/html-intl/intl/pt-br/training/articles/scoped-directory-access.jd
index a4c51ab..215afd1 100644
--- a/docs/html-intl/intl/pt-br/training/articles/scoped-directory-access.jd
+++ b/docs/html-intl/intl/pt-br/training/articles/scoped-directory-access.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Neste documento</h2>
<ol>
<li><a href="#accessing">Acessar um diretório de armazenamento externo</a></li>
diff --git a/docs/html-intl/intl/pt-br/training/tv/playback/picture-in-picture.jd b/docs/html-intl/intl/pt-br/training/tv/playback/picture-in-picture.jd
index 14f5209..baa7d61 100644
--- a/docs/html-intl/intl/pt-br/training/tv/playback/picture-in-picture.jd
+++ b/docs/html-intl/intl/pt-br/training/tv/playback/picture-in-picture.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Neste documento</h2>
<ol>
diff --git a/docs/html-intl/intl/pt-br/training/tv/tif/content-recording.jd b/docs/html-intl/intl/pt-br/training/tv/tif/content-recording.jd
index 890e140..c6d7bb7 100644
--- a/docs/html-intl/intl/pt-br/training/tv/tif/content-recording.jd
+++ b/docs/html-intl/intl/pt-br/training/tv/tif/content-recording.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Neste documento</h2>
<ol>
<li><a href="#supporting">Indicar suporte para gravação</a></li>
diff --git a/docs/html-intl/intl/ru/training/articles/direct-boot.jd b/docs/html-intl/intl/ru/training/articles/direct-boot.jd
index 3392c13..98849fe 100644
--- a/docs/html-intl/intl/ru/training/articles/direct-boot.jd
+++ b/docs/html-intl/intl/ru/training/articles/direct-boot.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Содержание документа</h2>
<ol>
<li><a href="#run">Запрос доступа для запуска в режиме Direct Boot</a></li>
diff --git a/docs/html-intl/intl/ru/training/articles/scoped-directory-access.jd b/docs/html-intl/intl/ru/training/articles/scoped-directory-access.jd
index f70c92c..3e67d35 100644
--- a/docs/html-intl/intl/ru/training/articles/scoped-directory-access.jd
+++ b/docs/html-intl/intl/ru/training/articles/scoped-directory-access.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Содержание документа</h2>
<ol>
<li><a href="#accessing">Доступ к каталогу во внешнем хранилище</a></li>
diff --git a/docs/html-intl/intl/ru/training/tv/playback/picture-in-picture.jd b/docs/html-intl/intl/ru/training/tv/playback/picture-in-picture.jd
index f0ffd48..fc26368 100644
--- a/docs/html-intl/intl/ru/training/tv/playback/picture-in-picture.jd
+++ b/docs/html-intl/intl/ru/training/tv/playback/picture-in-picture.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Содержание документа</h2>
<ol>
diff --git a/docs/html-intl/intl/ru/training/tv/tif/content-recording.jd b/docs/html-intl/intl/ru/training/tv/tif/content-recording.jd
index 5e6ce45..19d6db3 100644
--- a/docs/html-intl/intl/ru/training/tv/tif/content-recording.jd
+++ b/docs/html-intl/intl/ru/training/tv/tif/content-recording.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Содержание документа</h2>
<ol>
<li><a href="#supporting">Указание на поддержку записи</a></li>
diff --git a/docs/html-intl/intl/vi/training/articles/direct-boot.jd b/docs/html-intl/intl/vi/training/articles/direct-boot.jd
index 9b2a557..c93e255 100644
--- a/docs/html-intl/intl/vi/training/articles/direct-boot.jd
+++ b/docs/html-intl/intl/vi/training/articles/direct-boot.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Trong tài liệu này</h2>
<ol>
<li><a href="#run">Yêu cầu Truy cập để Chạy trong quá trình Khởi động Trực tiếp</a></li>
diff --git a/docs/html-intl/intl/vi/training/articles/scoped-directory-access.jd b/docs/html-intl/intl/vi/training/articles/scoped-directory-access.jd
index d3b7174..a4d9779 100644
--- a/docs/html-intl/intl/vi/training/articles/scoped-directory-access.jd
+++ b/docs/html-intl/intl/vi/training/articles/scoped-directory-access.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Trong tài liệu này</h2>
<ol>
<li><a href="#accessing">Truy cập một Thư mục lưu trữ bên ngoài</a></li>
diff --git a/docs/html-intl/intl/vi/training/tv/playback/picture-in-picture.jd b/docs/html-intl/intl/vi/training/tv/playback/picture-in-picture.jd
index 8146a15..9156152 100644
--- a/docs/html-intl/intl/vi/training/tv/playback/picture-in-picture.jd
+++ b/docs/html-intl/intl/vi/training/tv/playback/picture-in-picture.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Trong tài liệu này</h2>
<ol>
diff --git a/docs/html-intl/intl/vi/training/tv/tif/content-recording.jd b/docs/html-intl/intl/vi/training/tv/tif/content-recording.jd
index 6dfb53e..bfd718b 100644
--- a/docs/html-intl/intl/vi/training/tv/tif/content-recording.jd
+++ b/docs/html-intl/intl/vi/training/tv/tif/content-recording.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>Trong tài liệu này</h2>
<ol>
<li><a href="#supporting">Chỉ báo Hỗ trợ ghi lại</a></li>
diff --git a/docs/html-intl/intl/zh-cn/training/articles/direct-boot.jd b/docs/html-intl/intl/zh-cn/training/articles/direct-boot.jd
index 306a7a4..20f8b57 100644
--- a/docs/html-intl/intl/zh-cn/training/articles/direct-boot.jd
+++ b/docs/html-intl/intl/zh-cn/training/articles/direct-boot.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>本文内容</h2>
<ol>
<li><a href="#run">请求在直接启动时运行</a></li>
diff --git a/docs/html-intl/intl/zh-cn/training/articles/scoped-directory-access.jd b/docs/html-intl/intl/zh-cn/training/articles/scoped-directory-access.jd
index 6473fc8..83d50b4 100644
--- a/docs/html-intl/intl/zh-cn/training/articles/scoped-directory-access.jd
+++ b/docs/html-intl/intl/zh-cn/training/articles/scoped-directory-access.jd
@@ -8,8 +8,8 @@
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>本文内容</h2>
<ol>
<li><a href="#accessing">访问外部存储目录</a></li>
diff --git a/docs/html-intl/intl/zh-cn/training/tv/playback/picture-in-picture.jd b/docs/html-intl/intl/zh-cn/training/tv/playback/picture-in-picture.jd
index 782b5b8..6cfa815 100644
--- a/docs/html-intl/intl/zh-cn/training/tv/playback/picture-in-picture.jd
+++ b/docs/html-intl/intl/zh-cn/training/tv/playback/picture-in-picture.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>本文内容</h2>
<ol>
diff --git a/docs/html-intl/intl/zh-cn/training/tv/tif/content-recording.jd b/docs/html-intl/intl/zh-cn/training/tv/tif/content-recording.jd
index 2dec87d..754e065 100644
--- a/docs/html-intl/intl/zh-cn/training/tv/tif/content-recording.jd
+++ b/docs/html-intl/intl/zh-cn/training/tv/tif/content-recording.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>本文内容</h2>
<ol>
<li><a href="#supporting">指示支持录制</a></li>
diff --git a/docs/html-intl/intl/zh-tw/training/articles/direct-boot.jd b/docs/html-intl/intl/zh-tw/training/articles/direct-boot.jd
index 7e4ea73..fdcb172 100644
--- a/docs/html-intl/intl/zh-tw/training/articles/direct-boot.jd
+++ b/docs/html-intl/intl/zh-tw/training/articles/direct-boot.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>此文件內容</h2>
<ol>
<li><a href="#run">要求直接開機期間的執行權限</a></li>
diff --git a/docs/html-intl/intl/zh-tw/training/articles/scoped-directory-access.jd b/docs/html-intl/intl/zh-tw/training/articles/scoped-directory-access.jd
index 0aa0034..b1c1a76 100644
--- a/docs/html-intl/intl/zh-tw/training/articles/scoped-directory-access.jd
+++ b/docs/html-intl/intl/zh-tw/training/articles/scoped-directory-access.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>此文件內容</h2>
<ol>
<li><a href="#accessing">存取外部儲存空間目錄</a></li>
diff --git a/docs/html-intl/intl/zh-tw/training/tv/playback/picture-in-picture.jd b/docs/html-intl/intl/zh-tw/training/tv/playback/picture-in-picture.jd
index b051985..e643f65d 100644
--- a/docs/html-intl/intl/zh-tw/training/tv/playback/picture-in-picture.jd
+++ b/docs/html-intl/intl/zh-tw/training/tv/playback/picture-in-picture.jd
@@ -4,8 +4,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>此文件內容</h2>
<ol>
diff --git a/docs/html-intl/intl/zh-tw/training/tv/tif/content-recording.jd b/docs/html-intl/intl/zh-tw/training/tv/tif/content-recording.jd
index d857477..8b3a5ce 100644
--- a/docs/html-intl/intl/zh-tw/training/tv/tif/content-recording.jd
+++ b/docs/html-intl/intl/zh-tw/training/tv/tif/content-recording.jd
@@ -5,8 +5,8 @@
@jd:body
-<div id="qv-wrapper">
-<div id="qv">
+<div id="tb-wrapper">
+<div id="tb">
<h2>此文件內容</h2>
<ol>
<li><a href="#supporting">指出錄製支援</a></li>
diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml
index 3dcc736..00a7edd 100644
--- a/docs/html/_redirects.yaml
+++ b/docs/html/_redirects.yaml
@@ -479,6 +479,14 @@
to: /distribute/stories/index.html
- from: /distribute/stories/tablets.html
to: /distribute/stories/index.html
+- from: /distribute/stories/glu-dh.html
+ to: /distribute/stories/games/glu-dh.html
+- from: /distribute/stories/apps/tapps.html
+ to: /distribute/stories/games/tapps.html
+- from: /distribute/stories/apps/upbeat-games.html
+ to: /distribute/stories/games/upbeat-games.html
+- from: /distribute/stories/games/two-dots.html
+ to: /distribute/stories/games/dots.html
- from: /distribute/googleplay/edu/index.html
to: /distribute/googleplay/edu/about.html
- from: /distribute/googleplay/edu/contact.html
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index 3cbfde9..f5d23e8 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -59,7 +59,7 @@
</div>
-<p style="clear:both"><em>Data collected during a 7-day period ending on July 11, 2016.
+<p style="clear:both"><em>Data collected during a 7-day period ending on August 1, 2016.
<br/>Any versions with less than 0.1% distribution are not shown.</em>
</p>
@@ -81,7 +81,7 @@
</div>
-<p style="clear:both"><em>Data collected during a 7-day period ending on July 11, 2016.
+<p style="clear:both"><em>Data collected during a 7-day period ending on August 1, 2016.
<br/>Any screen configurations with less than 0.1% distribution are not shown.</em></p>
@@ -101,7 +101,7 @@
<img alt="" style="float:right"
-src="//chart.googleapis.com/chart?chl=GL%202.0%7CGL%203.0%7CGL%203.1&chf=bg%2Cs%2C00000000&chd=t%3A47.5%2C41.9%2C10.6&chco=c4df9b%2C6fad0c&cht=p&chs=400x250">
+src="//chart.googleapis.com/chart?chl=GL%202.0%7CGL%203.0%7CGL%203.1&chf=bg%2Cs%2C00000000&chd=t%3A46.0%2C42.6%2C11.4&chco=c4df9b%2C6fad0c&cht=p&chs=400x250">
<p>To declare which version of OpenGL ES your application requires, you should use the {@code
android:glEsVersion} attribute of the <a
@@ -119,21 +119,21 @@
</tr>
<tr>
<td>2.0</td>
-<td>47.5%</td>
+<td>46.0%</td>
</tr>
<tr>
<td>3.0</td>
-<td>41.9%</td>
+<td>42.6%</td>
</tr>
<tr>
<td>3.1</td>
-<td>10.6%</td>
+<td>11.4%</td>
</tr>
</table>
-<p style="clear:both"><em>Data collected during a 7-day period ending on July 11, 2016</em></p>
+<p style="clear:both"><em>Data collected during a 7-day period ending on August 1, 2016</em></p>
@@ -147,19 +147,19 @@
"Large": {
"hdpi": "0.5",
"ldpi": "0.2",
- "mdpi": "4.4",
+ "mdpi": "4.3",
"tvdpi": "2.1",
"xhdpi": "0.5"
},
"Normal": {
- "hdpi": "40.9",
- "mdpi": "4.1",
+ "hdpi": "40.0",
+ "mdpi": "3.8",
"tvdpi": "0.1",
- "xhdpi": "26.3",
- "xxhdpi": "15.1"
+ "xhdpi": "27.3",
+ "xxhdpi": "15.5"
},
"Small": {
- "ldpi": "1.9"
+ "ldpi": "1.8"
},
"Xlarge": {
"hdpi": "0.3",
@@ -167,8 +167,8 @@
"xhdpi": "0.7"
}
},
- "densitychart": "//chart.googleapis.com/chart?chco=c4df9b%2C6fad0c&chd=t%3A2.1%2C11.4%2C2.2%2C41.7%2C27.5%2C15.1&chf=bg%2Cs%2C00000000&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chs=400x250&cht=p",
- "layoutchart": "//chart.googleapis.com/chart?chco=c4df9b%2C6fad0c&chd=t%3A3.9%2C7.7%2C86.5%2C1.9&chf=bg%2Cs%2C00000000&chl=Xlarge%7CLarge%7CNormal%7CSmall&chs=400x250&cht=p"
+ "densitychart": "//chart.googleapis.com/chart?chd=t%3A2.0%2C11.0%2C2.2%2C40.8%2C28.5%2C15.5&chf=bg%2Cs%2C00000000&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&cht=p&chs=400x250&chco=c4df9b%2C6fad0c",
+ "layoutchart": "//chart.googleapis.com/chart?chd=t%3A3.9%2C7.6%2C86.7%2C1.8&chf=bg%2Cs%2C00000000&chl=Xlarge%7CLarge%7CNormal%7CSmall&cht=p&chs=400x250&chco=c4df9b%2C6fad0c"
}
];
@@ -176,7 +176,7 @@
var VERSION_DATA =
[
{
- "chart": "//chart.googleapis.com/chart?chco=c4df9b%2C6fad0c&chd=t%3A0.1%2C1.9%2C1.7%2C17.8%2C30.2%2C35.1%2C13.3&chf=bg%2Cs%2C00000000&chl=Froyo%7CGingerbread%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat%7CLollipop%7CMarshmallow&chs=500x250&cht=p",
+ "chart": "//chart.googleapis.com/chart?chd=t%3A0.1%2C1.7%2C1.6%2C16.7%2C29.2%2C35.5%2C15.2&chf=bg%2Cs%2C00000000&chl=Froyo%7CGingerbread%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat%7CLollipop%7CMarshmallow&cht=p&chs=500x250&chco=c4df9b%2C6fad0c",
"data": [
{
"api": 8,
@@ -186,47 +186,47 @@
{
"api": 10,
"name": "Gingerbread",
- "perc": "1.9"
+ "perc": "1.7"
},
{
"api": 15,
"name": "Ice Cream Sandwich",
- "perc": "1.7"
+ "perc": "1.6"
},
{
"api": 16,
"name": "Jelly Bean",
- "perc": "6.4"
+ "perc": "6.0"
},
{
"api": 17,
"name": "Jelly Bean",
- "perc": "8.8"
+ "perc": "8.3"
},
{
"api": 18,
"name": "Jelly Bean",
- "perc": "2.6"
+ "perc": "2.4"
},
{
"api": 19,
"name": "KitKat",
- "perc": "30.1"
+ "perc": "29.2"
},
{
"api": 21,
"name": "Lollipop",
- "perc": "14.3"
+ "perc": "14.1"
},
{
"api": 22,
"name": "Lollipop",
- "perc": "20.8"
+ "perc": "21.4"
},
{
"api": 23,
"name": "Marshmallow",
- "perc": "13.3"
+ "perc": "15.2"
}
]
}
diff --git a/docs/html/distribute/googleplay/developer-console.jd b/docs/html/distribute/googleplay/developer-console.jd
index c826e82..5a6c96fc 100644
--- a/docs/html/distribute/googleplay/developer-console.jd
+++ b/docs/html/distribute/googleplay/developer-console.jd
@@ -10,30 +10,30 @@
<div id="qv">
<h2>Features</h2>
<ol>
- <li><a href="#latest">Latest blog posts</a></li>
- <li><a href="#publish">Publish with confidence</a></li>
- <li><a href="#aquire-users">Acquire users</a></li>
- <li><a href="#insights">Actionable insights</a></li>
- <li><a href="#manage">Manage your app</a></li>
+ <li><a href="#latest">Latest Blog Posts</a></li>
+ <li><a href="#publish">Publish with Confidence</a></li>
+ <li><a href="#aquire-users">Acquire Users</a></li>
+ <li><a href="#insights">Learn about Users and App Performance</a></li>
+ <li><a href="#manage">Manage Your App</a></li>
</ol>
</div>
</div>
<p>
- The <a href="https://play.google.com/apps/publish/">Google Play Developer
- Console</a> is your home for publishing operations and tools.
+ The <a class="external-link" href="https://play.google.com/apps/publish/">Google Play Developer
+ Console</a> is your home for publishing and managing your apps.
</p>
<img src="{@docRoot}images/distribute/googleplay/gp-devconsole-home.png" style="width:480px;">
<p>
- Upload apps, build your product pages, configure prices and distribution, and
- publish. You can manage all phases of publishing on Google Play through the
- Developer Console, from any web browser.
+ You can manage all phases of publishing on Google Play through the Developer
+ Console. Using any web browser, you can upload apps, build product pages, set
+ prices, configure distribution, and publish apps.
</p>
<p>
- Once you've <a href=
+ After you've <a href=
"{@docRoot}distribute/googleplay/start.html">registered</a> and received
verification by email, you can sign in to your Google Play Developer Console.
</p>
@@ -44,7 +44,7 @@
<div class="dynamic-grid">
<div class="headerLine">
-<h2 id="latest">Latest blog posts</h2>
+<h2 id="latest">Latest Blog Posts</h2>
</div>
<div class="resource-widget resource-flow-layout col-13"
@@ -54,31 +54,10 @@
data-maxResults="3"></div>
</div>
-<h2 id="publish">Publish with confidence</h2>
-
+<h2 id="publish">Publish with Confidence</h2>
+<p>The Developer Console provides rich testing features and staged rollouts that help you to
+ provide apps that satisfy your users.</p>
<div class="wrap">
- <h3 id="alpha-beta">Alpha and beta tests</h3>
-
- <div class="cols" style="margin-top:2em;">
- <div class="col-3of12">
- <p>
- Distribute your pre-release app to users as an open beta with a
- one-click, opt-in URL or as a closed beta using an email list, Google
- Group, or Google+ community. Users can then provide feedback, while not
- affecting your app’s public reviews and rating. This valuable feedback
- will help you test features and improve the quality of your app.
- <a href="{@docRoot}distribute/engage/beta.html">Learn more</a>.
- </p>
- </div>
-
- <div class="col-8of12 col-push-1of12">
- <img src=
- "{@docRoot}images/distribute/googleplay/dev-console_running-a-beta-test.png"
- srcset=
- "{@docRoot}images/distribute/googleplay/dev-console_running-a-beta-test.png 1x, {@docRoot}images/distribute/googleplay/dev-console_running-a-beta-test_2x.png 2x"
- width="500">
- </div>
- </div>
<h3 id="cloud-test">Cloud Test Lab</h3>
@@ -87,8 +66,8 @@
<p>
Get free automated testing of your app on physical devices covering
nearly every brand, model, and version of the devices your users might
- be using. The lab will help you quickly find compatibility issues you
- may miss using only your available test devices. Sign-up in the
+ have. The lab helps you quickly find compatibility issues that you
+ might miss using only your available test devices. Sign up in the
Developer Console to become an early tester before this feature becomes
more widely available. <a href=
"https://developers.google.com/cloud-test-lab/" class=
@@ -100,57 +79,85 @@
<img src=
"{@docRoot}images/distribute/googleplay/dev-console_cloud-test-lab.png"
srcset=
- "{@docRoot}images/distribute/googleplay/dev-console_cloud-test-lab.png 1x, {@docRoot}images/distribute/googleplay/dev-console_cloud-test-lab_2x.png 2x"
+ "{@docRoot}images/distribute/googleplay/dev-console_cloud-test-lab.png 1x,
+ {@docRoot}images/distribute/googleplay/dev-console_cloud-test-lab_2x.png 2x"
width="500">
</div>
</div>
</div>
+ <h3 id="alpha-beta">Alpha and beta tests</h3>
+
+ <div class="cols" style="margin-top:2em;">
+ <div class="col-3of12">
+ <p>
+ Collect user feedback on early versions of your app with alpha and beta testing.
+ Distribute your pre-release app to users as an open beta with a
+ one-click, opt-in URL or as a closed beta using an email list, Google
+ Group, or Google+ community. Users can provide feedback, while not
+ affecting your app’s public reviews and rating. This valuable feedback
+ helps you test features and improve the quality of your app.
+ <a href="{@docRoot}distribute/engage/beta.html">Learn more</a>.
+ </p>
+ </div>
+
+ <div class="col-8of12 col-push-1of12">
+ <img src=
+ "{@docRoot}images/distribute/googleplay/dev-console_running-a-beta-test.png"
+ srcset=
+ "{@docRoot}images/distribute/googleplay/dev-console_running-a-beta-test.png 1x,
+ {@docRoot}images/distribute/googleplay/dev-console_running-a-beta-test_2x.png 2x"
+ width="500">
+ </div>
+ </div>
+
<h3 id="staged-rollouts">Staged rollouts</h3>
<p>
- Release app updates progressively to an increasing portion of your users and
- monitor for missed issues. Then take the opportunity to fix problems before
- all your users are affected. <a href=
+Discover and fix problems with a limited user base before making a wider release.
+With staged rollouts, you can release app updates progressively to an increasing portion of
+ your users.
+You can fix problems before your app reaches the broader user community. <a href=
"https://support.google.com/googleplay/android-developer/answer/3131213"
- class="external-link">Learn more.</a>
+ class="external-link">Learn more</a>.
</p>
-<p class="aside">
- <strong>Tip:</strong> If you find an issue during a rollout stage you can
- halt the rollout to further minimize the effect, and then resume rollout once
- a fix has been made.
+<p class="note">
+ <strong>Tip:</strong> If you find an issue during a rollout stage, you can
+ halt the rollout, make the fix, and then resume.
</p>
-<h2 id="aquire-users">Aquire users</h2>
-
- <h3 id="adwords">AdWords Universal App Campaigns</h3>
+<h2 id="aquire-users">Acquire Users</h2>
+<p>Using the Developer Console, you can configure targeted ads to present your app to more users.
+ You can test variations of your Play Store listings and track user responses.</p>
+ <h3 id="adwords">Promote your app with AdWords</h3>
<p>
- Easily and conveniently buy AdWords app install ads, across Search
+ Easily and conveniently buy AdWords app install ads. AdWords Universal App Campaigns
+ appear across Search
(including Play Search), YouTube, AdMob, and the Google Display Network.
- Simply set a budget and cost per acquisition and Google takes care of the
+ Set a budget and cost per acquisition, and Google takes care of the
rest. <a href="{@docRoot}distribute/users/promote-with-ads.html">Learn
more</a>.
</p>
<div class="wrap">
- <h3 id="listing-experiments">Store Listing Experiments</h3>
+ <h3 id="listing-experiments">Increase installs with improved store listings</h3>
<div class="cols" style="margin-top:2em;">
<div class="col-3of12">
- <p>
- Test variations of the images and text used to promote and describe
- your app on your Play store listing. Then when enough data has been
- collected, choose to make the winning combination visible on Google
+ <p>With store listing experiments,
+ you can test variations of your app's Play Store listing.
+ You can try different combinations of images and text used to promote and describe
+ your app on its Play Store listing. Collect data, choose the best combination, and make
+ it visible on Google
Play. <a href="{@docRoot}distribute/users/experiments.html">Learn
more</a>.
</p>
- <p class="aside">
- <strong>Tip:</strong> You can even try out different orders for your
- screenshots and other images to discover which grabs users’ attention
- the best.
+ <p class="note">
+ <strong>Tip:</strong> You can reorder your screenshots and other images in different ways
+ to determine the arrangement that best attracts users.
</p>
</div>
@@ -158,20 +165,21 @@
<img src=
"{@docRoot}images/distribute/googleplay/dev-console_store-listing-experiment.png"
srcset=
- "{@docRoot}images/distribute/googleplay/dev-console_store-listing-experiment.png 1x, {@docRoot}images/distribute/googleplay/dev-console_store-listing-experiment_2x.png 2x"
+ "{@docRoot}images/distribute/googleplay/dev-console_store-listing-experiment.png 1x,
+ {@docRoot}images/distribute/googleplay/dev-console_store-listing-experiment_2x.png 2x"
width="500">
</div>
</div>
- <h3 id="user-perf-report">User Acquisition performance report</h3>
+ <h3 id="user-perf-report">User acquisition performance report</h3>
<div class="cols" style="margin-top:2em;">
<div class="col-3of12">
<p>
- Discover where visitors to your Play Store listing come from, how many
- go on to install your app, and how many buy your in-app products in the
- User Acquisition performance report; compare cohorts, examine
- acquisition channels, and see details of users and buyers. <a href=
+ Discover information about visitors to your Play Store listing, such as where they come
+ from, how many go on to install your app, and how many buy your in-app products. You
+ can also compare cohorts, examine acquisition channels, and see details of users and
+ buyers. <a href=
"{@docRoot}distribute/users/user-acquisition.html">Learn more</a>.
</p>
</div>
@@ -180,14 +188,16 @@
<img src=
"{@docRoot}images/distribute/googleplay/dev-console_conversion-funnel.png"
srcset=
- "{@docRoot}images/distribute/googleplay/dev-console_conversion-funnel.png 1x, {@docRoot}images/distribute/googleplay/dev-console_conversion-funnel_2x.png 2x"
+ "{@docRoot}images/distribute/googleplay/dev-console_conversion-funnel.png 1x,
+ {@docRoot}images/distribute/googleplay/dev-console_conversion-funnel_2x.png 2x"
width="500">
</div>
</div>
</div>
-<h2 id="insights">Actionable insights</h2>
-
+<h2 id="insights">Learn about App Users and Performance</h2>
+<p>Using the Developer console, you can gain valuable insights about app performance.
+ You can better understand user behavior and find out ways to optimize your app. </p>
<div class="wrap">
<h3 id="player-analytics">Player Analytics</h3>
@@ -195,8 +205,10 @@
<div class="cols" style="margin-top:2em;">
<div class="col-3of12">
<p>
- With Google Play game services integration, discover more about the
- behaviour of your game players; how they play and how they buy. Also get
+ Google Play game services offers a comprehensive dashboard of player and engagement
+ statistics.
+ With Player Analytics, discover more about the
+ behavior of your game users, including how they play and how they buy. Also get
help setting and monitoring revenue budgets. <a href=
"{@docRoot}distribute/engage/game-services.html">Learn more</a>.
</p>
@@ -206,7 +218,8 @@
<img src=
"{@docRoot}images/distribute/googleplay/dev-console_player-analytics.png"
srcset=
- "{@docRoot}images/distribute/googleplay/dev-console_player-analytics.png 1x, {@docRoot}images/distribute/googleplay/dev-console_player-analytics_2x.png 2x"
+ "{@docRoot}images/distribute/googleplay/dev-console_player-analytics.png 1x,
+ {@docRoot}images/distribute/googleplay/dev-console_player-analytics_2x.png 2x"
width="500">
</div>
</div>
@@ -216,74 +229,77 @@
<div class="cols" style="margin-top:2em;">
<div class="col-3of12">
<p>
- Get a wide range of reports on the performance of your app and behaviour
- of users; such as installs, revenue, crashes, and more. Turn on email
- alerts to be notified of any sudden changes to important stats. <a href=
- "https://support.google.com/googleplay/android-developer/topic/3450942?ref_topic=3450986"
- class="external-link">Learn more.</a>
+ Get a wide range of reports on the performance of your app and behavior
+ of users such as installs, revenue, and crashes. Turn on email
+ alerts to receive notifications of any sudden changes to important stats. <a href=
+ "https://support.google.com/googleplay/android-developer/topic/3450942?ref_topic=3450986"
+ class="external-link">Learn more</a>.
</p>
</div>
<div class="col-8of12 col-push-1of12">
<img src=
"{@docRoot}images/distribute/googleplay/dev-console_statistics.png" srcset=
- "{@docRoot}images/distribute/googleplay/dev-console_statistics.png 1x, {@docRoot}images/distribute/googleplay/dev-console_statistics_2x.png 2x"
+ "{@docRoot}images/distribute/googleplay/dev-console_statistics.png 1x,
+ {@docRoot}images/distribute/googleplay/dev-console_statistics_2x.png 2x"
width="500">
</div>
</div>
</div>
-<h3 id="optimization"> Optimization tips</h3>
+<h3 id="optimization">Optimization tips</h3>
<p>
- Get tips, based on automatic app scanning, on ways in which you can improve
- your app, everything from updating old APIs to suggestions for languages you
- should consider localizing to.
+ Automatic app scanning provides tips on ways to improve your apps—everything
+ from updating old APIs to suggested languages for localization.
</p>
-<h2 id="manage">Manage your app</h2>
+<h2 id="manage">Manage Your App</h2>
<h3 id="manage-apks">Manage your APKs</h3>
<p>
Upload and manage your Android application packages (APK) to the Developer
- Console as drafts or to your Alpha, Beta, or Production channels. <a href=
+ Console as drafts or to your Alpha, Beta, or Production channels. <a href=
"https://support.google.com/googleplay/android-developer/answer/113469?ref_topic=3450986"
- class="external-link">Learn more.</a>
+ class="external-link">Learn more</a>.
</p>
-<p class="aside">
- <strong>Tip:</strong> Ensure users get the best possible experience for the
+<p class="note">
+ <strong>Tip:</strong> Ensure that users get the best possible experience for the
smallest app downloads by creating multiple APKs with just the right content
- for device screen size, hardware features and more.
+ for hardware features such as screen size. For more information about using multiple APKs,
+ see <a href="https://developer.android.com/training/multiple-apks/index.html">
+ Maintaining Multiple APKs.</a>
</p>
<h3 id="iap">In-app products and subscriptions</h3>
<p>
- Manage your in-app products and price them for local markets accordingly.
- Offer weekly, monthly, annual, or seasonal subscriptions and take advantage
- of features such as grace periods and trials. <a href=
+ Manage your in-app products and price them for local markets.
+ Offer weekly, monthly, annual, or seasonal subscriptions. Attract new users
+ with features such as grace periods and trials. <a href=
"https://support.google.com/googleplay/android-developer/topic/3452896?ref_topic=3452890"
- class="external-link">Learn more.</a>
+ class="external-link">Learn more</a>.
</p>
<h3 id="pricing">Pricing and distribution</h3>
<p>
- Control the price of your app for each country you choose to distribute to.
- Make your app available to new audiences — opt-in to Android Auto, Android
+ Control the price of your app for each country that you distribute to.
+ Make your app available to new audiences—opt-in to Android Auto, Android
TV, and Android Wear, as well as Designed for Families, Google Play for Work,
and Google Play for Education. <a href=
"https://support.google.com/googleplay/android-developer/answer/113469#pricing"
class="external-link">Learn more</a>.
</p>
-<p class="external-link">
- <strong>Tip:</strong> You can set prices in other countries automatically
- based on current exchange rates using the <strong>auto-convert prices
- now</strong> feature.
+<p class="note">
+ <strong>Note:</strong> When you distribute your app to countries that use other currencies,
+ the Google Play Developer Console autofills country-specific prices based on current exchange
+ rates and locally-relevant pricing patterns. You can update the exchange rates manually by
+ selecting <strong>Refresh exchange rates</strong>.
</p>
<p style="clear:both">
diff --git a/docs/html/distribute/stories/apps/aftenposten.jd b/docs/html/distribute/stories/apps/aftenposten.jd
index 149e6bb..a813c00 100644
--- a/docs/html/distribute/stories/apps/aftenposten.jd
+++ b/docs/html/distribute/stories/apps/aftenposten.jd
@@ -2,7 +2,7 @@
page.metaDescription=Aftenposten upgraded their app and improved user retention.
page.tags="developerstory", "apps", "googleplay"
page.image=images/cards/distribute/stories/aftenposten.png
-page.timestamp=1468270114
+page.timestamp=1468901834
@jd:body
diff --git a/docs/html/distribute/stories/apps/el-mundo.jd b/docs/html/distribute/stories/apps/el-mundo.jd
index 2ee813d..2dbaeea 100644
--- a/docs/html/distribute/stories/apps/el-mundo.jd
+++ b/docs/html/distribute/stories/apps/el-mundo.jd
@@ -2,7 +2,7 @@
page.metaDescription=El Mundo uses Material Design principles to enhance their app's user experience.
page.tags="developerstory", "apps", "googleplay"
page.image=images/cards/distribute/stories/el-mundo.png
-page.timestamp=1468270112
+page.timestamp=1468901833
@jd:body
diff --git a/docs/html/distribute/stories/apps/segundamano.jd b/docs/html/distribute/stories/apps/segundamano.jd
index 4cbf817..7ed4d8e 100644
--- a/docs/html/distribute/stories/apps/segundamano.jd
+++ b/docs/html/distribute/stories/apps/segundamano.jd
@@ -2,7 +2,7 @@
page.metaDescription=Segundamano developed Android app to increase potential for growth.
page.tags="developerstory", "apps", "googleplay"
page.image=images/cards/distribute/stories/segundamano.png
-page.timestamp=1468270110
+page.timestamp=1468901832
@jd:body
diff --git a/docs/html/distribute/stories/glu-dh.jd b/docs/html/distribute/stories/games/glu-dh.jd
similarity index 100%
rename from docs/html/distribute/stories/glu-dh.jd
rename to docs/html/distribute/stories/games/glu-dh.jd
diff --git a/docs/html/distribute/stories/apps/tapps.jd b/docs/html/distribute/stories/games/tapps.jd
similarity index 98%
rename from docs/html/distribute/stories/apps/tapps.jd
rename to docs/html/distribute/stories/games/tapps.jd
index 1292139..221b9a8 100644
--- a/docs/html/distribute/stories/apps/tapps.jd
+++ b/docs/html/distribute/stories/games/tapps.jd
@@ -1,8 +1,8 @@
page.title=Tapps Games Increases Installs by More Than 20% with Store Listing Experiments
page.metaDescription=Tapps Games increased their use of store listing experiments in the Developer Console, with impressive results.
-page.tags="developerstory", "apps", "googleplay"
+page.tags="developerstory", "games", "googleplay"
page.image=images/cards/distribute/stories/tapps.png
-page.timestamp=1468270108
+page.timestamp=1468901831
@jd:body
diff --git a/docs/html/distribute/stories/games/two-dots.jd b/docs/html/distribute/stories/games/two-dots.jd
deleted file mode 100644
index a2299ce..0000000
--- a/docs/html/distribute/stories/games/two-dots.jd
+++ /dev/null
@@ -1,77 +0,0 @@
-page.title=Two Dots increased installs by 7 percent using Store Listing Experiments
-page.metaDescription=Two Dots, the sequel to the popular game Dots, is a free-to-play puzzle game launched by Playdots, Inc. Playdots decided to use Store Listing Experiments to see if adding a call to action in the games’ store listing short descriptions had an impact on installs.
-page.tags="developerstory", "games", "googleplay"
-page.image=images/cards/distribute/stories/two-dots.png
-page.timestamp=1456431511
-
-@jd:body
-
-
-<h3>Background</h3>
-
-<div class="figure" style="width:113px">
- <img src="{@docRoot}images/distribute/stories/two-dots-icon.png"
- height="113" />
-</div>
-
-<p>
- <a class="external-link"
- href="https://play.google.com/store/apps/details?id=com.weplaydots.twodotsandroid&hl=en">
- Two Dots</a>, the sequel to the popular game
- <a class="external-link"
- href="https://play.google.com/store/apps/details?id=com.nerdyoctopus.gamedots&hl=en">
- Dots</a>, is a free-to-play puzzle game launched by Playdots, Inc. in May
- 2014. Since launch it has gained over 30 million downloads, seen over five
- billion games played, and achieved 15 times the revenue of the original Dots
- game within a year. Dots decided to use
- <a class="external-link"
- href="https://support.google.com/googleplay/android-developer/answer/6227309">
- Store Listing Experiments</a> to see if adding a call to action in the games'
- store listing short descriptions had an impact on installs.
-
-</p>
-
-<h3>What they did</h3>
-
-<p>
- Dots used localized store listing experiments in the Google Play Developer
- Console to test both games’ short descriptions. They compared the games’
- current descriptions — the control, with no call to action — against variant
- descriptions, targeting half of their traffic with the variant descriptions.
-</p>
-
-<h3>Results</h3>
-
-<p>
- The results showed that the addition of a call to action in the short
- description had a positive impact on installs.
-</p>
-
-
- <img
- src="{@docRoot}images/distribute/stories/two-dots-screenshot.png"
- srcset=
- "{@docRoot}images/distribute/stories/two-dots-screenshot.png 1x
- {@docRoot}images/distribute/stories/two-dots-screenshot_2x.png 2x">
- <p class="img-caption">
- Beautifully designed achievements badges encourage unlock
- </p>
-
-
-<p>
- In Dots, the conversion rate increased by 2 percent with a simple call to
- action in the variant text. In Two Dots, where a call to action was combined
- with messaging that the game is the “best puzzle game on Android”, conversion
- rates increased by 7 percent compared to the control description.
-</p>
-
-<h3>Get started</h3>
-
-<p>
- Learn how to run
- <a clas="external-link"
- href="https://support.google.com/googleplay/android-developer/answer/6227309">
- Store Listing Experiments</a> and read our best practices for
- <a href="https://developer.android.com/distribute/users/experiments.html">
- running successful experiments</a>.
-</p>
diff --git a/docs/html/distribute/stories/apps/upbeat-games.jd b/docs/html/distribute/stories/games/upbeat-games.jd
similarity index 96%
rename from docs/html/distribute/stories/apps/upbeat-games.jd
rename to docs/html/distribute/stories/games/upbeat-games.jd
index 02222d3..16a1d51 100644
--- a/docs/html/distribute/stories/apps/upbeat-games.jd
+++ b/docs/html/distribute/stories/games/upbeat-games.jd
@@ -1,8 +1,8 @@
page.title=Witch Puzzle Achieves 98% of International Installs on Android
page.metaDescription=Witch Puzzle localized their app into 12 languages.
-page.tags="developerstory", "apps", "googleplay"
+page.tags="developerstory", "games", "googleplay"
page.image=images/cards/distribute/stories/witch-puzzle.png
-page.timestamp=1468270106
+page.timestamp=1468901832
@jd:body
diff --git a/docs/html/distribute/stories/index.jd b/docs/html/distribute/stories/index.jd
index 8fe1019..1adc5ae 100644
--- a/docs/html/distribute/stories/index.jd
+++ b/docs/html/distribute/stories/index.jd
@@ -19,21 +19,43 @@
<section class="dac-section dac-small" id="latest-apps"><div class="wrap">
<h2 class="norule">Latest from apps</h2>
+ <h3 class="norule">Videos</h3>
+
<div class="resource-widget resource-flow-layout col-16"
- data-query="type:distribute+tag:developerstory+tag:apps, type:youtube+tag:developerstory+tag:apps"
+ data-query="type:youtube+tag:developerstory+tag:apps"
data-sortOrder="-timestamp"
data-cardSizes="6x6"
data-items-per-page="15"
- data-initial-results="9"></div>
+ data-initial-results="6"></div>
+
+ <h3 class="norule">Articles</h3>
+
+ <div class="resource-widget resource-flow-layout col-16"
+ data-query="type:distribute+tag:developerstory+tag:apps"
+ data-sortOrder="-timestamp"
+ data-cardSizes="6x6"
+ data-items-per-page="15"
+ data-initial-results="6"></div>
</div></section>
<section class="dac-section dac-small" id="latest-games"><div class="wrap">
<h2 class="norule">Latest from games</h2>
+ <h3 class="norule">Videos</h3>
+
<div class="resource-widget resource-flow-layout col-16"
- data-query="type:distribute+tag:developerstory+tag:games,type:youtube+tag:developerstory+tag:games"
+ data-query="type:youtube+tag:developerstory+tag:games"
data-sortOrder="-timestamp"
data-cardSizes="6x6"
data-items-per-page="15"
- data-initial-results="9"></div>
+ data-initial-results="6"></div>
+
+ <h3 class="norule">Articles</h3>
+
+ <div class="resource-widget resource-flow-layout col-16"
+ data-query="type:distribute+tag:developerstory+tag:games"
+ data-sortOrder="-timestamp"
+ data-cardSizes="6x6"
+ data-items-per-page="15"
+ data-initial-results="6"></div>
</div></section>
diff --git a/docs/html/google/play/billing/billing_overview.jd b/docs/html/google/play/billing/billing_overview.jd
index a05cc8d..7d932b7 100644
--- a/docs/html/google/play/billing/billing_overview.jd
+++ b/docs/html/google/play/billing/billing_overview.jd
@@ -7,19 +7,20 @@
<div id="qv">
<h2>Quickview</h2>
<ul>
- <li>Use In-app Billing to sell digital goods, including one-time items and
+ <li>Use In-app Billing to sell digital products, including one-time products and
recurring subscriptions.</li>
- <li>Supported for any app published on Google Play. You only need a Google
+ <li>In-app Billing is supported for any app published on Google Play. You need only a
+ Google
Play Developer Console account and a Google payments merchant account.</li>
- <li>Checkout processing is automatically handled by Google Play, with the
-same look-and-feel as for app purchases.</li>
+ <li>Google Play automatically handles checkout processing with the
+same look and feel as app purchases.</li>
</ul>
<h2>In this document</h2>
<ol>
<li><a href="#api">In-app Billing API</a></li>
<li><a href="#products">In-app Products</a>
<ol>
- <li><a href="#prodtypes">Product Types</a>
+ <li><a href="#prodtypes">Product types</a>
</ol>
</li>
<li><a href="#console">Google Play Developer Console</a></li>
@@ -27,30 +28,33 @@
<li><a href="#samples">Sample App</a></li>
<li><a href="#migration">Migration Considerations</a></li>
</ol>
- <h2>Related Samples</h2>
+ <h2>Related samples</h2>
<ol>
<li><a href="{@docRoot}training/in-app-billing/preparing-iab-app.html#GetSample">Sample
Application (V3)</a></li>
</ol>
- <h2>Related Videos</h2>
+ <h2>Related videos</h2>
<ol>
- <li><a href="https://www.youtube.com/watch?v=UvCl5Xx7Z5o">Implementing
+ <li><a class="external-link" href="https://www.youtube.com/watch?v=UvCl5Xx7Z5o">
+ Implementing
Freemium</a></li>
</ol>
</div>
</div>
-<p>This documentation describes the fundamental In-app Billing components and
+<p>This document describes the fundamental In-app Billing components and
features that you need to understand in order to add In-app
Billing features into your application.</p>
-<p class="note"><b>Note</b>: Ensure that you comply with applicable laws in the countries where you
-distribute apps. For example, in EU countries, laws based on the
-<a href="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2005:149:0022:0039:EN:PDF">
-Unfair Commercial Practices Directive</a> prohibit direct exhortations to children to buy advertised
-products or to persuade their parents or other adults to buy advertised products for them.
-See the
-<a href="http://ec.europa.eu/consumers/enforcement/docs/common_position_on_online_games_en.pdf">
+<p class="note"><b>Note</b>: Ensure that you comply with applicable laws in the countries where
+ you distribute apps. For example, in EU countries, laws based on the
+<a class="external-link"
+ href="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2005:149:0022:0039:EN:PDF">
+Unfair Commercial Practices Directive</a> prohibit direct exhortations to children to buy
+ advertised products or to persuade their parents or other adults to buy advertised products
+ for them. See the
+<a class="external-link"
+ href="http://ec.europa.eu/consumers/enforcement/docs/common_position_on_online_games_en.pdf">
position of the EU consumer protection authorities</a> for more information on this and other
topics.
</p>
@@ -61,75 +65,82 @@
app then conveys billing requests and responses between your
application and the Google Play server. In practice, your application never
directly communicates with the Google Play server. Instead, your application
-sends billing requests to the Google Play application over interprocess
+sends billing requests to the Google Play app over interprocess
communication (IPC) and receives responses from the Google Play app.
Your application does not manage any network connections between itself and
the Google Play server.</p>
-<p>In-app Billing can be implemented only in applications that you publish
+<p>You can implement In-app Billing only in applications that you publish
through Google Play. To complete in-app purchase requests, the Google Play app
must be able to access the Google Play server over the network.</p>
-<p>In-app billing Version 3 is the latest version, and maintains very broad
+<p>In-app Billing Version 3 is the latest version, and it maintains very broad
compatibility across the range of Android devices. In-app Billing Version 3 is
-supported on devices running Android 2.2 or higher that have the latest version
-of the Google Play store installed (<a
+supported on devices running Android 2.2 (API level 8) or higher that have the latest version
+of the Google Play app installed (<a
href="{@docRoot}about/dashboards/index.html">a vast majority</a> of active
devices).</p>
<h4>Version 3 features</h4>
+<p>In-app Billing Version 3 provides the following features:</p>
<ul>
-<li>Requests are sent through a streamlined API that allows you to easily request
-product details from Google Play, order in-app products, and quickly restore
-items based on users' product ownership</li>
-<li>Order information is synchronously propagated to the device on purchase
-completion</li>
-<li>All purchases are “managed” (that is, Google Play keeps track of the user's
-ownership of in-app products). The user cannot own multiple copies of an in-app
-item; only one copy can be owned at any point in time</li>
-<li>Purchased items can be consumed. When consumed, the item reverts to the
-"unowned" state and can be purchased again from Google Play</li>
-<li>Provides support for <a
- href="{@docRoot}google/play/billing/billing_subscriptions.html">subscriptions</a></li>
+<li>Your app sends requests through a streamlined API that allows users to easily request
+product details from Google Play and order in-app products. The API quickly restores
+products based on the user's ownership.</li>
+<li>The API synchronously propagates order information to the device on purchase
+completion.</li>
+<li>All purchases are <em>managed</em> (that is, Google Play keeps track of the user's
+ownership of in-app products). The user can't own multiple copies of an in-app
+product; only one copy can be owned at any point in time.</li>
+<li>Purchased products can be consumed. When consumed, the product reverts to the
+<em>unowned</em> state and can be purchased again from Google Play.</li>
+<li>The API provides support for <a
+ href="{@docRoot}google/play/billing/billing_subscriptions.html">subscriptions</a>.</li>
</ul>
<p>For details about other versions of In-app Billing, see the
<a href="{@docRoot}google/play/billing/versions.html">Version Notes</a>.</p>
<h2 id="products">In-app Products</h2>
-<p>In-app products are the digital goods that you offer for sale from inside your
-application to users. Examples of digital goods includes in-game currency,
+<p>In-app products are the digital products that you offer for sale to users from inside your
+application. Examples of digital products include in-game currency,
application feature upgrades that enhance the user experience, and new content
for your application.</p>
<p>You can use In-app Billing to sell only digital content.
-You cannot use In-app Billing to sell physical goods, personal services, or
-anything that requires physical delivery. Unlike with priced applications, once
-the user has purchased an in-app product there is no refund window.</p>
+You can't use In-app Billing to sell physical products, personal services, or
+anything that requires physical delivery. Unlike with priced applications, there is no refund
+ window after
+the user has purchased an in-app product.</p>
<p>Google Play does not provide any form of content delivery. You are
responsible for delivering the digital content that you sell in your
-applications. In-app products are always explicitly associated with one and
-only one app. That is, one application cannot purchase an in-app product
-published for another app, even if they are from the same developer.</p>
+applications. In-app products are always explicitly associated with
+ only one app. That is, one application can't purchase an in-app product
+that is published for another app, even if they are from the same developer.</p>
<h3 id="prodtypes">Product types</h3>
<p>In-app Billing supports different product types to give you flexibility in
how you monetize your application. In all cases, you define your products using
the Google Play Developer Console.</p>
-<p>You can specify these types of products for your In-app Billing application
-— <em>managed in-app products</em> and <em>subscriptions</em>. Google Play
-handles and tracks ownership for in-app products and subscriptions on your
-application on a per user account basis.
-<a href="{@docRoot}google/play/billing/api.html#producttypes">Learn more about
-the product types supported by In-app Billing Version 3</a>.</p>
+<p>You can specify two product types for your In-app Billing application:
+ <em>managed in-app products</em> and <em>subscriptions</em>. Google Play
+handles and tracks ownership for in-app products and subscriptions for your
+application on a per-user basis.
+<a href="{@docRoot}google/play/billing/api.html#producttypes">Learn more</a> about
+the product types supported by In-app Billing Version 3.</p>
<h2 id="console">Google Play Developer Console</h2>
<p>The Developer Console is where you can publish your
In-app Billing application and manage the various in-app products that are
available for purchase from your application.</p>
<p>You can create a product list of
-digital goods that are associated with your application, including items for
-one-time purchase and recurring subscriptions. For each item, you can define
-information such as the item’s unique product ID (also called its SKU), product
-type, pricing, description, and how Google Play should handle and track
-purchases for that product.</p>
+digital products that are associated with your application, including products for
+one-time purchase and recurring subscriptions. You can define
+information for each product such as the following:</p>
+<ul>
+<li>Unique product ID (also called its SKU).</li>
+<li>Product type.</li>
+<li>Pricing.</li>
+<li>Description.</li>
+<li>Google Play handling and tracking of purchases for that product.</li></p>
+</ul>
<p>If you sell several of your apps or in-app products at the same price, you
can add <em>pricing templates</em> to manage these price points from a
centralized location. When using pricing templates, you can include local taxes
@@ -146,7 +157,7 @@
In-app Billing</a>.</p>
<h2 id="checkout">Google Play Purchase Flow</h2>
-<p>Google Play uses the same checkout backend service as is used for application
+<p>Google Play uses the same backend checkout service that is used for application
purchases, so your users experience a consistent and familiar purchase flow.</p>
<p class="note"><strong>Important:</strong> You must have a Google payments
merchant account to use the In-app Billing service on Google Play.</p>
@@ -157,8 +168,8 @@
<p>When the checkout process is complete,
Google Play sends your application the purchase details, such as the order
number, the order date and time, and the price paid. At no point does your
-application have to handle any financial transactions; that role is provided by
-Google Play.</p>
+application have to handle any financial transactions; that role belongs to
+ Google Play.</p>
<h2 id="samples">Sample Application</h2>
<p>To help you integrate In-app Billing into your application, the Android SDK
@@ -166,16 +177,16 @@
from inside an app.</p>
<p>The <a href="{@docRoot}training/in-app-billing/preparing-iab-app.html#GetSample">
-TrivialDrive sample for the Version 3 API</a> sample shows how to use the In-app
+TrivialDrive for the Version 3 API</a> sample shows how to use the In-app
Billing Version 3 API
to implement in-app product and subscription purchases for a driving game. The
-application demonstrates how to send In-app Billing requests, and handle
+application demonstrates how to send In-app Billing requests and handle
synchronous responses from Google Play. The application also shows how to record
-item consumption with the API. The Version 3 sample includes convenience classes
+product consumption with the API. The Version 3 sample includes convenience classes
for processing In-app Billing operations as well as perform automatic signature
verification.</p>
-<p class="caution"><strong>Recommendation</strong>: Make sure to obfuscate the
+<p class="caution"><strong>Recommendation</strong>: Be sure to obfuscate the
code in your application before you publish it. For more information, see
<a href="{@docRoot}google/play/billing/billing_best_practices.html">Security
and Design</a>.</p>
@@ -183,16 +194,17 @@
<h2 id="migration">Migration Considerations</h2>
<p>The In-app Billing Version 2 API was discontinued in January 2015.
If you have an existing In-app Billing implementation that uses API Version 2 or
-earlier, you must migrate to <a href="{@docRoot}google/play/billing/api.html">In-app Billing Version
-3</a>.</p>
+earlier, you must migrate to <a href="{@docRoot}google/play/billing/api.html">
+In-app Billing Version 3</a>.</p>
-<p>If you have published apps selling in-app products, note that:</p>
+<p>After migration, managed and unmanaged products are handled as follows:</p>
<ul>
-<li>Managed items and subscriptions that you have previously defined in the Developer Console will
-work with Version 3 as before.</li>
-<li>Unmanaged items that you have defined for existing applications will be
-treated as managed products if you make a purchase request for these items using
-the Version 3 API. You do not need to create a new product entry in Developer
-Console for these items, and you can use the same product IDs to purchase these
-items.
+<li>Managed products and subscriptions that you have previously defined in the
+ Developer Console
+ work with Version 3 just as before.</li>
+<li>Unmanaged products that you have defined for existing applications are
+ treated as managed products if you make a purchase request for these products using
+the Version 3 API. You don't need to create a new product entry in the Developer
+Console for these products, and you can use the same product IDs to manage these
+products.
</ul>
diff --git a/docs/html/google/play/billing/billing_promotions.jd b/docs/html/google/play/billing/billing_promotions.jd
index ccf50fc..4fe1abf 100644
--- a/docs/html/google/play/billing/billing_promotions.jd
+++ b/docs/html/google/play/billing/billing_promotions.jd
@@ -1,7 +1,7 @@
page.title=In-app Promotions
parent.title=In-app Billing
parent.link=index.html
-page.metaDescription=Support promo codes in your app, which let you give content or features away to a limited number of users free of charge.
+page.metaDescription=Support promo codes in your app, which lets you give content or features away to a limited number of users free of charge.
page.image=/images/play_dev.jpg
page.tags="promotions, billing, promo codes"
meta.tags="monetization, inappbilling, promotions"
@@ -13,7 +13,7 @@
<h2>In this document</h2>
<ol>
<li><a href="#workflow">Creating and Redeeming Promo Codes</a></li>
- <li><a href="#supporting">Supporting Promo Codes In Your App</a></li>
+ <li><a href="#supporting">Supporting Promo Codes in Your App</a></li>
<li><a href="#testing">Testing In-app Promotions</a></li>
</ol>
<h2>See also</h2>
@@ -27,26 +27,26 @@
<p>
Promo codes let you give content or features away to a limited number of
- users free of charge. Once you create a promo code, you can distribute it
+ users free of charge. After you create a promo code, you can distribute it
subject to the
<!--TODO: Link to TOS when/if they're available as a web page --> terms of
- service. The user enters the promo code in your app or in the Play Store app,
- and gets the item at no cost. You can use promo codes in many ways to
- creatively engage with users. For example:
+ service. The user enters the promo code in your app or in the Google Play Store app
+ and receives the item at no cost. You can use promo codes in many ways to
+ creatively engage with users, such as the following:
</p>
<ul>
<li>A game could have a special item, such as a character or decoration,
that's only available to players who attend an event. The developer could
distribute cards with promo codes at the event, and users would enter their
- promo code to unlock the item.
+ promo codes to unlock the item.
</li>
- <li>An app developer might distribute promo codes at local businesses, to
+ <li>An app developer might distribute promo codes at local businesses to
encourage potential users to try the app.
</li>
- <li>An app developer might give out "friends and family" codes to its employees to
+ <li>An app developer might give <em>friends and family codes</em> to its employees to
share with their friends.
</li>
</ul>
@@ -54,11 +54,11 @@
<p>
Every promo code is associated with a particular <em>product ID</em> (also
known as a <em>SKU</em>). You can create promo codes for your existing in-app
- products. You can also keep a SKU off the Play Store, so the only way to get
+ products. You can also keep an SKU off the Play Store, so that the only way to get
that item is by entering that SKU's promo code. When a user enters the promo
- code in the Play Store or in their app, the user gets the item, just as if
+ code in the Play Store or in an app, the user gets the item, just as if
they paid full price for it. If your app already uses <a href=
- "{@docRoot}google/play/billing/api.html">In-app Billing version 3</a> to
+ "{@docRoot}google/play/billing/api.html">In-app Billing Version 3</a> to
support in-app purchases, it's easy to add support for promo codes.
</p>
@@ -67,12 +67,12 @@
<p>
You create promo codes through the <a href=
"https://play.google.com/apps/publish/" class="external-link">Google Play
- Developer Console</a>. Each promo code is associated with a single product item
+ Developer Console</a>. Each promo code is associated with a single product
registered in the developer console.
</p>
<p>
- When a user gets a promo code, they redeem it in one of two ways:
+ A user can redeem a promo code in one of these two ways:
</p>
<ul>
@@ -85,33 +85,20 @@
<li>The user can redeem the code in the Google Play Store app. Once the user
enters the code, the Play Store prompts the user to open the app (if they have
- the latest version installed) or to download or update it. (We do not
- currently support redeeming promo codes from the Google Play web store.)
+ the latest version installed) or to download or update it. Google doesn't
+ currently support redeeming promo codes from the Google Play web store.
</li>
</ul>
-<p>
- If the promo code is for a <a href=
- "{@docRoot}google/play/billing/api.html#consumetypes">consumable product</a>,
- the user can apply an additional code for the same product <em>after</em> the first
- product is consumed. For example, a game might offer promo codes for a bundle
- of extra lives. Betty has two different promo codes for that bundle. She
- redeems a single promo code, then launches the game. When the game launches,
- the her character receives the lives, consuming the item. She can now redeem
- the second promo code for another bundle of lives. (She cannot redeem the
- second promo code until after she consumes the item she purchased with the
- first promo code.)
-</p>
-
-<h2 id="supporting">Supporting Promo Codes In Your App</h2>
+<h2 id="supporting">Supporting Promo Codes in Your App</h2>
<p>
- To support promotion codes, your app should call the <a href=
+ To support promotion codes, your app must call the <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
><code>getPurchases()</code></a>
method whenever the app starts or resumes. This method returns a bundle of all
current, unconsumed purchases, including purchases the user made by redeeming
- a promo code. This simplest approach is to call <a href=
+ a promo code. The simplest approach is to call <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
><code>getPurchases()</code></a>
in your activity's {@link android.app.Activity#onResume onResume()} method,
@@ -119,21 +106,21 @@
activity is unpaused. Calling <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
><code>getPurchases()</code></a>
- on startup and resume guarantees that your app will find out about all
+ on startup and resume guarantees that your app finds out about all
purchases and redemptions the user may have made while the app wasn't
running. Furthermore, if a user makes a purchase while the app is running and
- your app misses it for any reason, your app will still find out about the
+ your app misses it for any reason, your app still finds out about the
purchase the next time the activity resumes and calls <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
><code>getPurchases()</code></a>.
</p>
<p>
- In addition, your app should allow users to redeem promo codes inside the app
+ Your app should allow users to redeem promo codes inside the app
itself. If your app supports the in-app purchase workflow (described in
<a href=
"{@docRoot}google/play/billing/billing_integrate.html#billing-requests">Making
- In-app Billing Requests</a>), your app automatically supports in-app
+ In-app Billing requests</a>), your app automatically supports in-app
redemption of promo codes. When you launch the in-app purchase UI,
the user has the option to pay for the purchase with
a promo code. Your activity's {@link android.app.Activity#onActivityResult
@@ -141,9 +128,9 @@
purchase was completed. However, your app should still call <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
><code>getPurchases()</code></a>
- on startup and resume, just in case the purchase and consumption workflow
- didn't complete. For example, if the user successfully redeems a promo code,
- and then your app crashes before the item is consumed, your app still gets
+ on startup and resume, in case the purchase and consumption workflow
+ didn't complete. For example, if the user successfully redeems a promo code
+ and then your app crashes before the item is consumed, your app still receives
information about the purchase when the app calls <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
><code>getPurchases()</code></a> on its next startup.
@@ -160,8 +147,8 @@
<p>
To listen for the <code>PURCHASES_UPDATED</code> intent, dynamically create a
{@link android.content.BroadcastReceiver} object and register it to listen
- for <code>"com.android.vending.billing.PURCHASES_UPDATED"</code>. Register
- the receiver by putting code like this in your activity's {@link
+ for <code>com.android.vending.billing.PURCHASES_UPDATED</code>. Register
+ the receiver by inserting code similar to the following in your activity's {@link
android.app.Activity#onResume onResume()} method:
</p>
@@ -172,36 +159,34 @@
<p>
When the user makes a purchase, the system invokes your broadcast receiver's
{@link android.content.BroadcastReceiver#onReceive onReceive()} method. That
- method should call <a href=
+ method must call <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
><code>getPurchases()</code></a>
to see what purchases the user has made.
</p>
-<p>
- Your activity's {@link android.app.Activity#onPause onPause()} method should
- unregister the broadcast receiver, to reduce system overhead when your app
- isn't running:
+<p>To reduce system overhead when your app
+ isn't running, your activity's {@link android.app.Activity#onPause onPause()} method must
+ unregister the broadcast receiver:
</p>
<pre>unRegisterReceiver(myPromoReceiver);</pre>
<p class="note">
- <strong>Note:</strong> You should not register this broadcast receiver in the
+ <strong>Note:</strong> Don't register this broadcast receiver in the
app manifest. Declaring the receiver in the manifest can cause the system to
launch the app to handle the intent if the user makes a purchase while the app
- isn't running. This behavior is not necessary, and may be annoying to the
- user. Instead, your app should call <a href=
- "{@docRoot}google/play/billing/billing_reference.html#getPurchases"
- ><code>getPurchases()</code></a>
- when the user launches it, to find out about any purchases the user made
- while the app wasn't running.
+ isn't running. This behavior is not necessary and may be annoying to the
+ user.
+ To find out about any purchases the user made while the app wasn't running,
+ call <a href="{@docRoot}google/play/billing/billing_reference.html#getPurchases"
+ ><code>getPurchases()</code></a> when the user launches the app.
</p>
<h2 id="testing">Testing In-app Promotions</h2>
<p>
- If your app supports in-app promotions, you should test the following use
+ If your app supports in-app promotions, test the following use
cases.
</p>
@@ -211,18 +196,18 @@
If the user redeems a promo code within the app's purchase flow, as described
in <a href=
"{@docRoot}google/play/billing/billing_integrate.html#billing-requests">Making
- In-app Billing Requests</a>, the system invokes your activity's {@link
+ In-app Billing requests</a>, the system invokes your activity's {@link
android.app.Activity#onActivityResult onActivityResult()} method to handle
the purchase. Verify that {@link android.app.Activity#onActivityResult
- onActivityResult()} handles the purchase properly, whether the user uses cash
+ onActivityResult()} handles the purchase properly, whether the user pays with money
or a promo code.
</p>
-<h3 id="test-playstore">User redeems promo code in the Play Store</h3>
+<h3 id="test-playstore">User redeems promo code in the Google Play Store</h3>
<p>
If the user redeems a promo code in the Play Store, there are several
- possible workflows. You should verify each one of these.
+ possible workflows. Verify each one of these workflows.
</p>
<h4 id="test-app-uninstalled">App is not installed</h4>
@@ -231,16 +216,16 @@
If the user redeems a promo code for an app that is not installed on the
device, the Play Store prompts the user to install the app. (If the app is
installed but not up-to-date, the Play Store prompts the user to update the
- app.) You should test the following sequence on a device that does not
+ app.) Test the following sequence on a device that doesn't
have your app installed.
</p>
<ol>
- <li>User redeems a promo code for the app in the Play Store. The Play Store
+ <li>The user redeems a promo code for the app in the Play Store. The Play Store
prompts the user to install your app.
</li>
- <li>User installs and launches your app. Verify that on startup, the app
+ <li>The user installs and launches your app. Verify that on startup, the app
calls <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
><code>getPurchases()</code></a>
@@ -252,16 +237,16 @@
<p>
If the user redeems a promo code for an app that is installed on the device,
- the Play Store prompts the user to switch to the app. You should test the
+ the Play Store prompts the user to switch to the app. Test the
following sequence on a device that has your app installed but not running:
</p>
<ol>
- <li>User redeems a promo code for the app in the Play Store. The Play Store
+ <li>The user redeems a promo code for the app in the Play Store. The Play Store
prompts the user to switch to your app.
</li>
- <li>User launches your app. Verify that on startup, the app calls <a href=
+ <li>The user launches your app. Verify that on startup the app calls <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
><code>getPurchases()</code></a>
and correctly detects the purchase the user made with the promo code.
@@ -274,15 +259,15 @@
<p>
If the user redeems a promo code for an app that is currently running on the
device, the Play Store notifies the app via a <code>PURCHASES_UPDATED</code>
- intent. You should test the following sequence:
+ intent. Test the following sequence:
</p>
<ol>
- <li>User launches the app. Verify that the app has properly registered itself to
+ <li>The user launches the app. Verify that the app has properly registered itself to
receive the <code>PURCHASES_UPDATED</code> intent.
</li>
- <li>User launches the Play Store app and redeems a promo code for the app. The Play
+ <li>The user launches the Play Store app and redeems a promo code for the app. The Play
Store fires a <code>PURCHASES_UPDATED</code> intent. Verify that your app's
{@link android.content.BroadcastReceiver#onReceive
BroadcastReceiver.onReceive()} callback fires to handle the intent.
@@ -291,11 +276,11 @@
<li>Your {@link android.content.BroadcastReceiver#onReceive onReceive()}
method should respond to the intent by calling <a href=
"{@docRoot}google/play/billing/billing_reference.html#getPurchases"
- ><code>getPurchases()</code></a>. Verify that it calls this method, and that
+ ><code>getPurchases()</code></a>. Verify that your app calls this method and that
it correctly detects the purchase the user made with the promo code.
</li>
- <li>User switches back to your app. Verify that the user has the purchased
+ <li>The user switches back to your app. Verify that the user has the purchased
item.
</li>
</ol>
diff --git a/docs/html/topic/arc/_book.yaml b/docs/html/topic/arc/_book.yaml
new file mode 100644
index 0000000..ad83ba9
--- /dev/null
+++ b/docs/html/topic/arc/_book.yaml
@@ -0,0 +1,9 @@
+toc:
+- title: Optimize Apps for Chromebooks
+ path: /topic/arc/index.html
+- title: Loading Apps on Chromebooks
+ path: /topic/arc/sideload.html
+- title: Chrome OS Device Support for Apps
+ path: /topic/arc/device-support.html
+- title: App Manifest Compatibility for Chromebooks
+ path: /topic/arc/manifest.html
\ No newline at end of file
diff --git a/docs/html/topic/libraries/data-binding/index.jd b/docs/html/topic/libraries/data-binding/index.jd
index ec6e58c..454bb59 100644
--- a/docs/html/topic/libraries/data-binding/index.jd
+++ b/docs/html/topic/libraries/data-binding/index.jd
@@ -246,21 +246,21 @@
</pre>
<p>
Expressions within the layout are written in the attribute properties using
- the “<code>&commat;{}</code>” syntax. Here, the TextView’s text is set to
+ the "<code>@{}</code>" syntax. Here, the TextView's text is set to
the firstName property of user:
</p>
<pre>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="&commat;{user.firstName}"/>
+ android:text="@{user.firstName}"/>
</pre>
<h3 id="data_object">
Data Object
</h3>
<p>
- Let’s assume for now that you have a plain-old Java object (POJO) for User:
+ Let's assume for now that you have a plain-old Java object (POJO) for User:
</p>
<pre>
@@ -296,8 +296,8 @@
</pre>
<p>
From the perspective of data binding, these two classes are equivalent. The
- expression <strong><code>&commat;{user.firstName}</code></strong> used
- for the TextView’s <strong><code>android:text</code></strong> attribute will
+ expression <strong><code>@{user.firstName}</code></strong> used
+ for the TextView's <strong><code>android:text</code></strong> attribute will
access the <strong><code>firstName</code></strong> field in the former class
and the <code>getFirstName()</code> method in the latter class.
Alternatively, it will also be resolved to <code>firstName()</code> if that
@@ -310,10 +310,10 @@
<p>
By default, a Binding class will be generated based on the name of the layout
- file, converting it to Pascal case and suffixing “Binding” to it. The above
+ file, converting it to Pascal case and suffixing "Binding" to it. The above
layout file was <code>main_activity.xml</code> so the generate class was
<code>MainActivityBinding</code>. This class holds all the bindings from the
- layout properties (e.g. the <code>user</code> variable) to the layout’s Views
+ layout properties (e.g. the <code>user</code> variable) to the layout's Views
and knows how to assign values for the binding expressions.The easiest means
for creating the bindings is to do it while inflating:
</p>
@@ -328,7 +328,7 @@
}
</pre>
<p>
- You’re done! Run the application and you’ll see Test User in the UI.
+ You're done! Run the application and you'll see Test User in the UI.
Alternatively, you can get the view via:
</p>
@@ -434,15 +434,15 @@
</pre>
Then you can bind the click event to your class as follows:
<pre>
- <?xml version="1.0" encoding="utf-8"?>
- <layout xmlns:android="http://schemas.android.com/apk/res/android">
+ <?xml version="1.0" encoding="utf-8"?>
+ <layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
- <variable name="task" type="com.android.example.Task" />
- <variable name="presenter" type="com.android.example.Presenter" />
+ <variable name="task" type="com.android.example.Task" />
+ <variable name="presenter" type="com.android.example.Presenter" />
</data>
- <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:onClick="@{() -> presenter.onSaveClick(task)}" />
+ <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:layout_width="wrap_content" android:layout_height="wrap_content"
+ android:onClick="@{() -> presenter.onSaveClick(task)}" />
</LinearLayout>
</layout>
</pre>
@@ -465,7 +465,7 @@
above could be written as:
</p>
<pre>
- android:onClick="@{(view) -> presenter.onSaveClick(task)}"
+ android:onClick="@{(view) -> presenter.onSaveClick(task)}"
</pre>
Or if you wanted to use the parameter in the expression, it could work as follows:
<pre>
@@ -474,7 +474,7 @@
}
</pre>
<pre>
- android:onClick="@{(theView) -> presenter.onSaveClick(theView, task)}"
+ android:onClick="@{(theView) -> presenter.onSaveClick(theView, task)}"
</pre>
You can use a lambda expression with more than one parameter:
<pre>
@@ -483,8 +483,8 @@
}
</pre>
<pre>
- <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:onCheckedChanged="@{(cb, isChecked) -> presenter.completeChanged(task, isChecked)}" />
+ <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content"
+ android:onCheckedChanged="@{(cb, isChecked) -> presenter.completeChanged(task, isChecked)}" />
</pre>
<p>
If the event you are listening to returns a value whose type is not {@code
@@ -498,7 +498,7 @@
}
</pre>
<pre>
- android:onLongClick="@{(theView) -> presenter.onLongClick(theView, task)}"
+ android:onLongClick="@{(theView) -> presenter.onLongClick(theView, task)}"
</pre>
<p>
If the expression cannot be evaluated due to {@code null} objects, Data Binding returns
@@ -510,7 +510,7 @@
{@code void} as a symbol.
</p>
<pre>
- android:onClick="@{(v) -> v.isVisible() ? doSomething() : void}"
+ android:onClick="@{(v) -> v.isVisible() ? doSomething() : void}"
</pre>
<h5>Avoid Complex Listeners</h5>
@@ -580,7 +580,7 @@
</pre>
<p>
When there are class name conflicts, one of the classes may be renamed to an
- “alias:”
+ "alias:"
</p>
<pre>
@@ -601,7 +601,7 @@
<import type="com.example.User"/>
<import type="java.util.List"/>
<variable name="user" type="User"/>
- <variable name="userList" type="List&lt;User>"/>
+ <variable name="userList" type="List<User>"/>
</data>
</pre>
<p class="caution">
@@ -695,7 +695,7 @@
<p>
By default, a Binding class is generated based on the name of the layout
file, starting it with upper-case, removing underscores ( _ ) and
- capitalizing the following letter and then suffixing “Binding”. This class
+ capitalizing the following letter and then suffixing "Binding". This class
will be placed in a databinding package under the module package. For
example, the layout file <code>contact_item.xml</code> will generate
<code>ContactItemBinding</code>. If the module package is
@@ -718,7 +718,7 @@
This generates the binding class as <code>ContactItem</code> in the
databinding package in the module package. If the class should be generated
in a different package within the module package, it may be prefixed with
- “.”:
+ ".":
</p>
<pre>
@@ -741,7 +741,7 @@
</h3>
<p>
- Variables may be passed into an included layout's binding from the
+ Variables may be passed into an included layout's binding from the
containing layout by using the application namespace and the variable name in
an attribute:
</p>
@@ -855,8 +855,8 @@
<pre>
android:text="@{String.valueOf(index + 1)}"
-android:visibility="@{age &lt; 13 ? View.GONE : View.VISIBLE}"
-android:transitionName='@{"image_" + id}'
+android:visibility="@{age < 13 ? View.GONE : View.VISIBLE}"
+android:transitionName='@{"image_" + id}'
</pre>
<h4 id="missing_operations">
Missing Operations
@@ -945,9 +945,9 @@
<import type="android.util.SparseArray"/>
<import type="java.util.Map"/>
<import type="java.util.List"/>
- <variable name="list" type="List&lt;String>"/>
- <variable name="sparse" type="SparseArray&lt;String>"/>
- <variable name="map" type="Map&lt;String, String>"/>
+ <variable name="list" type="List<String>"/>
+ <variable name="sparse" type="SparseArray<String>"/>
+ <variable name="map" type="Map<String, String>"/>
<variable name="index" type="int"/>
<variable name="key" type="String"/>
</data>
@@ -969,17 +969,17 @@
</p>
<pre>
-android:text='@{map["firstName"]}'
+android:text='@{map["firstName"]}'
</pre>
<p>
It is also possible to use double quotes to surround the attribute value.
- When doing so, String literals should either use the &quot; or back quote
+ When doing so, String literals should either use the ' or back quote
(`).
</p>
<pre>
android:text="@{map[`firstName`}"
-android:text="@{map[&quot;firstName&quot;]}"
+android:text="@{map['firstName']}"
</pre>
<h4 id="resources">
Resources
@@ -1216,7 +1216,7 @@
}
</pre>
<p>
- That's it! To access the value, use the set and get accessor methods:
+ That's it! To access the value, use the set and get accessor methods:
</p>
<pre>
@@ -1247,15 +1247,15 @@
<pre>
<data>
<import type="android.databinding.ObservableMap"/>
- <variable name="user" type="ObservableMap&lt;String, Object>"/>
+ <variable name="user" type="ObservableMap<String, Object>"/>
</data>
…
<TextView
- android:text='@{user["lastName"]}'
+ android:text='@{user["lastName"]}'
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
- android:text='@{String.valueOf(1 + (Integer)user["age"])}'
+ android:text='@{String.valueOf(1 + (Integer)user["age"])}'
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</pre>
@@ -1277,15 +1277,15 @@
<data>
<import type="android.databinding.ObservableList"/>
<import type="com.example.my.app.Fields"/>
- <variable name="user" type="ObservableList&lt;Object>"/>
+ <variable name="user" type="ObservableList<Object>"/>
</data>
…
<TextView
- android:text='@{user[Fields.LAST_NAME]}'
+ android:text='@{user[Fields.LAST_NAME]}'
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
- android:text='@{String.valueOf(1 + (Integer)user[Fields.AGE])}'
+ android:text='@{String.valueOf(1 + (Integer)user[Fields.AGE])}'
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</pre>
@@ -1428,7 +1428,7 @@
<p>
When inflating another layout, a binding must be established for the new
- layout. Therefore, the <code>ViewStubProxy</code> must listen to the <code>ViewStub</code>'s
+ layout. Therefore, the <code>ViewStubProxy</code> must listen to the <code>ViewStub</code>'s
{@link android.view.ViewStub.OnInflateListener} and establish the binding at that time. Since
only one can exist, the <code>ViewStubProxy</code> allows the developer to set an
<code>OnInflateListener</code> on it that it will call after establishing the binding.
@@ -1443,9 +1443,9 @@
</h4>
<p>
- At times, the specific binding class won't be known. For example, a
+ At times, the specific binding class won't be known. For example, a
{@link android.support.v7.widget.RecyclerView.Adapter} operating against arbitrary layouts
- won't know the specific binding class. It still must assign the binding value during the
+ won't know the specific binding class. It still must assign the binding value during the
{@link android.support.v7.widget.RecyclerView.Adapter#onBindViewHolder}.
</p>
@@ -1499,13 +1499,13 @@
For an attribute, data binding tries to find the method setAttribute. The
namespace for the attribute does not matter, only the attribute name itself.
<p>
- For example, an expression associated with TextView's attribute
+ For example, an expression associated with TextView's attribute
<strong><code>android:text</code></strong> will look for a setText(String).
If the expression returns an int, data binding will search for a setText(int)
method. Be careful to have the expression return the correct type, casting if
necessary. Note that data binding will work even if no attribute exists with
the given name. You can then easily "create" attributes for any setter by
- using data binding. For example, support DrawerLayout doesn't have any
+ using data binding. For example, support DrawerLayout doesn't have any
attributes, but plenty of setters. You can use the automatic setters to use
one of these.
</p>
@@ -1522,7 +1522,7 @@
</h3>
<p>
- Some attributes have setters that don't match by name. For these
+ Some attributes have setters that don't match by name. For these
methods, an attribute may be associated with the setter through
{@link android.databinding.BindingMethods} annotation. This must be associated with
a class and contains {@link android.databinding.BindingMethod} annotations, one for
@@ -1591,8 +1591,8 @@
}
</pre>
<pre>
-<ImageView app:imageUrl=“@{venue.imageUrl}”
-app:error=“@{@drawable/venueError}”/>
+<ImageView app:imageUrl="@{venue.imageUrl}"
+app:error="@{@drawable/venueError}"/>
</pre>
<p>
@@ -1747,7 +1747,7 @@
<pre>
<TextView
- android:text='@{userMap["lastName"]}'
+ android:text='@{userMap["lastName"]}'
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</pre>
diff --git a/docs/html/training/_book.yaml b/docs/html/training/_book.yaml
index 0523ec9e..891574f 100644
--- a/docs/html/training/_book.yaml
+++ b/docs/html/training/_book.yaml
@@ -1384,6 +1384,11 @@
path_attributes:
- name: description
value: How to use the SafetyNet service to analyze a device where your app is running and get information about its compatibility with your app.
+ - title: Checking URLs with the Safe Browsing API
+ path: /training/safebrowsing/index.html
+ path_attributes:
+ - name: description
+ value: How to use the SafetyNet service to determine if a URL is designated as a known threat.
- title: Verifying Hardware-backed Key Pairs with Key Attestation
path: /training/articles/security-key-attestation.html
path_attributes:
diff --git a/docs/html/training/in-app-billing/preparing-iab-app.jd b/docs/html/training/in-app-billing/preparing-iab-app.jd
old mode 100755
new mode 100644
index 2c6e9a0..780f2f80
--- a/docs/html/training/in-app-billing/preparing-iab-app.jd
+++ b/docs/html/training/in-app-billing/preparing-iab-app.jd
@@ -31,23 +31,32 @@
</div>
<a class="notice-developers-video wide"
-href="https://www.youtube.com/watch?v=UvCl5Xx7Z5o">
+href="https://www.youtube.com/watch?v=UvCl5Xx7Z5o" class="external-link">
<div>
<h3>Video</h3>
<p>Implementing Freemium</p>
</div>
</a>
-<p>Before you can start using the In-app Billing service, you'll need to add the library that contains the In-app Billing Version 3 API to your Android project. You also need to set the permissions for your application to communicate with Google Play. In addition, you'll need to establish a connection between your application and Google Play. You should also verify that the In-app Billing API version that you are using in your application is supported by Google Play.</p>
+<p>Before you can start using the In-app Billing service, you need to add the library that
+ contains the In-app Billing Version 3 API to your Android project. You also need to set the
+ permissions for your application to communicate with Google Play. In addition, you need to
+ establish a connection between your application and Google Play. You must also verify that
+ the In-app Billing API version that you are using in your application is supported
+ by Google Play.</p>
<h2 id="GetSample">Download the Sample Application</h2>
-<p>In this training class, you will use a reference implementation for the In-app Billing Version 3 API called the {@code TrivialDrive} sample application. The sample includes convenience classes to quickly set up the In-app Billing service, marshal and unmarshal data types, and handle In-app Billing requests from the main thread of your application.</p>
-<p>To download the sample application:</p>
+<p>In this training class, you use a reference implementation for the In-app Billing
+ Version 3 API
+ called the {@code TrivialDrive} sample application. The sample includes convenience classes to
+ quickly set up the In-app Billing service, marshal and unmarshal data types, and handle In-app
+ Billing requests from the main thread of your application.</p>
+<p>To download the sample application, follow these steps:</p>
<ol>
<li>Open Android Studio and then close any open projects until you are
presented with the welcome screen.</li>
-<li>Choose <strong>Import an Android code sample</strong> from the
- <strong>Quick Start</strong> list on the right side the window.</li>
+<li>From the <strong>Quick Start</strong> list on the right side of the window, choose
+ <strong>Import an Android code sample</strong>.</li>
<li>Type {@code Trivial Drive} into the search bar and select the
<strong>Trivial Drive</strong> sample.</li>
<li>Follow the rest of the instructions in the <strong>Import Sample</strong>
@@ -56,66 +65,121 @@
</ol>
<p>Alternatively, you can use {@code git} to manually clone
- the repository from <a
+ the repository from the <a
href="https://github.com/googlesamples/android-play-billing"
- class="external-link">https://github.com/googlesamples/android-play-billing</a></p>
+ class="external-link">Google Samples</a> GitHub site.</p>
<h2 id="AddToDevConsole">Add Your Application to the Developer Console</h2>
-<p>The Google Play Developer Console is where you publish your In-app Billing application and manage the various digital goods that are available for purchase from your application. When you create a new application entry in the Developer Console, it automatically generates a public license key for your application. You will need this key to establish a trusted connection from your application to the Google Play servers. You only need to generate this key once per application, and don’t need to repeat these steps when you update the APK file for your application.</p>
-<p>To add your application to the Developer Console:</p>
+<p>The Google Play Developer Console is where you publish your In-app Billing application
+ and manage the various digital products that are available for purchase from your
+ application.
+ When you create a new application entry in the Developer Console, it automatically generates
+ a public license key for your application. You need this key to establish a trusted connection
+ from your application to the Google Play servers. You need to generate this key only once
+ per application, and you don’t need to repeat these steps when you update the APK file for
+ your application.</p>
+<p>To add your application to the Developer Console, follow these steps:</p>
<ol>
-<li>Go to the <a href="http://play.google.com/apps/publish">Google Play Developer Console</a> site and log in. You will need to register for a new developer account, if you have not registered previously. To sell in-app items, you also need to have a <a href="http://www.google.com/wallet/merchants.html">Google payments</a> merchant account.</li>
-<li>Click on <strong>Try the new design</strong> to access the preview version of the Developer Console, if you are not already logged on to that version. </li>
-<li>In the <strong>All Applications</strong> tab, add a new application entry.
+<li>Go to the <a href="http://play.google.com/apps/publish" class="external-link">
+Google Play Developer Console</a>
+ site and log in. If you have not registered previously, you need to register for a new
+ developer account. To sell in-app products, you also need a
+ <a href="http://www.google.com/wallet/merchants.html" class="external-link">
+ Google payments</a> merchant account.</li>
+
+<li>In the <strong>All Applications</strong> tab, complete these steps to add a new
+ application entry:
<ol type="a">
<li>Click <strong>Add new application</strong>.</li>
<li>Enter a name for your new In-app Billing application.</li>
<li>Click <strong>Prepare Store Listing</strong>.</li>
</ol>
</li>
-<li>In the <strong>Services & APIs</strong> tab, find and make a note of the public license key that Google Play generated for your application. This is a Base64 string that you will need to include in your application code later.</li>
+<li>In the <strong>Services & APIs</strong> tab, find and make a note of the public license key
+ that Google Play generated for your application. This is a Base64 string that you need to
+ include in your application code later.</li>
</ol>
<p>Your application should now appear in the list of applications in Developer Console.</p>
<h2 id="AddLibrary">Add the In-app Billing Library</h2>
-<p>To use the In-app Billing Version 3 features, you must add the {@code IInAppBillingService.aidl} file to your Android project. This Android Interface Definition Language (AIDL) file defines the interface to the Google Play service.</p>
-<p>You can find the {@code IInAppBillingService.aidl} file in the provided sample app. Depending on whether you are creating a new application or modifying an existing application, follow the instructions below to add the In-app Billing Library to your project.</p>
-<h3>New Project</h3>
-<p>To add the In-app Billing Version 3 library to your new In-app Billing project:</p>
+<p>To use the In-app Billing Version 3 features, you must add the
+ {@code IInAppBillingService.aidl}
+ file to your Android project. This Android Interface Definition Language
+ (AIDL) file defines the
+ interface to the Google Play service.</p>
+<p>You can find the {@code IInAppBillingService.aidl} file in the provided sample app.
+ To add the
+ In-app Billing library to your project, follow the instructions below for a new or
+ existing project.</p>
+<h3>Adding in-app billing to a new project</h3>
+<p>To add the In-app Billing Version 3 library to a new project, follow these steps:</p>
<ol>
<li>Copy the {@code TrivialDrive} sample files into your Android project.</li>
-<li>Modify the package name in the files you copied to use the package name for your project. In Android Studio, you can use this shortcut: right-click the package name, then select <strong>Refactor</strong> > <strong>Rename</strong>.</li>
-<li>Open the {@code AndroidManifest.xml} file and update the package attribute value to use the package name for your project.</li>
-<li>Fix import statements as needed so that your project compiles correctly. In Android Studio, you can use this shortcut: press <strong>Ctrl+Shift+O</strong> in each file showing errors.</li>
-<li>Modify the sample to create your own application. Remember to copy the Base64 public license key for your application from the Developer Console over to your {@code MainActivity.java}.</li>
+<li>Modify the package name in the files that you copied to use the package name
+ for your project.
+ In Android Studio, you can right-click the package name and then
+ select <strong>Refactor</strong> > <strong>Rename</strong>.</li>
+<li>Open the {@code AndroidManifest.xml} file and update the package attribute value to
+ use the package name for your project.</li>
+<li>Fix import statements as needed so that your project compiles correctly.
+ In Android Studio, you can press <strong>Ctrl+Shift+O</strong>
+ in each file showing errors.</li>
+<li>Modify the sample to create your own application. Remember to copy the Base64
+ public license key for your application from the Developer Console to
+ your {@code MainActivity.java}.</li>
</ol>
-<h3>Existing Project</h3>
-<p>To add the In-app Billing Version 3 library to your existing In-app Billing project:</p>
+<h3>Adding in-app billing to an existing project</h3>
+<p>To add the In-app Billing Version 3 library to an existing project, follow these steps:</p>
<ol>
<li>Copy the {@code IInAppBillingService.aidl} file to your Android project.
<ul>
- <li>In Android Studio: Create a directory named {@code aidl} under {@code src/main}, add a new
- package {@code com.android.vending.billing} in this directory, and import the
+ <li>In Android Studio: Create a directory named {@code aidl} under {@code src/main},
+ add a new
+ package {@code com.android.vending.billing} in this directory, and then import the
{@code IInAppBillingService.aidl} file into this package.</li>
- <li>In other dev environments: Create the following directory {@code /src/com/android/vending/billing} and copy the {@code IInAppBillingService.aidl} file into this directory.</li>
+ <li>In other dev environments: Create the following directory
+ {@code /src/com/android/vending/billing} and copy the {@code IInAppBillingService.aidl}
+ file into this directory.</li>
</ul>
</li>
-<li>Build your application. You should see a generated file named {@code IInAppBillingService.java} in the {@code /gen} directory of your project.</li>
-<li>Add the helper classes from the {@code /util} directory of the {@code TrivialDrive} sample to your project. Remember to change the package name declarations in those files accordingly so that your project compiles correctly.</li>
+<li>Build your application. You should see a generated file named
+ {@code IInAppBillingService.java}
+ in the {@code /gen} directory of your project.</li>
+<li>Add the helper classes from the {@code /util} directory of the {@code TrivialDrive}
+ sample to
+ your project. Remember to change the package name declarations in those files
+ accordingly so
+ that your project compiles correctly.</li>
</ol>
<p>Your project should now contain the In-app Billing Version 3 library.</p>
<h2 id="SetPermission">Set the Billing Permission</h2>
-<p>Your app needs to have permission to communicate request and response messages to the Google Play’s billing service. To give your app the necessary permission, add this line in your {@code AndroidManifest.xml} manifest file:</p>
+<p>Your app needs to have permission to communicate request and response messages to
+ the Google Play billing service. To give your app the necessary permission, add the following
+ line in your {@code AndroidManifest.xml} manifest file:</p>
<pre>
<uses-permission android:name="com.android.vending.BILLING" />
</pre>
<h2 id="Connect">Initiate a Connection with Google Play</h2>
-<p>You must bind your Activity to Google Play’s In-app Billing service to send In-app Billing requests to Google Play from your application. The convenience classes provided in the sample handles the binding to the In-app Billing service, so you don’t have to manage the network connection directly.</p>
-<p>To set up synchronous communication with Google Play, create an {@code IabHelper} instance in your activity's {@code onCreate} method. In the constructor, pass in the {@code Context} for the activity, along with a string containing the public license key that was generated earlier by the Google Play Developer Console. </p>
-<p class="note"><strong>Security Recommendation:</strong> It is highly recommended that you do not hard-code the exact public license key string value as provided by Google Play. Instead, you can construct the whole public license key string at runtime from substrings, or retrieve it from an encrypted store, before passing it to the constructor. This approach makes it more difficult for malicious third-parties to modify the public license key string in your APK file.</p>
+<p>To send In-app
+ Billing requests to Google Play from your application, you must bind your Activity
+ to the Google Play In-app Billing service. The sample includes convenience classes
+ that handle the binding to the In-app Billing service, so you don’t have to
+ manage the network connection directly.</p>
+<p>To set up synchronous communication with Google Play, create an {@code IabHelper}
+ instance in your activity's {@code onCreate} method, as shown in the following example.
+ In the constructor, pass in the {@code Context} for the activity along with a string
+ containing the public license key that was generated earlier by the Google Play
+ Developer Console.
+</p>
+<p class="caution"><strong>Security Recommendation:</strong> Google highly recommends that
+ you do not hard-code the exact public license key string value as provided by Google Play.
+ Instead, construct the whole public license key string at runtime from substrings
+ or retrieve it from an encrypted store before passing it to the constructor.
+ This approach makes it more difficult for malicious third parties to modify the public
+ license key string in your APK file.</p>
<pre>
IabHelper mHelper;
@@ -130,13 +194,20 @@
}
</pre>
-<p>Next, perform the service binding by calling the {@code startSetup} method on the {@code IabHelper} instance that you created. Pass the method an {@code OnIabSetupFinishedListener} instance, which is called once the {@code IabHelper} completes the asynchronous setup operation. As part of the setup process, the {@code IabHelper} also checks if the In-app Billing Version 3 API is supported by Google Play. If the API version is not supported, or if an error occured while establishing the service binding, the listener is notified and passed an {@code IabResult} object with the error message.</p>
+<p>Next, perform the service binding by calling the {@code startSetup} method on the
+ {@code IabHelper} instance that you created, as shown in the following example.
+ Pass the method an {@code OnIabSetupFinishedListener} instance, which is called once
+ the {@code IabHelper} completes the asynchronous setup operation. As part of the
+ setup process, the {@code IabHelper} also checks if the In-app Billing Version 3 API
+ is supported by Google Play. If the API version is not supported, or if an error occurs
+ while establishing the service binding, the listener is notified and passed an
+ {@code IabResult} object with the error message.</p>
<pre>
mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
public void onIabSetupFinished(IabResult result) {
if (!result.isSuccess()) {
- // Oh noes, there was a problem.
+ // Oh no, there was a problem.
Log.d(TAG, "Problem setting up In-app Billing: " + result);
}
// Hooray, IAB is fully set up!
@@ -144,9 +215,18 @@
});
</pre>
-<p>If the setup completed successfully, you can now use the {@code mHelper} reference to communicate with the Google Play service. When your application is launched, it is a good practice to query Google Play to find out what in-app items are owned by a user. This is covered further in the <a href="{@docRoot}training/in-app-billing/purchase-iab-products.html#QueryPurchases">Query Purchased Items</a> section.</p>
+<p>If the setup completed successfully, you can now use the {@code mHelper} reference
+ to communicate with the Google Play service. When your application is launched, it is
+ a good practice to query Google Play to find out what in-app items are owned by a user.
+ This is covered further in the
+ <a href="{@docRoot}training/in-app-billing/purchase-iab-products.html#QueryPurchases">
+ Query Purchased Items</a> section.</p>
-<p class="note"><strong>Important:</strong> Remember to unbind from the In-app Billing service when you are done with your activity. If you don’t unbind, the open service connection could cause your device’s performance to degrade. To unbind and free your system resources, call the {@code IabHelper}'s {@code dispose} method when your {@code Activity} is destroyed.</p>
+<p class="caution"><strong>Important:</strong> Remember to unbind from the In-app Billing service
+ when you are done with your activity. If you don’t unbind, the open service connection could
+ degrade device performance. To unbind and free your system resources, call the
+ {@code IabHelper}'s {@code dispose} method when your {@code Activity} is destroyed,
+ as shown in the following example.</p>
<pre>
@Override
@@ -156,8 +236,3 @@
mHelper = null;
}
</pre>
-
-
-
-
-
diff --git a/docs/html/training/safebrowsing/index.jd b/docs/html/training/safebrowsing/index.jd
new file mode 100644
index 0000000..c6c72bf
--- /dev/null
+++ b/docs/html/training/safebrowsing/index.jd
@@ -0,0 +1,315 @@
+page.title=Checking URLs with the Safe Browsing API
+
+@jd:body
+
+
+<div id="tb-wrapper">
+ <div id="tb">
+ <h2>
+ In this document
+ </h2>
+
+ <ol>
+ <li>
+ <a href="#tos">Terms of Service</a>
+ </li>
+
+ <li>
+ <a href="#api-key">Requesting and Registering an Android API Key</a>
+ <ol>
+ <li>
+ <a href="#manifest">Adding the Android API to your
+ AndroidManifest.xml</a>
+ </li>
+ </ol>
+ </li>
+
+ <li>
+ <a href="#connect-google-play">Connect to Google Play Services</a>
+ </li>
+
+ <li>
+ <a href="#url-check">Requesting a URL Check</a>
+ <ol>
+ <li>
+ <a href="#threat-types">Specifying threat types of interest</a>
+ </li>
+
+ <li>
+ <a href="#url-check-request">Send the URL check request</a>
+ </li>
+
+ <li>
+ <a href="#url-check-response">Read the URL check response</a>
+ </li>
+ </ol>
+ </li>
+
+ <li>
+ <a href="#warning-lang">Suggested Warning Language</a>
+ </li>
+ </ol>
+ </div>
+</div>
+
+<p>
+ SafetyNet provides services for determining whether a URL has been marked as
+ a known threat by Google.
+</p>
+
+<p>
+ The service provides an API your app can use to determine whether a
+ particular URL has been classified by Google as a known threat. Internally,
+ SafetyNet implements a client for the Safe Browsing Network Protocol v4
+ developed by Google. Both the client code and the v4 network protocol were
+ designed to preserve users' privacy, as well as keep battery and bandwidth
+ consumption to a minimum. This API allows you to take full advantage of
+ Google's Safe Browsing service on Android in the most resource-optimized way,
+ and without having to implement its network protocol.
+</p>
+
+<p>
+ This document shows you how to use SafetyNet for checking a URL for threat
+ types of interest.
+</p>
+
+<h2 id="tos">
+ Terms of Service
+</h2>
+
+<p>
+ By using the Safe Browsing API, you consent to be bound by the <a href=
+ "https://developers.google.com/safe-browsing/terms">Terms of Service</a>.
+ Please read and understand all applicable terms and policies before accessing
+ the Safe Browsing API.
+</p>
+
+<h2 id="api-key">
+ Requesting and Registering an Android API Key
+</h2>
+
+<p>
+ To create an API key, complete the following steps:
+</p>
+
+<ol>
+ <li>Go to the <a href="https://console.developers.google.com/project"
+ class="external-link">Google Developers Console</a>.
+ </li>
+
+ <li>On the upper toolbar, choose <strong>Select a project >
+ <em>your-project-name</em></strong>.
+ </li>
+
+ <li>In the search box, enter <em>Safe Browsing APIs</em>; when the Safe
+ Browsing API name appears in the table, select it.
+ </li>
+
+ <li>After the page redisplays, select <strong>Enable</strong> then select
+ <strong>Go to Credentials</strong>.
+ </li>
+
+ <li>When the <em>Add credentials to your project</em> window appears, choose
+ your parameters then select <strong>What credentials do I need?</strong>.
+ </li>
+
+ <li>Enter a name for your API key then select <strong>Create API
+ key</strong>.
+ </li>
+
+ <li>
+ <p>
+ Your new API key appears; copy and paste this key for future use.
+ </p>
+
+ <p class="note">
+ <strong>Note:</strong> Your API key allows you to perform a URL check
+ 10,000 times each day. The key, in this instance, should just be a
+ hexadecimal string, not part of a URL.
+ </p>
+ </li>
+
+ <li>Select <strong>Done</strong> to complete the process.
+ </li>
+</ol>
+
+<p>
+ If you need more help, check out the <a href=
+ "https://developers.google.com/console/help/new/">Google Developers Console
+ Help Center</a>.
+</p>
+
+<h3 id="manifest">
+ Adding the Android API key to your AndroidManifest.xml
+</h3>
+
+<p>
+ Once your key has been whitelisted, you need to add the key to the
+ <code>AndroidManifest.xml</code> file for your app:
+</p>
+
+<pre>
+<application>
+
+ ...
+
+ <!-- SafetyNet API metadata -->
+ <meta-data android:name="com.google.android.safetynet.API_KEY"
+ android:value="<var>your-API-key</var>" />
+
+ ...
+
+</application>
+</pre>
+<h2 id="connect-google-play">
+ Connect to Google Play Services
+</h2>
+
+<p>
+ The SafetyNet API is part of Google Play services. To connect to the API, you
+ need to create an instance of the Google Play services API client. For
+ details about using the client in your app, see <a href=
+ "https://developers.google.com/android/guides/api-client#Starting">Accessing
+ Google APIs</a>. Once you have established a connection to Google Play
+ services, you can use the Google API client classes to connect to the
+ SafetyNet API.
+</p>
+
+<p>
+ To connect to the API, in your activity's <code><a href=
+ "{@docRoot}reference/android/app/Activity.html#onCreate(android.os.Bundle)">onCreate()</a></code>
+ method, create an instance of Google API Client using <code><a href=
+ "https://developers.google.com/android/reference/com/google/android/gms/common/api/GoogleApiClient.Builder">
+ GoogleApiClient.Builder</a></code>. Use the builder to add the SafetyNet API,
+ as shown in the following code example:
+</p>
+
+<pre>
+protected synchronized void buildGoogleApiClient() {
+ mGoogleApiClient = new GoogleApiClient.Builder(this)
+ .addApi(SafetyNet.API)
+ .addConnectionCallbacks(myMainActivity.this)
+ .build();
+}
+</pre>
+<p class="note">
+ <strong>Note:</strong> You can only call these methods after your app has
+ established a connection to Google Play services by receiving the <code>
+ <a href="https://developers.google.com/android/reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks#public-methods">
+ onConnected()</a></code> callback. For details about listening for a completed
+ client connection, see <a href=
+ "https://developers.google.com/android/guides/api-client#Starting">Accessing
+ Google APIs</a>.
+</p>
+
+<h2 id="url-check">
+ Requesting a URL Check
+</h2>
+
+<p>
+ A URL check allows your app to determine if a URL has been marked as a threat
+ of interest. Some threat types may not be of interest to your particular
+ app, and the API allows you to choose which threat types are important for
+ your needs. You can specify multiple threat types of interest.
+</p>
+
+<h3 id="threat-types">
+ Specifying threat types of interest
+</h3>
+
+<p>
+ The constants in the {@code SafeBrowsingThreat} class contain the
+ currently-supported threat types:
+</p>
+
+<pre>
+package com.google.android.gms.safetynet;
+
+public class SafeBrowsingThreat {
+
+ /**
+ * This threat type identifies URLs of pages that are flagged as containing potentially
+ * harmful applications.
+ */
+ public static final int TYPE_POTENTIALLY_HARMFUL_APPLICATION = 4;
+
+ /**
+ * This threat type identifies URLs of pages that are flagged as containing social
+ * engineering threats.
+ */
+ public static final int TYPE_SOCIAL_ENGINEERING = 5;
+}
+</pre>
+<p>
+ When using the API, you must use constants that are not marked as deprecated.
+ You add threat type constants as arguments to the API. You may add as many
+ threat type constants as is required for your app.
+</p>
+
+<h3 id="url-check-request">
+ Send the URL check request
+</h3>
+
+<p>
+ The API is agnostic to the scheme used, so you can pass the URL with or
+ without a scheme. For example, either
+</p>
+
+<pre>
+String url = "https://www.google.com";
+</pre>
+<p>
+ or
+</p>
+
+<pre>
+String url = "www.google.com";
+</pre>
+<p>
+ is valid.
+</p>
+
+<pre>
+SafetyNet.SafetyNetApi.lookupUri(mGoogleApiClient, url,
+ SafeBrowsingThreat.TYPE_POTENTIALLY_HARMFUL_APPLICATION,
+ SafeBrowsingThreat.TYPE_SOCIAL_ENGINEERING)
+ .setResultCallback(
+ new ResultCallback<SafetyNetApi.SafeBrowsingResult>() {
+
+ @Override
+ public void onResult(SafetyNetApi.SafeBrowsingResult result) {
+ Status status = result.getStatus();
+ if ((status != null) && status.isSuccess()) {
+ // Indicates communication with the service was successful.
+ // Identify any detected threats.
+ if (result.getDetectedThreats().isEmpty()) {
+
+ }
+ } else {
+ // An error occurred. Let the user proceed without warning.
+ }
+ }
+});
+</pre>
+<h3 id="url-check-response">
+ Read the URL check response
+</h3>
+
+<p>
+ The result is provided as a list of {@code SafeBrowsingThreat} objects by
+ calling the {@code SafetyNetApi.SafeBrowsingResult.getDetectedThreats()}
+ method of the returned {@code SafetyNetApi.SafeBrowsingResult} object. If the
+ list is empty, no threats were detected; otherwise, calling {@code
+ SafeBrowsingThreat.getThreatType()} on each element in the list enumerates
+ the threats that were detected.
+</p>
+
+<h2 id="warning-lang">
+ Suggested Warning Language
+</h2>
+
+<p>
+ Please see the Safe Browsing API Developer's Guide for <a href=
+ "https://developers.google.com/safe-browsing/v4/usage-limits#suggested--warning-language">
+ suggested warning language</a>.
+</p>
\ No newline at end of file
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index d68f0e3..c6b258b 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -562,11 +562,16 @@
swap.damage = screenDirty;
swap.swapCompletedTime = systemTime(CLOCK_MONOTONIC);
swap.vsyncTime = mRenderThread.timeLord().latestVsync();
- int durationUs;
- mNativeSurface->query(NATIVE_WINDOW_LAST_DEQUEUE_DURATION, &durationUs);
- swap.dequeueDuration = us2ns(durationUs);
- mNativeSurface->query(NATIVE_WINDOW_LAST_QUEUE_DURATION, &durationUs);
- swap.queueDuration = us2ns(durationUs);
+ if (mNativeSurface.get()) {
+ int durationUs;
+ mNativeSurface->query(NATIVE_WINDOW_LAST_DEQUEUE_DURATION, &durationUs);
+ swap.dequeueDuration = us2ns(durationUs);
+ mNativeSurface->query(NATIVE_WINDOW_LAST_QUEUE_DURATION, &durationUs);
+ swap.queueDuration = us2ns(durationUs);
+ } else {
+ swap.dequeueDuration = 0;
+ swap.queueDuration = 0;
+ }
mCurrentFrameInfo->set(FrameInfoIndex::DequeueBufferDuration)
= swap.dequeueDuration;
mCurrentFrameInfo->set(FrameInfoIndex::QueueBufferDuration)
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/AddPrinterActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/AddPrinterActivity.java
index 2f58de5..c06e849 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/AddPrinterActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/AddPrinterActivity.java
@@ -737,9 +737,11 @@
public void updateInstalledServices(List<PrintServiceInfo> services) {
mInstalledServices.clear();
- final int numServices = services.size();
- for (int i = 0; i < numServices; i++) {
- mInstalledServices.add(services.get(i).getComponentName().getPackageName());
+ if (services != null) {
+ final int numServices = services.size();
+ for (int i = 0; i < numServices; i++) {
+ mInstalledServices.add(services.get(i).getComponentName().getPackageName());
+ }
}
filterRecommendations();
diff --git a/packages/SettingsLib/res/layout/usage_view.xml b/packages/SettingsLib/res/layout/usage_view.xml
index aa1a046..1d56668 100644
--- a/packages/SettingsLib/res/layout/usage_view.xml
+++ b/packages/SettingsLib/res/layout/usage_view.xml
@@ -71,9 +71,11 @@
android:id="@+id/bottom_label_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingStart="@dimen/usage_graph_labels_width"
android:orientation="horizontal">
-
+ <Space
+ android:id="@+id/bottom_label_space"
+ android:layout_width="@dimen/usage_graph_labels_width"
+ android:layout_height="wrap_content"/>
<include android:id="@+id/label_start"
layout="@layout/usage_side_label" />
diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java b/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java
index ee1821d..c6a45bc 100644
--- a/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java
+++ b/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java
@@ -71,10 +71,11 @@
layout.addView(labels);
// Set gravity.
labels.setGravity(Gravity.END);
- // Swap the bottom label padding
+ // Swap the bottom space order.
LinearLayout bottomLabels = (LinearLayout) findViewById(R.id.bottom_label_group);
- bottomLabels.setPadding(bottomLabels.getPaddingRight(), bottomLabels.getPaddingTop(),
- bottomLabels.getPaddingLeft(), bottomLabels.getPaddingBottom());
+ View bottomSpace = bottomLabels.findViewById(R.id.bottom_label_space);
+ bottomLabels.removeView(bottomSpace);
+ bottomLabels.addView(bottomSpace);
} else if (gravity != Gravity.START) {
throw new IllegalArgumentException("Unsupported gravity " + gravity);
}
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp.xml
index 67e6a01..e207cb3 100644
--- a/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp.xml
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp.xml
@@ -98,11 +98,11 @@
<path
android:name="path_2"
android:pathData="M 1.35900878906,6.76104736328 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-2.69995117188 0.0,-2.69995117188 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,2.69995117188 0.0,2.69995117188 Z"
- android:fillColor="#FFF2501D" />
+ android:fillColor="@*android:color/system_error" />
<path
android:name="path_1"
android:pathData="M 1.35363769531,1.36633300781 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-8.09997558594 0.0,-8.09997558594 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,8.09997558594 0.0,8.09997558594 Z"
- android:fillColor="#FFF2501D" />
+ android:fillColor="@*android:color/system_error" />
</group>
</group>
<group
@@ -117,7 +117,7 @@
<path
android:name="path_3"
android:pathData="M 0.0101470947266,10.8087768555 c -5.96701049805,0.0 -10.8000183105,-4.8330078125 -10.8000183105,-10.8000488281 c 0.0,-5.96691894531 4.8330078125,-10.7999267578 10.8000183105,-10.7999267578 c 5.96697998047,0.0 10.799987793,4.8330078125 10.799987793,10.7999267578 c 0.0,5.96704101562 -4.8330078125,10.8000488281 -10.799987793,10.8000488281 Z"
- android:strokeColor="#FFF2501D"
+ android:strokeColor="@*android:color/system_error"
android:strokeWidth="2"
android:trimPathStart="0"
android:trimPathEnd="1" />
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state.xml
index bbadec1..2b4babc 100644
--- a/packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state.xml
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state.xml
@@ -96,7 +96,7 @@
<path
android:name="ridge_5_path_0"
android:pathData="M -25.3591003418,-24.4138946533 c -0.569000244141,0.106399536133 -1.12660217285,0.140594482422 -1.45460510254,0.140594482422 c -1.29689025879,0.0 -2.53239440918,-0.343307495117 -3.62019348145,-1.12400817871 c -1.67700195312,-1.20349121094 -2.76950073242,-3.17008972168 -2.76950073242,-5.39189147949"
- android:strokeColor="#FFF2501D"
+ android:strokeColor="@*android:color/system_error"
android:strokeWidth="1.45"
android:strokeLineCap="round"
android:trimPathEnd="0" />
@@ -106,7 +106,7 @@
<path
android:name="ridge_7_path_0"
android:pathData="M -36.1409912109,-21.7843475342 c -1.00540161133,-1.19300842285 -1.57499694824,-1.9181060791 -2.36520385742,-3.50170898438 c -0.827560424805,-1.65869140625 -1.31352233887,-3.49159240723 -1.31352233887,-5.48489379883 c 0.0,-3.66279602051 2.96932983398,-6.63220214844 6.63221740723,-6.63220214844 c 3.6628112793,0.0 6.63220214844,2.96940612793 6.63220214844,6.63220214844"
- android:strokeColor="#FFF2501D"
+ android:strokeColor="@*android:color/system_error"
android:strokeWidth="1.45"
android:strokeLineCap="round"
android:trimPathEnd="0" />
@@ -116,7 +116,7 @@
<path
android:name="ridge_6_path_0"
android:pathData="M -42.1907958984,-25.6756896973 c -0.758117675781,-2.14370727539 -0.896545410156,-3.86891174316 -0.896545410156,-5.12921142578 c 0.0,-1.46069335938 0.249176025391,-2.84799194336 0.814682006836,-4.09748840332 c 1.56153869629,-3.45030212402 5.03434753418,-5.85076904297 9.0679473877,-5.85076904297 c 5.49430847168,0.0 9.94830322266,4.4539642334 9.94830322266,9.94825744629 c 0.0,1.83151245117 -1.48460388184,3.31610107422 -3.31610107422,3.31610107422 c -1.83149719238,0.0 -3.31610107422,-1.48469543457 -3.31610107422,-3.31610107422 c 0.0,-1.83139038086 -1.48458862305,-3.31610107422 -3.31610107422,-3.31610107422 c -1.83149719238,0.0 -3.31610107422,1.48471069336 -3.31610107422,3.31610107422 c 0.0,2.57020568848 0.989517211914,4.88710021973 2.60510253906,6.5865020752 c 1.22210693359,1.28550720215 2.43139648438,2.09950256348 4.47590637207,2.69030761719"
- android:strokeColor="#FFF2501D"
+ android:strokeColor="@*android:color/system_error"
android:strokeWidth="1.45"
android:strokeLineCap="round"
android:trimPathEnd="0" />
@@ -126,7 +126,7 @@
<path
android:name="ridge_2_path_0"
android:pathData="M -44.0646514893,-38.1672973633 c 1.19026184082,-1.77430725098 2.67503356934,-3.24531555176 4.55902099609,-4.27278137207 c 1.88395690918,-1.0274810791 4.04466247559,-1.61137390137 6.34175109863,-1.61137390137 c 2.28761291504,0.0 4.43991088867,0.579071044922 6.31831359863,1.59861755371 c 1.8784942627,1.01954650879 3.36059570312,2.4796295166 4.55279541016,4.24153137207"
- android:strokeColor="#FFF2501D"
+ android:strokeColor="@*android:color/system_error"
android:strokeWidth="1.45"
android:strokeLineCap="round"
android:trimPathStart="1" />
@@ -138,7 +138,7 @@
<path
android:name="ridge_1_path_0"
android:pathData="M 71.7812347412,97.0507202148 c -2.27149963379,-1.31344604492 -4.71360778809,-2.07006835938 -7.56221008301,-2.07006835938 c -2.84869384766,0.0 -5.23320007324,0.779556274414 -7.34411621094,2.07006835938"
- android:strokeColor="#FFF2501D"
+ android:strokeColor="@*android:color/system_error"
android:strokeWidth="1.45"
android:strokeLineCap="round"
android:trimPathEnd="0" />
@@ -157,11 +157,11 @@
<path
android:name="path_2"
android:pathData="M -1.3705291748,4.06730651855 c 0.0,0.0 0.036376953125,-0.0102386474609 0.036376953125,-0.0102386474609 c 0.0,0.0 -0.00682067871094,0.0040283203125 -0.00682067871093,0.0040283203125 c 0.0,0.0 -0.0161437988281,0.00479125976562 -0.0161437988281,0.00479125976563 c 0.0,0.0 -0.0134124755859,0.00141906738281 -0.0134124755859,0.00141906738281 Z"
- android:fillColor="#FFF2501D" />
+ android:fillColor="@*android:color/system_error" />
<path
android:name="path_1"
android:pathData="M -1.3737487793,-6.77532958984 c 0.0,0.0 0.00604248046875,0.0166625976562 0.00604248046876,0.0166625976562 c 0.0,0.0 0.0213623046875,0.0250244140625 0.0213623046875,0.0250244140625 c 0.0,0.0 -0.00604248046875,-0.0166625976562 -0.00604248046876,-0.0166625976562 c 0.0,0.0 -0.0213623046875,-0.0250244140625 -0.0213623046875,-0.0250244140625 Z"
- android:fillColor="#FFF2501D" />
+ android:fillColor="@*android:color/system_error" />
</group>
</group>
<group
@@ -176,7 +176,7 @@
<path
android:name="path_3"
android:pathData="M 0.0101470947266,10.8087768555 c -5.96701049805,0.0 -10.8000183105,-4.8330078125 -10.8000183105,-10.8000488281 c 0.0,-5.96691894531 4.8330078125,-10.7999267578 10.8000183105,-10.7999267578 c 5.96697998047,0.0 10.799987793,4.8330078125 10.799987793,10.7999267578 c 0.0,5.96704101562 -4.8330078125,10.8000488281 -10.799987793,10.8000488281 Z"
- android:strokeColor="#FFF2501D"
+ android:strokeColor="@*android:color/system_error"
android:strokeWidth="2"
android:trimPathStart="1" />
</group>
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java
index 2d1f753..9415b27 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java
@@ -16,6 +16,7 @@
package com.android.systemui.qs.tiles;
+import android.app.ActivityManager;
import android.content.Intent;
import android.provider.Settings;
import android.widget.Switch;
@@ -29,11 +30,12 @@
public class NightDisplayTile extends QSTile<QSTile.BooleanState>
implements NightDisplayController.Callback {
- private final NightDisplayController mController;
+ private NightDisplayController mController;
+ private boolean mIsListening;
public NightDisplayTile(Host host) {
super(host);
- mController = new NightDisplayController(mContext);
+ mController = new NightDisplayController(mContext, ActivityManager.getCurrentUser());
}
@Override
@@ -54,6 +56,22 @@
}
@Override
+ protected void handleUserSwitch(int newUserId) {
+ // Stop listening to the old controller.
+ if (mIsListening) {
+ mController.setListener(null);
+ }
+
+ // Make a new controller for the new user.
+ mController = new NightDisplayController(mContext, newUserId);
+ if (mIsListening) {
+ mController.setListener(this);
+ }
+
+ super.handleUserSwitch(newUserId);
+ }
+
+ @Override
protected void handleUpdateState(BooleanState state, Object arg) {
final boolean isActivated = mController.isActivated();
state.value = isActivated;
@@ -79,6 +97,7 @@
@Override
protected void setListening(boolean listening) {
+ mIsListening = listening;
if (listening) {
mController.setListener(this);
refreshState();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java
index 63f726b..95cb672 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java
@@ -176,8 +176,18 @@
mCurrentView = currentView.findViewById(mId);
}
+ public void setCarMode(boolean carMode) {
+ final int N = mViews.size();
+ for (int i = 0; i < N; i++) {
+ final View view = mViews.get(i);
+ if (view instanceof ButtonInterface) {
+ ((ButtonInterface) view).setCarMode(carMode);
+ }
+ }
+ }
+
/**
- * Interface for ImageView button actions.
+ * Interface for button actions.
*/
public interface ButtonInterface {
void setImageResource(@DrawableRes int resId);
@@ -187,5 +197,7 @@
void abortCurrentGesture();
void setLandscape(boolean landscape);
+
+ void setCarMode(boolean carMode);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 23aeae8..0f4d9ed 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -624,6 +624,7 @@
mCarMode = true;
uiCarModeChanged = true;
}
+ getHomeButton().setCarMode(mCarMode);
}
return uiCarModeChanged;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
index 405ccd6..10facea 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
@@ -334,6 +334,9 @@
|| ((CustomTile) tile).getUser() == currentUser)) {
if (DEBUG) Log.d(TAG, "Adding " + tile);
tile.removeCallbacks();
+ if (!(tile instanceof CustomTile) && mCurrentUser != currentUser) {
+ tile.userSwitch(currentUser);
+ }
newTiles.put(tileSpec, tile);
} else {
if (DEBUG) Log.d(TAG, "Creating tile: " + tileSpec);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
index 3df7590..61bac2d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
@@ -270,6 +270,11 @@
public void setLandscape(boolean landscape) {
//no op
}
+
+ @Override
+ public void setCarMode(boolean carMode) {
+ // no op
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index a1265fb..83463e2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -471,6 +471,10 @@
}
mServiceState = state;
mDataNetType = state.getDataNetworkType();
+ if (mDataNetType == TelephonyManager.NETWORK_TYPE_LTE && mServiceState != null &&
+ mServiceState.isUsingCarrierAggregation()) {
+ mDataNetType = TelephonyManager.NETWORK_TYPE_LTE_CA;
+ }
updateTelephony();
}
@@ -482,6 +486,10 @@
}
mDataState = state;
mDataNetType = networkType;
+ if (mDataNetType == TelephonyManager.NETWORK_TYPE_LTE && mServiceState != null &&
+ mServiceState.isUsingCarrierAggregation()) {
+ mDataNetType = TelephonyManager.NETWORK_TYPE_LTE_CA;
+ }
updateTelephony();
}
diff --git a/services/core/java/com/android/server/am/PreBootBroadcaster.java b/services/core/java/com/android/server/am/PreBootBroadcaster.java
index b24edb9..f4f6b66 100644
--- a/services/core/java/com/android/server/am/PreBootBroadcaster.java
+++ b/services/core/java/com/android/server/am/PreBootBroadcaster.java
@@ -130,7 +130,7 @@
switch (msg.what) {
case MSG_SHOW:
final CharSequence title = context
- .getText(R.string.android_upgrading_title);
+ .getText(R.string.android_upgrading_notification_title);
final Intent intent = new Intent();
intent.setClassName("com.android.settings",
diff --git a/services/core/java/com/android/server/job/controllers/ContentObserverController.java b/services/core/java/com/android/server/job/controllers/ContentObserverController.java
index a42d0cd..5d209fc 100644
--- a/services/core/java/com/android/server/job/controllers/ContentObserverController.java
+++ b/services/core/java/com/android/server/job/controllers/ContentObserverController.java
@@ -16,6 +16,7 @@
package com.android.server.job.controllers;
+import android.annotation.UserIdInt;
import android.app.job.JobInfo;
import android.content.Context;
import android.database.ContentObserver;
@@ -23,6 +24,7 @@
import android.os.Handler;
import android.os.UserHandle;
import android.util.Slog;
+import android.util.SparseArray;
import android.util.TimeUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -35,6 +37,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Objects;
/**
* Controller for monitoring changes to content URIs through a ContentObserver.
@@ -59,7 +62,11 @@
private static volatile ContentObserverController sController;
final private List<JobStatus> mTrackedTasks = new ArrayList<JobStatus>();
- ArrayMap<JobInfo.TriggerContentUri, ObserverInstance> mObservers = new ArrayMap<>();
+ /**
+ * Per-userid {@link JobInfo.TriggerContentUri} keyed ContentObserver cache.
+ */
+ SparseArray<ArrayMap<JobInfo.TriggerContentUri, ObserverInstance>> mObservers =
+ new SparseArray<>();
final Handler mHandler;
public static ContentObserverController get(JobSchedulerService taskManagerService) {
@@ -203,18 +210,21 @@
final class ObserverInstance extends ContentObserver {
final JobInfo.TriggerContentUri mUri;
+ final @UserIdInt int mUserId;
final ArraySet<JobInstance> mJobs = new ArraySet<>();
- public ObserverInstance(Handler handler, JobInfo.TriggerContentUri uri) {
+ public ObserverInstance(Handler handler, JobInfo.TriggerContentUri uri,
+ @UserIdInt int userId) {
super(handler);
mUri = uri;
+ mUserId = userId;
}
@Override
public void onChange(boolean selfChange, Uri uri) {
if (DEBUG) {
Slog.i(TAG, "onChange(self=" + selfChange + ") for " + uri
- + " when mUri=" + mUri);
+ + " when mUri=" + mUri + " mUserId=" + mUserId);
}
synchronized (mLock) {
final int N = mJobs.size();
@@ -258,27 +268,38 @@
boolean mTriggerPending;
+ // This constructor must be called with the master job scheduler lock held.
JobInstance(JobStatus jobStatus) {
mJobStatus = jobStatus;
mExecuteRunner = new TriggerRunnable(this);
mTimeoutRunner = new TriggerRunnable(this);
final JobInfo.TriggerContentUri[] uris = jobStatus.getJob().getTriggerContentUris();
+ final int sourceUserId = jobStatus.getSourceUserId();
+ ArrayMap<JobInfo.TriggerContentUri, ObserverInstance> observersOfUser =
+ mObservers.get(sourceUserId);
+ if (observersOfUser == null) {
+ observersOfUser = new ArrayMap<>();
+ mObservers.put(sourceUserId, observersOfUser);
+ }
if (uris != null) {
for (JobInfo.TriggerContentUri uri : uris) {
- ObserverInstance obs = mObservers.get(uri);
+ ObserverInstance obs = observersOfUser.get(uri);
if (obs == null) {
- obs = new ObserverInstance(mHandler, uri);
- mObservers.put(uri, obs);
+ obs = new ObserverInstance(mHandler, uri, jobStatus.getSourceUserId());
+ observersOfUser.put(uri, obs);
final boolean andDescendants = (uri.getFlags() &
JobInfo.TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS) != 0;
if (DEBUG) {
Slog.v(TAG, "New observer " + obs + " for " + uri.getUri()
- + " andDescendants=" + andDescendants);
+ + " andDescendants=" + andDescendants
+ + " sourceUserId=" + sourceUserId);
}
mContext.getContentResolver().registerContentObserver(
uri.getUri(),
andDescendants,
- obs);
+ obs,
+ sourceUserId
+ );
} else {
if (DEBUG) {
final boolean andDescendants = (uri.getFlags() &
@@ -342,7 +363,11 @@
Slog.i(TAG, "Unregistering observer " + obs + " for " + obs.mUri.getUri());
}
mContext.getContentResolver().unregisterContentObserver(obs);
- mObservers.remove(obs.mUri);
+ ArrayMap<JobInfo.TriggerContentUri, ObserverInstance> observerOfUser =
+ mObservers.get(obs.mUserId);
+ if (observerOfUser != null) {
+ observerOfUser.remove(obs.mUri);
+ }
}
}
}
@@ -366,60 +391,66 @@
int N = mObservers.size();
if (N > 0) {
pw.println(" Observers:");
- for (int i = 0; i < N; i++) {
- ObserverInstance obs = mObservers.valueAt(i);
- int M = obs.mJobs.size();
- boolean shouldDump = false;
- for (int j=0; j<M; j++) {
- JobInstance inst = obs.mJobs.valueAt(j);
- if (inst.mJobStatus.shouldDump(filterUid)) {
- shouldDump = true;
- break;
+ for (int userIdx = 0; userIdx < N; userIdx++) {
+ final int userId = mObservers.keyAt(userIdx);
+ ArrayMap<JobInfo.TriggerContentUri, ObserverInstance> observersOfUser =
+ mObservers.get(userId);
+ int numbOfObserversPerUser = observersOfUser.size();
+ for (int observerIdx = 0 ; observerIdx < numbOfObserversPerUser; observerIdx++) {
+ ObserverInstance obs = observersOfUser.valueAt(observerIdx);
+ int M = obs.mJobs.size();
+ boolean shouldDump = false;
+ for (int j = 0; j < M; j++) {
+ JobInstance inst = obs.mJobs.valueAt(j);
+ if (inst.mJobStatus.shouldDump(filterUid)) {
+ shouldDump = true;
+ break;
+ }
}
- }
- if (!shouldDump) {
- continue;
- }
- pw.print(" ");
- JobInfo.TriggerContentUri trigger = mObservers.keyAt(i);
- pw.print(trigger.getUri());
- pw.print(" 0x");
- pw.print(Integer.toHexString(trigger.getFlags()));
- pw.print(" (");
- pw.print(System.identityHashCode(obs));
- pw.println("):");
- pw.println(" Jobs:");
- for (int j=0; j<M; j++) {
- JobInstance inst = obs.mJobs.valueAt(j);
- pw.print(" #");
- inst.mJobStatus.printUniqueId(pw);
- pw.print(" from ");
- UserHandle.formatUid(pw, inst.mJobStatus.getSourceUid());
- if (inst.mChangedAuthorities != null) {
- pw.println(":");
- if (inst.mTriggerPending) {
- pw.print(" Trigger pending: update=");
- TimeUtils.formatDuration(
- inst.mJobStatus.getTriggerContentUpdateDelay(), pw);
- pw.print(", max=");
- TimeUtils.formatDuration(
- inst.mJobStatus.getTriggerContentMaxDelay(), pw);
+ if (!shouldDump) {
+ continue;
+ }
+ pw.print(" ");
+ JobInfo.TriggerContentUri trigger = observersOfUser.keyAt(observerIdx);
+ pw.print(trigger.getUri());
+ pw.print(" 0x");
+ pw.print(Integer.toHexString(trigger.getFlags()));
+ pw.print(" (");
+ pw.print(System.identityHashCode(obs));
+ pw.println("):");
+ pw.println(" Jobs:");
+ for (int j = 0; j < M; j++) {
+ JobInstance inst = obs.mJobs.valueAt(j);
+ pw.print(" #");
+ inst.mJobStatus.printUniqueId(pw);
+ pw.print(" from ");
+ UserHandle.formatUid(pw, inst.mJobStatus.getSourceUid());
+ if (inst.mChangedAuthorities != null) {
+ pw.println(":");
+ if (inst.mTriggerPending) {
+ pw.print(" Trigger pending: update=");
+ TimeUtils.formatDuration(
+ inst.mJobStatus.getTriggerContentUpdateDelay(), pw);
+ pw.print(", max=");
+ TimeUtils.formatDuration(
+ inst.mJobStatus.getTriggerContentMaxDelay(), pw);
+ pw.println();
+ }
+ pw.println(" Changed Authorities:");
+ for (int k = 0; k < inst.mChangedAuthorities.size(); k++) {
+ pw.print(" ");
+ pw.println(inst.mChangedAuthorities.valueAt(k));
+ }
+ if (inst.mChangedUris != null) {
+ pw.println(" Changed URIs:");
+ for (int k = 0; k < inst.mChangedUris.size(); k++) {
+ pw.print(" ");
+ pw.println(inst.mChangedUris.valueAt(k));
+ }
+ }
+ } else {
pw.println();
}
- pw.println(" Changed Authorities:");
- for (int k=0; k<inst.mChangedAuthorities.size(); k++) {
- pw.print(" ");
- pw.println(inst.mChangedAuthorities.valueAt(k));
- }
- if (inst.mChangedUris != null) {
- pw.println(" Changed URIs:");
- for (int k = 0; k<inst.mChangedUris.size(); k++) {
- pw.print(" ");
- pw.println(inst.mChangedUris.valueAt(k));
- }
- }
- } else {
- pw.println();
}
}
}
diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java
index a3f09c0..777eee8 100644
--- a/services/core/java/com/android/server/media/MediaSessionService.java
+++ b/services/core/java/com/android/server/media/MediaSessionService.java
@@ -239,7 +239,8 @@
synchronized (mLock) {
UserManager manager = (UserManager) getContext().getSystemService(Context.USER_SERVICE);
int currentUser = ActivityManager.getCurrentUser();
- int[] userIds = manager.getEnabledProfileIds(currentUser);
+ // Include all profiles even though they aren't yet enabled to handle work profile case.
+ int[] userIds = manager.getProfileIdsWithDisabled(currentUser);
mCurrentUserIdList.clear();
if (userIds != null && userIds.length > 0) {
for (int userId : userIds) {
@@ -440,6 +441,12 @@
private MediaSessionRecord createSessionLocked(int callerPid, int callerUid, int userId,
String callerPackageName, ISessionCallback cb, String tag) {
+ UserRecord user = mUserRecords.get(userId);
+ if (user == null) {
+ Log.wtf(TAG, "Request from invalid user: " + userId);
+ throw new RuntimeException("Session request from invalid user.");
+ }
+
final MediaSessionRecord session = new MediaSessionRecord(callerPid, callerUid, userId,
callerPackageName, cb, tag, this, mHandler);
try {
@@ -450,8 +457,6 @@
mAllSessions.add(session);
mPriorityStack.addSession(session, mCurrentUserIdList.contains(userId));
-
- UserRecord user = mUserRecords.get(userId);
user.addSessionLocked(session);
mHandler.post(MessageHandler.MSG_SESSIONS_CHANGED, userId, 0);
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 8b5942c..de1d7a7 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -58,7 +58,6 @@
import android.app.NotificationManager;
import android.app.NotificationManager.Policy;
import android.app.PendingIntent;
-import android.app.RemoteInput;
import android.app.StatusBarManager;
import android.app.backup.BackupManager;
import android.app.usage.UsageEvents;
@@ -93,7 +92,6 @@
import android.os.IInterface;
import android.os.Looper;
import android.os.Message;
-import android.os.Parcelable;
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
@@ -122,6 +120,8 @@
import android.util.Slog;
import android.util.SparseArray;
import android.util.Xml;
+import android.view.WindowManager;
+import android.view.WindowManagerInternal;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.widget.Toast;
@@ -138,6 +138,7 @@
import com.android.server.lights.Light;
import com.android.server.lights.LightsManager;
import com.android.server.notification.ManagedServices.ManagedServiceInfo;
+import com.android.server.policy.PhoneWindowManager;
import com.android.server.statusbar.StatusBarManagerInternal;
import com.android.server.vr.VrManagerInternal;
import com.android.server.notification.ManagedServices.UserProfiles;
@@ -193,7 +194,7 @@
private static final int MESSAGE_RECONSIDER_RANKING = 1000;
private static final int MESSAGE_RANKING_SORT = 1001;
- static final int LONG_DELAY = 3500; // 3.5 seconds
+ static final int LONG_DELAY = PhoneWindowManager.TOAST_WINDOW_TIMEOUT;
static final int SHORT_DELAY = 2000; // 2 seconds
static final long[] DEFAULT_VIBRATE_PATTERN = {0, 250, 250, 250};
@@ -232,6 +233,7 @@
@Nullable StatusBarManagerInternal mStatusBar;
Vibrator mVibrator;
private VrManagerInternal mVrManagerInternal;
+ private WindowManagerInternal mWindowManagerInternal;
final IBinder mForegroundToken = new Binder();
private Handler mHandler;
@@ -452,13 +454,15 @@
final String pkg;
final ITransientNotification callback;
int duration;
+ Binder token;
- ToastRecord(int pid, String pkg, ITransientNotification callback, int duration)
- {
+ ToastRecord(int pid, String pkg, ITransientNotification callback, int duration,
+ Binder token) {
this.pid = pid;
this.pkg = pkg;
this.callback = callback;
this.duration = duration;
+ this.token = token;
}
void update(int duration) {
@@ -1125,6 +1129,7 @@
mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
mAudioManagerInternal = getLocalService(AudioManagerInternal.class);
mVrManagerInternal = getLocalService(VrManagerInternal.class);
+ mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class);
mZenModeHelper.onSystemReady();
} else if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
// This observer will force an update when observe is called, causing us to
@@ -1325,10 +1330,13 @@
}
}
- record = new ToastRecord(callingPid, pkg, callback, duration);
+ Binder token = new Binder();
+ mWindowManagerInternal.addWindowToken(token,
+ WindowManager.LayoutParams.TYPE_TOAST);
+ record = new ToastRecord(callingPid, pkg, callback, duration, token);
mToastQueue.add(record);
index = mToastQueue.size() - 1;
- keepProcessAliveLocked(callingPid);
+ keepProcessAliveIfNeededLocked(callingPid);
}
// If it's at index 0, it's the current toast. It doesn't matter if it's
// new or just been updated. Call back and tell it to show itself.
@@ -2987,7 +2995,7 @@
while (record != null) {
if (DBG) Slog.d(TAG, "Show pkg=" + record.pkg + " callback=" + record.callback);
try {
- record.callback.show();
+ record.callback.show(record.token);
scheduleTimeoutLocked(record);
return;
} catch (RemoteException e) {
@@ -2998,7 +3006,7 @@
if (index >= 0) {
mToastQueue.remove(index);
}
- keepProcessAliveLocked(record.pid);
+ keepProcessAliveIfNeededLocked(record.pid);
if (mToastQueue.size() > 0) {
record = mToastQueue.get(0);
} else {
@@ -3018,8 +3026,11 @@
// don't worry about this, we're about to remove it from
// the list anyway
}
- mToastQueue.remove(index);
- keepProcessAliveLocked(record.pid);
+
+ ToastRecord lastToast = mToastQueue.remove(index);
+ mWindowManagerInternal.removeWindowToken(lastToast.token, true);
+
+ keepProcessAliveIfNeededLocked(record.pid);
if (mToastQueue.size() > 0) {
// Show the next one. If the callback fails, this will remove
// it from the list, so don't assume that the list hasn't changed
@@ -3063,7 +3074,7 @@
}
// lock on mToastQueue
- void keepProcessAliveLocked(int pid)
+ void keepProcessAliveIfNeededLocked(int pid)
{
int toastCount = 0; // toasts from this pid
ArrayList<ToastRecord> list = mToastQueue;
diff --git a/services/core/java/com/android/server/pm/OtaDexoptService.java b/services/core/java/com/android/server/pm/OtaDexoptService.java
index 77c69c9..c5f3cfd3b 100644
--- a/services/core/java/com/android/server/pm/OtaDexoptService.java
+++ b/services/core/java/com/android/server/pm/OtaDexoptService.java
@@ -56,16 +56,9 @@
// TODO: Evaluate the need for WeakReferences here.
/**
- * The list of packages to dexopt.
+ * The list of dexopt invocations for all work.
*/
- private List<PackageParser.Package> mDexoptPackages;
-
- /**
- * The list of dexopt invocations for the current package (which will no longer be in
- * mDexoptPackages). This can be more than one as a package may have multiple code paths,
- * e.g., in the split-APK case.
- */
- private List<String> mCommandsForCurrentPackage;
+ private List<String> mDexoptCommands;
private int completeSize;
@@ -94,15 +87,43 @@
@Override
public synchronized void prepare() throws RemoteException {
- if (mDexoptPackages != null) {
+ if (mDexoptCommands != null) {
throw new IllegalStateException("already called prepare()");
}
synchronized (mPackageManagerService.mPackages) {
- mDexoptPackages = PackageManagerServiceUtils.getPackagesForDexopt(
+ // Important: the packages we need to run with ab-ota compiler-reason.
+ List<PackageParser.Package> important = PackageManagerServiceUtils.getPackagesForDexopt(
mPackageManagerService.mPackages.values(), mPackageManagerService);
+ // Others: we should optimize this with the (first-)boot compiler-reason.
+ List<PackageParser.Package> others =
+ new ArrayList<>(mPackageManagerService.mPackages.values());
+ others.removeAll(important);
+
+ // Pre-size the array list by over-allocating by a factor of 1.5.
+ mDexoptCommands = new ArrayList<>(3 * mPackageManagerService.mPackages.size() / 2);
+
+ for (PackageParser.Package p : important) {
+ // Make sure that core apps are optimized according to their own "reason".
+ // If the core apps are not preopted in the B OTA, and REASON_AB_OTA is not speed
+ // (by default is speed-profile) they will be interepreted/JITed. This in itself is
+ // not a problem as we will end up doing profile guided compilation. However, some
+ // core apps may be loaded by system server which doesn't JIT and we need to make
+ // sure we don't interpret-only
+ int compilationReason = p.coreApp
+ ? PackageManagerService.REASON_CORE_APP
+ : PackageManagerService.REASON_AB_OTA;
+ mDexoptCommands.addAll(generatePackageDexopts(p, compilationReason));
+ }
+ for (PackageParser.Package p : others) {
+ // We assume here that there are no core apps left.
+ if (p.coreApp) {
+ throw new IllegalStateException("Found a core app that's not important");
+ }
+ mDexoptCommands.addAll(
+ generatePackageDexopts(p, PackageManagerService.REASON_FIRST_BOOT));
+ }
}
- completeSize = mDexoptPackages.size();
- mCommandsForCurrentPackage = null;
+ completeSize = mDexoptCommands.size();
}
@Override
@@ -110,87 +131,52 @@
if (DEBUG_DEXOPT) {
Log.i(TAG, "Cleaning up OTA Dexopt state.");
}
- mDexoptPackages = null;
- mCommandsForCurrentPackage = null;
+ mDexoptCommands = null;
}
@Override
public synchronized boolean isDone() throws RemoteException {
- if (mDexoptPackages == null) {
+ if (mDexoptCommands == null) {
throw new IllegalStateException("done() called before prepare()");
}
- return mDexoptPackages.isEmpty() && (mCommandsForCurrentPackage == null);
+ return mDexoptCommands.isEmpty();
}
@Override
public synchronized float getProgress() throws RemoteException {
- // We approximate by number of packages here. We could track all compiles, if we
- // generated them ahead of time. Right now we're trying to conserve memory.
+ // Approximate the progress by the amount of already completed commands.
if (completeSize == 0) {
return 1f;
}
- int packagesLeft = mDexoptPackages.size() + (mCommandsForCurrentPackage != null ? 1 : 0);
- return (completeSize - packagesLeft) / ((float)completeSize);
- }
-
- /**
- * Return the next dexopt command for the current package. Enforces the invariant
- */
- private String getNextPackageDexopt() {
- if (mCommandsForCurrentPackage != null) {
- String next = mCommandsForCurrentPackage.remove(0);
- if (mCommandsForCurrentPackage.isEmpty()) {
- mCommandsForCurrentPackage = null;
- }
- return next;
- }
- return null;
+ int commandsLeft = mDexoptCommands.size();
+ return (completeSize - commandsLeft) / ((float)completeSize);
}
@Override
public synchronized String nextDexoptCommand() throws RemoteException {
- if (mDexoptPackages == null) {
+ if (mDexoptCommands == null) {
throw new IllegalStateException("dexoptNextPackage() called before prepare()");
}
- // Get the next command.
- for (;;) {
- // Check whether there's one for the current package.
- String next = getNextPackageDexopt();
- if (next != null) {
- return next;
- }
+ if (mDexoptCommands.isEmpty()) {
+ return "(all done)";
+ }
- // Move to the next package, if possible.
- if (mDexoptPackages.isEmpty()) {
- return "Nothing to do";
- }
+ String next = mDexoptCommands.remove(0);
- PackageParser.Package nextPackage = mDexoptPackages.remove(0);
-
- if (DEBUG_DEXOPT) {
- Log.i(TAG, "Processing " + nextPackage.packageName + " for OTA dexopt.");
- }
-
- // Generate the next mPackageDexopts state. Ignore errors, this loop is strongly
- // monotonically increasing, anyways.
- generatePackageDexopts(nextPackage);
-
- // Invariant check: mPackageDexopts is null or not empty.
- if (mCommandsForCurrentPackage != null && mCommandsForCurrentPackage.isEmpty()) {
- cleanup();
- throw new IllegalStateException("mPackageDexopts empty for " + nextPackage);
- }
+ if (IsFreeSpaceAvailable()) {
+ return next;
+ } else {
+ mDexoptCommands.clear();
+ return "(no free space)";
}
}
/**
- * Generate all dexopt commands for the given package and place them into mPackageDexopts.
- * Returns true on success, false in an error situation like low disk space.
+ * Check for low space. Returns true if there's space left.
*/
- private synchronized boolean generatePackageDexopts(PackageParser.Package nextPackage) {
- // Check for low space.
+ private boolean IsFreeSpaceAvailable() {
// TODO: If apps are not installed in the internal /data partition, we should compare
// against that storage's free capacity.
File dataDir = Environment.getDataDirectory();
@@ -200,12 +186,14 @@
throw new IllegalStateException("Invalid low memory threshold");
}
long usableSpace = dataDir.getUsableSpace();
- if (usableSpace < lowThreshold) {
- Log.w(TAG, "Not running dexopt on " + nextPackage.packageName + " due to low memory: " +
- usableSpace);
- return false;
- }
+ return (usableSpace >= lowThreshold);
+ }
+ /**
+ * Generate all dexopt commands for the given package.
+ */
+ private synchronized List<String> generatePackageDexopts(PackageParser.Package pkg,
+ int compilationReason) {
// Use our custom connection that just collects the commands.
RecordingInstallerConnection collectingConnection = new RecordingInstallerConnection();
Installer collectingInstaller = new Installer(mContext, collectingConnection);
@@ -213,71 +201,22 @@
// Use the package manager install and install lock here for the OTA dex optimizer.
PackageDexOptimizer optimizer = new OTADexoptPackageDexOptimizer(
collectingInstaller, mPackageManagerService.mInstallLock, mContext);
- // Make sure that core apps are optimized according to their own "reason".
- // If the core apps are not preopted in the B OTA, and REASON_AB_OTA is not speed
- // (by default is speed-profile) they will be interepreted/JITed. This in itself is not a
- // problem as we will end up doing profile guided compilation. However, some core apps may
- // be loaded by system server which doesn't JIT and we need to make sure we don't
- // interpret-only
- int compilationReason = nextPackage.coreApp
- ? PackageManagerService.REASON_CORE_APP
- : PackageManagerService.REASON_AB_OTA;
- optimizer.performDexOpt(nextPackage, nextPackage.usesLibraryFiles,
+ optimizer.performDexOpt(pkg, pkg.usesLibraryFiles,
null /* ISAs */, false /* checkProfiles */,
getCompilerFilterForReason(compilationReason),
null /* CompilerStats.PackageStats */);
- mCommandsForCurrentPackage = collectingConnection.commands;
- if (mCommandsForCurrentPackage.isEmpty()) {
- mCommandsForCurrentPackage = null;
- }
-
- return true;
+ return collectingConnection.commands;
}
@Override
public synchronized void dexoptNextPackage() throws RemoteException {
- if (mDexoptPackages == null) {
- throw new IllegalStateException("dexoptNextPackage() called before prepare()");
- }
- if (mDexoptPackages.isEmpty()) {
- // Tolerate repeated calls.
- return;
- }
-
- PackageParser.Package nextPackage = mDexoptPackages.remove(0);
-
- if (DEBUG_DEXOPT) {
- Log.i(TAG, "Processing " + nextPackage.packageName + " for OTA dexopt.");
- }
-
- // Check for low space.
- // TODO: If apps are not installed in the internal /data partition, we should compare
- // against that storage's free capacity.
- File dataDir = Environment.getDataDirectory();
- @SuppressWarnings("deprecation")
- long lowThreshold = StorageManager.from(mContext).getStorageLowBytes(dataDir);
- if (lowThreshold == 0) {
- throw new IllegalStateException("Invalid low memory threshold");
- }
- long usableSpace = dataDir.getUsableSpace();
- if (usableSpace < lowThreshold) {
- Log.w(TAG, "Not running dexopt on " + nextPackage.packageName + " due to low memory: " +
- usableSpace);
- return;
- }
-
- PackageDexOptimizer optimizer = new OTADexoptPackageDexOptimizer(
- mPackageManagerService.mInstaller, mPackageManagerService.mInstallLock, mContext);
- optimizer.performDexOpt(nextPackage, nextPackage.usesLibraryFiles, null /* ISAs */,
- false /* checkProfiles */,
- getCompilerFilterForReason(PackageManagerService.REASON_AB_OTA),
- mPackageManagerService.getOrCreateCompilerPackageStats(nextPackage));
+ throw new UnsupportedOperationException();
}
private void moveAbArtifacts(Installer installer) {
- if (mDexoptPackages != null) {
+ if (mDexoptCommands != null) {
throw new IllegalStateException("Should not be ota-dexopting when trying to move.");
}
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index 68ccbdf..c9ad49a 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -555,7 +555,7 @@
public List<UserInfo> getProfiles(int userId, boolean enabledOnly) {
boolean returnFullInfo = true;
if (userId != UserHandle.getCallingUserId()) {
- checkManageUsersPermission("getting profiles related to user " + userId);
+ checkManageOrCreateUsersPermission("getting profiles related to user " + userId);
} else {
returnFullInfo = hasManageUsersPermission();
}
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index e502764..6253963 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -301,6 +301,9 @@
/** Amount of time (in milliseconds) to wait for windows drawn before powering on. */
static final int WAITING_FOR_DRAWN_TIMEOUT = 1000;
+ /** Amount of time (in milliseconds) a toast window can be shown. */
+ public static final int TOAST_WINDOW_TIMEOUT = 3500; // 3.5 seconds
+
/**
* Lock protecting internal state. Must not call out into window
* manager with lock held. (This lock will be acquired in places
@@ -2229,6 +2232,18 @@
attrs.privateFlags &= ~WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD;
}
break;
+
+ case TYPE_TOAST:
+ // While apps should use the dedicated toast APIs to add such windows
+ // it possible legacy apps to add the window directly. Therefore, we
+ // make windows added directly by the app behave as a toast as much
+ // as possible in terms of timeout and animation.
+ if (attrs.hideTimeoutMilliseconds < 0
+ || attrs.hideTimeoutMilliseconds > TOAST_WINDOW_TIMEOUT) {
+ attrs.hideTimeoutMilliseconds = TOAST_WINDOW_TIMEOUT;
+ }
+ attrs.windowAnimations = com.android.internal.R.style.Animation_Toast;
+ break;
}
if (attrs.type != TYPE_STATUS_BAR) {
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 2215cbb..2824e6e 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -2085,7 +2085,12 @@
float screenAutoBrightnessAdjustment = 0.0f;
boolean autoBrightness = (mScreenBrightnessModeSetting ==
Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC);
- if (isValidBrightness(mScreenBrightnessOverrideFromWindowManager)) {
+ if (!mBootCompleted) {
+ // Keep the brightness steady during boot. This requires the
+ // bootloader brightness and the default brightness to be identical.
+ autoBrightness = false;
+ brightnessSetByUser = false;
+ } else if (isValidBrightness(mScreenBrightnessOverrideFromWindowManager)) {
screenBrightness = mScreenBrightnessOverrideFromWindowManager;
autoBrightness = false;
brightnessSetByUser = false;
diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java
index 8be5dfb..d2d5c28 100644
--- a/services/core/java/com/android/server/wm/AccessibilityController.java
+++ b/services/core/java/com/android/server/wm/AccessibilityController.java
@@ -1071,14 +1071,15 @@
Region.Op.REVERSE_DIFFERENCE);
}
- // We figured out what is touchable for the entire screen - done.
- if (unaccountedSpace.isEmpty()) {
- break;
- }
-
// If a window is modal it prevents other windows from being touched
if ((flags & (WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL)) == 0) {
+ // Account for all space in the task, whether the windows in it are
+ // touchable or not. The modal window blocks all touches from the task's
+ // area.
+ unaccountedSpace.op(windowState.getDisplayFrameLw(), unaccountedSpace,
+ Region.Op.REVERSE_DIFFERENCE);
+
if (task != null) {
// If the window is associated with a particular task, we can skip the
// rest of the windows for that task.
@@ -1090,6 +1091,10 @@
break;
}
}
+ // We figured out what is touchable for the entire screen - done.
+ if (unaccountedSpace.isEmpty()) {
+ break;
+ }
}
// Always report the focused window.
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 6451c74..70a1ee6 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -35,6 +35,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
+import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
@@ -200,6 +201,7 @@
import static android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION;
import static android.view.WindowManager.LayoutParams.TYPE_QS_DIALOG;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
+import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
import static android.view.WindowManagerGlobal.RELAYOUT_DEFER_SURFACE_DESTROY;
@@ -1867,6 +1869,7 @@
boolean reportNewConfig = false;
WindowState attachedWindow = null;
long origId;
+ final int callingUid = Binder.getCallingUid();
final int type = attrs.type;
synchronized(mWindowMap) {
@@ -1914,6 +1917,8 @@
boolean addToken = false;
WindowToken token = mTokenMap.get(attrs.token);
AppWindowToken atoken = null;
+ boolean addToastWindowRequiresToken = false;
+
if (token == null) {
if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
Slog.w(TAG_WM, "Attempted to add application window with unknown token "
@@ -1950,6 +1955,15 @@
+ attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
+ if (type == TYPE_TOAST) {
+ // Apps targeting SDK above N MR1 cannot arbitrary add toast windows.
+ if (doesAddToastWindowRequireToken(attrs.packageName, callingUid,
+ attachedWindow)) {
+ Slog.w(TAG_WM, "Attempted to add a toast window with unknown token "
+ + attrs.token + ". Aborting.");
+ return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
+ }
+ }
token = new WindowToken(this, attrs.token, -1, false);
addToken = true;
} else if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
@@ -1999,6 +2013,15 @@
+ attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
+ } else if (type == TYPE_TOAST) {
+ // Apps targeting SDK above N MR1 cannot arbitrary add toast windows.
+ addToastWindowRequiresToken = doesAddToastWindowRequireToken(attrs.packageName,
+ callingUid, attachedWindow);
+ if (addToastWindowRequiresToken && token.windowType != TYPE_TOAST) {
+ Slog.w(TAG_WM, "Attempted to add a toast window with bad token "
+ + attrs.token + ". Aborting.");
+ return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
+ }
} else if (type == TYPE_QS_DIALOG) {
if (token.windowType != TYPE_QS_DIALOG) {
Slog.w(TAG_WM, "Attempted to add QS dialog window with bad token "
@@ -2043,6 +2066,35 @@
win.openInputChannel(outInputChannel);
}
+ // If adding a toast requires a token for this app we always schedule hiding
+ // toast windows to make sure they don't stick around longer then necessary.
+ // We hide instead of remove such windows as apps aren't prepared to handle
+ // windows being removed under them.
+ // If the app is older it can add toasts without a token and hence overlay
+ // other apps. To be maximally compatible with these apps we will hide the
+ // window after the toast timeout only if the focused window is from another
+ // UID, otherwise we allow unlimited duration. When a UID looses focus we
+ // schedule hiding all of its toast windows.
+ if (type == TYPE_TOAST) {
+ if (!canAddToastWindowForUid(getDefaultDisplayContentLocked(), callingUid)) {
+ Slog.w(TAG_WM, "Adding more than one toast window for UID at a time.");
+ return WindowManagerGlobal.ADD_DUPLICATE_ADD;
+ }
+ // Make sure this happens before we moved focus as one can make the
+ // toast focusable to force it not being hidden after the timeout.
+ // Focusable toasts are always timed out to prevent a focused app to
+ // show a focusable toasts while it has focus which will be kept on
+ // the screen after the activity goes away.
+ if (addToastWindowRequiresToken
+ || (attrs.flags & LayoutParams.FLAG_NOT_FOCUSABLE) == 0
+ || mCurrentFocus == null
+ || mCurrentFocus.mOwnerUid != callingUid) {
+ mH.sendMessageDelayed(
+ mH.obtainMessage(H.WINDOW_HIDE_TIMEOUT, win),
+ win.mAttrs.hideTimeoutMilliseconds);
+ }
+ }
+
// From now on, no exceptions or errors allowed!
res = WindowManagerGlobal.ADD_OKAY;
@@ -2181,11 +2233,6 @@
if (win.isVisibleOrAdding() && updateOrientationFromAppTokensLocked(false)) {
reportNewConfig = true;
}
- if (attrs.removeTimeoutMilliseconds > 0) {
- mH.sendMessageDelayed(
- mH.obtainMessage(H.WINDOW_REMOVE_TIMEOUT, win),
- attrs.removeTimeoutMilliseconds);
- }
}
if (reportNewConfig) {
@@ -2197,6 +2244,73 @@
return res;
}
+ private boolean canAddToastWindowForUid(DisplayContent displayContent, int uid) {
+ // We allow one toast window per UID being shown at a time.
+ WindowList windows = displayContent.getWindowList();
+ final int windowCount = windows.size();
+ for (int i = 0; i < windowCount; i++) {
+ WindowState window = windows.get(i);
+ if (window.mAttrs.type == TYPE_TOAST && window.mOwnerUid == uid
+ && !window.mPermanentlyHidden) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private boolean doesAddToastWindowRequireToken(String packageName, int callingUid,
+ WindowState attachedWindow) {
+ // Try using the target SDK of the root window
+ if (attachedWindow != null) {
+ WindowState currentWindow = attachedWindow;
+ while (currentWindow != null) {
+ if (currentWindow.mAppToken != null
+ && currentWindow.mAppToken.targetSdk > Build.VERSION_CODES.N_MR1) {
+ return true;
+ }
+ currentWindow = currentWindow.mAttachedWindow;
+ }
+ } else {
+ // Otherwise, look at the package
+ try {
+ ApplicationInfo appInfo = mContext.getPackageManager()
+ .getApplicationInfoAsUser(packageName, 0,
+ UserHandle.getUserId(callingUid));
+ if (appInfo.uid != callingUid) {
+ throw new SecurityException("Package " + packageName + " not in UID "
+ + callingUid);
+ }
+ if (appInfo.targetSdkVersion > Build.VERSION_CODES.N_MR1) {
+ return true;
+ }
+ } catch (PackageManager.NameNotFoundException e) {
+ /* ignore */
+ }
+ }
+ return false;
+ }
+
+ private void scheduleToastWindowsTimeoutIfNeededLocked(WindowState oldFocus,
+ WindowState newFocus) {
+ if (oldFocus == null || (newFocus != null && newFocus.mOwnerUid == oldFocus.mOwnerUid)) {
+ return;
+ }
+ final int lostFocusUid = oldFocus.mOwnerUid;
+ DisplayContent displayContent = oldFocus.getDisplayContent();
+ WindowList windows = displayContent.getWindowList();
+ final int windowCount = windows.size();
+ for (int i = 0; i < windowCount; i++) {
+ WindowState window = windows.get(i);
+ if (window.mAttrs.type == TYPE_TOAST && window.mOwnerUid == lostFocusUid) {
+ if (!mH.hasMessages(H.WINDOW_HIDE_TIMEOUT, window)) {
+ mH.sendMessageDelayed(
+ mH.obtainMessage(H.WINDOW_HIDE_TIMEOUT, window),
+ window.mAttrs.hideTimeoutMilliseconds);
+ }
+ }
+ }
+ }
+
/**
* Returns true if we're done setting up any transitions.
*/
@@ -8124,7 +8238,7 @@
public static final int NOTIFY_APP_TRANSITION_FINISHED = 49;
public static final int NOTIFY_STARTING_WINDOW_DRAWN = 50;
public static final int UPDATE_ANIMATION_SCALE = 51;
- public static final int WINDOW_REMOVE_TIMEOUT = 52;
+ public static final int WINDOW_HIDE_TIMEOUT = 52;
public static final int NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED = 53;
public static final int SEAMLESS_ROTATION_TIMEOUT = 54;
@@ -8744,7 +8858,7 @@
mAmInternal.notifyStartingWindowDrawn();
}
break;
- case WINDOW_REMOVE_TIMEOUT: {
+ case WINDOW_HIDE_TIMEOUT: {
final WindowState window = (WindowState) msg.obj;
synchronized(mWindowMap) {
// TODO: This is all about fixing b/21693547
@@ -8755,8 +8869,11 @@
// running under debugger) to crash (b/29105388). The windows will
// eventually be removed when the client process finishes.
// The best we can do for now is remove the FLAG_KEEP_SCREEN_ON
- // and prevent the symptoms of b/21693547.
+ // and prevent the symptoms of b/21693547. Since apps don't
+ // support windows being removed under them we hide the window
+ // and it will be removed when the app dies.
window.mAttrs.flags &= ~FLAG_KEEP_SCREEN_ON;
+ window.markPermanentlyHiddenLw();
window.setDisplayLayoutNeeded();
mWindowPlacerLocked.performSurfacePlacement();
}
@@ -9786,6 +9903,11 @@
adjustForImeIfNeeded(displayContent);
+ // We may need to schedule some toast windows to be removed. The
+ // toasts for an app that does not have input focus are removed
+ // within a timeout to prevent apps to redress other apps' UI.
+ scheduleToastWindowsTimeoutIfNeededLocked(oldFocus, newFocus);
+
Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
return true;
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 94226ca..10f01e4 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -165,6 +165,7 @@
boolean mPolicyVisibility = true;
boolean mPolicyVisibilityAfterAnim = true;
boolean mAppOpVisibility = true;
+ boolean mPermanentlyHidden;
boolean mAppFreezing;
boolean mAttachedHidden; // is our parent window hidden?
boolean mWallpaperVisible; // for wallpaper, what was last vis report?
@@ -829,10 +830,10 @@
final int height = Math.min(mFrame.height(), mContentFrame.height());
final int width = Math.min(mContentFrame.width(), mFrame.width());
final DisplayMetrics displayMetrics = getDisplayContent().getDisplayMetrics();
- final int minVisibleHeight = WindowManagerService.dipToPixel(
- MINIMUM_VISIBLE_HEIGHT_IN_DP, displayMetrics);
- final int minVisibleWidth = WindowManagerService.dipToPixel(
- MINIMUM_VISIBLE_WIDTH_IN_DP, displayMetrics);
+ final int minVisibleHeight = Math.min(height, WindowManagerService.dipToPixel(
+ MINIMUM_VISIBLE_HEIGHT_IN_DP, displayMetrics));
+ final int minVisibleWidth = Math.min(width, WindowManagerService.dipToPixel(
+ MINIMUM_VISIBLE_WIDTH_IN_DP, displayMetrics));
final int top = Math.max(mContentFrame.top,
Math.min(mFrame.top, mContentFrame.bottom - minVisibleHeight));
final int left = Math.max(mContentFrame.left + minVisibleWidth - width,
@@ -1873,6 +1874,11 @@
// Being hidden due to app op request.
return false;
}
+ if (mPermanentlyHidden) {
+ // Permanently hidden until the app exists as apps aren't prepared
+ // to handle their windows being removed from under them.
+ return false;
+ }
if (mPolicyVisibility && mPolicyVisibilityAfterAnim) {
// Already showing.
return false;
@@ -1963,6 +1969,13 @@
}
}
+ public void markPermanentlyHiddenLw() {
+ if (!mPermanentlyHidden) {
+ mPermanentlyHidden = true;
+ hideLw(true, true);
+ }
+ }
+
public void pokeDrawLockLw(long timeout) {
if (isVisibleOrAdding()) {
if (mDrawLock == null) {
@@ -2612,7 +2625,7 @@
pw.println(Integer.toHexString(mSystemUiVisibility));
}
if (!mPolicyVisibility || !mPolicyVisibilityAfterAnim || !mAppOpVisibility
- || mAttachedHidden) {
+ || mAttachedHidden || mPermanentlyHidden) {
pw.print(prefix); pw.print("mPolicyVisibility=");
pw.print(mPolicyVisibility);
pw.print(" mPolicyVisibilityAfterAnim=");
@@ -2620,6 +2633,7 @@
pw.print(" mAppOpVisibility=");
pw.print(mAppOpVisibility);
pw.print(" mAttachedHidden="); pw.println(mAttachedHidden);
+ pw.print(" mPermanentlyHidden="); pw.println(mPermanentlyHidden);
}
if (!mRelayoutCalled || mLayoutNeeded) {
pw.print(prefix); pw.print("mRelayoutCalled="); pw.print(mRelayoutCalled);
diff --git a/services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java b/services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java
index c0bf9b3..7a3b461 100644
--- a/services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java
+++ b/services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java
@@ -130,6 +130,10 @@
// Install on user 0 so that the package is cached when demo user is re-created
installExistingPackage(basePackageName, UserHandle.USER_SYSTEM, counter);
} else if (returnCode == PackageManager.INSTALL_FAILED_ALREADY_EXISTS) {
+ // This can only happen in first session after a reboot
+ if (!mApkToPackageMap.containsKey(apkName)) {
+ mApkToPackageMap.put(apkName, basePackageName);
+ }
installExistingPackage(basePackageName, userId, counter);
}
}
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index 8446dd0..6151e5b 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -240,6 +240,8 @@
private boolean mIsDataRoamingFromRegistration;
+ private boolean mIsUsingCarrierAggregation;
+
/**
* get String description of roaming type
* @hide
@@ -318,6 +320,7 @@
mCdmaEriIconMode = s.mCdmaEriIconMode;
mIsEmergencyOnly = s.mIsEmergencyOnly;
mIsDataRoamingFromRegistration = s.mIsDataRoamingFromRegistration;
+ mIsUsingCarrierAggregation = s.mIsUsingCarrierAggregation;
}
/**
@@ -346,6 +349,7 @@
mCdmaEriIconMode = in.readInt();
mIsEmergencyOnly = in.readInt() != 0;
mIsDataRoamingFromRegistration = in.readInt() != 0;
+ mIsUsingCarrierAggregation = in.readInt() != 0;
}
public void writeToParcel(Parcel out, int flags) {
@@ -371,6 +375,7 @@
out.writeInt(mCdmaEriIconMode);
out.writeInt(mIsEmergencyOnly ? 1 : 0);
out.writeInt(mIsDataRoamingFromRegistration ? 1 : 0);
+ out.writeInt(mIsUsingCarrierAggregation ? 1 : 0);
}
public int describeContents() {
@@ -680,7 +685,8 @@
&& equalsHandlesNulls(mCdmaDefaultRoamingIndicator,
s.mCdmaDefaultRoamingIndicator)
&& mIsEmergencyOnly == s.mIsEmergencyOnly
- && mIsDataRoamingFromRegistration == s.mIsDataRoamingFromRegistration);
+ && mIsDataRoamingFromRegistration == s.mIsDataRoamingFromRegistration
+ && mIsUsingCarrierAggregation == s.mIsUsingCarrierAggregation);
}
/**
@@ -788,7 +794,8 @@
+ " RoamInd=" + mCdmaRoamingIndicator
+ " DefRoamInd=" + mCdmaDefaultRoamingIndicator
+ " EmergOnly=" + mIsEmergencyOnly
- + " IsDataRoamingFromRegistration=" + mIsDataRoamingFromRegistration);
+ + " IsDataRoamingFromRegistration=" + mIsDataRoamingFromRegistration
+ + " IsUsingCarrierAggregation=" + mIsUsingCarrierAggregation);
}
private void setNullState(int state) {
@@ -815,6 +822,7 @@
mCdmaEriIconMode = -1;
mIsEmergencyOnly = false;
mIsDataRoamingFromRegistration = false;
+ mIsUsingCarrierAggregation = false;
}
public void setStateOutOfService() {
@@ -988,6 +996,7 @@
mCdmaDefaultRoamingIndicator = m.getInt("cdmaDefaultRoamingIndicator");
mIsEmergencyOnly = m.getBoolean("emergencyOnly");
mIsDataRoamingFromRegistration = m.getBoolean("isDataRoamingFromRegistration");
+ mIsUsingCarrierAggregation = m.getBoolean("isUsingCarrierAggregation");
}
/**
@@ -1017,21 +1026,42 @@
m.putInt("cdmaDefaultRoamingIndicator", mCdmaDefaultRoamingIndicator);
m.putBoolean("emergencyOnly", Boolean.valueOf(mIsEmergencyOnly));
m.putBoolean("isDataRoamingFromRegistration", Boolean.valueOf(mIsDataRoamingFromRegistration));
+ m.putBoolean("isUsingCarrierAggregation", Boolean.valueOf(mIsUsingCarrierAggregation));
}
/** @hide */
public void setRilVoiceRadioTechnology(int rt) {
+ if (rt == RIL_RADIO_TECHNOLOGY_LTE_CA) {
+ rt = RIL_RADIO_TECHNOLOGY_LTE;
+ }
+
this.mRilVoiceRadioTechnology = rt;
}
/** @hide */
public void setRilDataRadioTechnology(int rt) {
+ if (rt == RIL_RADIO_TECHNOLOGY_LTE_CA) {
+ rt = RIL_RADIO_TECHNOLOGY_LTE;
+ this.mIsUsingCarrierAggregation = true;
+ } else {
+ this.mIsUsingCarrierAggregation = false;
+ }
this.mRilDataRadioTechnology = rt;
if (VDBG) Rlog.d(LOG_TAG, "[ServiceState] setRilDataRadioTechnology=" +
mRilDataRadioTechnology);
}
/** @hide */
+ public boolean isUsingCarrierAggregation() {
+ return mIsUsingCarrierAggregation;
+ }
+
+ /** @hide */
+ public void setIsUsingCarrierAggregation(boolean ca) {
+ mIsUsingCarrierAggregation = ca;
+ }
+
+ /** @hide */
public void setCssIndicator(int css) {
this.mCssIndicator = (css != 0);
}
diff --git a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
index 2346f85..16a0def 100644
--- a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
+++ b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
@@ -574,6 +574,7 @@
mLaunchIntent = intent;
mForceStopBeforeLaunch = forceStopBeforeLaunch;
mLaunchReason = launchReason;
+ mResult = -1L;
}
public Long getResult() {