diff options
161 files changed, 1727 insertions, 10987 deletions
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index d54ce4bd3f05..e411e03a8a94 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -662,9 +662,11 @@ public interface IActivityManager extends IInterface { public void setRenderThread(int tid) throws RemoteException; /** - * Let's activity manager know whether the calling process is currently showing "top-level" UI + * Lets activity manager know whether the calling process is currently showing "top-level" UI * that is not an activity, i.e. windows on the screen the user is currently interacting with. * + * <p>This flag can only be set for persistent processes. + * * @param hasTopUi Whether the calling process has "top-level" UI. */ public void setHasTopUi(boolean hasTopUi) throws RemoteException; diff --git a/core/java/android/app/ITransientNotification.aidl b/core/java/android/app/ITransientNotification.aidl index 35b53a48e6e1..d5b3ed0a44d8 100644 --- a/core/java/android/app/ITransientNotification.aidl +++ b/core/java/android/app/ITransientNotification.aidl @@ -19,7 +19,7 @@ package android.app; /** @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 029c5bdccd41..9a2d4e0a3124 100644 --- a/core/java/android/net/ConnectivityMetricsLogger.java +++ b/core/java/android/net/ConnectivityMetricsLogger.java @@ -46,11 +46,12 @@ public class ConnectivityMetricsLogger { public static final String DATA_KEY_EVENTS_COUNT = "count"; - /** {@hide} */ protected final IConnectivityMetricsLogger mService; + /** {@hide} */ protected IConnectivityMetricsLogger mService; /** {@hide} */ protected volatile long mServiceUnblockedTimestampMillis; private int mNumSkippedEvents; public ConnectivityMetricsLogger() { + // TODO: consider not initializing mService in constructor this(IConnectivityMetricsLogger.Stub.asInterface( ServiceManager.getService(CONNECTIVITY_METRICS_LOGGER_SERVICE))); } @@ -61,6 +62,18 @@ public class ConnectivityMetricsLogger { mService = service; } + /** {@hide} */ + protected boolean checkLoggerService() { + if (mService != null) { + return true; + } + // Two threads racing here will write the same pointer because getService + // is idempotent once MetricsLoggerService is initialized. + mService = IConnectivityMetricsLogger.Stub.asInterface( + ServiceManager.getService(CONNECTIVITY_METRICS_LOGGER_SERVICE)); + return mService != null; + } + /** * Log a ConnectivityMetricsEvent. * @@ -96,6 +109,12 @@ public class ConnectivityMetricsLogger { // 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/net/metrics/IpConnectivityLog.java b/core/java/android/net/metrics/IpConnectivityLog.java index a7c1d40e90de..dd7bd1b915b8 100644 --- a/core/java/android/net/metrics/IpConnectivityLog.java +++ b/core/java/android/net/metrics/IpConnectivityLog.java @@ -31,7 +31,7 @@ import com.android.internal.annotations.VisibleForTesting; */ public class IpConnectivityLog extends ConnectivityMetricsLogger { private static String TAG = "IpConnectivityMetricsLogger"; - private static final boolean DBG = false; + private static final boolean DBG = true; public IpConnectivityLog() { // mService initialized in super constructor. @@ -52,9 +52,9 @@ public class IpConnectivityLog extends ConnectivityMetricsLogger { * @return true if the event was successfully logged. */ public boolean log(long timestamp, Parcelable data) { - if (mService == null) { + if (!checkLoggerService()) { if (DBG) { - Log.d(TAG, CONNECTIVITY_METRICS_LOGGER_SERVICE + " service not ready"); + Log.d(TAG, CONNECTIVITY_METRICS_LOGGER_SERVICE + " service was not ready"); } return false; } diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 5e4cd3331306..5da55b164f54 100755 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -6299,6 +6299,12 @@ public final class Settings { public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = "system_navigation_keys_enabled"; + /** + * Whether preloaded APKs have been installed for the user. + * @hide + */ + public static final String DEMO_USER_SETUP_COMPLETE + = "demo_user_setup_complete"; /** * This are the settings to be backed up. diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 48189106f2c4..b6955a82a3ed 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -233,6 +233,7 @@ public class SurfaceView extends View { 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 fe2423093c88..4a20619b000f 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -1734,14 +1734,18 @@ public interface WindowManager extends ViewManager { 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 @@ public interface WindowManager extends ViewManager { 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 @@ public interface WindowManager extends ViewManager { 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 @@ public interface WindowManager extends ViewManager { } // 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/Toast.java b/core/java/android/widget/Toast.java index 77626754264f..eca10cb5e7fd 100644 --- a/core/java/android/widget/Toast.java +++ b/core/java/android/widget/Toast.java @@ -25,6 +25,8 @@ import android.content.res.Configuration; 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 @@ public class Toast { } 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 @@ public class Toast { }; 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 @@ public class Toast { * 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 @@ public class Toast { 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 @@ public class Toast { 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 b174e3325168..17635aefe6ac 100644 --- a/core/java/com/android/internal/os/BatteryStatsImpl.java +++ b/core/java/com/android/internal/os/BatteryStatsImpl.java @@ -1791,11 +1791,17 @@ public class BatteryStatsImpl extends BatteryStats { 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 class BatteryStatsImpl extends BatteryStats { } public void clear() { + mLastClearTime = SystemClock.elapsedRealtime(); mMap.clear(); mCurOverflow = null; mActiveOverflow = null; @@ -1819,6 +1826,7 @@ public class BatteryStatsImpl extends BatteryStats { } public void cleanup() { + mLastCleanupTime = SystemClock.elapsedRealtime(); if (mActiveOverflow != null) { if (mActiveOverflow.size() == 0) { mActiveOverflow = null; @@ -1885,6 +1893,7 @@ public class BatteryStatsImpl extends BatteryStats { mActiveOverflow = new ArrayMap<>(); } mActiveOverflow.put(name, new MutableInt(1)); + mLastOverflowTime = SystemClock.elapsedRealtime(); return obj; } @@ -1914,6 +1923,7 @@ public class BatteryStatsImpl extends BatteryStats { over.value--; if (over.value <= 0) { mActiveOverflow.remove(name); + mLastOverflowFinishTime = SystemClock.elapsedRealtime(); } return obj; } @@ -1922,9 +1932,35 @@ public class BatteryStatsImpl extends BatteryStats { // 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 @@ public class BatteryStatsImpl extends BatteryStats { 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/java/com/android/internal/os/KernelUidCpuTimeReader.java b/core/java/com/android/internal/os/KernelUidCpuTimeReader.java index c828d11fd3d2..e8919ede82b5 100644 --- a/core/java/com/android/internal/os/KernelUidCpuTimeReader.java +++ b/core/java/com/android/internal/os/KernelUidCpuTimeReader.java @@ -120,7 +120,7 @@ public class KernelUidCpuTimeReader { sb.append(" s="); TimeUtils.formatDuration(systemTimeDeltaUs / 1000, sb); sb.append(" p=").append(powerDeltaMaUs / 1000).append("mAms"); - Slog.wtf(TAG, sb.toString()); + Slog.e(TAG, sb.toString()); userTimeDeltaUs = 0; systemTimeDeltaUs = 0; diff --git a/core/java/com/android/internal/view/menu/CascadingMenuPopup.java b/core/java/com/android/internal/view/menu/CascadingMenuPopup.java index ddf3a7646612..69e974c672d0 100644 --- a/core/java/com/android/internal/view/menu/CascadingMenuPopup.java +++ b/core/java/com/android/internal/view/menu/CascadingMenuPopup.java @@ -366,7 +366,7 @@ final class CascadingMenuPopup extends MenuPopup implements MenuPresenter, OnKey final int menuWidth = measureIndividualMenuWidth(adapter, null, mContext, mMenuMaxWidth); final MenuPopupWindow popupWindow = createPopupWindow(); popupWindow.setAdapter(adapter); - popupWindow.setWidth(menuWidth); + popupWindow.setContentWidth(menuWidth); popupWindow.setDropDownGravity(mDropDownGravity); final CascadingMenuInfo parentInfo; diff --git a/core/res/res/layout/alert_dialog_material.xml b/core/res/res/layout/alert_dialog_material.xml index 6d33de6ca307..178505c264a4 100644 --- a/core/res/res/layout/alert_dialog_material.xml +++ b/core/res/res/layout/alert_dialog_material.xml @@ -20,6 +20,7 @@ android:id="@+id/parentPanel" android:layout_width="match_parent" android:layout_height="wrap_content" + android:gravity="start|top" android:orientation="vertical"> <include layout="@layout/alert_dialog_title_material" /> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index dcec07d091b1..8d3cd487e644 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/design/patterns/notifications.jd b/docs/html-intl/intl/es/design/patterns/notifications.jd deleted file mode 100644 index 5499e8b3d4e1..000000000000 --- a/docs/html-intl/intl/es/design/patterns/notifications.jd +++ /dev/null @@ -1,872 +0,0 @@ -page.title=Notificaciones -page.tags="notifications","design","L" -@jd:body - - <a class="notice-developers" href="{@docRoot}training/notify-user/index.html"> - <div> - <h3>Documentos para desarrolladores</h3> - <p>Cómo notificar al usuario</p> - </div> -</a> - -<a class="notice-designers" href="notifications_k.html"> - <div> - <h3>Notificaciones en Android 4.4 y versiones anteriores</h3> - </div> -</a> - -<!-- video box --> -<a class="notice-developers-video" href="https://www.youtube.com/watch?v=Uiq2kZ2JHVY"> -<div> - <h3>Video</h3> - <p>DevBytes: Notificaciones en la vista previa para desarrolladores de Android L</p> -</div> -</a> - -<style> - .col-5, .col-6, .col-7 { - margin-left:0px; - } -</style> - -<p>El sistema de notificaciones les permite a los usuarios mantenerse informados sobre eventos relevantes y -oportunos -de su aplicación, como nuevos mensajes de chat de un amigo o un evento del calendario. -Piense en las notificaciones como un canal de noticias que alerta a los usuarios sobre eventos -importantes -a medida que se producen o como un registro en el que se relatan los eventos mientras el usuario no está prestando -atención y que se sincroniza de forma correspondiente en todos los dispositivos de Android.</p> - -<h4 id="New"><strong>Novedades de Android 5.0</strong></h4> - -<p>En Android 5.0, las notificaciones reciben actualizaciones importantes a nivel estructural, -visual y funcional.</p> - -<ul> - <li>En las notificaciones, se han realizado cambios visuales de forma coherente con el nuevo -tema Material Design.</li> - <li> Las notificaciones ahora están disponibles en la pantalla de bloqueo del dispositivo y -el contenido confidencial se puede seguir - ocultando detrás de dicha pantalla.</li> - <li>En las notificaciones de alta prioridad que se reciben cuando el dispositivo está en uso, ahora se utiliza un nuevo formato llamado - notificaciones emergentes.</li> - <li>Notificaciones sincronizadas en la nube: Si se omite una notificación en un dispositivo -Android, esta se omitirá - también en los demás dispositivos.</li> -</ul> - -<p class="note"><strong>Nota:</strong> El diseño de las notificaciones de esta versión de -Android se diferencia -de manera significativa del diseño de las versiones anteriores. Para obtener información sobre el diseño de las notificaciones en versiones -anteriores, consulte <a href="./notifications_k.html">Notificaciones en Android 4.4 y versiones anteriores</a>.</p> - -<h2 id="Anatomy">Anatomía de una notificación</h2> - -<p>En esta sección, se repasan las partes básicas de una notificación y cómo se pueden mostrar en -diferentes tipos de dispositivos.</p> - -<h3 id="BaseLayout">Diseño básico</h3> - -<p>Como mínimo, todas las notificaciones poseen un diseño básico que incluye lo siguiente:</p> - -<ul> - <li> El <strong>icono</strong> de la notificación. El icono simboliza la -aplicación que lo origina. También puede - indicar el tipo de notificación si la aplicación genera más de un -tipo.</li> - <li> <strong>Título</strong> de la notificación y -<strong>texto</strong> adicional.</li> - <li> Una <strong>marca de tiempo</strong>.</li> -</ul> - -<p>Las notificaciones creadas con {@link android.app.Notification.Builder Notification.Builder} -para versiones anteriores de la plataforma lucen y funcionan igual en Android -5.0; solo presentan algunos cambios de estilo que el sistema realiza -por usted. Para obtener más información sobre las notificaciones en versiones anteriores de -Android, consulte -<a href="./notifications_k.html">Notificaciones en Android 4.4 y versiones anteriores</a>.</p></p> - - - <img style="margin:20px 0 0 0" src="{@docRoot}images/android-5.0/notifications/basic_combo.png" alt="" width="700px" /> - - -<div style="clear:both;margin-top:20px"> - <p class="img-caption"> - Diseño básico de una notificación para dispositivos portátiles (izquierda) y la misma notificación en Wear (derecha), - con una fotografía del usuario y un icono de la notificación - </p> - </div> - -<h3 id="ExpandedLayouts">Diseños expandidos</h3> - - -<p>Usted puede decidir cuántos detalles mostrarán las notificaciones -de su aplicación. Las notificaciones pueden mostrar las primeras -líneas de un mensaje o la vista previa de una imagen más grande. A través de la -información adicional, se proporciona más -contexto al usuario y, en algunos casos, se puede permitir que el usuario lea todo el -mensaje. El usuario -puede acercar o alejar la imagen, o deslizar la imagen con un solo dedo para alternar entre los diseños compacto -y expandido. - En el caso de las notificaciones de un solo evento, Android proporciona tres plantillas de -diseños expandidos (texto, bandeja de entrada e - imagen) para que usted utilice en su aplicación. En las siguientes imágenes, se muestra cómo -se ven las notificaciones de un solo evento en los - dispositivos portátiles (izquierda) y los dispositivos con Wear (derecha).</p> - -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/expandedtext_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/stack_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/ExpandedImage.png" - alt="" width="311px" height;="450px" /> - -<h3 id="actions" style="clear:both; margin-top:40px">Acciones</h3> - -<p>Android es compatible con acciones opcionales que se muestran en la parte inferior -de la notificación. -A través de las acciones, los usuarios pueden administrar las tareas más comunes para una determinada -notificación desde el interior del panel de notificaciones, sin tener que abrir la -aplicación que la originó. -Esto acelera la interacción y, junto con la función deslizar para descartar, ayuda a los usuarios a enfocarse en las -notificaciones que les parecen importantes.</p> - - - <img src="{@docRoot}images/android-5.0/notifications/action_combo.png" alt="" width="700px" /> - - - -<p style="clear:both">Sea moderado con la cantidad de acciones que incluye en una -notificación. Mientras más -acciones incluya, mayor complejidad cognitiva generará. Limítese a -la menor cantidad posible -de acciones al incluir solo las acciones más importantes -y significativas.</p> - -<p>Las acciones recomendadas para las notificaciones son aquellas que:</p> - -<ul> - <li> Son fundamentales, frecuentes y típicas para el tipo de contenido que está -mostrando. - <li> Les permiten a los usuarios realizar las tareas rápidamente. -</ul> - -<p>Evite acciones que sean:</p> - -<ul> - <li> ambiguas; - <li> iguales que la acción predeterminada de la notificación (tales como "Leer" o -"Abrir"). -</ul> - - - -<p>Puede especificar un máximo de tres acciones, cada una de ellas formada por un icono -de la acción y un nombre. - Al agregarle acciones a un diseño básico simple, la notificación será expandible, -incluso si no - cuenta con un diseño expandido. Como las acciones solo se muestran en las notificaciones -expandidas - y, de lo contrario, se ocultan, asegúrese de que cualquier acción que el -usuario invoque desde - una notificación esté disponible también desde la aplicación -asociada.</p> - -<h2 style="clear:left">Notificación emergente</h2> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/hun-example.png" alt="" width="311px" /> - <p class="img-caption"> - Ejemplo de una notificación emergente (llamada telefónica entrante, alta prioridad) -que aparece en la parte superior de una - aplicación inmersiva - </p> -</div> - -<p>Cuando llega una notificación de alta prioridad (ver a la derecha), esta se presenta -a los usuarios -durante un período breve, con un diseño expandido que expone las posibles acciones.</p> -<p> Luego de este período, la notificación se retira hacia el -panel de notificaciones. Si la <a href="#correctly_set_and_manage_notification_priority">prioridad</a> de una notificación -se marca como Alta, Máxima o Pantalla completa, se obtiene una notificación emergente.</p> - -<p><b>Buenos ejemplos de notificaciones emergentes</b></p> - -<ul> - <li> Llamada telefónica entrante cuando se utiliza un dispositivo</li> - <li> Alarma cuando se utiliza un dispositivo</li> - <li> Nuevo mensaje SMS</li> - <li> Batería baja</li> -</ul> - -<h2 style="clear:both" id="guidelines">Pautas</h2> - - -<h3 id="MakeItPersonal">Personalización</h3> - -<p>En el caso de las notificaciones de los elementos que envía otra persona (como un mensaje o una -actualización de estado), utilice -{@link android.app.Notification.Builder#setLargeIcon setLargeIcon()} para incluir la imagen de esa persona. Además, adjunte información sobre -la persona en los metadatos de la notificación (consulte {@link android.app.Notification#EXTRA_PEOPLE}).</p> - -<p>El icono principal de su notificación seguirá estando visible, de modo que el usuario pueda asociarlo -con el icono -que se muestra en la barra de estado.</p> - - -<img src="{@docRoot}images/android-5.0/notifications/Triggered.png" alt="" width="311px" /> -<p style="margin-top:10px" class="img-caption"> - Notificación en la que se muestra la persona que la generó y el contenido que envió. -</p> - - -<h3 id="navigate_to_the_right_place">Navegación hacia el lugar correcto</h3> - -<p>Cuando el usuario toca el cuerpo de una notificación (fuera de los botones de acción -), esta se abre -en el lugar en el que el usuario puede visualizarla y utilizar los datos que se mencionan en la -notificación. En la mayoría de los casos, se tratará de la vista detallada de un solo elemento de datos como un mensaje, -pero también se podría tratar de una -vista resumida si la notificación está apilada. Si la aplicación dirige al -usuario a cualquier sitio que se encuentre debajo del nivel superior, incorpore la navegación en la pila de retroceso de la aplicación para que el -usuario pueda presionar el botón Back del sistema y regresar al nivel superior. Para obtener más información, consulte -<em>Navegación dentro de la aplicación a través de los widgets y las notificaciones de la pantalla de Inicio</em> en el patrón de -diseño <a href="{@docRoot}design/patterns/navigation.html#into-your-app">Navegación</a>.</p> - -<h3 id="correctly_set_and_manage_notification_priority">Configuración y administración -correctas de la prioridad -de las notificaciones</h3> - -<p>Android admite el uso de una marca de prioridad en las notificaciones. Esta marca -le permite influir en el lugar donde aparecerá la notificación, en relación con otras notificaciones, y -lo ayuda a asegurarse de -que los usuarios vean siempre primero las notificaciones más importantes. Cuando publica una notificación, puede elegir -entre los -siguientes niveles de prioridad:</p> -<table> - <tr> - <td class="tab0"> -<p><strong>Prioridad</strong></p> -</td> - <td class="tab0"> -<p><strong>Uso</strong></p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MAX</code></p> -</td> - <td class="tab1"> -<p>Utilícelo para las notificaciones críticas y urgentes en las que se le informa al usuario sobre una condición -que es -crítica en el tiempo o que se debe resolver antes de que el usuario continúe con una -tarea específica.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>HIGH</code></p> -</td> - <td class="tab1"> -<p>Utilícelo, principalmente, para comunicaciones importantes, como eventos de mensajes o -chats con contenido que sea particularmente interesante para el usuario. -Las notificaciones de alta prioridad activan la pantalla de notificaciones emergentes.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>DEFAULT</code></p> -</td> - <td class="tab1"> -<p>Utilícelo para todas las notificaciones que no pertenecen a ninguno de los otros tipos de prioridades que se describen aquí.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>LOW</code></p> -</td> - <td class="tab1"> -<p>Utilícelo para las notificaciones que desea que el usuario reciba, pero -que son menos urgentes. Las notificaciones de baja prioridad tienden a aparecer en la parte inferior de la lista, -por lo que son ideales para -eventos como actualizaciones sociales públicas o indirectas: El usuario solicitó que se le notifiquen -estas -actualizaciones, pero estas notificaciones nunca tendrán prioridad sobre las comunicaciones -urgentes o directas.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MIN</code></p> -</td> - <td class="tab1"> -<p>Utilícelo para la información contextual o de segundo plano, como información sobre el clima o la -ubicación contextual. -Las notificaciones cuya prioridad es mínima no aparecen en la barra de estado. El usuario -las descubre al expandir el panel de notificaciones.</p> -</td> - </tr> -</table> - - -<h4 id="how_to_choose_an_appropriate_priority"><strong>Cómo elegir la -prioridad -adecuada</strong></h4> - -<p><code>DEFAULT</code>, <code>HIGH</code> y <code>MAX</code> son niveles de prioridad interruptiva, y se corre el riesgo de -interrumpir al usuario -en el medio de su actividad. Para evitar incomodar a los usuarios de su aplicación, reserve los niveles de prioridad interruptiva para -las notificaciones:</p> - -<ul> - <li> en las que participe otra persona;</li> - <li> en las que el tiempo sea importante;</li> - <li> que puedan modificar inmediatamente el comportamiento del usuario en el mundo real.</li> -</ul> - -<p>Las notificaciones que se configuran en <code>LOW</code> y <code>MIN</code> pueden seguir siendo -valiosas para el usuario: muchas, tal vez la mayoría, de las notificaciones simplemente no le piden al usuario que actúe de inmediato -ni llaman su atención mediante una vibración, pero poseen información que será valiosa para el -usuario -cuando este decida ver las notificaciones. Entre los criterios de las notificaciones con prioridad <code>LOW</code> y <code>MIN</code>, -se incluyen los siguientes:</p> - -<ul> - <li> No participan otras personas.</li> - <li> El tiempo no es importante.</li> - <li> Incluyen contenido que podría interesarle al usuario, pero que tal vez desee -buscarlo cuando lo necesite.</li> -</ul> - - - <img src="{@docRoot}images/android-5.0/notifications/notifications_pattern_priority.png" alt="" width="700" /> - - -<h3 style="clear:both" id="set_a_notification_category">Configuración de una -categoría de notificaciones</h3> - -<p>Si su notificación se puede clasificar dentro de alguna de las categorías predefinidas (consulte -a continuación), asígnela -según corresponda. Esta información se puede utilizar en determinados aspectos de la IU del sistema, como el panel de notificaciones (o cualquier -otro -agente de escucha de la notificación), para realizar una clasificación y filtrar las decisiones.</p> -<table> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_CALL">CATEGORY_CALL</a></code></p> -</td> - <td> -<p>Llamada entrante (voz o video) o una solicitud de comunicación -sincrónica similar</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_MESSAGE">CATEGORY_MESSAGE</a></code></p> -</td> - <td> -<p>Mensaje entrante directo (SMS, mensaje instantáneo, etc.)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EMAIL">CATEGORY_EMAIL</a></code></p> -</td> - <td> -<p>Mensaje en bloque asíncrono (correo electrónico)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EVENT">CATEGORY_EVENT</a></code></p> -</td> - <td> -<p>Evento del calendario</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROMO">CATEGORY_PROMO</a></code></p> -</td> - <td> -<p>Promoción o anuncio</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ALARM">CATEGORY_ALARM</a></code></p> -</td> - <td> -<p>Alarma o temporizador</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROGRESS">CATEGORY_PROGRESS</a></code></p> -</td> - <td> -<p>Progreso de una operación en segundo plano de larga ejecución</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SOCIAL">CATEGORY_SOCIAL</a></code></p> -</td> - <td> -<p>Actualización de red social o uso compartido de datos</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ERROR">CATEGORY_ERROR</a></code></p> -</td> - <td> -<p>Error en una operación en segundo plano o un estado de autenticación</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_TRANSPORT">CATEGORY_TRANSPORT</a></code></p> -</td> - <td> -<p>Control de transporte de medios para la reproducción</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SYSTEM">CATEGORY_SYSTEM</a></code></p> -</td> - <td> -<p>Actualización del estado del dispositivo o el sistema. Reservado para ser utilizado por el sistema</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SERVICE">CATEGORY_SERVICE</a></code></p> -</td> - <td> -<p>Indicación de ejecución de servicio en segundo plano</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_RECOMMENDATION">CATEGORY_RECOMMENDATION</a></code></p> -</td> - <td> -<p>Una recomendación específica y oportuna para un solo evento. Por ejemplo, en una -aplicación de noticias tal vez se desee -recomendar una historia que se considere que el usuario deseará leer luego</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_STATUS">CATEGORY_STATUS</a></code></p> -</td> - <td> -<p>Información constante sobre el estado contextual o del dispositivo</p> -</td> - </tr> -</table> - -<h3 id="summarize_your_notifications">Resumen de las notificaciones</h3> - -<p>Si una notificación de un determinado tipo ya está pendiente cuando su aplicación intenta enviar una nueva -notificación del mismo tipo, combínelas en una misma notificación resumida para la aplicación. No -cree un objeto nuevo.</p> - -<p>Las notificaciones resumidas incluirán una descripción resumida y le permitirán al usuario -conocer cuántas -notificaciones de un determinado tipo están pendientes.</p> - -<div class="col-6"> - -<p><strong>Lo que no debe hacer</strong></p> - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Dont.png" alt="" width="311px" /> -</div> - -<div> -<p><strong>Lo que debe hacer</strong></p> - - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Do.png" alt="" width="311px" /> -</div> - -<p style="clear:left; padding-top:30px; padding-bottom:20px">Puede proporcionar -información más detallada sobre cada una de las notificaciones que conforman un - resumen al utilizar el diseño resumido expandido. Este enfoque les permite a los usuarios tener -una idea más clara de las - notificaciones pendientes y determinar si están lo suficientemente interesados como para leer -los detalles en la - aplicación asociada.</p> -<div class="col-6"> - <img src="{@docRoot}images/android-5.0/notifications/Stack.png" style="margin-bottom:20px" alt="" width="311px" /> - <p class="img-caption"> - Notificación contraída y expandida que es un resumen (mediante el uso de <code>InboxStyle</code>) - </p> -</div> - -<h3 style="clear:both" id="make_notifications_optional">Uso de notificaciones -opcionales</h3> - -<p>Los usuarios deben tener siempre el control sobre las notificaciones. Permítale al usuario -deshabilitar las notificaciones -de su aplicación o cambiar las propiedades de las alertas, como el sonido de una alerta y si desea -utilizar la vibración, -mediante la incorporación de un elemento de configuración de notificaciones en las configuraciones de la aplicación.</p> - -<h3 id="use_distinct_icons">Uso de iconos diferentes</h3> -<p>Al mirar el área de notificaciones, el usuario debe poder diferenciar -los tipos de -notificaciones que están pendientes actualmente.</p> - -<div class="figure"> - <img src="{@docRoot}images/android-5.0/notifications/ProductIcons.png" alt="" width="420" /> -</div> - - <div><p><strong>Lo que debe hacer</strong></p> - <p>Mirar los iconos de notificaciones que ya se proporcionan en las aplicaciones de Android y crear -iconos de notificaciones para - su aplicación que tengan una apariencia bastante diferente.</p> - - <p><strong>Lo que debe hacer</strong></p> - <p>Utilizar el <a href="/design/style/iconography.html#notification">estilo de icono de notificación</a> - adecuado para los iconos pequeños y el -<a href="/design/style/iconography.html#action-bar">estilo -de icono de barra de acción</a> del diseño Material Light para los iconos - de acciones.</p> -<p ><strong>Lo que debe hacer</strong></p> -<p >Hacer que los iconos sean simples y evitar incluir una cantidad excesiva de detalles difíciles de -distinguir.</p> - - <div><p><strong>Lo que no debe hacer</strong></p> - <p>Colocar valores alfa adicionales (que se oscurezcan o aclaren) en los -iconos pequeños y los - iconos de acciones. Estos pueden tener bordes alisados, pero como en Android estos iconos se utilizan -como máscaras (es decir, solo se - utiliza el canal alfa), por lo general, la imagen se debe dibujar con -opacidad completa.</p> - -</div> -<p style="clear:both"><strong>Lo que no debe hacer</strong></p> - -<p>Utilizar colores para diferenciar su aplicación de las demás. Los iconos de las notificaciones simplemente -deben ser una imagen sobre un fondo blanco o transparente.</p> - - -<h3 id="pulse_the_notification_led_appropriately">Pulsación adecuada del -LED de notificaciones</h3> - -<p>Muchos dispositivos con Android incluyen un LED de notificaciones, que se utiliza para mantener al -usuario informado sobre los -eventos cuando la pantalla está apagada. Las notificaciones con un nivel de prioridad <code>MAX</code>, -<code>HIGH</code> o <code>DEFAULT</code> deben -hacer que se encienda el LED, mientras que las de menor prioridad (<code>LOW</code> y -<code>MIN</code>) no deben activar esta función.</p> - -<p>El control del usuario sobre las notificaciones debe extenderse al LED. Cuando se utilice -DEFAULT_LIGHTS, el -LED se iluminará en color blanco. Sus notificaciones no deberían utilizar un color -diferente, a menos que el -usuario lo haya personalizado explícitamente.</p> - -<h2 id="building_notifications_that_users_care_about">Creación de notificaciones -importantes para los usuarios</h2> - -<p>Para crear una aplicación que les guste a los usuarios, es importante diseñar las notificaciones -cuidadosamente. -Las notificaciones son la voz de su aplicación y ayudan a definir su -personalidad. Las notificaciones no deseadas -o que no son importantes pueden hacer que el usuario se moleste o no se sienta cómodo con la cantidad de -atención que le demanda la -aplicación, por eso debe utilizarlas de forma moderada.</p> - -<h3 id="when_to_display_a_notification">Cuándo se deben mostrar las notificaciones</h3> - -<p>Para crear una aplicación que los usuarios disfruten, es importante -reconocer que la atención -y el enfoque del usuario son recursos que se deben proteger. Aunque el sistema de notificaciones de Android -se diseñó -para minimizar el impacto de las notificaciones en la atención del usuario, -es -importante tener en cuenta que las notificaciones interrumpen el -flujo de tareas del usuario. -Cuando planifique sus notificaciones, pregúntese si son lo suficiente importantes como para -realizar una interrupción. Si no está seguro, permítale al usuario que elija las -notificaciones mediante la configuración de notificaciones de su aplicación o que ajuste -la marca de prioridad de las notificaciones en <code>LOW</code> o <code>MIN</code> para -evitar distraer al usuario cuando realiza -alguna otra tarea.</p> - - <img src="{@docRoot}images/android-5.0/notifications/TimeSensitive.png" alt="" width="311px" /> - <p style="margin-top:10px" class="img-caption"> - Ejemplos de notificaciones sujetas a limitación temporal - </p> - -<p>Aunque las aplicaciones más eficientes para el usuario solo proporcionan una respuesta cuando se la solicita, en algunos casos, -vale la pena que una aplicación interrumpa al usuario con una notificación no solicitada.</p> - -<p>Utilice las notificaciones principalmente para <strong>eventos sujetos a limitaciones temporales</strong>, en especial - si estos eventos sincrónicos <strong>involucran a otras personas</strong>. Por -ejemplo, un chat entrante - es una forma de comunicación sincrónica y en tiempo real: otro usuario -está esperando de forma activa su respuesta. Los eventos del calendario son otros buenos ejemplos de cuándo se debe utilizar una -notificación y llamar la atención del usuario, - ya que los eventos son inminentes y, generalmente, -involucran a otras personas.</p> - -<h3 style="clear:both" id="when_not_to_display_a_notification">Cuándo no se debe -mostrar una notificación</h3> - -<div class="figure" style="margin-top:60px"> - <img src="{@docRoot}images/android-5.0/notifications/AntiSample1.png" alt="" width="311px" /> -</div> - -<p>En muchos otros casos, no es apropiado enviar notificaciones:</p> - -<ul> - <li> Evite notificarle al usuario acerca de información que no le enviaron -específicamente a él o -información que no está verdaderamente sujeta a una limitación temporal. Por ejemplo, las actualizaciones asíncronas -e indirectas - que circulan por las redes sociales generalmente no justifican una interrupción en -tiempo real. En el caso de los usuarios - interesados en dichas notificaciones, permítales elegir.</li> - <li> No cree una notificación si la información nueva y relevante se muestra actualmente -en la pantalla. En su lugar, - utilice la IU de la aplicación para notificarle al usuario sobre la nueva información -directamente en contexto. - Por ejemplo, una aplicación de chat no debe crear notificaciones del sistema mientras -el usuario está chateando de forma activa con otro usuario.</li> - <li> No interrumpa al usuario para que ejecute operaciones técnicas de bajo nivel, como guardar -o sincronizar información, o actualizar una aplicación si dicha aplicación o el sistema pueden resolver el problema -sin la participación del usuario.</li> - <li> No interrumpa al usuario para informarle sobre un error si la -aplicación puede solucionar el error por sus propios medios, sin que el usuario -realice ninguna acción.</li> - <li> No cree notificaciones que no incluyan contenidos reales de notificación y que -simplemente promocionen - su aplicación. Una notificación debe proporcionar información nueva, útil y oportuna, y -no debe utilizarse - solo para lanzar una aplicación.</li> - <li> No cree notificaciones superfluas solo para mostrar su marca -a los usuarios. - Dichas notificaciones frustran y aíslan a su público. La -mejor forma de proporcionar - pequeñas cantidades de información actualizada y de mantener a los usuarios interesados -en su - aplicación es desarrollar un widget que puedan colocar en la -pantalla de inicio, si así lo desean.</li> -</ul> - -<h2 style="clear:left" id="interacting_with_notifications">Interacción con -las notificaciones</h2> - -<p>Las notificaciones se indican mediante iconos en la barra de estado, y se puede acceder a ellas -al abrir el -panel lateral de notificaciones.</p> - -<p>Al tocar una notificación, se abre la aplicación asociada con el contenido detallado -que coincide con el de la notificación. -Si dicha notificación se desplaza hacia la izquierda o la derecha, esta se eliminará del panel lateral.</p> - -<h3 id="ongoing_notifications">Notificaciones constantes</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/MusicPlayback.png" alt="" width="311px" /> - <p class="img-caption"> - Notificaciones constantes relacionadas con la reproducción de música - </p> -</div> -<p>Mediante las notificaciones constantes, se mantiene a los usuarios informados sobre un proceso en curso en -segundo plano. -Por ejemplo, los reproductores de música anuncian la pista que se está reproduciendo actualmente en el -sistema de notificaciones y -siguen haciéndolo hasta que el usuario detiene la reproducción. Mediante las notificaciones constantes también se le pueden -mostrar al usuario -comentarios sobre tareas más extensas, como descargar un archivo o codificar un video. Los usuarios no podrán -eliminar las notificaciones constantes del panel lateral de notificaciones.</p> - -<h3 id="ongoing_notifications">Reproducción de medios</h3> -<p>En Android 5.0, la pantalla de bloqueo no muestra los controles de transporte para la clase -{@link android.media.RemoteControlClient} obsoleta. Sin embargo, <em>sí</em> muestra las notificaciones, de modo que las notificaciones de reproducción de cada -aplicación ahora son la forma principal -en la que los usuarios controlan la reproducción desde el estado bloqueado. A través de este comportamiento, se le otorga más control -a la aplicación sobre los -botones que se deben mostrar, y la forma en que debe mostrarlos, al mismo tiempo que se proporciona -al usuario una experiencia coherente, independientemente de si la pantalla está bloqueada o no.</p> - -<h3 style="clear:both" -id="dialogs_and_toasts_are_for_feedback_not_notification">Diálogos -y avisos</h3> - -<p>Su aplicación no debe crear un diálogo o un aviso si actualmente no se muestra en la -pantalla. Los diálogos o los avisos se deben - mostrar únicamente como una respuesta inmediata a una acción que realiza el usuario -dentro de su aplicación. -Para obtener más información sobre cómo utilizar los diálogos y los avisos, consulte -<a href="/design/patterns/confirming-acknowledging.html">Confirmación y reconocimiento</a>.</p> - -<h3>Orden y clasificación</h3> - -<p>Las notificaciones son noticias que, como tales, se muestran, básicamente, en -orden cronológico inverso, prestando -especial atención a la -<a href="#correctly_set_and_manage_notification_priority">prioridad</a> de la notificación especificada en la aplicación.</p> - -<p>Las notificaciones son una parte clave de la pantalla de bloqueo y se muestran de forma prominente -cada vez -que se enciende la pantalla del dispositivo. El espacio en la pantalla de bloqueo es reducido, por lo que -es sumamente importante -que se identifiquen las notificaciones más urgentes o relevantes. Por este -motivo, Android cuenta -con un algoritmo de clasificación más sofisticado para las notificaciones, que tiene en cuenta lo siguiente:</p> - -<ul> - <li> La marca de tiempo y la prioridad especificada en la aplicación.</li> - <li> Si la notificación interrumpió al usuario recientemente con un sonido o una -vibración. (Es decir, - si el teléfono emitió un sonido y el usuario desea saber "¿Qué -pasó?", en la pantalla de bloqueo se debe - proporcionar una respuesta a simple vista).</li> - <li> Todas aquellas personas involucradas en la notificación mediante{@link android.app.Notification#EXTRA_PEOPLE} - y, especialmente, si son contactos preferidos.</li> -</ul> - -<p>Para aprovechar aún más esta función de clasificación, enfóquese en la -experiencia del usuario que desea -crear, en lugar de centrarse en algún punto importante de la lista.</p> - - <img src="{@docRoot}images/android-5.0/notifications/AntiSample3.png" alt="" width="700px" /> - - <p class="img-caption" style="margin-top:10px">Las notificaciones de Gmail -poseen una prioridad predeterminada, por lo que - normalmente clasifican los mensajes de una aplicación de mensajería instantánea como Hangouts, pero -realizan - un cambio de prioridad temporal cuando ingresan nuevos mensajes. - </p> - - -<h3>En la pantalla de bloqueo</h3> - -<p>Como las notificaciones son visibles en la pantalla de bloqueo, la privacidad del usuario es un aspecto -especialmente -importante. Por lo general, las notificaciones contienen información confidencial y -no necesariamente deben ser visibles -para cualquier persona que agarre el dispositivo y encienda la pantalla.</p> - -<ul> - <li> En el caso de los dispositivos que posean una pantalla de bloqueo segura (PIN, patrón o contraseña), la interface está formada por - partes públicas y privadas. La interfaz pública se puede mostrar en una pantalla de bloqueo segura y, - por ende, cualquier persona puede verla. La interfaz privada es el mundo detrás de esa pantalla de bloqueo y - solo se revela cuando el usuario se registra en el dispositivo.</li> -</ul> - -<h3>Control del usuario sobre la información que se muestra en la pantalla de bloqueo segura</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/LockScreen@2x.png" srcset="{@docRoot}images/android-5.0/notifications/LockScreen.png 1x" alt="" width="311px" /> - <p class="img-caption"> - Notificaciones en la pantalla de bloqueo, en la que el contenido se revela luego de que el usuario desbloquea el dispositivo - </p> -</div> - -<p>Cuando se configura una pantalla de bloqueo segura, el usuario puede decidir ocultar los -detalles confidenciales de dicha pantalla. En este caso, la IU del sistema -analiza el <em>nivel de visibilidad</em> de la notificación para decidir -qué información se puede mostrar de forma segura.</p> -<p> Para controlar el nivel de visibilidad, realice una llamada a -<code><a -href="/reference/android/app/Notification.Builder.html#setVisibility(int)">Notification.Builder.setVisibility()</a></code> - y especifique uno de los siguientes valores:</p> - -<ul> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PUBLIC">VISIBILITY_PUBLIC</a></code>. -Se muestra todo el contenido de la notificación. - Esta es la opción predeterminada del sistema si no se especificó el grado de visibilidad.</li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PRIVATE">VISIBILITY_PRIVATE</a></code>. -En la pantalla de bloqueo se muestra la información básica sobre la existencia de esta notificación, incluido -el icono y el nombre de la aplicación a través de la cual se publicó. No se muestra el resto de los detalles de la notificación. -A continuación, especificamos algunos puntos que se deben tener en cuenta: - <ul> - <li> Si desea proporcionar una versión pública diferente de su notificación -para que el sistema la muestre en una pantalla de bloqueo segura, suministre un -objeto de notificación de reemplazo en el campo <code><a -href="/reference/android/app/Notification.html#publicVersion">Notification.publicVersion</a></code> -. - <li> Mediante esta configuración, su aplicación puede crear una versión resumida del -contenido que sigue siendo útil, pero que no revela información personal. Considere el ejemplo de una -aplicación de SMS cuyas notificaciones incluyen el texto del SMS, el nombre del remitente y el icono del contacto. -Esta notificación debe ser <code>VISIBILITY_PRIVATE</code>, pero <code>publicVersion</code> podría -seguir conteniendo información útil como "3 mensajes nuevos", sin que se muestren otros detalles -de identificación. - </ul> - </li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_SECRET">Notification.VISIBILITY_SECRET</a></code>. Se muestra solo la menor cantidad de información posible; se excluye incluso -el icono de la notificación.</li> -</ul> -<h2 style="clear:both" id="notifications_on_android_wear">Notificaciones en -Android Wear</h2> - -<p>Las notificaciones y sus <em>acciones</em> se conectan de forma predeterminada con los dispositivos con Wear. -Los desarrolladores pueden controlar qué notificaciones se conectan desde el -teléfono hacia el reloj -y viceversa. Los desarrolladores también pueden controlar qué acciones se conectan. Si -en su aplicación se incluyen -acciones que no se pueden realizar con una sola pulsación, oculte dichas acciones -en su notificación para Wear -o considere anclarlas a una aplicación de Wear. De este modo, el usuario podrá -finalizar con la acción desde el -reloj.</p> - -<h4>Conexión entre notificaciones y acciones</h4> - -<p>Mediante un dispositivo conectado, como un teléfono, es posible conectar las notificaciones con un dispositivo con Wear, para que las -notificaciones se muestren allí. De modo similar, también es posible conectar acciones para que el usuario pueda ejecutarlas -directamente desde las notificaciones en los dispositivos con Wear.</p> - -<p><strong>Conexión</strong></p> - -<ul> - <li> Nuevos mensajes instantáneos</li> - <li> Acciones de una sola pulsación como Hacer +1, Me gusta o Favorito</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/WearBasic.png" width="156px" height="156px" alt="" /> - -<p><strong>Sin conexión</strong></p> - -<ul> - <li> Notificaciones de podcasts que llegaron recientemente</li> - <li> Acciones que se asignan a funciones que no se pueden ejecutar desde el reloj</li> -</ul> - - - -<p><h4>Acciones únicas diseñadas para Wear</h4></p> - -<p>Existen algunas acciones que solo puede realizar en Wear. Entre estas, se incluyen las siguientes:</p> - -<ul> - <li> listas rápidas de respuestas predeterminadas como "Vuelvo enseguida";</li> - <li> acciones que se abren desde el teléfono;</li> - <li> un "Comentario" o una acción de "Respuesta" que activa la pantalla de entrada de voz;</li> - <li> acciones que lanzan aplicaciones específicas de Wear.</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/ReplyAction.png" width="156px" height="156px" alt="" /> 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 e1d99e9d2b0e..0ce3f5b2db27 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 67f9ad672d76..194bfd74d354 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 @@ page.tags=androidn @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/preview/features/security-config.jd b/docs/html-intl/intl/es/training/articles/security-config.jd index 8c3db641c577..7deadbec2264 100644 --- a/docs/html-intl/intl/es/preview/features/security-config.jd +++ b/docs/html-intl/intl/es/training/articles/security-config.jd @@ -4,8 +4,8 @@ page.image=images/cards/card-nyc_2x.jpg @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/playback/picture-in-picture.jd b/docs/html-intl/intl/es/training/tv/playback/picture-in-picture.jd index 0aa46dcaa980..30c9e8bf9cf0 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 @@ page.tags=androidn @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 855db8d5fffe..9e8a34679de4 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 b06a7dd7864d..a7e3cf3cad77 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 855993f0b15c..30aed6fbb2a4 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 @@ page.tags=androidn @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/preview/features/security-config.jd b/docs/html-intl/intl/in/training/articles/security-config.jd index 7a0303e59fd7..e13429dec04e 100644 --- a/docs/html-intl/intl/in/preview/features/security-config.jd +++ b/docs/html-intl/intl/in/training/articles/security-config.jd @@ -4,8 +4,8 @@ page.image=images/cards/card-nyc_2x.jpg @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/playback/picture-in-picture.jd b/docs/html-intl/intl/in/training/tv/playback/picture-in-picture.jd index 1cad9550e40c..41af6de97723 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 @@ page.tags=androidn @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 afedf8f31b21..3389dbf84cbf 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 @@ page.image=images/cards/card-nyc_2x.jpg @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/design/patterns/notifications.jd b/docs/html-intl/intl/ja/design/patterns/notifications.jd deleted file mode 100644 index 8c5b6babd085..000000000000 --- a/docs/html-intl/intl/ja/design/patterns/notifications.jd +++ /dev/null @@ -1,872 +0,0 @@ -page.title=通知 -page.tags="notifications","design","L" -@jd:body - - <a class="notice-developers" href="{@docRoot}training/notify-user/index.html"> - <div> - <h3>デベロッパー文書</h3> - <p>ユーザーに通知する</p> - </div> -</a> - -<a class="notice-designers" href="notifications_k.html"> - <div> - <h3>Android 4.4 以前での通知</h3> - </div> -</a> - -<!-- video box --> -<a class="notice-developers-video" href="https://www.youtube.com/watch?v=Uiq2kZ2JHVY"> -<div> - <h3>ビデオ</h3> - <p>DevBytes:Notifications in the Android L Developer Preview</p> -</div> -</a> - -<style> - .col-5, .col-6, .col-7 { - margin-left:0px; - } -</style> - -<p>通知システムを使用すると、ユーザーは友人からの新しいチャット メッセージやカレンダー イベントなど、自分に関係のあるタイムリーなイベントについてアプリで常に通知を受けることができます。通知は、重要な出来事が起こるとすぐに知らせてくれるニュース チャンネルであり、ユーザーが意識していない間に出来事を時系列的に記録するログであると捉えることができます — さらに、すべての Android 端末で適宜同期されます。 - - - - - -</p> - -<h4 id="New"><strong>Android 5.0 での新機能</strong></h4> - -<p>Android 5.0 において、通知は構造的に、視覚的に、機能的に重要なアップデートを受信します。 -</p> - -<ul> - <li>通知は、新しいマテリアル デザインのテーマにあわせて外観が変更されているところす。 -</li> - <li> 端末のロック画面で通知を利用できるようになりましたが、機密性の高いコンテンツはこれからも非表示にできます。 - -</li> - <li>端末の使用中に受信した高優先度の通知において、ヘッドアップ通知と呼ばれる新しい形式が使用されるようになりました。 -</li> - <li>クラウド同期通知: 所有する Android 端末のどれかで通知を却下すると、他でも却下されます。 - -</li> -</ul> - -<p class="note"><strong>注</strong>: このバージョンの Android での通知設計は、従来のバージョンから大きく変わっています。 - -これまでのバージョンの通知設計について詳しくは、<a href="./notifications_k.html">Android 4.4 以前での通知</a>をご覧ください。 -</p> - -<h2 id="Anatomy">通知の仕組み</h2> - -<p>このセクションでは、通知の基本パーツと各種端末における通知の表示について詳しく説明します。 -</p> - -<h3 id="BaseLayout">基本レイアウト</h3> - -<p>あらゆる通知の最低限の基本レイアウトは次のようになっています。</p> - -<ul> - <li> 通知の<strong>アイコン</strong>。このアイコンは通知元のアプリを示します。複数タイプの通知を生成するアプリでは、通知のタイプを示すことがあります。 - - -</li> - <li> 通知の<strong>タイトル</strong>と追加<strong>テキストメッセージ</strong>。 -</li> - <li> <strong>タイムスタンプ</strong>。</li> -</ul> - -<p>従来のプラットフォーム バージョンの {@link android.app.Notification.Builder Notification.Builder} で作成された通知は、Android 5.0 でも同じように表示され、機能します。スタイルにいくらかの違いがありますが、システムが対処します。 - - -従来のバージョンの Android での通知について詳しくは、<a href="./notifications_k.html">Android 4.4 以前での通知</a>をご覧ください。 - -</p></p> - - - <img style="margin:20px 0 0 0" src="{@docRoot}images/android-5.0/notifications/basic_combo.png" alt="" width="700px" /> - - -<div style="clear:both;margin-top:20px"> - <p class="img-caption"> - ユーザー フォトと通知アイコンを使用した、携帯端末での通知(左)と Wear での同じ通知(右) - - </p> - </div> - -<h3 id="ExpandedLayouts">展開レイアウト</h3> - - -<p>通知にどこまでの詳細を表示するかを選択できます。 -メッセージの最初の数行を表示したり、大きな画像プレビューを表示したりできます。 -追加情報はユーザーにより多くのコンテキストを提供し、—場合によっては—メッセージ全体が表示されることもあります。 - - -ユーザーは、ピンチ ズームまたは 1 本指のスワイプで、コンパクトなレイアウトと展開されたレイアウトを切り替えることができます。 - - - 1 つのイベントに関する通知に対し、Android では 3 種類の展開レイアウト(テキスト、受信トレイ、画像)をアプリケーションで使用できるようにしています。 - -次の図に、1 つのイベントに関する通知が携帯端末(左)とウェアラブル(右)でどのように見えるかを示します。 - -</p> - -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/expandedtext_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/stack_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/ExpandedImage.png" - alt="" width="311px" height;="450px" /> - -<h3 id="actions" style="clear:both; margin-top:40px">アクション</h3> - -<p>Android では、通知の最下部に表示されるオプションのアクションをサポートしています。ここに示されるアクションを使用することで、ユーザーは特定の通知に対するほとんどの一般的なタスクを通知シェードで処理でき、通知元のアプリケーションを開く必要はありません。これによりやり取りがスピードアップし、スワイプで却下もできることから、ユーザーは自分に関係のある通知に集中しやすくなります。 - - - - - -</p> - - - <img src="{@docRoot}images/android-5.0/notifications/action_combo.png" alt="" width="700px" /> - - - -<p style="clear:both">通知に含めるアクションの数はほどほどに抑えることをお勧めします。 -含めるアクションを増やすほど、わかりにくくなるからです。 -もっとも差し迫った意味のある重要なアクションだけにして、アクションの数を最小限に抑えてください。 - - -</p> - -<p>通知に対するアクションとして好ましい候補は次のとおりです。</p> - -<ul> - <li> 表示するコンテンツ タイプに欠かせず、よく使われ、典型的である - - <li> ユーザーがタスクを手早く完了できる -</ul> - -<p>次のようなアクションは避けてください。</p> - -<ul> - <li> あいまいである - <li> 通知のデフォルト アクションと同じである(「読む」や「開く」など) - -</ul> - - - -<p>アクションは 3 つまで指定でき、それぞれにアクションのアイコンと名前が付きます。 - - シンプルな基本レイアウトにアクションを追加すると、展開レイアウトがない場合でも、通知は展開可能になります。 - -アクションは展開可能な通知にのみ表示され、それ以外では非表示になることから、ユーザーが通知から起動できるどのアクションについても、関連アプリケーションからも利用できるようにしてください。 - - - - -</p> - -<h2 style="clear:left">ヘッドアップ通知</h2> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/hun-example.png" alt="" width="311px" /> - <p class="img-caption"> - イマーシブ アプリの最上部に表示されたヘッドアップ通知の例(電話の着信、高優先度) - - - </p> -</div> - -<p>優先度の高い通知が作成されると(右図)、その展開レイアウトが可能なアクションとともに短時間表示されます。 - -</p> -<p> この時間が過ぎると、通知は通知シェードに戻ります。 -通知の<a href="#correctly_set_and_manage_notification_priority">優先度</a>を示すフラグが高、最大、全画面の場合は、ヘッドアップ通知になります。 -</p> - -<p><b>ヘッドアップ通知にふさわしい例</b></p> - -<ul> - <li> 端末使用中の電話の着信</li> - <li> 端末使用中のアラーム</li> - <li> 新しい SMS メッセージ</li> - <li> 低バッテリ残量</li> -</ul> - -<h2 style="clear:both" id="guidelines">ガイドライン</h2> - - -<h3 id="MakeItPersonal">パーソナルにする</h3> - -<p>他人から送信されたアイテム(メッセージ、ステータス アップデートなど)の通知には、{@link android.app.Notification.Builder#setLargeIcon setLargeIcon()} を使用して相手の画像を含めます。 - -また、通知のメタデータに相手に関する情報を添付します({@link android.app.Notification#EXTRA_PEOPLE} を参照)。 -</p> - -<p>通知のメインアイコンは表示され続けるため、ユーザーはそれをステータスバーに表示されるアイコンと関連付けることができます。 - -</p> - - -<img src="{@docRoot}images/android-5.0/notifications/Triggered.png" alt="" width="311px" /> -<p style="margin-top:10px" class="img-caption"> - 通知をトリガーした人と送信内容が表示された通知。 -</p> - - -<h3 id="navigate_to_the_right_place">適切な画面へのナビゲーション</h3> - -<p>ユーザーが通知の本体(アクション ボタン以外)をタップしたら、アプリが開き、通知に表示されているデータの表示や操作ができる画面へ移動するようにします。 - - -ほとんどの場合、移動先はメッセージのような 1 つのデータアイテムの詳細表示になりますが、通知がスタックされている場合は概要ビューにすることも考えられます。 - -アプリがユーザーをアプリの最上位レベルより下のどこかに移動する場合は、アプリのバックスタックにナビゲーションを挿入して、ユーザーがシステムの Back ボタンを押すと最上位レベルに戻れるようにします。 - -詳しくは、<a href="{@docRoot}design/patterns/navigation.html#into-your-app">ナビゲーション</a>デザイン パターンの<em>ホーム画面ウィジェットと通知を経由するアプリへのナビゲーション</em>をご覧ください。 - -</p> - -<h3 id="correctly_set_and_manage_notification_priority">通知優先度の適切な設定と管理 - -</h3> - -<p>Android では、通知用の優先度フラグをサポートしています。このフラグを使用すると、通知の表示位置に他の通知との相対関係として影響を及ぼして、ユーザーが常に最重要の通知を真っ先に目にするようにできます。 - - -通知を投稿する際には、優先度を次の中から選べます。 - -</p> -<table> - <tr> - <td class="tab0"> -<p><strong>優先度</strong></p> -</td> - <td class="tab0"> -<p><strong>用途</strong></p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MAX</code></p> -</td> - <td class="tab1"> -<p>重大で切迫した通知に対して使用します。緊急を要する状況、または特定のタスクを続ける前に解決する必要がある状況であることをユーザーに通告します。 - - -</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>HIGH</code></p> -</td> - <td class="tab1"> -<p>主に重要な情報に対して使用します。ユーザーが特に関心を持ちそうなメッセージ イベントやチャット イベントなどが該当します。通知の優先度を高く設定すると、ヘッドアップ通知を表示できます。 - -</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>DEFAULT</code></p> -</td> - <td class="tab1"> -<p>ここで説明している他の優先度のどれにも該当しないすべての通知に対して使用します。</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>LOW</code></p> -</td> - <td class="tab1"> -<p>ユーザーに知らせたいがそれほど緊急ではない通知に対して使用します。 -低優先度の通知は一般にリストの末尾に表示され、公の、または間接的なソーシャル アップデートなどに適しています。 - -ユーザーがこうした通知の設定をしていても、急を要するコミュニケーションや直接的なコミュニケーションより優先されないようにする必要があります。 - - -</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MIN</code></p> -</td> - <td class="tab1"> -<p>天気予報や周辺位置情報のようなコンテキスト的またはバックグラウンド的な情報に対して使用します。最小優先度の通知はステータスバーに表示されません。 - -ユーザーは通知シェードを展開したときにその存在に気づきます。 -</p> -</td> - </tr> -</table> - - -<h4 id="how_to_choose_an_appropriate_priority"><strong>適切な優先度の選び方</strong> - -</h4> - -<p><code>DEFAULT</code>、<code>HIGH</code>、<code>MAX</code> は中断を伴う優先度レベルで、ユーザーによるアクティビティに割り込むリスクがあります。 - -アプリのユーザーに不快に思われないようにするため、割り込みを伴う優先度レベルの通知は次のような場合に限定してください。 -</p> - -<ul> - <li> 他人が絡む</li> - <li> 急を要する</li> - <li> 実世界におけるユーザーの行動が直ちに変わりうる</li> -</ul> - -<p><code>LOW</code> や <code>MIN</code> に設定されている通知も、ユーザーにとって価値がある可能性はあります。 -ほとんどとは言わないまでも、多くの通知は、ユーザーの注意を直ちに引く、またはユーザーの手首に振動を与える必要はありませんが、ユーザーがその通知を見ることにしたときに価値があると気づくような情報が含まれている必要があります。 - - -優先度が <code>LOW</code> や <code>MIN</code> の通知の条件は以下のとおりです。 -</p> - -<ul> - <li> 他人が絡まない</li> - <li> 急を要さない</li> - <li> ユーザーが興味を持ちうる内容が含まれているが、手が空いたときに参照することにして問題ない -</li> -</ul> - - - <img src="{@docRoot}images/android-5.0/notifications/notifications_pattern_priority.png" alt="" width="700" /> - - -<h3 style="clear:both" id="set_a_notification_category">通知カテゴリの設定 -</h3> - -<p>通知が、あらかじめ定義されているカテゴリ(下を参照)のどれかに該当する場合は、それに沿って割り当てます。 - -通知シェード(やその他の通知リスナー)などの各種システム UI は、評価やフィルタリングの判断にこの情報を使用することがあります。 - -</p> -<table> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_CALL">CATEGORY_CALL</a></code></p> -</td> - <td> -<p>電話(ビデオまたは音声)の着信またはそれに類する同期通信の要求 -</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_MESSAGE">CATEGORY_MESSAGE</a></code></p> -</td> - <td> -<p>直接メッセージ(SMS、インスタントメッセージなど)の受信</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EMAIL">CATEGORY_EMAIL</a></code></p> -</td> - <td> -<p>非同期バルク メッセージ(メール)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EVENT">CATEGORY_EVENT</a></code></p> -</td> - <td> -<p>カレンダー イベント</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROMO">CATEGORY_PROMO</a></code></p> -</td> - <td> -<p>販促または広告</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ALARM">CATEGORY_ALARM</a></code></p> -</td> - <td> -<p>アラームまたはタイマー</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROGRESS">CATEGORY_PROGRESS</a></code></p> -</td> - <td> -<p>長時間実行のバックグラウンド処理の進捗</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SOCIAL">CATEGORY_SOCIAL</a></code></p> -</td> - <td> -<p>ソーシャル ネットワークまたは共有アップデート</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ERROR">CATEGORY_ERROR</a></code></p> -</td> - <td> -<p>バックグラウンド処理または認証ステータスにおけるエラー</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_TRANSPORT">CATEGORY_TRANSPORT</a></code></p> -</td> - <td> -<p>再生のためのメディア転送コントロール</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SYSTEM">CATEGORY_SYSTEM</a></code></p> -</td> - <td> -<p>システムまたは端末のステータス アップデート。システム用に予約済み。</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SERVICE">CATEGORY_SERVICE</a></code></p> -</td> - <td> -<p>バックグラウンド サービス実行中の表示。</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_RECOMMENDATION">CATEGORY_RECOMMENDATION</a></code></p> -</td> - <td> -<p>1 つの事項に対する具体的でタイムリーな推奨。たとえば、ニュースアプリがユーザーが次に読みたいのではないかと予想した記事を推奨するなど。 - -</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_STATUS">CATEGORY_STATUS</a></code></p> -</td> - <td> -<p>端末やコンテキスト ステータスに関する進行中情報。</p> -</td> - </tr> -</table> - -<h3 id="summarize_your_notifications">通知の概要</h3> - -<p>アプリで特定の新しい通知を送信しようとしたときに同じタイプの通知が既に保留されていた場合は、それらを統合してそのアプリに対する 1 つの概要通知にします。新しいオブジェクトは作成しないでください。 - -</p> - -<p>概要通知は概要説明を作成し、特定タイプの通知がいくつ保留になっているのかがユーザーにわかるようにします。 - -</p> - -<div class="col-6"> - -<p><strong>非推奨</strong></p> - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Dont.png" alt="" width="311px" /> -</div> - -<div> -<p><strong>推奨</strong></p> - - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Do.png" alt="" width="311px" /> -</div> - -<p style="clear:left; padding-top:30px; padding-bottom:20px">概要を構成している個々の通知に関する詳細は、展開ダイジェスト レイアウトを使用して提示できます。 - -このアプローチにより、ユーザーはどの通知が保留中か、そして関連アプリで詳しく読もうと思うほどそれらに興味があるかを把握しやすくなります。 - - - -</p> -<div class="col-6"> - <img src="{@docRoot}images/android-5.0/notifications/Stack.png" style="margin-bottom:20px" alt="" width="311px" /> - <p class="img-caption"> - 通知の展開された概要と折りたたまれた概要(<code>InboxStyle</code> を使用) - </p> -</div> - -<h3 style="clear:both" id="make_notifications_optional">通知をオプションにする -</h3> - -<p>ユーザーは常に通知を制御できる必要があります。アプリケーションの設定に通知設定アイテムを追加して、ユーザーがアプリの通知を無効にしたり、警告音や振動を使用するかどうかなどのアラート設定を変更したりできるようにしてください。 - - - -</p> - -<h3 id="use_distinct_icons">見分けやすいアイコンにする</h3> -<p>現在保留になっているのがどのタイプの通知なのか、ユーザーが通知エリアを一目で見分けられることが必要です。 - -</p> - -<div class="figure"> - <img src="{@docRoot}images/android-5.0/notifications/ProductIcons.png" alt="" width="420" /> -</div> - - <div><p><strong>推奨</strong></p> - <p>Android アプリが既に提供している通知アイコンを見ながら、独自アプリ用に見かけの十分異なるアイコンを作成する。 - -</p> - - <p><strong>推奨</strong></p> - <p>小さなアイコン用の適切な<a href="/design/style/iconography.html#notification">通知アイコン スタイル</a>と、アクション アイコン用の Material Light <a href="/design/style/iconography.html#action-bar">アクションバー アイコンスタイル</a>を使う。 - - - -</p> -<p ><strong>推奨</strong></p> -<p >アイコンの見た目はシンプルに保ち、細かくしすぎて見にくくならないようにする。 -</p> - - <div><p><strong>非推奨</strong></p> - <p>なんらかの追加アルファ(暗転やフェード)を小さなアイコンやアクション アイコンに配置する。エッジはアンチ エイリアス処理できますが、Android ではこれらのアイコンをマークとして使用するため(つまり、アルファ チャンネルのみ使用)、画像は概して完全不透明で描画されます。 - - - - -</p> - -</div> -<p style="clear:both"><strong>非推奨</strong></p> - -<p>アプリを他と色で区別する。通知アイコンは、背景が透明な白に限定してください。 -</p> - - -<h3 id="pulse_the_notification_led_appropriately">通知 LED を適切に点灯させる -</h3> - -<p>多くの Android 端末には通知 LED が用意されており、スクリーンがオフのときでもユーザーに引き続きイベントを通知するために使用されます。 - -優先度が <code>MAX</code>、<code>HIGH</code>、<code>DEFAULT</code> の通知を LED 点灯するようにし、優先度の低い通知(<code>LOW</code> と <code>MIN</code>)は点灯しないようにしてください。 - - -</p> - -<p>ユーザーによる通知の制御が LED にも及ぶようにしてください。DEFAULT_LIGHTS を使用すると、LED が白く点灯します。 - -ユーザーが明示的にカスタマイズしない限り、通知では別の色を使用しないでください。 - -</p> - -<h2 id="building_notifications_that_users_care_about">ユーザーが気にする通知の作成 -</h2> - -<p>ユーザーに愛されるアプリを開発するためには、通知を入念にデザインすることが重要です。通知はアプリの声を体現するものであり、アプリの個性の一部です。 - - -望まれない通知や重要ではない通知がユーザーの邪魔になったり、アプリへの注目を集める意図が逆にユーザーに不快に思われたりしかねませんので、通知は適切に使用してください。 - - -</p> - -<h3 id="when_to_display_a_notification">通知を表示すべきケース</h3> - -<p>ユーザーが楽しんで使えるアプリケーションを開発するには、ユーザーの注目や関心は保護すべきリソースであるという認識が重要です。 - -Android の通知システムは、ユーザーの注意に対する通知のインパクトを最小限に抑える設計になっていますが、通知がユーザーのタスクフローに割り込むという事実を意識することがやはり重要です。通知を盛り込む予定の場合は、それが割り込みに値するほど重要かどうかを自問してください。 - - - - - - -確信が持てない場合は、ユーザーがアプリの通知設定を使用して通知をコントロールできるようにするか、通知のフラグを <code>LOW</code> か <code>MIN</code> に設定してユーザーがしている別のことを邪魔しないようにします。 - - - -</p> - - <img src="{@docRoot}images/android-5.0/notifications/TimeSensitive.png" alt="" width="311px" /> - <p style="margin-top:10px" class="img-caption"> - 急を要する通知の例 - </p> - -<p>概して、適切に振る舞うアプリは話しかけられたときだけ口を開きますが、求められていない通知でユーザーの作業に割り込むことにメリットがあるケースもいくつか存在します。 -</p> - -<p>通知は主に<strong>急を要するイベント</strong>で、特に<strong>他人が絡む</strong>同期イベントで使用します。 -たとえば、受信チャットはリアルタイムの同期コミュニケーションです。 - -他人が応答を能動的に待っています。 -カレンダー イベントも、通知でユーザーの注目を引くタイミングに関する好例です。なぜなら、そうしたイベントは差し迫っており、往々にして他人が絡みます。 - - -</p> - -<h3 style="clear:both" id="when_not_to_display_a_notification">通知を表示すべきでないケース -</h3> - -<div class="figure" style="margin-top:60px"> - <img src="{@docRoot}images/android-5.0/notifications/AntiSample1.png" alt="" width="311px" /> -</div> - -<p>以上を除く多くの場合、通知の使用は適切ではありません。</p> - -<ul> - <li> 明示的にユーザー宛てではない情報や、それほど急を要さない情報は、ユーザーへの通知を避けます。 - -たとえば、ソーシャル ネットワーク経由で流れてくる非同期の間接的なアップデートは、概してリアルタイムの割り込みにふさわしくありません。 - - -それらに本当に関心のあるユーザーが選択できるようにします。 -</li> - <li> 関連する新しい情報が現在画面に表示されている場合は、通知を作成しないようにします。 -その代わり、アプリケーションそのものの UI を使用して、ユーザーに情報をコンテキスト内で直接通知します。 - - - たとえば、チャット アプリケーションは、ユーザーが他のユーザーとチャットしている最中にシステム通知を作成しないようにします。 -</li> - <li> 情報の保存や同期、アプリケーションのアップデートなど、低レベルの技術的な通知については、アプリやシステムがユーザーの介入なしに問題を解決できる場合は割り込まないようにします。 - -</li> - <li> アプリケーションがユーザーの介入なしにエラーから復旧できる場合は、そのようなエラーの通知で割り込まないでください。 - -</li> - <li> 通知にふさわしい内容がなく、アプリを宣伝するだけの通知は、作成しないようにします。通知は、有益でタイムリーな新しい情報を提供するものであり、アプリを起動するためだけには使用しないでください。 - - - -</li> - <li> ブランドをユーザーの目の前に提示するだけの表面的な通知を作成しないようにします。 - - そうした通知はユーザーにフラストレーションを与え、アプリが使われなくなります。アップデートされた情報を少しだけ提供し、ユーザーをアプリにつなぎ止める最適な方法は、ホームスクリーンに配置できるウィジェットを開発することです。 - - - - -</li> -</ul> - -<h2 style="clear:left" id="interacting_with_notifications">通知の操作 -</h2> - -<p>通知はステータスバーにアイコンとして示され、通知ドロワーを開いてアクセスできます。 - -</p> - -<p>通知をタップすると関連アプリが開き、その通知に対応する詳細なコンテンツに移動します。通知上で左か右にスワイプされた通知は、ドロワーから削除されます。 - -</p> - -<h3 id="ongoing_notifications">進行中通知</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/MusicPlayback.png" alt="" width="311px" /> - <p class="img-caption"> - 音楽再生の進行中通知 - </p> -</div> -<p>進行中通知は、バックグラウンドで進行中の処理に関する情報をユーザーに伝えます。たとえば、音楽プレイヤーは通知システムで現在再生中のトラックを示し、ユーザーが再生を停止するまで通知を継続します。 - - - -進行中通知には、ファイルのダウンロードやビデオのエンコードなど、時間のかかるタスクに対するフィードバックをユーザーに示すこともできます。 - -ユーザーは、進行中通知を通知ドロワーから手動では削除できません。 -</p> - -<h3 id="ongoing_notifications">メディア再生</h3> -<p>Android 5.0 では、廃止された {@link android.media.RemoteControlClient} クラスの転送コントロールがロック画面に表示されません。 -ただし、通知が表示されるため、<em></em>ユーザーがロック状態から再生をコントロールするための主な手段は、現状では各アプリの再生通知です。 - -この動作により、アプリは表示するボタンとその表示形態についてより多くをコントロールでき、画面がロックされているかどうかによらない一貫した操作感をユーザーに提供できます。 - - -</p> - -<h3 style="clear:both" -id="dialogs_and_toasts_are_for_feedback_not_notification">ダイアログとトースト -</h3> - -<p>アプリが画面上に表示されていないときにダイアログやトーストを作成しないようにしてください。 -ダイアログやトーストの表示は、アプリでのアクションに対するユーザーへの即座の応答のみにします。ダイアログやトーストの使用の目安については、<a href="/design/patterns/confirming-acknowledging.html">確認と通知</a>をご覧ください。 - - - -</p> - -<h3>評価と並べ替え</h3> - -<p>通知はニュースであるため、基本的には新しい順に表示され、アプリが通知に指定した<a href="#correctly_set_and_manage_notification_priority">優先度</a>に基づき特別な配慮がなされます。 - - -</p> - -<p>通知はロック画面の重要な一部であり、端末のディスプレイがオンになるたび前面に出ます。 - -ロック画面のスペースは限られているため、もっとも緊急か重要な通知を識別することが何より重要になります。 - -この理由から、Android では洗練された通知並べ替えアルゴリズムを採用しており、その中で以下を考慮しています。 - -</p> - -<ul> - <li> タイムスタンプと、アプリが指定した優先度。</li> - <li> その通知が最近ユーザーに音または振動で配信されたかどうか。 -(つまり、電話が音を立てるだけの場合、ユーザーが「何が起こったのか」を知りたくなったら、ロック画面はそれに一目でわかる答えを示すべきです)。 - - -</li> - <li> {@link android.app.Notification#EXTRA_PEOPLE} を使用して通知に添付された人、特にその人が「お気に入り」の連絡先かどうか。 -</li> -</ul> - -<p>この並べ替え機能を最大限に生かすには、リストにおける特定の位置付けを狙うのではなく、ユーザーの操作感に注目します。 - -</p> - - <img src="{@docRoot}images/android-5.0/notifications/AntiSample3.png" alt="" width="700px" /> - - <p class="img-caption" style="margin-top:10px">Gmail 通知の優先度はデフォルトであり、そのため Hangouts などのインスタントメッセージ アプリからのメッセージの下に並びますが、新しいメッセージが来たときは一時的にそれより先に表示されます。 - - - - - </p> - - -<h3>ロック画面上</h3> - -<p>通知はロック画面に表示されるため、ユーザーのプライバシーはとりわけ重要な考慮対象です。 - -通知には機密性の高い情報が含まれることが多く、端末を手に取ってディスプレイをオンにした誰にでも見られるようにすべきではありません。 - -</p> - -<ul> - <li> セキュリティ保護されたロック画面(PIN、パターン、パスワードなど)を持つ端末の場合、インターフェースには公開部分と秘密部分があります。 -公開インターフェースはセキュリティ保護されたロック画面に表示でき、誰でも見られます。 -秘密インターフェースはロック画面の背後にある世界で、ユーザーが端末にサインインして初めて表示されます。 -</li> -</ul> - -<h3>セキュリティ保護されたロック画面に表示される情報のユーザー コントロール</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/LockScreen@2x.png" srcset="{@docRoot}images/android-5.0/notifications/LockScreen.png 1x" alt="" width="311px" /> - <p class="img-caption"> - ロック画面上の通知。コンテンツはユーザーが端末をロック解除した後に表示されます。 - </p> -</div> - -<p>セキュリティ保護されたロック画面をセットアップする際、ユーザーはセキュリティ保護されたロック画面には表示しない機密性の高い情報を選ぶことができます。 -その場合、システム UI は通知の<em>可視性レベル</em>を考慮して、表示しても問題ない情報を識別します。 - -</p> -<p> 可視性レベルをコントロールするには、<code><a -href="/reference/android/app/Notification.Builder.html#setVisibility(int)">Notification.Builder.setVisibility()</a></code> を呼び出し、次の値のどれかを指定します。 - -</p> - -<ul> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PUBLIC">VISIBILITY_PUBLIC</a></code>。通知の内容がすべて表示されます。 - - 可視性レベルが指定されていない場合は、これがシステム デフォルトです。</li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PRIVATE">VISIBILITY_PRIVATE</a></code>。ロック画面に、その通知の存在に関する基本情報、たとえば通知のアイコンやそれを提示したアプリ名などを表示します。 - -通知のその他の詳細は表示されません。いくつか留意すべき点があります。 - - <ul> - <li> システムがセキュリティ保護されたロック画面に表示するためとして公開バージョンの通知を別に提供する場合は、<code><a -href="/reference/android/app/Notification.html#publicVersion">Notification.publicVersion</a></code> フィールドに代替 Notification オブジェクトを用意します。 - - - - <li> この設定により、アプリは利便性はあるが個人情報は明かさない編集されたバージョンのコンテンツを作成できるようになります。 -SMS アプリを例に考えて見ましょう。通知には SMS のテキストメッセージ、送信者の名前、連絡先アイコンが含まれています。この通知は <code>VISIBILITY_PRIVATE</code> であるべきですが、<code>publicVersion</code> にも "3 件の新しいメッセージ" のような個人を特定する詳細なしでも利便性のある情報を盛り込めます。 - - - - - </ul> - </li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_SECRET">Notification.VISIBILITY_SECRET</a></code>。必要最小限の情報のみ表示し、通知のアイコンさえありません。 -</li> -</ul> -<h2 style="clear:both" id="notifications_on_android_wear">Android Wear での通知 -</h2> - -<p>通知とそのアクション<em></em>は、デフォルトで Wear 端末にブリッジされます。デベロッパーは、どの通知が電話から腕時計へ、またはその逆へブリッジするかを制御できます。 - - -また、どのアクションがブリッジするかも制御できます。タップ 1 回では完了しないアクションがアプリに含まれている場合は、そうしたアクションを Wear 通知では隠すか Wear アプリに接続することを検討してください。いずれにしても、ユーザーがアクションを腕時計で完了できるようにします。 - - - - - -</p> - -<h4>通知とアクションのブリッジ</h4> - -<p>電話のような接続状態の端末は、通知を Wear 端末にブリッジして、通知が腕時計に表示されるようにできます。 -同様に、アクションもブリッジして、ユーザーが通知に Wear 端末で直接対処できるようにできます。 -</p> - -<p><strong>ブリッジする</strong></p> - -<ul> - <li> 新しいインスタントメッセージ</li> - <li> +1、いいね、心拍数のようなタップ 1 回のアクション</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/WearBasic.png" width="156px" height="156px" alt="" /> - -<p><strong>ブリッジしない</strong></p> - -<ul> - <li> 新着ポッドキャストの通知</li> - <li> 腕時計ではできない機能にマップされたアクション</li> -</ul> - - - -<p><h4>Wear 専用に定義されたアクション</h4></p> - -<p>Wear でのみできるアクションがいくつかあります。次に例を挙げます。</p> - -<ul> - <li> 「Be right back」 のような定形応答のクイックリスト</li> - <li> 携帯電話で開く</li> - <li> 音声入力画面を起動する 「Comment」 アクションや 「Reply」 アクション</li> - <li> Wear 専用アプリを起動するアクション</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/ReplyAction.png" width="156px" height="156px" alt="" /> 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 933e682c062b..eaa684c76292 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 32681a03620e..076768933792 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 @@ page.tags=androidn @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/preview/features/security-config.jd b/docs/html-intl/intl/ja/training/articles/security-config.jd index 1fbfe72bd4e8..d86c547a95d6 100644 --- a/docs/html-intl/intl/ja/preview/features/security-config.jd +++ b/docs/html-intl/intl/ja/training/articles/security-config.jd @@ -4,8 +4,8 @@ page.image=images/cards/card-nyc_2x.jpg @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/playback/picture-in-picture.jd b/docs/html-intl/intl/ja/training/tv/playback/picture-in-picture.jd index 7593670c98fc..1df16cd54393 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 @@ page.tags=androidn @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 bf5f9a961a3b..3c58cfd31204 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 @@ page.image=images/cards/card-nyc_2x.jpg @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/design/patterns/notifications.jd b/docs/html-intl/intl/ko/design/patterns/notifications.jd deleted file mode 100644 index aab5eacb313d..000000000000 --- a/docs/html-intl/intl/ko/design/patterns/notifications.jd +++ /dev/null @@ -1,872 +0,0 @@ -page.title=알림 -page.tags="notifications","design","L" -@jd:body - - <a class="notice-developers" href="{@docRoot}training/notify-user/index.html"> - <div> - <h3>개발자 문서</h3> - <p>사용자에게 알리기</p> - </div> -</a> - -<a class="notice-designers" href="notifications_k.html"> - <div> - <h3>Android 4.4 이하 버전의 알림</h3> - </div> -</a> - -<!-- video box --> -<a class="notice-developers-video" href="https://www.youtube.com/watch?v=Uiq2kZ2JHVY"> -<div> - <h3>비디오</h3> - <p>DevBytes: Android L Developer Preview의 알림</p> -</div> -</a> - -<style> - .col-5, .col-6, .col-7 { - margin-left:0px; - } -</style> - -<p>알림 시스템을 사용하면 친구로부터 받은 새 채팅 메시지나 캘린더 이벤트와 같이 앱에서 관련된 -시기 적절한 -이벤트에 대한 알림을 사용자에게 표시할 수 있습니다. -알림을 중요한 -이벤트가 -발생한 경우 사용자에게 이에 대해 알리는 뉴스 채널이나 사용자가 앱에 집중하고 -있지 않은 동안에 이벤트를 시간순으로 기록하는 로그라고 생각하세요. 또한, 적절한 경우 모든 Android 기기에 걸쳐 동기화될 수도 있습니다.</p> - -<h4 id="New"><strong>Android 5.0의 새로운 기능</strong></h4> - -<p>Android 5.0에서는 구조적, -시각적, 그리고 기능적으로 중요한 업데이트를 알림을 통해 받을 수 있습니다.</p> - -<ul> - <li>새로운 -머티어리얼 디자인 테마와 일치하도록 알림이 시각적으로 바뀌었습니다.</li> - <li> 알림이 이제 기기 잠금 화면에 표시되나, -민감한 콘텐츠는 여전히 -숨길 수 있습니다.</li> - <li>기기가 사용 중일 때 수신되는 최우선 순위의 알림은 이제 -헤드업 알림이라는 새로운 형식을 사용합니다.</li> - <li>클라우드와 동기화되는 알림: Android -기기 중 하나에서 알림을 해지하면 -다른 기기에서도 해지됩니다.</li> -</ul> - -<p class="note"><strong>참고:</strong> 이 -Android 버전의 알림 디자인은 이전 버전과 많이 -다릅니다. 이전 -버전의 알림 디자인에 대한 자세한 내용은 <a href="./notifications_k.html">Android 4.4 이하 버전의 알림</a>을 참조하세요.</p> - -<h2 id="Anatomy">알림의 해부학적 구조</h2> - -<p>이 섹션에서는 알림의 기본적인 부분과 다양한 유형의 기기에서 알림이 어떻게 -표시될 수 있는지에 대해 살펴봅니다.</p> - -<h3 id="BaseLayout">기본 레이아웃</h3> - -<p>모든 알림은 기본적으로 다음을 포함하는 기본 레이아웃으로 구성됩니다.</p> - -<ul> - <li> 알림 <strong>아이콘</strong>. 알림 아이콘은 -알림을 발생시킨 앱을 나타냅니다. 또한, -앱이 두 가지 이상의 -유형을 생성하는 경우 알림 유형을 나타낼 수도 있습니다.</li> - <li> 알림 <strong>제목</strong> 및 추가 -<strong>텍스트</strong>.</li> - <li> <strong>타임스탬프</strong>.</li> -</ul> - -<p>이전 플랫폼 버전의 -{@link android.app.Notification.Builder Notification.Builder}로 생성된 알림은 시스템이 대신 -처리하는 사소한 스타일 변화를 제외하면 Android -5.0에서 똑같이 표시되고 동작합니다. 이전 -Android 버전의 알림에 대한 자세한 내용은 -<a href="./notifications_k.html">Android 4.4 이하 버전의 알림</a>을 참조하세요.</p></p> - - - <img style="margin:20px 0 0 0" src="{@docRoot}images/android-5.0/notifications/basic_combo.png" alt="" width="700px" /> - - -<div style="clear:both;margin-top:20px"> - <p class="img-caption"> - 핸드헬드 알림(왼쪽) 및 Wear에서 표시되는 동일한 알림(오른쪽)의 기본 레이아웃 -- 사용자 사진 및 알림 아이콘 포함 - </p> - </div> - -<h3 id="ExpandedLayouts">확장 레이아웃</h3> - - -<p>앱 알림이 얼마나 자세한 정보를 -제공하도록 할지는 직접 선택할 수 있습니다. 메시지의 처음 -몇 줄을 보여주거나 더 큰 이미지 미리보기를 보여줄 수 있습니다. 이러한 추가 -정보는 사용자에게 더 많은 -컨텍스트를 제공하며, 경우에 따라 이를 통해 사용자는 메시지 -전체를 읽을 수도 있습니다. 사용자는 -핀치-줌(pinch-zoom) 또는 한 손가락으로 밀기를 이용하여 축소 레이아웃과 -확장 레이아웃 간을 전환할 수 있습니다. - Android는 단일 이벤트 알림에 대해 세 개의 확장 레이아웃 -템플릿(텍스트, 받은 편지함, -이미지)을 애플리케이션에 사용할 수 있도록 제공합니다. 다음 이미지는 -단일 이벤트 알림이 -핸드헬드(왼쪽) 및 웨어러블(오른쪽)에서 어떻게 표시되는지 보여줍니다.</p> - -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/expandedtext_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/stack_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/ExpandedImage.png" - alt="" width="311px" height;="450px" /> - -<h3 id="actions" style="clear:both; margin-top:40px">작업</h3> - -<p>Android는 알림의 -맨 아래 부분에 표시되는 선택적인 작업을 지원합니다. -이러한 작업을 통해 사용자는 알림을 발생시킨 -애플리케이션을 열 필요 없이 알림 창에서 특정 -알림에 대한 가장 일반적인 태스크를 처리할 수 있습니다. -이 기능은 밀어서 해제하기와 함께 작용하여 상호 작용의 속도를 향상시키며, 사용자가 자신에게 중요한 알림에 -집중하는 데 도움이 됩니다.</p> - - - <img src="{@docRoot}images/android-5.0/notifications/action_combo.png" alt="" width="700px" /> - - - -<p style="clear:both">알림에 -포함할 작업의 수는 신중하게 결정해야 합니다. 더 많은 -작업을 포함할수록 인지적 복합성이 가중됩니다. 당장에 중요하며 의미 -있는 작업만 포함하여 작업 -수를 최소한으로 -제한해야 합니다.</p> - -<p>알림에 포함하기에 적합한 작업은 다음과 같습니다.</p> - -<ul> - <li> 표시하려는 -콘텐츠 유형과 관련하여 필수적이고, 자주 사용되며 전형적인 작업 - <li> 사용자가 신속하게 태스크를 완료할 수 있게 하는 작업 -</ul> - -<p>다음과 같은 작업은 피합니다.</p> - -<ul> - <li> 애매모호한 작업 - <li> "읽기" 또는 -"열기"와 같이 알림의 기본 작업과 동일한 작업 -</ul> - - - -<p>작업 -아이콘 및 이름으로 각각 구성된, 최대 세 개의 작업을 지정할 수 있습니다. - 단순한 기본 레이아웃에 작업을 추가하면 알림이 확장 가능하게 되며, -알림에 -확장 레이아웃이 없는 경우에도 이러한 사항이 적용됩니다. 작업은 -확장된 -알림에서만 표시되고 그 외에는 숨겨져 있으므로 -사용자가 알림에서 -호출할 수 있는 모든 작업을 관련 애플리케이션 내에서도 -사용할 수 있는지 확인해야 합니다.</p> - -<h2 style="clear:left">헤드업 알림</h2> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/hun-example.png" alt="" width="311px" /> - <p class="img-caption"> - 몰입형 앱의 -최상위에 -표시되는 헤드업 알림의 예(걸려오는 전화, 최우선 순위) - </p> -</div> - -<p>최우선 순위의 알림을 수신하면(오른쪽), 가능한 작업을 보여주는 확장된 레이아웃 형태로 -잠시 동안 사용자에게 -표시됩니다.</p> -<p> 그런 다음, 알림이 알림 -창으로 돌아갑니다. 알림에 대한 <a href="#correctly_set_and_manage_notification_priority">우선 순위</a> 플래그가 HIGH, MAX 또는 전체 화면으로 -지정된 경우 헤드업 알림이 표시됩니다.</p> - -<p><b>헤드업 알림의 좋은 예</b></p> - -<ul> - <li> 기기 사용 시 걸려오는 전화</li> - <li> 기기 사용 시 알람</li> - <li> 새 SMS 메시지</li> - <li> 배터리 부족</li> -</ul> - -<h2 style="clear:both" id="guidelines">가이드라인</h2> - - -<h3 id="MakeItPersonal">개인에 맞게 만들기</h3> - -<p>다른 사람이 보낸 항목(메시지 또는 -상태 업데이트)에 대한 알림의 경우 -{@link android.app.Notification.Builder#setLargeIcon setLargeIcon()}을 사용하여 그 사람의 이미지를 포함합니다. 또한 -그 사람에 대한 정보를 알림의 메타데이터에 추가합니다({@link android.app.Notification#EXTRA_PEOPLE} 참조).</p> - -<p>알림의 기본 아이콘이 여전히 표시됩니다. 따라서 사용자는 -해당 아이콘을 상태 표시줄에 -보이는 아이콘과 관련시킬 수 있습니다.</p> - - -<img src="{@docRoot}images/android-5.0/notifications/Triggered.png" alt="" width="311px" /> -<p style="margin-top:10px" class="img-caption"> - 누가 트리거했는지와 보낸 내용을 보여주는 알림입니다. -</p> - - -<h3 id="navigate_to_the_right_place">적합한 곳으로 이동하기</h3> - -<p>사용자가 작업 -버튼 외부에서 알림을 터치하면, 사용자가 알림에서 -참조되는 데이터를 확인하고 처리할 수 있는 곳에서 -앱이 열리도록 합니다. 대부분의 경우, 메시지와 같은 단일 데이터 항목을 표시하는 상세 뷰가 이에 해당합니다. -하지만 알림이 중첩되어 있을 경우에는 -요약 뷰일 수도 있습니다. 앱이 -최상위 레벨 아래의 위치에서 열린 경우 -사용자가 시스템의 뒤로 버튼을 눌러 최상위 레벨로 돌아갈 수 있도록 앱의 백 스택에 탐색 경로를 삽입합니다. 자세한 내용은 -<a href="{@docRoot}design/patterns/navigation.html#into-your-app">탐색</a> -디자인 패턴의 <em>홈 화면 위젯 및 알림을 통한 앱 탐색</em>을 참조하세요.</p> - -<h3 id="correctly_set_and_manage_notification_priority">알림의 -우선 순위를 정확하게 설정하고 -관리하기</h3> - -<p>Android는 알림 우선 순위 플래그를 지원합니다. 이 플래그를 통해 다른 알림에 상대적으로 알림이 표시되는 위치가 -결정되도록 할 수 있습니다. 또한 -사용자가 가장 중요한 알림을 항상 가장 먼저 볼 수 있게 -할 수 있습니다. 알림을 게시할 때 -다음 우선 순위 중에서 -선택할 수 있습니다.</p> -<table> - <tr> - <td class="tab0"> -<p><strong>우선 순위</strong></p> -</td> - <td class="tab0"> -<p><strong>용도</strong></p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MAX</code></p> -</td> - <td class="tab1"> -<p>시간에 민감한 -또는 -특정 태스크를 계속 진행하기 전에 처리해야 할 -상황을 사용자에게 알리는 중요하고 긴급한 알림에 사용합니다.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>HIGH</code></p> -</td> - <td class="tab1"> -<p>중요한 대화에 주로 사용합니다. 일례로 사용자에게 특별히 흥미로운 내용이 포함된 메시지 또는 채팅 -이벤트가 이에 해당합니다. -최우선 순위의 알림은 헤드업 알림이 표시되도록 합니다.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>DEFAULT</code></p> -</td> - <td class="tab1"> -<p>여기서 설명하지 않은 기타 모든 우선 순위의 알림에 사용합니다.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>LOW</code></p> -</td> - <td class="tab1"> -<p>사용자에게 알려야 하지만 긴급하지 않은 -알림에 사용합니다. 우선 순위가 낮은 알림은 보통 목록의 맨 아래에 표시되며, -공개 또는 대상이 불특정한 소셜 업데이트에 사용하기 -좋습니다. 사용자가 -요구한 -알림이지만, 이러한 알림은 긴급하거나 직접적인 -대화를 우선할 수 없습니다.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MIN</code></p> -</td> - <td class="tab1"> -<p>날씨 정보 또는 상황에 맞는 -위치 정보와 같은 상황별 또는 배경 정보에 사용합니다. -최소 우선 순위 알림은 상태 표시줄에 표시되지 않습니다. 이러한 알림은 사용자가 알림 창을 확대하면 -볼 수 있습니다.</p> -</td> - </tr> -</table> - - -<h4 id="how_to_choose_an_appropriate_priority"><strong> -적절한 -우선 순위를 선택하는 방법</strong></h4> - -<p><code>DEFAULT</code>, <code>HIGH</code> 및 <code>MAX</code>는 작업을 중단시키는 우선 순위이며, 사용자의 액티비티를 -중단시키는 -위험 요소입니다. 앱 사용자를 성가시게 하지 않으려면 다음과 같은 -알림에만 작업을 중단시키는 우선 순위를 지정해야 합니다.</p> - -<ul> - <li> 다른 사람이 관련된 알림</li> - <li> 시간에 민감한 알림</li> - <li> 실제 환경에서의 사용자 행동을 즉시 바꿀 수 있는 알림</li> -</ul> - -<p><code>LOW</code> 및 <code>MIN</code>으로 설정된 알림도 사용자에게 -중요할 수 있습니다. 대부분은 아니지만 많은 알림이 사용자의 -즉각적인 주의를 필요로 하지 않거나 사용자의 손목에 진동을 줄 필요가 없지만, 사용자가 알림을 확인하고자 -했을 때 유용하다고 -여길 정보를 포함합니다. <code>LOW</code> 및 <code>MIN</code> -우선 순위 알림에 대한 조건은 다음과 같습니다.</p> - -<ul> - <li> 다른 사람이 관련되지 않음</li> - <li> 시간에 민감하지 않음</li> - <li> 사용자가 흥미를 가질 만하지만 시간이 있을 때 -보기를 원할 수 있는 내용을 포함함</li> -</ul> - - - <img src="{@docRoot}images/android-5.0/notifications/notifications_pattern_priority.png" alt="" width="700" /> - - -<h3 style="clear:both" id="set_a_notification_category">알림 -범주 설정하기</h3> - -<p>알림이 미리 정의된 범주에 포함될 경우(아래 -참조), -그에 따라 할당합니다. 알림 창(또는 -다른 알림 -수신자)과 같은 시스템 UI의 기능은 순위 및 필터링 결정을 내리는 데 이 정보를 활용할 수 있습니다.</p> -<table> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_CALL">CATEGORY_CALL</a></code></p> -</td> - <td> -<p>수신 전화(음성 또는 화상) 또는 이와 유사한 동기적 대화 -요청</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_MESSAGE">CATEGORY_MESSAGE</a></code></p> -</td> - <td> -<p>수신되는 직접 메시지(SMS, 인스턴트 메시지 등)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EMAIL">CATEGORY_EMAIL</a></code></p> -</td> - <td> -<p>비동기적 대량 메시지(이메일)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EVENT">CATEGORY_EVENT</a></code></p> -</td> - <td> -<p>캘린더 이벤트</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROMO">CATEGORY_PROMO</a></code></p> -</td> - <td> -<p>홍보 또는 광고</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ALARM">CATEGORY_ALARM</a></code></p> -</td> - <td> -<p>알람 또는 타이머</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROGRESS">CATEGORY_PROGRESS</a></code></p> -</td> - <td> -<p>장기간 실행 중인 백그라운드 작업의 진행 상황</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SOCIAL">CATEGORY_SOCIAL</a></code></p> -</td> - <td> -<p>소셜 네트워크 또는 공유 업데이트</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ERROR">CATEGORY_ERROR</a></code></p> -</td> - <td> -<p>백그라운드 작업 또는 인증 상태 오류</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_TRANSPORT">CATEGORY_TRANSPORT</a></code></p> -</td> - <td> -<p>재생에 대한 미디어 전송 제어</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SYSTEM">CATEGORY_SYSTEM</a></code></p> -</td> - <td> -<p>시스템 또는 기기 상태 업데이트. 시스템용으로 예약됨</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SERVICE">CATEGORY_SERVICE</a></code></p> -</td> - <td> -<p>실행 중인 백그라운드 서비스에 대한 표시</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_RECOMMENDATION">CATEGORY_RECOMMENDATION</a></code></p> -</td> - <td> -<p>한 가지 특정 항목에 대한 구체적이고 시기적절한 권장 사항. 예를 들어, 뉴스 -앱이 사용자가 다음으로 읽기 원할 것이라고 생각하는 뉴스를 -권하고자 하는 경우</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_STATUS">CATEGORY_STATUS</a></code></p> -</td> - <td> -<p>기기 또는 상황별 상태에 대한 지속적인 정보</p> -</td> - </tr> -</table> - -<h3 id="summarize_your_notifications">알림 요약하기</h3> - -<p>특정 유형의 알림이 이미 보류 중일 때 앱에서 같은 유형의 새 -알림을 보내려고 하는 경우, 이 앱에 대해 두 알림을 하나의 요약 알림으로 결합합니다. 새로운 개체는 -생성하지 않아야 합니다.</p> - -<p>요약 알림은 사용자가 특정 종류의 알림이 -몇 개나 보류 중인지 -파악할 수 있도록 간단한 개요를 표시합니다.</p> - -<div class="col-6"> - -<p><strong>잘못된 사용</strong></p> - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Dont.png" alt="" width="311px" /> -</div> - -<div> -<p><strong>올바른 사용</strong></p> - - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Do.png" alt="" width="311px" /> -</div> - -<p style="clear:left; padding-top:30px; padding-bottom:20px">확장된 다이제스트 레이아웃을 사용하여 -요약에 포함된 각각의 알림에 대한 -더 자세한 정보를 제공할 수 있습니다. 이 방식을 통해 사용자는 -어떠한 알림이 보류 중이고, -관련된 앱에서 -상세 정보를 읽고 싶을 정도로 알림이 흥미로운지를 -판단할 수 있습니다.</p> -<div class="col-6"> - <img src="{@docRoot}images/android-5.0/notifications/Stack.png" style="margin-bottom:20px" alt="" width="311px" /> - <p class="img-caption"> - 확장된 알림 및 축소된 요약 알림(<code>InboxStyle</code> 사용) - </p> -</div> - -<h3 style="clear:both" id="make_notifications_optional">알림을 -선택 항목으로 만들기</h3> - -<p>사용자는 항상 알림을 통제할 수 있어야 합니다. 애플리케이션 설정에 알림 설정 항목을 추가하여 -사용자가 앱의 -알림을 -해제하거나 경고 속성(예: 경고음 및 진동 사용 -여부)을 변경할 수 있도록 허용합니다.</p> - -<h3 id="use_distinct_icons">뚜렷한 아이콘 사용</h3> -<p>알림 영역을 봄으로써 사용자는 현재 -어떠한 종류의 -알림이 보류 중인지 파악할 수 있어야 합니다.</p> - -<div class="figure"> - <img src="{@docRoot}images/android-5.0/notifications/ProductIcons.png" alt="" width="420" /> -</div> - - <div><p><strong>올바른 사용</strong></p> - <p>Android 앱이 이미 제공하는 알림 아이콘을 살펴본 후 본인의 앱에서 -뚜렷히 나타날 수 있는 -알림 아이콘을 만듭니다.</p> - - <p><strong>올바른 사용</strong></p> - <p>작은 아이콘에 -적절한 <a href="/design/style/iconography.html#notification">알림 아이콘 스타일</a>을 사용하며, 작업 -아이콘에는 머티어리얼 라이트 -<a href="/design/style/iconography.html#action-bar">작업 모음 아이콘 -스타일</a>을 사용합니다.</p> -<p ><strong>올바른 사용</strong></p> -<p >아이콘은 시각적으로 단순하게 유지하고, -알아차리기 힘들 정도로 과도하게 세부적인 디자인은 피합니다.</p> - - <div><p><strong>잘못된 사용</strong></p> - <p>작은 -아이콘 및 작업 -아이콘에 알파(어둡게 설정 또는 페이드 효과)를 추가합니다. 아이콘의 가장자리를 안티-앨리어싱할 수는 있지만, Android가 이러한 -아이콘을 마스크(즉, -알파 채널만 사용됨)로 사용하기 때문에 일반적으로 이미지는 최대 수준의 -불투명도로 그려집니다.</p> - -</div> -<p style="clear:both"><strong>잘못된 사용</strong></p> - -<p>다른 앱과의 차별화를 위해 색상을 사용합니다. 알림 아이콘은 투명한 배경 이미지에 흰색 아이콘이어야만 -합니다.</p> - - -<h3 id="pulse_the_notification_led_appropriately">알림 LED를 -적절하게 사용하기</h3> - -<p>많은 Android 기기에는 알림 LED가 내장되어 있으며, 이러한 알림 LED는 화면이 꺼져 있을 때 -사용자에게 -이벤트에 대해 알리기 위해 사용됩니다. 우선 순위가 <code>MAX</code>, -<code>HIGH</code> 또는 <code>DEFAULT</code>인 알림의 경우 -LED가 켜지며, 낮은 우선 순위(<code>LOW</code> 및 -<code>MIN</code>)의 알림의 경우 LED가 켜지지 않습니다.</p> - -<p>알림과 관련하여 사용자는 LED도 제어할 수 있어야 합니다. -DEFAULT_LIGHTS를 사용하는 경우 -LED는 흰색으로 켜집니다. 사용자가 -명시적으로 지정한 경우 외에는 다른 알림 -색상을 사용할 수 없습니다.</p> - -<h2 id="building_notifications_that_users_care_about">사용자가 관심을 가질 만한 -알림 만들기</h2> - -<p>사용자의 사랑을 받는 앱을 만들기 위해서는 -알림을 신중하게 디자인해야 합니다. -알림은 앱의 목소리를 대변하며, 앱의 -개성에 큰 영향을 미칩니다. 원하지 않거나 -중요하지 않은 알림은 사용자를 성가시게 하거나 앱에서 -많은 신경을 -쓰게 하는 것에 대해 짜증이 나게 합니다. 따라서 알림을 사용할 때는 현명하게 판단해야 합니다.</p> - -<h3 id="when_to_display_a_notification">알림을 표시해야 하는 경우</h3> - -<p>사람들이 즐겨 사용하는 애플리케이션을 만들려면 사용자의 -주의와 집중을 흐트러뜨리지 않고 보호해야 하는 리소스임을 -인지하는 것이 중요합니다. Android의 -알림 시스템은 알림이 사용자의 주의를 최대한 방해하지 않도록 -디자인되었습니다. -하지만 -알림이 -사용자의 태스크 흐름을 방해한다는 사실을 계속해서 인지해야 합니다. -알림을 계획할 때 알림이 사용자의 작업을 중단할 만큼 -중요한지 곰곰히 생각해 보시기 바랍니다. 잘 모르겠는 경우, 사용자가 앱의 알림 설정을 사용하여 알림에 대한 수신 동의를 -선택할 수 있도록 허용하거나 알림 우선 순위 플래그를 <code>LOW</code> 또는 <code>MIN</code>으로 -조정하여 사용자 작업을 -방해하지 -않도록 합니다.</p> - - <img src="{@docRoot}images/android-5.0/notifications/TimeSensitive.png" alt="" width="311px" /> - <p style="margin-top:10px" class="img-caption"> - 시간에 민감한 알림의 예 - </p> - -<p>일반적으로 잘 만들어진 앱은 사용자의 요청이 있을 때에만 정보를 알리고 -요청하지 않은 알림은 꼭 필요한 경우에만 표시하도록 합니다.</p> - -<p>알림은 <strong>시간에 민감한 이벤트</strong>에 주로 사용하며, 특히 -이러한 동기적 이벤트에 <strong>다른 사람이 관련된 경우</strong>에 사용합니다. 예를 -들어 수신되는 채팅 메시지는 -실시간으로 진행되는 동기적 대화 형식이며, 이때 다른 사람은 -적극적으로 응답을 기다립니다. 캘린더 이벤트는 언제 -알림을 사용하고 -사용자의 주의를 끌어야 하는지에 대해 알 수 있는 또 다른 좋은 예입니다. 왜냐하면 이는 임박한 이벤트이며, 캘린더 이벤트에는 종종 다른 사람이 -관련되기 때문입니다.</p> - -<h3 style="clear:both" id="when_not_to_display_a_notification">알림을 -표시하지 않아야 하는 경우</h3> - -<div class="figure" style="margin-top:60px"> - <img src="{@docRoot}images/android-5.0/notifications/AntiSample1.png" alt="" width="311px" /> -</div> - -<p>다른 대부분의 경우 알림은 적합하지 않습니다.</p> - -<ul> - <li> 사용자와 -직접 관련이 없는 정보나 시간에 민감하지 않은 -정보는 알리지 않도록 합니다. 예를 들어 소셜 네트워크를 통한 비동기적이며 -대상이 불특정한 업데이트는 -일반적으로 실시간으로 -사용자를 방해할 수 없습니다. 그러한 업데이트를 원하는 사용자의 -경우에는 사전에 수신 동의를 설정할 수 있게 하면 됩니다.</li> - <li> 관련된 새 정보가 현재 -화면에 표시된 경우에는 알림을 생성하지 않아야 합니다. 대신 애플리케이션 UI를 -사용하여 컨텍스트 내에 새로운 정보가 있음을 사용자에게 -직접 알립니다. - 예를 들어 채팅 애플리케이션은 -사용자가 다른 사용자와 대화 중일 때는 시스템 알림을 생성하지 않아야 합니다.</li> - <li> 정보 저장 -또는 동기화, 애플리케이션 업데이트와 같은 낮은 수준의 기술 정보의 경우 사용자가 개입하지 -않아도 앱이나 시스템에서 스스로 알아서 처리할 수 있다면 사용자를 방해하지 않도록 합니다.</li> - <li> 사용자가 아무런 조치를 -취하지 않아도 애플리케이션 스스로 오류를 복구할 -수 있는 경우, 이러한 오류에 대해 사용자에게 알리지 않도록 합니다.</li> - <li> 알리는 내용은 없고 -단순히 앱을 -홍보하는 알림은 만들지 않습니다. 알림은 유용하고, 시기적절하며 새로운 정보를 제공해야 하며, 단지 앱 출시를 위한 용도로는 -사용하지 -않습니다.</li> - <li> 단지 -사용자에게 브랜드를 알리기 위한 불필요한 알림은 만들지 않도록 합니다. - 그러한 알림은 사용자를 짜증 나게 만들어 앱에 대한 관심을 멀어지게 합니다. 소량의 -업데이트된 정보를 제공하면서 사용자가 지속적으로 -앱에 관심을 -갖게 만드는 최고의 -방법은 -홈 화면에 추가할 수 있는 위젯을 개발하는 것입니다.</li> -</ul> - -<h2 style="clear:left" id="interacting_with_notifications">알림과 -상호 작용하기</h2> - -<p>알림은 상태 표시줄에 아이콘으로 표시되며, -알림 창을 열어서 -확인할 수 있습니다.</p> - -<p>알림을 터치하면 관련 앱이 열리고 알림에 -해당되는 세부 내용이 표시됩니다. 알림을 왼쪽이나 오른쪽으로 -스와이프하면 알림 창에서 제거됩니다.</p> - -<h3 id="ongoing_notifications">지속적인 알림</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/MusicPlayback.png" alt="" width="311px" /> - <p class="img-caption"> - 음악 재생으로 인한 지속적인 알림 - </p> -</div> -<p>지속적인 알림은 -백그라운드에서 진행 중인 프로세스에 대해 사용자에게 알립니다. -예를 들어 음악 플레이어는 사용자가 재생을 멈출 때까지 -알림 시스템 내에 현재 재생 중인 트랙을 -계속 표시합니다. 또한 지속적인 알림은 파일을 다운로드하거나 비디오를 인코딩하는 등의 장기 태스크에 대한 -피드백을 사용자에게 -표시할 수도 있습니다. 지속적인 알림은 사용자가 알림 창에서 직접 -제거할 수 없습니다.</p> - -<h3 id="ongoing_notifications">미디어 재생</h3> -<p>Android 5.0에서는 잠금 화면에 사용이 중단된 -{@link android.media.RemoteControlClient} 클래스에 대한 전송 제어가 표시되지 않습니다. 하지만 알림은 <em>표시되며</em>, 각 -앱의 재생 알림이 현재 사용자가 잠금 상태에서 재생을 제어하는 기본 -방법입니다. 이 동작은 화면의 잠금 여부와 상관없이 사용자에게 -일관된 환경을 제공하면서, 어떠한 버튼을 -어떻게 표시할지에 대해 앱이 더 세부적으로 제어할 수 있도록 -지원합니다.</p> - -<h3 style="clear:both" -id="dialogs_and_toasts_are_for_feedback_not_notification">대화 상자 -및 알림 메시지</h3> - -<p>현재 -화면에 표시되어 있는 경우가 아니라면 앱은 대화 상자나 알림 메시지를 생성해서는 안 됩니다. 대화 상자나 알림 메시지는 -앱 내에서 -사용자가 어떠한 행동을 취했을 때 이에 대한 즉각적인 응답으로만 표시되어야 합니다. -대화 상자 및 알림 메시지 사용에 대한 자세한 지침은 -<a href="/design/patterns/confirming-acknowledging.html">확인 및 승인하기</a>를 참조하세요.</p> - -<h3>순위 및 순서</h3> - -<p>알림은 뉴스이므로, 기본적으로 발생한 순서의 역순으로 -표시되며, 특히 -앱에서 명시된 알림 -<a href="#correctly_set_and_manage_notification_priority">우선 순위</a>에 따라 순서가 결정됩니다.</p> - -<p>알림은 잠금 화면에서 중요한 부분이며, 기기의 화면이 켜질 -때마다 -표시됩니다. 잠금 화면의 공간은 협소하기 때문에 가장 긴급하고 관련 있는 알림을 식별하는 것이 -가장 -중요합니다. 이러한 -이유 때문에 Android에는 다음을 고려한 -더욱 정교한 정렬 알고리즘이 있습니다.</p> - -<ul> - <li> 타임스탬프 및 애플리케이션에 명시된 우선 순위.</li> - <li> 알림이 최근에 소리 또는 -진동으로 사용자를 방해했는지에 대한 여부. (즉, -휴대폰에서 방금 소리가 났을 때 사용자가 "방금 무슨 -일이 있었지?"에 대해 알고 싶어하는 경우 잠금 화면을 -보면 한 눈에 알 수 있어야 합니다.)</li> - <li> {@link android.app.Notification#EXTRA_PEOPLE}을 사용하여 알림에 첨부된 사람, -그리고 특히 즐겨찾기에 추가된 연락처인지에 대한 여부.</li> -</ul> - -<p>이러한 정렬 알고리즘을 잘 이용하기 위해서는 목록의 특정 부분에 초점을 두기 보다는 생성하고자 -하는 사용자 -환경에 초점을 둡니다.</p> - - <img src="{@docRoot}images/android-5.0/notifications/AntiSample3.png" alt="" width="700px" /> - - <p class="img-caption" style="margin-top:10px">Gmail 알림은 -기본 우선 순위이기 때문에 -보통은 행아웃과 같은 인스턴트 메시징 앱에서 온 메시지보다 하위에 정렬됩니다. 하지만 -새 메시지가 들어오면 -일시적으로 순위가 올라갑니다. - </p> - - -<h3>잠금 화면</h3> - -<p>알림은 잠금 화면에 표시되기 때문에 사용자의 개인 정보 보호가 -특히 -중요하게 고려해야 할 사항입니다. 알림은 종종 민감한 정보를 포함하기 때문에, 아무나 -기기의 화면을 켰을 때 볼 수 있게 할 필요는 -없습니다.</p> - -<ul> - <li> 보안 잠금 화면(PIN, 패턴 또는 암호)이 있는 기기의 인터페이스에는 -공개 및 비공개 부분이 있습니다. 공개 인터페이스는 보안 잠금 화면에 표시될 수 있기 때문에 -누구나 볼 수 있습니다. 비공개 인터페이스는 잠금 화면 뒤에 있기 때문에 -기기의 잠금 화면을 푼 사람만 볼 수 있습니다.</li> -</ul> - -<h3>보안 잠금 화면에 표시된 정보에 대한 사용자 제어</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/LockScreen@2x.png" srcset="{@docRoot}images/android-5.0/notifications/LockScreen.png 1x" alt="" width="311px" /> - <p class="img-caption"> - 사용자가 기기의 잠금을 푼 후 보이는 콘텐츠와 함께 잠금 화면에 표시된 알림 - </p> -</div> - -<p>보안 잠금 화면을 설정할 때 사용자는 -민감한 세부 정보를 보안 잠금 화면에서 숨기도록 선택할 수 있습니다. 이러한 경우 시스템 UI는 알림의 <em>정보 공개 수준</em>을 -고려하여 -안전하게 표시할 수 있는 정보를 파악합니다.</p> -<p> 정보 공개 수준을 제어하려면 -<code><a -href="/reference/android/app/Notification.Builder.html#setVisibility(int)">Notification.Builder.setVisibility()</a></code>를 호출한 후 -다음 값 중 하나를 지정합니다.</p> - -<ul> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PUBLIC">VISIBILITY_PUBLIC</a></code>. 알림의 전체 내용을 -표시합니다. - 정보 공개 수준을 지정하지 않을 경우 시스템 기본값입니다.</li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PRIVATE">VISIBILITY_PRIVATE</a></code>. -잠금 화면에 알림의 -아이콘과 알림을 게시한 앱의 이름을 포함하여 해당 알림의 존재에 대한 기본 정보를 표시합니다. 알림의 나머지 세부 사항은 표시되지 않습니다. -다음과 같은 몇 가지 유용한 사항을 염두해야 합니다. - <ul> - <li> 시스템이 보안 잠금 화면에 다른 공개 버전의 알림을 -표시하도록 제공하려는 경우, <code><a -href="/reference/android/app/Notification.html#publicVersion">Notification.publicVersion</a></code> -필드에 대체 -알림 개체를 제공해야 합니다. - <li> 이렇게 설정하면 앱에서 여전히 유용하지만 개인 정보를 노출하지 않는 편집된 버전의 -내용을 생성할 수 있습니다. 예를 들어, 알림에 SMS 텍스트, 발신자 이름 및 연락처 아이콘을 포함하는 -SMS 앱이 있다고 가정합니다. -이 알림은 <code>VISIBILITY_PRIVATE</code>여야 하지만, <code>publicVersion</code>은 다른 식별 -정보 없이 "3개의 새 메시지"와 같이 여전히 유용한 정보를 -포함할 수 있습니다. - </ul> - </li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_SECRET">Notification.VISIBILITY_SECRET</a></code>. 최소한의 정보만 표시하며, 알림의 아이콘마저 -표시하지 않습니다.</li> -</ul> -<h2 style="clear:both" id="notifications_on_android_wear">Android Wear에 -표시되는 알림</h2> - -<p>Android Wear에 표시되는 알림과 해당 <em>작업</em>은 기본적으로 Wear 기기에 연결되어 있습니다. -개발자는 어떠한 알림을 -휴대폰에서 워치로, -그리고 그 반대로 연결할지 제어할 수 있습니다. 또한 개발자는 어떠한 작업을 연결할지도 제어할 수 있습니다. 앱이 -단일 탭으로 실행할 수 없는 -작업을 포함하는 경우, 이러한 작업을 -Wear -알림에 표시되지 않도록 숨기거나 Wear 앱에 연결하여 사용자가 -워치에서 작업을 -끝낼 수 있도록 합니다.</p> - -<h4>알림과 작업 연결하기</h4> - -<p>휴대폰과 같이 연결된 기기는 알림을 Wear 기기에 연결하여 해당 기기에서 -알림이 표시될 수 있게 합니다. 마찬가지로 작업도 연결할 수 있기 때문에 사용자는 Wear 기기에서 -알림을 바로 처리할 수 있습니다.</p> - -<p><strong>연결해야 할 사항</strong></p> - -<ul> - <li> 새 인스턴트 메시지</li> - <li> +1, Like, Heart와 같은 단일 탭 작업</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/WearBasic.png" width="156px" height="156px" alt="" /> - -<p><strong>연결하지 않아야 할 사항</strong></p> - -<ul> - <li> 새로 도착한 팟캐스트의 알림</li> - <li> 워치에서 수행할 수 없는 기능에 매핑되는 작업</li> -</ul> - - - -<p><h4>Wear에 대해서만 정의할 수 있는 고유한 작업</h4></p> - -<p>Wear에서만 수행할 수 있는 작업이 몇 가지 있으며, 이러한 작업은 다음과 같습니다.</p> - -<ul> - <li> "금방 올게"와 같은 미리 준비된 대답으로 구성된 빠른 목록</li> - <li> 휴대폰에서 열기</li> - <li> 음성 입력 화면을 불러오는 "댓글 달기" 또는 "응답" 작업</li> - <li> Wear에 특화된 앱을 실행하는 작업</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/ReplyAction.png" width="156px" height="156px" alt="" /> 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 2674481181a4..e58a4f98019b 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 efd05f3e3a69..f2ce6500327d 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 @@ page.tags=androidn @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/preview/features/security-config.jd b/docs/html-intl/intl/ko/training/articles/security-config.jd index 7e3f951cc6dd..414c139b7808 100644 --- a/docs/html-intl/intl/ko/preview/features/security-config.jd +++ b/docs/html-intl/intl/ko/training/articles/security-config.jd @@ -4,8 +4,8 @@ page.image=images/cards/card-nyc_2x.jpg @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/playback/picture-in-picture.jd b/docs/html-intl/intl/ko/training/tv/playback/picture-in-picture.jd index 15d85fa4626e..96129ce216e1 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 @@ page.tags=androidn @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 fa557bcf14fd..ed8b6e04ec85 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 @@ page.image=images/cards/card-nyc_2x.jpg @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/design/patterns/notifications.jd b/docs/html-intl/intl/pt-br/design/patterns/notifications.jd deleted file mode 100644 index 5560e85f5c2e..000000000000 --- a/docs/html-intl/intl/pt-br/design/patterns/notifications.jd +++ /dev/null @@ -1,872 +0,0 @@ -page.title=Notificações -page.tags="notifications","design","L" -@jd:body - - <a class="notice-developers" href="{@docRoot}training/notify-user/index.html"> - <div> - <h3>Documentos do desenvolvedor</h3> - <p>Notificação ao usuário</p> - </div> -</a> - -<a class="notice-designers" href="notifications_k.html"> - <div> - <h3>Notificações no Android 4.4 e em anteriores</h3> - </div> -</a> - -<!-- video box --> -<a class="notice-developers-video" href="https://www.youtube.com/watch?v=Uiq2kZ2JHVY"> -<div> - <h3>Vídeo</h3> - <p>DevBytes: Notificações na pré-visualização do desenvolvedor do Android L</p> -</div> -</a> - -<style> - .col-5, .col-6, .col-7 { - margin-left:0px; - } -</style> - -<p>O sistema de notificações permite que os usuários se mantenham informados sobre eventos relevantes e -imediatos -no aplicativo, como novas mensagens de bate-papo de um amigo ou um evento de calendário. -Pense nas notificações como um canal de notícias que alerta o usuário sobre eventos -importantes à -medida que acontecem ou sobre um registro que grava eventos enquanto o usuário não está prestando -atenção — e que é sincronizado conforme apropriado em todos os dispositivos Android dele.</p> - -<h4 id="New"><strong>Novo no Android 5.0</strong></h4> - -<p>No Android 5.0, as notificações recebem atualizações importantes: em termos estruturais, visuais e -funcionais:</p> - -<ul> - <li>As notificações passaram por mudanças visuais consistentes com o novo -tema do Material Design.</li> - <li> As notificações agora estão disponíveis na tela de bloqueio do dispositivo, enquanto que -o conteúdo sensível ainda pode -ficar oculto atrás dela.</li> - <li>Notificações de alta prioridade recebidas enquanto o dispositivo está em uso agora usam um novo formato, chamado de -notificações heads-up.</li> - <li>Notificações sincronizadas na nuvem: descartar uma notificação em um dos -dispositivos Android a descarta -também nos outros.</li> -</ul> - -<p class="note"><strong>Observação:</strong> o projeto de notificação nesta versão do -Android é uma mudança -significativa em relação às versões anteriores. Para obter informações sobre o projeto de notificação em versões -anteriores, consulte <a href="./notifications_k.html">Notificações no Android 4.4 ou em anteriores</a>.</p> - -<h2 id="Anatomy">Anatomia de uma notificação</h2> - -<p>Esta seção aborda as partes básicas de uma notificação e como elas -podem aparecer em diferentes tipos de dispositivos.</p> - -<h3 id="BaseLayout">Layout básico</h3> - -<p>No mínimo, todas as notificações consistem em um layout básico, incluindo:</p> - -<ul> - <li> O <strong>ícone</strong> da notificação. O ícone simboliza o -aplicativo de origem. Ele também - pode indicar o tipo de notificação, caso o aplicativo gere mais de um -tipo.</li> - <li> Um <strong>título</strong> da notificação e -<strong>texto</strong> adicional.</li> - <li> Uma <strong>marcação de data e hora</strong>.</li> -</ul> - -<p>Notificações criadas com {@link android.app.Notification.Builder Notification.Builder} -para versões anteriores da plataforma têm a mesma aparência e o mesmo funcionamento no Android -5.0, com apenas mudanças menores de estilo que o sistema -entrega a você. Para obter mais informações sobre notificações em versões -anteriores do Android, consulte -<a href="./notifications_k.html">Notificações no Android 4.4 ou em anteriores</a>.</p></p> - - - <img style="margin:20px 0 0 0" src="{@docRoot}images/android-5.0/notifications/basic_combo.png" alt="" width="700px" /> - - -<div style="clear:both;margin-top:20px"> - <p class="img-caption"> - Layout básico de uma notificação em dispositivo portátil (à esquerda) e a mesma notificação em Wear (à direita), -com uma foto do usuário e um ícone de notificação - </p> - </div> - -<h3 id="ExpandedLayouts">Layouts expandidos</h3> - - -<p>Você pode escolher o nível de detalhe que as notificações de seu aplicativo -devem fornecer. Elas podem mostrar as primeiras -linhas de uma mensagem ou exibir uma visualização de imagem maior. As informações -adicionais fornecem ao usuário mais -contexto e — em alguns casos — podem permitir que o usuário leia uma mensagem -em sua totalidade. O usuário pode -pinçar para aproximar ou afastar a vista ou realizar deslizamento de um dedo para alternar entre os layouts -compacto e expandido. - Para notificações de um evento, o Android fornece três modelos de layout -expandido (texto, caixa de entrada e - imagem) para usar em seu aplicativo. As imagens a seguir mostram como -se parecem notificações de um evento em - dispositivos portáteis (à esquerda) e usados junto ao corpo (à direita).</p> - -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/expandedtext_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/stack_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/ExpandedImage.png" - alt="" width="311px" height;="450px" /> - -<h3 id="actions" style="clear:both; margin-top:40px">Ações</h3> - -<p>O Android tem suporte para ações opcionais que são exibidas na parte inferior -da notificação. -Com ações, os usuários podem tratar as tarefas mais comuns para -determinada notificação de dentro da sombra da notificação sem precisar abrir o -aplicativo de origem. -Isso acelera a interação e, em conjunto com deslizar-para-descartar, ajuda os usuários a -se concentrarem em notificações que sejam importantes.</p> - - - <img src="{@docRoot}images/android-5.0/notifications/action_combo.png" alt="" width="700px" /> - - - -<p style="clear:both">Tenha cuidado com o número de ações que inclui em uma -notificação. Quanto mais -ações incluir, maior será a complexidade cognitiva criada. Limite-se -ao menor número possível -de ações, incluindo apenas as ações efetivamente mais importantes e -significativas.</p> - -<p>Boas candidatas a ações em notificações são ações que:</p> - -<ul> - <li> Sejam essenciais, frequentes e típicas para o tipo de conteúdo -exibido - <li> Permitam que o usuário realize tarefas rapidamente -</ul> - -<p>Evite ações que sejam:</p> - -<ul> - <li> Ambíguas - <li> Idênticas à ação padrão da notificação (como "Ler" ou -"Abrir") -</ul> - - - -<p>Você pode especificar no máximo três ações, cada uma consistindo em um ícone -e um nome de ação. - Adicionar ações a um layout básico simples torna a notificação expansível, -mesmo se a -notificação não tiver um layout expandido. Como as ações são exibidas apenas para notificações -expandidas - e que ficam de outra forma ocultas, certifique-se de que qualquer ação que um -usuário possa invocar de dentro de uma - notificação esteja disponível também dentro do aplicativo -associado.</p> - -<h2 style="clear:left">Notificação heads-up</h2> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/hun-example.png" alt="" width="311px" /> - <p class="img-caption"> - Exemplo de uma notificação heads-up (chamada telefônica recebida, alta prioridade) -que aparece sobre um -aplicativo imersivo - </p> -</div> - -<p>Quando uma notificação de alta prioridade chega (veja à direita), ela é apresentada -aos usuários por -um período curto com um layout expandido mostrando possíveis ações.</p> -<p> Depois desse período, a notificação recua para a sombra -de notificação. Se a <a href="#correctly_set_and_manage_notification_priority">prioridade</a> de uma notificação for -marcada como Alta, Máxima ou tela cheia, ela receberá uma notificação heads-up.</p> - -<p><b>Bons exemplos de notificações heads-up</b></p> - -<ul> - <li> Chamada telefônica recebida durante o uso do dispositivo</li> - <li> Alarme durante o uso do dispositivo</li> - <li> Nova mensagem SMS</li> - <li> Bateria fraca</li> -</ul> - -<h2 style="clear:both" id="guidelines">Diretrizes</h2> - - -<h3 id="MakeItPersonal">Torne-a pessoal</h3> - -<p>Para notificações de itens enviados por outra pessoa (como uma mensagem ou -atualização de status), inclua a imagem da pessoa usando -{@link android.app.Notification.Builder#setLargeIcon setLargeIcon()}. Anexe também informações sobre -a pessoa nos metadados da notificação (consulte {@link android.app.Notification#EXTRA_PEOPLE}).</p> - -<p>O ícone principal de sua notificação ainda é mostrado, portanto, o usuário pode associá-lo -ao ícone -visível na barra de status.</p> - - -<img src="{@docRoot}images/android-5.0/notifications/Triggered.png" alt="" width="311px" /> -<p style="margin-top:10px" class="img-caption"> - Notificação que mostra a pessoa que a ativou e o conteúdo enviado. -</p> - - -<h3 id="navigate_to_the_right_place">Navegação para o lugar certo</h3> - -<p>Quando o usuário toca no corpo de uma notificação (fora dos botões -de ação), abra o aplicativo -no lugar em que o usuário possa visualizar e agir sobre os dados referenciados na -notificação. Na maioria dos casos, será a exibição detalhada de um único item de dado, como uma mensagem, -mas também poderá ser uma -vista resumida se a notificação estiver empilhada. Se o aplicativo -levar o usuário a qualquer lugar abaixo do nível superior do aplicativo, insira a navegação na pilha de retorno do aplicativo para que -o usuário possa pressionar o botão Voltar do sistema para voltar ao nível superior. Para obter mais informações, consulte -<em>Navegação para o seu aplicativo pelos widgets de página inicial e notificações</em> no padrão de projeto de <a href="{@docRoot}design/patterns/navigation.html#into-your-app">Navegação</a>. -</p> - -<h3 id="correctly_set_and_manage_notification_priority">Definição e gerenciamento -corretos da prioridade das -notificações</h3> - -<p>O Android tem suporte para um sinalizador de prioridade para notificações. Esse sinalizador permite -influenciar o local em que a notificação é exibida em relação a outras notificações e -ajuda a garantir -que os usuários sempre vejam primeiro as notificações mais importantes. Você pode escolher entre -os seguintes -níveis de prioridade ao publicar uma notificação:</p> -<table> - <tr> - <td class="tab0"> -<p><strong>Prioridade</strong></p> -</td> - <td class="tab0"> -<p><strong>Uso</strong></p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MAX</code></p> -</td> - <td class="tab1"> -<p>Use para notificações críticas e urgentes que alertam o usuário sobre uma condição -que depende -do tempo ou que precisa ser resolvida antes que o usuário possa continuar -com uma determinada tarefa.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>HIGH</code></p> -</td> - <td class="tab1"> -<p>Use principalmente para comunicações importantes, como uma mensagem ou -eventos de bate-papo com conteúdo particularmente interessante para o usuário. -Notificações de alta prioridade acionam a exibição de uma notificação heads-up.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>DEFAULT</code></p> -</td> - <td class="tab1"> -<p>Use para todas as notificações que não recaiam em nenhuma das outras prioridades descritas aqui.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>LOW</code></p> -</td> - <td class="tab1"> -<p>Use para notificações sobre as quais deseja que o usuário seja informado, mas -que sejam menos urgentes. Notificações de baixa prioridade tendem a ser exibidas na parte inferior da lista, -o que as torna uma boa -opção para coisas como atualizações públicas ou sociais não direcionadas: o usuário pediu para -ser notificado sobre -elas, mas essas notificações nunca devem ter precedência sobre comunicações -urgentes ou diretas.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MIN</code></p> -</td> - <td class="tab1"> -<p>Use para informações contextuais ou de histórico, como informações sobre clima ou -informações contextuais de localização. -Notificações de prioridade mínima não aparecem na barra de status. O usuário -as descobre expandindo a sombra da notificação.</p> -</td> - </tr> -</table> - - -<h4 id="how_to_choose_an_appropriate_priority"><strong>Como escolher uma prioridade -adequada -</strong></h4> - -<p><code>DEFAULT</code>, <code>HIGH</code> e <code>MAX</code> são níveis de prioridade de interrupção e arriscam -interromper a atividade -do usuário. Para evitar irritar os usuários de seu aplicativo, reserve níveis de prioridade de interrupção para -notificações que:</p> - -<ul> - <li> Envolvam outra pessoa</li> - <li> Dependam do tempo</li> - <li> Possam mudar imediatamente o comportamento do usuário no mundo real</li> -</ul> - -<p>Notificações definidas como <code>LOW</code> e <code>MIN</code> ainda podem -ser valiosas para o usuário: muitas, se não a maioria, das notificações não precisam demandar a atenção -imediata do usuário, ou vibrar o pulso do usuário, mas ainda contêm informações que o usuário -achará valiosas ao decidir procurar -notificações. Os critérios para notificações de prioridade <code>LOW</code> e <code>MIN</code> -incluem:</p> - -<ul> - <li> Não envolver outras pessoas</li> - <li> Não depender de tempo</li> - <li> Ter conteúdo no qual o usuário pode estar interessado, mas que pode decidir -verificar no momento em que desejar</li> -</ul> - - - <img src="{@docRoot}images/android-5.0/notifications/notifications_pattern_priority.png" alt="" width="700" /> - - -<h3 style="clear:both" id="set_a_notification_category">Definição de uma categoria -de notificação</h3> - -<p>Se a sua notificação recair em uma das categorias predefinidas (veja -abaixo), atribua-a -adequadamente. Aspectos da IU do sistema, como a sombra da notificação (ou qualquer -outra escuta -de notificação), podem usar essas informações para tomar decisões de classificação e filtragem.</p> -<table> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_CALL">CATEGORY_CALL</a></code></p> -</td> - <td> -<p>Chamada recebida (voz ou vídeo) ou solicitação similar de -comunicação síncrona</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_MESSAGE">CATEGORY_MESSAGE</a></code></p> -</td> - <td> -<p>Mensagem direta recebida (SMS, mensagem instantânea etc.)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EMAIL">CATEGORY_EMAIL</a></code></p> -</td> - <td> -<p>Mensagens assíncronas em lote (e-mail)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EVENT">CATEGORY_EVENT</a></code></p> -</td> - <td> -<p>Evento de calendário</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROMO">CATEGORY_PROMO</a></code></p> -</td> - <td> -<p>Promoção ou publicidade</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ALARM">CATEGORY_ALARM</a></code></p> -</td> - <td> -<p>Alarme ou cronômetro</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROGRESS">CATEGORY_PROGRESS</a></code></p> -</td> - <td> -<p>Andamento de uma operação de execução longa em segundo plano</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SOCIAL">CATEGORY_SOCIAL</a></code></p> -</td> - <td> -<p>Atualização de rede social ou de compartilhamento</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ERROR">CATEGORY_ERROR</a></code></p> -</td> - <td> -<p>Erro em operação de segundo plano ou no status de autenticação</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_TRANSPORT">CATEGORY_TRANSPORT</a></code></p> -</td> - <td> -<p>Controle de transporte de mídia para reprodução</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SYSTEM">CATEGORY_SYSTEM</a></code></p> -</td> - <td> -<p>Atualização do sistema ou do status do dispositivo. Reservado para uso do sistema.</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SERVICE">CATEGORY_SERVICE</a></code></p> -</td> - <td> -<p>Indicação de serviço de segundo plano em execução</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_RECOMMENDATION">CATEGORY_RECOMMENDATION</a></code></p> -</td> - <td> -<p>Uma recomendação específica e oportuna para uma única coisa. Por exemplo, um aplicativo -de notícias pode querer -recomendar uma notícia que acredita que o usuário desejará ler em seguida.</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_STATUS">CATEGORY_STATUS</a></code></p> -</td> - <td> -<p>Informações contínuas sobre o dispositivo ou o status contextual</p> -</td> - </tr> -</table> - -<h3 id="summarize_your_notifications">Resuma as notificações</h3> - -<p>Se uma notificação de um certo tipo já estiver pendente quando o aplicativo tentar enviar uma nova -notificação do mesmo tipo, combine-as em uma única notificação de resumo para o aplicativo. Não -crie um novo objeto.</p> - -<p>Uma notificação de resumo cria uma descrição resumida e permite que o -usuário entenda quantas notificações -de um determinado tipo estão pendentes.</p> - -<div class="col-6"> - -<p><strong>O que não fazer</strong></p> - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Dont.png" alt="" width="311px" /> -</div> - -<div> -<p><strong>O que fazer</strong></p> - - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Do.png" alt="" width="311px" /> -</div> - -<p style="clear:left; padding-top:30px; padding-bottom:20px">Você pode fornecer -mais detalhes sobre as notificações individuais que compõem um -resumo usando o layout resumido expandido. Essa abordagem permite que os usuários -entendam melhor quais -notificações estão pendentes e decidam se estão interessados o suficiente para lê-las -em detalhes dentro -do aplicativo associado.</p> -<div class="col-6"> - <img src="{@docRoot}images/android-5.0/notifications/Stack.png" style="margin-bottom:20px" alt="" width="311px" /> - <p class="img-caption"> - Notificação expandida e contraída que é um resumo (usando <code>InboxStyle</code>) - </p> -</div> - -<h3 style="clear:both" id="make_notifications_optional">Torne as notificações -opcionais</h3> - -<p>Os usuários devem sempre controlar as notificações. Permita que o usuário -desative as notificações -de seu aplicativo ou altere as propriedades de alerta, como som de alerta e -se a vibração será usada, -adicionando um item de configuração da notificação nas configurações do aplicativo.</p> - -<h3 id="use_distinct_icons">Use ícones distintos</h3> -<p>Ao olhar para a área de notificação, o usuário deverá ser capaz de discernir -que tipos de -notificações estão atualmente pendentes.</p> - -<div class="figure"> - <img src="{@docRoot}images/android-5.0/notifications/ProductIcons.png" alt="" width="420" /> -</div> - - <div><p><strong>O que fazer</strong></p> - <p>Verifique os ícones de notificação que os aplicativos do Android já fornecem e crie -ícones de notificação para o seu -aplicativo que tenham aparência suficientemente distinta.</p> - - <p><strong>O que fazer</strong></p> - <p>Use o <a href="/design/style/iconography.html#notification">estilo de ícone de notificação</a> apropriado - para ícones pequenos e o - <a href="/design/style/iconography.html#action-bar">estilo de ícone de barra -de ação</a> da luminosidade do Material para os ícones - de ação.</p> -<p ><strong>O que fazer</strong></p> -<p >Mantenha os ícones visualmente simples, evitando detalhes excessivos que sejam -difíceis de discernir.</p> - - <div><p><strong>O que não fazer</strong></p> - <p>Coloque um alfa adicional (esmaecimento ou redução de intensidade) nos ícones pequenos -e nos ícones de - ação; eles podem ter bordas suavizadas, mas, como o Android usa esses -ícones como máscaras (ou seja, somente - o canal alfa é usado), a imagem normalmente deve ser desenhada com -opacidade total.</p> - -</div> -<p style="clear:both"><strong>O que não fazer</strong></p> - -<p>Use cores para distinguir o seu aplicativo dos outros. Ícones de notificação devem -somente ser uma imagem com fundo branco sobre transparente.</p> - - -<h3 id="pulse_the_notification_led_appropriately">Pisque o LED de notificação -adequadamente</h3> - -<p>Muitos dispositivos Android contêm um LED de notificação, que é usado para manter o -usuário informado sobre -eventos enquanto a tela está desligada. Notificações com um nível de prioridade de <code>MAX</code>, -<code>HIGH</code> ou <code>DEFAULT</code> devem -fazer com que o LED brilhe, enquanto que os de prioridade mais baixa (<code>LOW</code> e -<code>MIN</code>) não devem.</p> - -<p>O controle do usuário sobre as notificações deve se estender ao LED. Ao usar -DEFAULT_LIGHTS, o -LED brilhará na cor branca. Suas notificações não devem usar uma cor -diferente, a não ser que o -usuário as tenha explicitamente personalizado.</p> - -<h2 id="building_notifications_that_users_care_about">Criação de notificações -que agradam aos usuários</h2> - -<p>Para criar um aplicativo que os usuários amem, é importante projetar as -notificações cuidadosamente. -As notificações personificam a voz do seu aplicativo e contribuem para -a personalidade dele. Notificações indesejadas ou -irrelevantes podem irritar o usuário ou fazer com que ele reprove a -quantidade de atenção que o -aplicativo exige. Portanto, use notificações de forma cuidadosa.</p> - -<h3 id="when_to_display_a_notification">Quando exibir uma notificação</h3> - -<p>Para criar um aplicativo que as pessoas gostem de usar, é importante -reconhecer que a atenção e o foco -do usuário são recursos que devem ser protegidos. Apesar de o sistema de -notificação do Android ter -sido projetado para minimizar o impacto das notificações na atenção do usuário, -ainda é -importante ter ciência do fato de que as notificações interrompem o -fluxo de tarefas do usuário. -Ao planejar as notificações, pergunte-se se elas são importantes o suficiente para -justificar uma interrupção. Se não tiver certeza, permita que o usuário decida se quer -uma notificação usando as configurações de notificação do seu aplicativo ou ajuste -o sinalizador de prioridade das notificações para <code>LOW</code> ou <code>MIN</code> para -evitar distrair o usuário enquanto ele faz -alguma outra coisa.</p> - - <img src="{@docRoot}images/android-5.0/notifications/TimeSensitive.png" alt="" width="311px" /> - <p style="margin-top:10px" class="img-caption"> - Exemplos de notificação que depende de tempo - </p> - -<p>Apesar de aplicativos bem comportados geralmente se manifestarem apenas quando ocorre interação com eles, alguns -casos justificam que o aplicativo interrompa o usuário com uma notificação não solicitada.</p> - -<p>Use notificações principalmente para <strong>eventos que dependam de tempo</strong>, especialmente - se esses eventos síncronos <strong>envolverem outras pessoas</strong>. Por -exemplo, um bate-papo recebido -é uma forma síncrona em tempo real de comunicação: outro usuário -espera ativamente a resposta. Eventos de calendário são outro exemplo bom de quando usar uma -notificação e atrair a -atenção do usuário, pois o evento é iminente e eventos de calendário frequentemente -envolvem outras pessoas.</p> - -<h3 style="clear:both" id="when_not_to_display_a_notification">Quando não exibir -uma notificação</h3> - -<div class="figure" style="margin-top:60px"> - <img src="{@docRoot}images/android-5.0/notifications/AntiSample1.png" alt="" width="311px" /> -</div> - -<p>Em muitos outros casos, notificações não são adequadas:</p> - -<ul> - <li> Evite notificar o usuário sobre informações que não são especificamente -direcionadas a ele ou -que não dependam realmente de tempo. Por exemplo, as atualizações -assíncronas e não direcionadas -que fluem por uma rede social geralmente não justificam uma interrupção -em tempo real. Para os usuários que se importam -com elas, deixe que decidam recebê-las.</li> - <li> Não crie uma notificação se as informações novas relevantes estiverem -atualmente na tela. Em vez disso, -use a IU do próprio aplicativo para notificar o usuário das novas informações -diretamente no contexto. - Por exemplo, um aplicativo de bate-papo não deve criar notificações de sistema enquanto o -usuário estiver conversando ativamente com outro usuário.</li> - <li> Não interrompa o usuário para realizar operações técnicas de baixo nível, como salvar -ou sincronizar informações, nem atualize um aplicativo se o aplicativo ou o sistema puder resolver -o problema sem envolver o usuário.</li> - <li> Não interrompa o usuário para informar um erro se o aplicativo -puder se recuperar dele por conta própria, sem que o usuário -tome qualquer ação.</li> - <li> Não crie notificações que não tenham conteúdo real de notificação e -que meramente anunciem o seu -aplicativo. Uma notificação deve fornecer informações úteis, oportunas e novas e -não deve ser usada -meramente para executar um aplicativo.</li> - <li> Não crie notificações supérfluas apenas para colocar sua marca na frente -dos usuários. - Tais notificações frustram e provavelmente alienam seu público-alvo. A -melhor forma de fornecer - pequenas quantidades de informações atualizadas e manter o usuário envolvido -com o seu - aplicativo é desenvolver um widget que ele possa colocar na -tela inicial.</li> -</ul> - -<h2 style="clear:left" id="interacting_with_notifications">Interação com -notificações</h2> - -<p>Notificações são indicadas por ícones na barra de status e podem ser acessadas -abrindo a -gaveta de notificações.</p> - -<p>Tocar em uma notificação abre o aplicativo associado com o conteúdo -detalhado que corresponde à notificação. -Deslizar à esquerda ou à direita em uma notificação a remove da gaveta.</p> - -<h3 id="ongoing_notifications">Notificações contínuas</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/MusicPlayback.png" alt="" width="311px" /> - <p class="img-caption"> - Notificação contínua devido à reprodução de música - </p> -</div> -<p>Notificações contínuas mantêm os usuários informados sobre um processo em andamento em -segundo plano. -Por exemplo, reprodutores de música anunciam a faixa em reprodução no -sistema de notificação e -continuam a fazer isso até que o usuário interrompa a reprodução. Notificações contínuas também podem -mostrar ao usuário -feedback sobre tarefas mais longas, como o download de um arquivo ou a codificação de um vídeo. Um usuário não pode remover -manualmente uma notificação contínua da gaveta de notificações.</p> - -<h3 id="ongoing_notifications">Reprodução de mídia</h3> -<p>No Android 5.0, a tela de bloqueio não mostra controles de transporte por causa da classe -{@link android.media.RemoteControlClient} obsoleta. Mas ela <em>mostra</em> notificações, portanto, a notificação de reprodução -de cada aplicativo agora é a forma -principal para que os usuários controlem a reprodução em um estado bloqueado. Esse comportamento dá aos aplicativos mais -controle sobre quais -botões exibir e de que forma, ao mesmo tempo em que fornece uma experiência consistente -para o usuário, com a tela bloqueada ou não.</p> - -<h3 style="clear:both" -id="dialogs_and_toasts_are_for_feedback_not_notification">Diálogos -e avisos</h3> - -<p>O seu aplicativo não deve criar uma caixa de diálogo ou um aviso se não estiver -atualmente na tela. Uma caixa de diálogo ou um aviso - deve ser exibido somente como uma resposta imediata ao usuário tomando uma ação -dentro do seu aplicativo. -Para obter orientação adicional sobre o uso de caixas de diálogo e avisos, consulte -<a href="/design/patterns/confirming-acknowledging.html">Confirmação e reconhecimento</a>.</p> - -<h3>Avaliação e classificação</h3> - -<p>Notificações são notícias e, portanto, são essencialmente exibidas -em ordem cronológica inversa, com -consideração especial para a -<a href="#correctly_set_and_manage_notification_priority">prioridade</a> da notificação declarada no aplicativo.</p> - -<p>Notificações são uma parte importante da tela de bloqueio e são exibidas proeminentemente -sempre -que a tela do dispositivo é exibida. O espaço na tela de bloqueio é restrito, portanto, -é mais importante -do que nunca identificar as notificações mais urgentes ou relevantes. Por esse -motivo, o Android tem um -algoritmo de classificação mais sofisticado para notificações, levando em conta:</p> - -<ul> - <li> A marcação de data e hora e a prioridade declarada no aplicativo.</li> - <li> Se a notificação incomodou recentemente o usuário com som ou -vibração (ou seja, - se o celular acabou de fazer um ruído e o usuário deseja saber "O que acabou de -acontecer?", a tela de bloqueio - deve responder com um olhar rápido).</li> - <li> Qualquer pessoa anexada à notificação usando {@link android.app.Notification#EXTRA_PEOPLE} - e, em particular, se é contato especial (com estrelas).</li> -</ul> - -<p>Para aproveitar ao máximo essa classificação, concentre-se na experiência -do usuário que deseja -criar, e não em um determinado local na lista.</p> - - <img src="{@docRoot}images/android-5.0/notifications/AntiSample3.png" alt="" width="700px" /> - - <p class="img-caption" style="margin-top:10px">Notificações do Gmail têm -prioridade padrão e normalmente - são classificadas abaixo de mensagens de um aplicativo de mensagem instantânea, como o Hangouts, mas -recebem - uma promoção temporária quando novas mensagens chegam. - </p> - - -<h3>Na tela de bloqueio</h3> - -<p>Como as notificações são visíveis na tela de bloqueio, a privacidade do usuário é uma consideração -especialmente - importante. Notificações frequentemente contêm informações sensíveis e -não devem necessariamente estar visíveis -para qualquer pessoa que ligar a tela do dispositivo.</p> - -<ul> - <li> Para dispositivos que têm uma tela de bloqueio segura (PIN, padrão ou senha), a interface tem -partes públicas e privadas. A interface pública pode ser exibida em uma tela de bloqueio segura e, -portanto, vista por qualquer pessoa. A interface privada é o mundo atrás da tela de bloqueio e -só é revelada depois que o usuário faz login no dispositivo.</li> -</ul> - -<h3>Controle do usuário sobre as informações exibidas na tela de bloqueio segura</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/LockScreen@2x.png" srcset="{@docRoot}images/android-5.0/notifications/LockScreen.png 1x" alt="" width="311px" /> - <p class="img-caption"> - Notificações na tela de bloqueio com conteúdo revelado depois que o usuário desbloqueia o dispositivo. - </p> -</div> - -<p>Ao definir uma tela de bloqueio segura, o usuário poderá escolher ocultar -detalhes sensíveis da tela de bloqueio segura. Nesse caso, a IU do sistema -considerará o <em>nível de visibilidade</em> da notificação para descobrir o que pode -ser exibido com segurança.</p> -<p> Para controlar o nível de visibilidade, chame -<code><a -href="/reference/android/app/Notification.Builder.html#setVisibility(int)">Notification.Builder.setVisibility()</a></code> -e especifique um destes valores:</p> - -<ul> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PUBLIC">VISIBILITY_PUBLIC</a></code>. -Exibe o conteúdo inteiro da notificação. - Esse é o padrão do sistema se a visibilidade não for especificada.</li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PRIVATE">VISIBILITY_PRIVATE</a></code>. -Na tela de bloqueio, exibe informações básicas sobre essa notificação, incluindo o -ícone e o nome do aplicativo que a publicou. O restante dos detalhes da notificação não é exibido. -Alguns pontos a ter em mente são: - <ul> - <li> Se você quer fornecer uma versão pública diferente da sua notificação -para que o sistema a exiba em uma tela de bloqueio segura, forneça um objeto -Notificação substituto no campo <code><a -href="/reference/android/app/Notification.html#publicVersion">Notification.publicVersion</a></code>. - - <li> Essa configuração dá ao aplicativo uma oportunidade de criar uma versão alternativa do -conteúdo que ainda é útil, mas não revela informações pessoais. Considere o exemplo de um -aplicativo de SMS cujas notificações incluem o texto da mensagem SMS, o nome do remetente e o ícone do contato. -Essa notificação deve ser <code>VISIBILITY_PRIVATE</code>, mas <code>publicVersion</code> ainda pode -conter informações úteis, como "3 novas mensagens", sem outros detalhes -de identificação. - </ul> - </li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_SECRET">Notification.VISIBILITY_SECRET</a></code>. Mostra apenas as informações mínimas, excluindo até mesmo -o ícone da notificação.</li> -</ul> -<h2 style="clear:both" id="notifications_on_android_wear">Notificações no -Android Wear</h2> - -<p>Notificações e suas <em>ações</em> são enviadas a dispositivos Wear por padrão. -Os desenvolvedores podem controlar que notificações são enviadas do -celular ao relógio -e vice-versa. Os desenvolvedores também podem controlar quais ações são transmitidas. Se o -seu aplicativo inclui -ações que não podem ser executadas com um toque, oculte essas ações -na sua notificação do Wear -ou considere colocá-las em um aplicativo do Wear, permitindo que o usuário -termine a ação -no relógio.</p> - -<h4>Transmissão de notificações e ações</h4> - -<p>Um dispositivo conectado, como um celular, pode transmitir notificações para um dispositivo Wear para que as -notificações sejam exibidas nele. De forma similar, ele pode transmitir ações para que o usuário possa agir -sobre as notificações diretamente do dispositivo Wear.</p> - -<p><strong>Transmitir</strong></p> - -<ul> - <li> Novas mensagens instantâneas</li> - <li> Ações de um toque, como +1, Curtir, Coração</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/WearBasic.png" width="156px" height="156px" alt="" /> - -<p><strong>Não transmitir</strong></p> - -<ul> - <li> Notificações de podcasts recém-chegados</li> - <li> Ações que mapeiem para recursos que não são possíveis no relógio</li> -</ul> - - - -<p><h4>Ações exclusivas a definir para Wear</h4></p> - -<p>Há algumas ações que só podem ser realizadas em Wear. Elas incluem:</p> - -<ul> - <li> Listas rápidas de respostas prontas, como "Volto logo"</li> - <li> Abrir no celular</li> - <li> Uma ação "Comentar" ou "Responder" que abre a tela de entrada de voz</li> - <li> Ações que executam aplicativos específicos de Wear</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/ReplyAction.png" width="156px" height="156px" alt="" /> 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 8f588411a612..d95f4cded3c1 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 a4c51abe3398..215afd14b931 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 @@ page.tags=androidn @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/preview/features/security-config.jd b/docs/html-intl/intl/pt-br/training/articles/security-config.jd index 27d8f2ece65f..2ba9b606d012 100644 --- a/docs/html-intl/intl/pt-br/preview/features/security-config.jd +++ b/docs/html-intl/intl/pt-br/training/articles/security-config.jd @@ -4,8 +4,8 @@ page.image=images/cards/card-nyc_2x.jpg @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/playback/picture-in-picture.jd b/docs/html-intl/intl/pt-br/training/tv/playback/picture-in-picture.jd index 14f52091c86b..baa7d61b1390 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 @@ page.tags=androidn @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 890e1403793b..c6d7bb7f4fe5 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 @@ page.image=images/cards/card-nyc_2x.jpg @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/design/patterns/notifications.jd b/docs/html-intl/intl/ru/design/patterns/notifications.jd deleted file mode 100644 index 4d339c29258d..000000000000 --- a/docs/html-intl/intl/ru/design/patterns/notifications.jd +++ /dev/null @@ -1,872 +0,0 @@ -page.title=Уведомления -page.tags="notifications","design","L" -@jd:body - - <a class="notice-developers" href="{@docRoot}training/notify-user/index.html"> - <div> - <h3>Документация для разработчиков</h3> - <p>Уведомление пользователя</p> - </div> -</a> - -<a class="notice-designers" href="notifications_k.html"> - <div> - <h3>Уведомления в Android версии 4.4 и ниже</h3> - </div> -</a> - -<!-- video box --> -<a class="notice-developers-video" href="https://www.youtube.com/watch?v=Uiq2kZ2JHVY"> -<div> - <h3>Видеоролик</h3> - <p>DevBytes: Уведомления в Android L Developer Preview</p> -</div> -</a> - -<style> - .col-5, .col-6, .col-7 { - margin-left:0px; - } -</style> - -<p>Уведомления позволяют извещать пользователя о релевантных и -периодически возникающих -событиях в приложении, таких как новые сообщения в чате или события в календаре. -Систему уведомлений можно рассматривать как канал новостей, извещающий пользователя о важных -событиях по мере -их возникновения, или как журнал, ведущий хронику событий, пока пользователь не обращает на них -внимания, и синхронизируемый должным образом на всех устройствах Android этого пользователя.</p> - -<h4 id="New"><strong>Новые возможности Android 5.0</strong></h4> - -<p>В Android 5.0 уведомления были существенно обновлены структурно, -визуально, и функционально:</p> - -<ul> - <li>был изменен внешний вид уведомлений в соответствии с новой -темой Material Design;</li> - <li> теперь уведомления доступны на экране блокировки, в то время как -конфиденциальная информация по-прежнему - может быть скрыта;</li> - <li>уведомления с высоким приоритетом, полученные при включенном устройстве, теперь имеют новый формат и называются - уведомлениями Heads-up;</li> - <li>уведомления синхронизируются с облаком: если удалить уведомление на одном из устройств -Android, оно будет удалено - и на остальных устройствах.</li> -</ul> - -<p class="note"><strong>Примечание.</strong> Разработка уведомлений в этой версии -Android значительно -отличается от их разработки в предыдущих версиях. Информацию о разработке уведомлений в предыдущих -версиях можно найти в разделе <a href="./notifications_k.html">Уведомления в Android версии 4.4 и ниже</a>.</p> - -<h2 id="Anatomy">Структура уведомления</h2> - -<p>В этом разделе описываются основные компоненты уведомления и их -отображение на устройствах различных типов.</p> - -<h3 id="BaseLayout">Базовая компоновка</h3> - -<p>Все уведомления имеют, как минимум, базовую компоновку, которую составляют следующие элементы.</p> - -<ul> - <li> <strong>Значок</strong> уведомления. Значок символизирует -инициирующее приложение. Он также может - указывать на тип уведомления, если приложение генерирует уведомления нескольких -типов.</li> - <li> <strong>Заголовок</strong> уведомления и дополнительный -<strong>текст</strong>.</li> - <li> <strong>Временная метка</strong>.</li> -</ul> - -<p>Уведомления, созданные с помощью {@link android.app.Notification.Builder Notification.Builder} -для предыдущих версий платформы, выглядят и функционируют в Android -5.0 так же, как и прежде, за исключением незначительных стилистических отличий, вносимых -системой. Дополнительную информацию о внешнем виде и функциональности уведомлений в предыдущих версиях -Android можно найти в разделе -<a href="./notifications_k.html">Уведомления в Android версии 4.4 и ниже</a>.</p></p> - - - <img style="margin:20px 0 0 0" src="{@docRoot}images/android-5.0/notifications/basic_combo.png" alt="" width="700px" /> - - -<div style="clear:both;margin-top:20px"> - <p class="img-caption"> - Уведомление в базовой компоновке на мобильном устройстве (слева) и то же уведомление на носимом устройстве (справа) - с фотографией пользователя и значком уведомления - </p> - </div> - -<h3 id="ExpandedLayouts">Расширенная компоновка</h3> - - -<p>Разработчик может выбрать степень подробности уведомлений, генерируемых его -приложением. Уведомление может содержать первые -несколько строк сообщения или миниатюру изображения. В качестве дополнительной -информации можно предоставлять пользователю -контекст и, —в некоторых случаях, —давать ему возможность прочитать сообщение -целиком. Чтобы переключаться - между компактной и расширенной компоновкой, пользователь может применить жест сжатия/масштабирования или -провести пальцем по экрану. - Для уведомлений о единичных событиях Android предоставляет - разработчику приложения три шаблона расширенной компоновки -(текст, входящая почта и изображения). Ниже приведены скриншоты уведомлений о единичных -событиях на мобильных устройствах (слева) - и на носимых устройствах (справа).</p> - -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/expandedtext_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/stack_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/ExpandedImage.png" - alt="" width="311px" height;="450px" /> - -<h3 id="actions" style="clear:both; margin-top:40px">Действия</h3> - -<p>Android поддерживает дополнительные действия, отображаемые в нижней части -уведомления. -Благодаря этому пользователи могут выполнять операции, типичные для данного -уведомления, непосредственно из него, не открывая -само приложение. -Это ускоряет взаимодействие и, вместе с операцией "провести пальцем, чтобы удалить", позволяет пользователю сосредоточиться на -важных для него уведомлениях.</p> - - - <img src="{@docRoot}images/android-5.0/notifications/action_combo.png" alt="" width="700px" /> - - - -<p style="clear:both">При определении количества действий в уведомлении следует проявлять -благоразумие. Чем больше -действий предоставлено пользователю, тем выше когнитивная сложность приложения. Ограничьтесь -минимальным количеством -действий, предоставив пользователю наиболее важные и -значимые.</p> - -<p>В уведомлениях отдавайте предпочтение действиям</p> - -<ul> - <li> важным, выполняемым наиболее часто и типичным для отображаемого -содержимого; - <li> позволяющим пользователю быстрее решить задачу. -</ul> - -<p>Избегайте действий</p> - -<ul> - <li> неоднозначных; - <li> совпадающих с действиями, выполняемыми для данного уведомления по умолчанию (например, "Прочитать" или -"Открыть"). -</ul> - - - -<p>Следует предоставлять не более трех действий, указав для каждого -значок и название. - Добавление действий в базовую компоновку делает уведомление расширяемым, -даже если - оно не имеет расширенной компоновки. Поскольку действия отображаются только у -расширенных - уведомлений, необходимо, чтобы любое действие, -которое пользователь может выполнить из - уведомления, было доступно и в соответствующем -приложении.</p> - -<h2 style="clear:left">Уведомления heads-up</h2> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/hun-example.png" alt="" width="311px" /> - <p class="img-caption"> - Пример уведомления heads-up (входящий телефонный звонок, высокий приоритет), -появляющегося поверх - приложения с эффектом присутствия - </p> -</div> - -<p>Когда поступает уведомление с высоким приоритетом (см. изображение справа), оно в течение короткого времени -отображается -в расширенной компоновке, позволяя выполнить допустимые действия.</p> -<p> Затем уведомление принимает обычный -вид. Если для уведомления установлен высокий, максимальный или полноэкранный <a href="#correctly_set_and_manage_notification_priority">приоритет</a> -, оно становится уведомлением heads-up.</p> - -<p><b>Хорошими примерами событий для уведомлений heads-up являются</b></p> - -<ul> - <li> входящий телефонный звонок, во время использования устройства;</li> - <li> сигнал будильника во время использования устройства;</li> - <li> новое SMS-сообщение;</li> - <li> низкий уровень заряда аккумулятора.</li> -</ul> - -<h2 style="clear:both" id="guidelines">Основные рекомендации</h2> - - -<h3 id="MakeItPersonal">Персонализируете уведомление</h3> - -<p>Уведомление о событии, инициированном другим пользователем (например, сообщение или -обновление статуса), должно содержать изображение пользователя, добавленное с помощью -{@link android.app.Notification.Builder#setLargeIcon setLargeIcon()}. Кроме того, в метаданные уведомления необходимо включить информацию о -пользователе (см. {@link android.app.Notification#EXTRA_PEOPLE}).</p> - -<p>Главный значок уведомления будет по-прежнему отображаться, чтобы пользователь мог связать -его со значком -на строке состояния.</p> - - -<img src="{@docRoot}images/android-5.0/notifications/Triggered.png" alt="" width="311px" /> -<p style="margin-top:10px" class="img-caption"> - Уведомление, идентифицирующее пользователя-инициатора, и отображающее отправленное содержимое. -</p> - - -<h3 id="navigate_to_the_right_place">Выполняйте переход в нужное место</h3> - -<p>Когда пользователь касается тела уведомления (за пределами кнопок -с действиями), должен осуществляться переход в то место приложения, -где пользователь сможет просмотреть информацию, о которой извещает уведомление, и действовать в соответствии -с нею. В большинстве случаев там будет находиться подробное представление одного элемента данных, например, сообщения, -но возможно и -сокращенное представление, если накопилось несколько уведомлений. Если приложение переводит -пользователя на какой-либо уровень, отличный от верхнего, реализуйте навигацию в стеке переходов назад в приложении, чтобы -пользователь мог нажать системную кнопку "Назад" и вернуться на верхний уровень. Дополнительную информацию можно найти в разделе -<em>Навигация внутрь приложения с помощью виджетов и уведомлений главного экрана</em> в шаблоне проектирования -<a href="{@docRoot}design/patterns/navigation.html#into-your-app">Навигация</a>.</p> - -<h3 id="correctly_set_and_manage_notification_priority">Правильно выполняйте расстановку приоритетов уведомлений и -управление ими -</h3> - -<p>Android поддерживает флаг приоритета для уведомлений. Это флаг позволяет -влиять на позицию уведомления среди других уведомлений и -гарантировать, -что пользователь в первую очередь увидит самые важные уведомления. При отправке уведомления можно выбрать один -из -следующих уровней приоритета:</p> -<table> - <tr> - <td class="tab0"> -<p><strong>Приоритет</strong></p> -</td> - <td class="tab0"> -<p><strong>Использование</strong></p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MAX</code></p> -</td> - <td class="tab1"> -<p>Применяйте для наиболее важных и неотложных уведомлений, извещающих пользователя -о ситуации, -критичной по времени или такой, на которую необходимо отреагировать, чтобы продолжить -выполнение задачи.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>HIGH</code></p> -</td> - <td class="tab1"> -<p>Применяйте, в основном, для передачи важной информации, например, о сообщениях или событиях -в чате с содержимым, представляющим особый интерес для пользователя. -Уведомления с высоким приоритетом отображаются как уведомления heads-up.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>DEFAULT</code></p> -</td> - <td class="tab1"> -<p>Применяйте для всех уведомлений, не входящих ни в одну из описанных здесь категорий.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>LOW</code></p> -</td> - <td class="tab1"> -<p>Применяйте для уведомлений, которые должны быть переданы пользователю, но -не являются неотложными. Низкоприоритетные уведомления обычно появляются в конце списка, -что позволяет использовать их -для передачи информации, представляющей всеобщий интерес и не имеющей конкретной направленности. Например, если пользователь подписался -на новости, - эта информация не должна иметь преимущество перед неотложными или адресными -сообщениями.</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MIN</code></p> -</td> - <td class="tab1"> -<p>Применяйте для уведомлений, с контекстной или фоновой информацией, такой как прогноз погоды, или с информацией, -связанной с местоположением пользователя. -Уведомления с минимальным приоритетом не отображаются в строке состояния. Пользователь -обнаруживает их при раскрытии панели уведомления.</p> -</td> - </tr> -</table> - - -<h4 id="how_to_choose_an_appropriate_priority"><strong>Как выбрать -подходящий -приоритет</strong></h4> - -<p>При выдаче уведомлений с приоритетами <code>DEFAULT</code>, <code>HIGH</code> и <code>MAX</code> существует риск, что деятельность -пользователя будет прервана -в самом разгаре. Чтобы не раздражать пользователей вашего приложения, применяйте приоритеты этих уровней для -уведомлений,</p> - -<ul> - <li> имеющих отношение к другим пользователям;</li> - <li> быстро теряющих актуальность;</li> - <li> способных немедленно повлиять на поведение пользователя в реальном мире.</li> -</ul> - -<p>Уведомления с приоритетом <code>LOW</code> и <code>MIN</code> могут представлять определенную ценность -для пользователя. Значительное количество, если не большинство, уведомлений не требует немедленной -реакции пользователя, но, тем не менее, содержит информацию, которую пользователь сочтет -ценной, когда решит -просмотреть поступившие уведомления. Приоритеты уровней <code>LOW</code> и <code>MIN</code> - следует присваивать уведомлениям,</p> - -<ul> - <li> не имеющим прямого отношения к другим пользователям;</li> - <li> долго не теряющим актуальность;</li> - <li> содержащим информацию, способную заинтересовать пользователя, если он решит -просмотреть их в свободное время.</li> -</ul> - - - <img src="{@docRoot}images/android-5.0/notifications/notifications_pattern_priority.png" alt="" width="700" /> - - -<h3 style="clear:both" id="set_a_notification_category">Определите категорию -уведомления</h3> - -<p>Если уведомление попадает в одну из заранее определенных категорий (см. -ниже), укажите его -категорию. Процессы системного пользовательского интерфейса, например, панель уведомления (или любой -другой процесс-слушатель -уведомлений) могут воспользоваться этой информацией при классификации и фильтрации уведомлений.</p> -<table> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_CALL">CATEGORY_CALL</a></code></p> -</td> - <td> -<p>Входящий звонок (голосовой или по видеосвязи) или алогичный запрос синхронной -связи</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_MESSAGE">CATEGORY_MESSAGE</a></code></p> -</td> - <td> -<p>Входящее личное сообщение (SMS-сообщение, мгновенное сообщение и т. д.)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EMAIL">CATEGORY_EMAIL</a></code></p> -</td> - <td> -<p>Асинхронное массовое сообщение (по электронной почте)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EVENT">CATEGORY_EVENT</a></code></p> -</td> - <td> -<p>Событие в календаре</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROMO">CATEGORY_PROMO</a></code></p> -</td> - <td> -<p>Промоакция или реклама</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ALARM">CATEGORY_ALARM</a></code></p> -</td> - <td> -<p>Сигнал будильника или таймера</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROGRESS">CATEGORY_PROGRESS</a></code></p> -</td> - <td> -<p>Информация о ходе выполнения длительной фоновой операции</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SOCIAL">CATEGORY_SOCIAL</a></code></p> -</td> - <td> -<p>Новости, поступившие из социальной сети или касающиеся совместного использования ресурсов</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ERROR">CATEGORY_ERROR</a></code></p> -</td> - <td> -<p>Ошибка в фоновой операции или статусе аутентификации</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_TRANSPORT">CATEGORY_TRANSPORT</a></code></p> -</td> - <td> -<p>Управление передачей медиаданных для воспроизведения</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SYSTEM">CATEGORY_SYSTEM</a></code></p> -</td> - <td> -<p>Обновление статуса системы или устройства. Зарезервировано для использования системой.</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SERVICE">CATEGORY_SERVICE</a></code></p> -</td> - <td> -<p>Индикация работающей фоновой службы</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_RECOMMENDATION">CATEGORY_RECOMMENDATION</a></code></p> -</td> - <td> -<p>Конкретная и привязанная ко времени рекомендация относительно одного объекта. Например, приложение -новостей может -порекомендовать пользователю, какую новость читать следующей.</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_STATUS">CATEGORY_STATUS</a></code></p> -</td> - <td> -<p>Текущая информация о статусе устройства или контекста</p> -</td> - </tr> -</table> - -<h3 id="summarize_your_notifications">Суммируйте уведомления</h3> - -<p>Если при наличии ожидающего уведомления определенного типа приложение пытается отправить новое -уведомление того же типа, объедините их в одно сводное уведомление от этого приложения. Не -создавайте новый объект.</p> - -<p>Сводное уведомление формирует сводное описание и дает пользователю возможность -понять, сколько -имеется ожидающих уведомлений того или иного типа.</p> - -<div class="col-6"> - -<p><strong>Неправильно</strong></p> - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Dont.png" alt="" width="311px" /> -</div> - -<div> -<p><strong>Правильно</strong></p> - - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Do.png" alt="" width="311px" /> -</div> - -<p style="clear:left; padding-top:30px; padding-bottom:20px">Разработчик может сообщить -подробности об отдельных уведомлениях, образующих - сводное, используя расширенную компоновку для резюме. Такой подход позволит пользователям -лучше разобраться, какие -уведомления ожидают прочтения, и достаточно ли они интересны, чтобы ознакомиться с ними -более подробно в - соответствующем приложении.</p> -<div class="col-6"> - <img src="{@docRoot}images/android-5.0/notifications/Stack.png" style="margin-bottom:20px" alt="" width="311px" /> - <p class="img-caption"> - Расширенное и сжатое сводное уведомление (с использованием <code>InboxStyle</code>) - </p> -</div> - -<h3 style="clear:both" id="make_notifications_optional">Сделайте уведомления -необязательными</h3> - -<p>В распоряжении пользователей всегда должен быть метод управления уведомлениями. Предоставьте пользователю возможность -отключать уведомления, поступающие от вашего приложения, -или изменять способы оповещения, такие как звуковой сигнал и -вибрация. - С этой целью следует предусмотреть пункт настройки уведомлений в настройках приложения.</p> - -<h3 id="use_distinct_icons">Используйте отчетливые значки</h3> -<p>Беглого взгляда на область уведомлений должно быть достаточно, чтобы распознать -типы -ожидающих уведомлений.</p> - -<div class="figure"> - <img src="{@docRoot}images/android-5.0/notifications/ProductIcons.png" alt="" width="420" /> -</div> - - <div><p><strong>Правильно</strong></p> - <p>Рассмотрите уже существующие значки уведомлений от приложений Android и создайте -собственные, - достаточно уникальные.</p> - - <p><strong>Правильно</strong></p> - <p>Придерживайтесь подходящего <a href="/design/style/iconography.html#notification">стиля значков уведомления</a> - для мелких значков, и - <a href="/design/style/iconography.html#action-bar">стиля строки -действий</a> Material Light для значков - действий.</p> -<p ><strong>Правильно</strong></p> -<p >Стремитесь к визуальной простоте значков, избегайте излишних трудноразличимых -деталей.</p> - - <div><p><strong>Неправильно</strong></p> - <p>Применяйте к мелким значкам и значкам действий дополнительные альфа-эффекты -(постепенное появление/исчезание). - К их краям может быть применено сглаживание, но, поскольку в Android эти значки -служат масками (то есть, - используется только альфа-канал), изображение, как правило, должно отображаться полностью -непрозрачным.</p> - -</div> -<p style="clear:both"><strong>Неправильно</strong></p> - -<p>Чтобы ваше приложение отличалось от других, используйте цвет. Значки уведомлений должны -представлять собой изображение белого цвета на прозрачном фоне.</p> - - -<h3 id="pulse_the_notification_led_appropriately">Правильно используйте индикатор -уведомлений</h3> - -<p>На многих устройствах Android имеется светодиодный индикатор уведомлений, -информирующий пользователя о -событиях, когда экран выключен. Уведомления с приоритетом <code>MAX</code>, -<code>HIGH</code> или <code>DEFAULT</code> должны -вызывать свечение индикатора, а уведомления с низким приоритетом (<code>LOW</code> и -<code>MIN</code>) не должны.</p> - -<p>Возможности пользователя управлять уведомлениями должны распространяться на светодиодный индикатор. Когда разработчик использует -DEFAULT_LIGHTS, -индикатор светится белым цветом. Ваши уведомления не должны вызывать свечение другим -цветом, если -пользователь не указал этого явным образом.</p> - -<h2 id="building_notifications_that_users_care_about">Создание уведомлений, - важных для пользователя</h2> - -<p>Чтобы пользователям понравилось ваше приложение, необходимо тщательно -продумать его уведомления. -Уведомления — это голос приложения. Они определяют его -индивидуальность. Ненужные или -несущественные уведомления раздражают пользователя и заставляют его возмущаться тем, как много -внимания требует от него -приложение. Поэтому необходимо применять уведомления взвешенно.</p> - -<h3 id="when_to_display_a_notification">Ситуации, в которых следует показывать уведомления</h3> - -<p>Чтобы создать приложение, от работы с которым пользователи получат удовольствие, необходимо -осознать, что внимание пользователя - является ресурсом, требующим бережного обращения. Система уведомлений -Android была разработана -так, чтобы как можно меньше отвлекать пользователя. -Однако -вы должны отдавать себе отчет в том, что уведомления прерывают -деятельность пользователя. -Планируя уведомления, спрашивайте себя, достаточно ли они важны, чтобы -послужить основанием для такого прерывания. В случае сомнений предоставьте пользователю возможность запросить -в настройках приложения получение уведомления или измените -приоритет уведомления на <code>LOW</code> или <code>MIN</code>, чтобы -не отвлекать пользователя от -текущих занятий.</p> - - <img src="{@docRoot}images/android-5.0/notifications/TimeSensitive.png" alt="" width="311px" /> - <p style="margin-top:10px" class="img-caption"> - Примеры уведомлений, быстро теряющих актуальность - </p> - -<p>Хотя правильно работающие приложения ведут себя неназойливо, бывают ситуации, -заслуживающие того, чтобы приложение по своей инициативе прервало деятельность пользователя уведомлением.</p> - -<p>Отправляйте уведомления только в случае <strong>событий, требующих неотложной реакции</strong>, особенно - если эти синхронные события <strong>имеют прямое отношение к другим пользователям</strong>. Например, -чат - представляет собой форму синхронного общения в реальном времени, — другой пользователь -с нетерпением ожидает вашего ответа. События в календаре являются еще одним хорошим примером ситуации, в которой следует выдать -уведомление и завладеть - вниманием пользователя, потому что в приближающееся календарное событие часто -вовлечены другие люди.</p> - -<h3 style="clear:both" id="when_not_to_display_a_notification">Ситуации, -в которых не следует показывать уведомления</h3> - -<div class="figure" style="margin-top:60px"> - <img src="{@docRoot}images/android-5.0/notifications/AntiSample1.png" alt="" width="311px" /> -</div> - -<p>В большинстве остальных случаев уведомления неуместны.</p> - -<ul> - <li> Не следует извещать пользователя о событиях, не имеющих отношения -к нему конкретно, или - не теряющих актуальность со временем. Например, асинхронные -и безадресные новости, - циркулирующие в социальных сетях, как правило, не требуют немедленного -привлечения внимания. Пользователям, - действительно интересующимся таким новостями, предоставьте возможность запросить соответствующие уведомления.</li> - <li> Не генерируйте уведомление, если релевантная свежая информация уже находится -на экране. Вместо этого - воспользуйтесь интерфейсом самого приложения, чтобы донести до пользователя новую информацию -непосредственно в контексте. - Например, приложение-чат не должно генерировать системные уведомления, -пока пользователь активно общается с собеседником.</li> - <li> Не отвлекайте пользователя ради низкоуровневых технических действий, такие как сохранение -или синхронизация информации или обновление приложения, если приложение или система способны выполнить задачу -без вмешательства пользователя.</li> - <li> Не отвлекайте пользователя, чтобы проинформировать его об ошибке, если -приложение может восстановиться после нее самостоятельно, не требуя от пользователя -никаких действий.</li> - <li> Не создавайте уведомления, не имеющие осмысленного содержимого и -всего лишь рекламирующие ваше -приложение. Уведомление должно нести полезную, актуальную и новую информацию. Не следует -использовать его - исключительно для презентации приложения.</li> - <li> Не создавайте избыточные уведомления только для того, чтобы продемонстрировать свой бренд -пользователям. - Такие уведомления раздражают и отталкивают аудиторию. Лучший -способ сообщать - новую информацию небольшими порциями и поддерживать связь пользователей -с вашим - приложением заключается в том, чтобы разработать виджет, который они смогут поместить на - главный экран.</li> -</ul> - -<h2 style="clear:left" id="interacting_with_notifications">Взаимодействие с -уведомлениями</h2> - -<p>Уведомления обозначаются значками в строке состояния. Чтобы получить к ним доступ, -следует открыть -панель уведомлений.</p> - -<p>Если коснуться уведомления, откроется соответствующее приложение с подробным содержимым, -связанным с эти уведомлением. -Если провести пальцем по уведомлению влево или вправо, оно будет удалено из панели.</p> - -<h3 id="ongoing_notifications">Постоянные уведомления</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/MusicPlayback.png" alt="" width="311px" /> - <p class="img-caption"> - Постоянные уведомления при воспроизведении музыки - </p> -</div> -<p>Постоянные уведомления информируют пользователя о текущих фоновых -процессах. -Например, плееры сообщают через систему уведомлений информацию о дорожке, -воспроизводимой в данный момент, и -это продолжается, пока пользователь не остановит воспроизведение. Кроме того, постоянные уведомления могут -информировать пользователя -о ходе выполнения длительных задач, таких как загрузка файла или кодирование видеоданных. Пользователь не может вручную -удалить постоянное уведомление из панели уведомлений.</p> - -<h3 id="ongoing_notifications">Воспроизведение медиаданных</h3> -<p>В Android 5.0 на экране блокировки не отображаются элементы управления воспроизведением от устаревшего -класса {@link android.media.RemoteControlClient}. Однако на нем <em>отображаются</em> уведомления, так что теперь каждое -уведомление приложения о воспроизведении является для пользователей основным -способом управления воспроизведением в заблокированном состоянии. В результате у приложения появляется больше возможностей -управлять тем, какие -кнопки отображать, и каким образом. При этом с точки зрения пользователя система ведет себя непротиворечиво, -независимо от того, заблокирован ли экран.</p> - -<h3 style="clear:both" -id="dialogs_and_toasts_are_for_feedback_not_notification">Диалоговые окна -и всплывающие уведомления</h3> - -<p>Приложение, не отображаемое на экране, не должно генерировать диалоговое окно или всплывающее -уведомление. Диалоговое окно или всплывающее уведомление - должно появляться исключительно в качестве немедленной реакции на действия пользователя -в приложении. -Более подробные рекомендации по использованию диалоговых окон и всплывающих уведомлений см. в разделе -<a href="/design/patterns/confirming-acknowledging.html">Подтверждение и уведомление</a>.</p> - -<h3>Упорядочение уведомлений по степени важности</h3> - -<p>По своей сути уведомления — это новости, и поэтому они принципиально отображаются в -обратном хронологическом порядке. -При этом обязательно принимается во внимание -<a href="#correctly_set_and_manage_notification_priority">приоритет</a>, установленный приложением.</p> - -<p>Уведомления являются важной составляющей экрана блокировки и отображаются на видном месте -каждый -раз, когда включается дисплей устройства. На экране блокировки мало свободного места, поэтому -исключительно важно -выявлять неотложные или наиболее релевантные уведомления. По этой -причине Android применяет -сложный алгоритм сортировки уведомлений, в котором учитываются</p> - -<ul> - <li> временная метка и приоритет, установленный приложением;</li> - <li> тот факт, что уведомление только что оповестило пользователя звуковым сигналом -или вибрацией (иными словами, - если телефон издает звуки, и пользователь хочет узнать, в чем -дело, то на экране блокировки - должен находиться ответ, понятный с первого взгляда);</li> - <li> пользователи, связанные с уведомлением при помощи {@link android.app.Notification#EXTRA_PEOPLE}, - и, в частности, присутствие их в списке помеченных контактов.</li> -</ul> - -<p>Чтобы воспользоваться преимуществами этой сортировки наилучшим образом, думайте в первую очередь о создании -удобных условий для -пользователя, и не нацеливайтесь на конкретное место в рейтинге.</p> - - <img src="{@docRoot}images/android-5.0/notifications/AntiSample3.png" alt="" width="700px" /> - - <p class="img-caption" style="margin-top:10px">Уведомления от Gmail имеют -приоритет DEFAULT, поэтому они - обычно оказываются ниже уведомлений от приложений мгновенного обмена сообщениями, таких как Hangouts, но -поднимаются в списке - на некоторое время, когда поступают новые сообщения. - </p> - - -<h3>Уведомления на экране блокировки</h3> - -<p>Поскольку уведомления видны на экране блокировки, защита конфиденциальной информации пользователей приобретает -особо -важное значение. Уведомления нередко содержат частную информацию, и они -не должны быть доступны -каждому, кто взял в руки устройство и включил дисплей.</p> - -<ul> - <li> У устройств, экран блокировки которых защищен (при помощи PIN-кода, графического ключа или пароля), интерфейс имеет - общедоступную и закрытую части. Элементы общедоступного интерфейса отображаются на защищенном экране блокировки и - следовательно, видны всем. Закрытый интерфейс находится "позади" экрана блокировки и - доступен только пользователю, выполнившему вход в устройство.</li> -</ul> - -<h3>Возможности пользователя контролировать информацию, отображаемую на экране блокировки</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/LockScreen@2x.png" srcset="{@docRoot}images/android-5.0/notifications/LockScreen.png 1x" alt="" width="311px" /> - <p class="img-caption"> - Уведомления на экране блокировки с содержимым, отображаемым после того, как пользователь разблокирует устройство. - </p> -</div> - -<p>При настройке защиты экрана блокировки пользователь может предпочесть, - чтобы конфиденциальные данные не отображались на защищенном экране блокировки. В этом случае системный пользовательский интерфейс -учитывает <em>уровень видимости</em> уведомления, чтобы выяснить, какую информацию -можно отображать без риска.</p> -<p> Чтобы установить уровень видимости, вызовите -<code><a -href="/reference/android/app/Notification.Builder.html#setVisibility(int)">Notification.Builder.setVisibility()</a></code> -и укажите одно из следующих значений:</p> - -<ul> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PUBLIC">VISIBILITY_PUBLIC</a></code>. -Содержимое уведомления отображается полностью. - Это значение принимается системой по умолчанию, если уровень видимости не указан.</li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PRIVATE">VISIBILITY_PRIVATE</a></code>. -На экране блокировки отображается основная информация о наличии уведомления, включая его -значок и название приложения, отправившего его. Прочие данные уведомления скрыты. -Здесь уместно дать разработчику пару рекомендаций. - <ul> - <li> Если вы хотите реализовать отдельную общедоступную версию уведомления, -которую система будет отображать на экране блокировки, создайте замещающий -объект Notification в поле<code><a -href="/reference/android/app/Notification.html#publicVersion">Notification.publicVersion</a></code>. - - <li> Этот параметр предоставляет приложению возможность создавать "цензурированную" версию -содержимого, достаточно информативную, но скрывающую личную информацию. Рассмотрим в качестве примера приложение для отправки -SMS-сообщений. Его уведомления содержат текст SMS-сообщения и имя и контактный значок отправителя. -Такое уведомление должно иметь атрибут <code>VISIBILITY_PRIVATE</code>, но его версия <code>publicVersion</code> может -содержать полезную информацию, например, "3 новых сообщения", без уточняющих -подробностей. - </ul> - </li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_SECRET">Notification.VISIBILITY_SECRET</a></code>. Отображается минимум информации, -даже без значка уведомления.</li> -</ul> -<h2 style="clear:both" id="notifications_on_android_wear">Уведомления на -Android Wear</h2> - -<p>По умолчанию уведомления и их <em>действия</em> передаются на носимые устройства. -Разработчики могут управлять тем, какие уведомления следует передавать с -телефона на часы, -и наоборот. У разработчиков также есть возможность управлять передачей действий. Если -приложение включает в себя -действия, которые невозможно выполнить одним касанием, нужно либо скрывать их -в уведомлениях, отображаемых на носимом -устройстве, либо обеспечить их привязку к приложению под управлением Android Wear, позволив пользователю -совершать действие -на часах.</p> - -<h4>Передача уведомлений и действий на другое устройство</h4> - -<p>Подключенное устройство, например, телефон, может передавать уведомления на носимое устройство, -чтобы они отображались и на нем. Аналогичным образом можно передавать действия, чтобы пользователь мог реагировать -на уведомления непосредственно на носимом устройстве.</p> - -<p><strong>Передавайте</strong></p> - -<ul> - <li> новые мгновенные сообщения;</li> - <li> действия, выполняемые одним касанием, например, "+1", "Лайк", "Сердечко".</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/WearBasic.png" width="156px" height="156px" alt="" /> - -<p><strong>Не передавайте</strong></p> - -<ul> - <li> уведомления о новых подкастах;</li> - <li> действия, соответствующие функциям, недоступным на часах.</li> -</ul> - - - -<p><h4>Уникальные действия, определяемые для носимых устройств</h4></p> - -<p>Некоторые действия можно выполнить только на носимых устройствах, например:</p> - -<ul> - <li> выбор из списка шаблонных ответов, например, "Скоро вернусь"</li> - <li> действие "Открыть на телефоне";</li> - <li> действия "Прокомментировать" или "Ответить", открывающие окно речевого ввода;</li> - <li> действия, запускающие приложения, специфичные для Android Wear.</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/ReplyAction.png" width="156px" height="156px" alt="" /> 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 3392c1355f8f..98849feeebb3 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 f70c92c4e14d..3e67d358f8ee 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 @@ page.tags=androidn @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/preview/features/security-config.jd b/docs/html-intl/intl/ru/training/articles/security-config.jd index 5294a4f6bbbd..dee9b77bddd0 100644 --- a/docs/html-intl/intl/ru/preview/features/security-config.jd +++ b/docs/html-intl/intl/ru/training/articles/security-config.jd @@ -4,8 +4,8 @@ page.image=images/cards/card-nyc_2x.jpg @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/playback/picture-in-picture.jd b/docs/html-intl/intl/ru/training/tv/playback/picture-in-picture.jd index f0ffd482d86a..fc26368bb126 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 @@ page.tags=androidn @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 5e6ce45b99ec..19d6db37eb02 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 9b2a557c2b16..c93e2552e208 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 d3b71743dcae..a4d97796aaa3 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 @@ page.tags=androidn @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/preview/features/security-config.jd b/docs/html-intl/intl/vi/training/articles/security-config.jd index 797e198a15ab..1d8670df0851 100644 --- a/docs/html-intl/intl/vi/preview/features/security-config.jd +++ b/docs/html-intl/intl/vi/training/articles/security-config.jd @@ -4,8 +4,8 @@ page.image=images/cards/card-nyc_2x.jpg @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/playback/picture-in-picture.jd b/docs/html-intl/intl/vi/training/tv/playback/picture-in-picture.jd index 8146a1578682..9156152eb0d0 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 @@ page.tags=androidn @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 6dfb53ea3c9a..bfd718b28986 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 @@ page.image=images/cards/card-nyc_2x.jpg @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/design/patterns/notifications.jd b/docs/html-intl/intl/zh-cn/design/patterns/notifications.jd deleted file mode 100644 index 57e02e44942c..000000000000 --- a/docs/html-intl/intl/zh-cn/design/patterns/notifications.jd +++ /dev/null @@ -1,872 +0,0 @@ -page.title=通知 -page.tags="notifications","design","L" -@jd:body - - <a class="notice-developers" href="{@docRoot}training/notify-user/index.html"> - <div> - <h3>开发者文档</h3> - <p>通知用户</p> - </div> -</a> - -<a class="notice-designers" href="notifications_k.html"> - <div> - <h3>Android 4.4 及更低版本中的通知</h3> - </div> -</a> - -<!-- video box --> -<a class="notice-developers-video" href="https://www.youtube.com/watch?v=Uiq2kZ2JHVY"> -<div> - <h3>视频</h3> - <p>DevBytes:Android L 开发者预览当中的通知</p> -</div> -</a> - -<style> - .col-5, .col-6, .col-7 { - margin-left:0px; - } -</style> - -<p>通知系统可让用户随时了解应用中的相关和即时事件,例如来自好友的新聊天信息或日历事件。可将通知视作新闻频道,在重要的事件发生时提醒用户注意,或者当作日志,在用户未注意时记录事件—可在用户的所有 Android 设备上按需同步。 - - - - - -</p> - -<h4 id="New"><strong>Android 5.0 新增内容</strong></h4> - -<p>在 Android 5.0 中,通知在结构、外观和功能方面获得了重要的更新: -</p> - -<ul> - <li>通知在外观上发生了更改,与新的材料设计主题保持一致。 -</li> - <li> 通知现在可以在设备锁定屏幕上使用,而敏感信息仍然可以隐藏于背后。 - -</li> - <li>设备在使用时收到的高优先级通知现在采用名为浮动通知的新格式。 -</li> - <li>云同步通知:在一台 Android 设备上清除通知,则在其他设备上也会将其清除。 - -</li> -</ul> - -<p class="note"><strong>注:</strong>该版本 Android 的通知设计与之前的版本大不相同。 - -有关之前版本通知设计的信息,请参阅<a href="./notifications_k.html"> Android 4.4 及更低版本中的通知</a>。 -</p> - -<h2 id="Anatomy">通知详解</h2> - -<p>本部分介绍通知的基本组成部分,及其在不同类型设备上显示的方式。 -</p> - -<h3 id="BaseLayout">基本布局</h3> - -<p>所有通知至少要包括一个基本布局,包括:</p> - -<ul> - <li> 通知的<strong>图标</strong>。图标以符号形式表示来源应用。如果应用生成多个类型的通知,它也可用于指明通知类型。 - - -</li> - <li> 通知<strong>标题</strong>以及其他 -<strong>文本</strong>。</li> - <li> <strong>时间戳</strong>。</li> -</ul> - -<p>利用 {@link android.app.Notification.Builder Notification.Builder}为之前版本平台创建的通知,其外观和行为方式与在 Android -5.0 中完全相同,唯一的变动在于系统为您处理通知的方式存在细微的样式变动。 - -如需了解之前 Android 版本通知设计的详细信息,请参阅<a href="./notifications_k.html"> Android 4.4 及更低版本中的通知</a>。 - -</p></p> - - - <img style="margin:20px 0 0 0" src="{@docRoot}images/android-5.0/notifications/basic_combo.png" alt="" width="700px" /> - - -<div style="clear:both;margin-top:20px"> - <p class="img-caption"> - 手持设备通知(左)和穿戴设备(右)上同一通知的基本布局,带有用户照片和通知图标 - - </p> - </div> - -<h3 id="ExpandedLayouts">展开布局</h3> - - -<p>您可以选择让应用的通知提供多少信息详情。 -它们可显示消息的前几行,也可以显示更大的预览图像。 -额外的信息可以为用户提供更多上下文,并且,在某些情况下,可能允许用户完整阅读消息。 - - -用户可进行两指缩放或执行单指滑移,在紧凑和展开布局之间切换。 - - - 对于单一事件通知,Android 提供了三种展开布局模板(文本、收件箱和图像),供您在应用中使用。 - -下图展示单一事件通知在手持设备(左)和穿戴式设备(右)上的外观。 - -</p> - -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/expandedtext_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/stack_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/ExpandedImage.png" - alt="" width="311px" height;="450px" /> - -<h3 id="actions" style="clear:both; margin-top:40px">操作</h3> - -<p>Android 支持在通知底部显示可选的操作。通过操作,用户可在通知栏中处理最常见的任务,而无需打开来源应用。这样可加快交互的速度,而通过结合使用滑动清除通知的功能,有助于用户专注于对自身重要的通知。 - - - - - -</p> - - - <img src="{@docRoot}images/android-5.0/notifications/action_combo.png" alt="" width="700px" /> - - - -<p style="clear:both">请慎重考虑要在通知中包含多少操作。 -您加入的操作越多,用户就越无所适从。 -请通过只包含最重要且有意义的操作,尽量减少通知中的操作数量。 - - -</p> - -<p>适合在通知中使用的操作具有如下特点:</p> - -<ul> - <li> 对正在显示的内容类型必要、常用且常见 - - <li> 让用户可以迅速完成任务 -</ul> - -<p>避免以下类型的操作:</p> - -<ul> - <li> 含义模糊 - <li> 跟通知的默认操作一样(例如“阅读”或“打开”) - -</ul> - - - -<p>您最多可以指定三个操作,每个操作由操作图标和名称组成。 - - 通过为简单的基本布局添加操作,可以展开该通知,即使该通知没有展开布局,此方法仍然有效。 - -由于操作仅对展开的通知显示(否则会隐藏),因此要确保用户从通知调用的任何操作都可在相关联的应用中使用。 - - - - -</p> - -<h2 style="clear:left">浮动通知</h2> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/hun-example.png" alt="" width="311px" /> - <p class="img-caption"> - 出现在沉浸式应用顶部的浮动通知(手机来电,高优先级)示例 - - - </p> -</div> - -<p>收到高优先级通知时(见右侧),它会向用户短时间显示一个包含可选操作的展开布局。 - -</p> -<p> 之后,通知会缩回通知栏。 -如果通知的<a href="#correctly_set_and_manage_notification_priority">优先级</a>标志为高、最大或全屏,则会得到浮动通知。 -</p> - -<p><b>浮动通知的范例</b></p> - -<ul> - <li> 使用设备时来电</li> - <li> 使用设备时闹铃</li> - <li> 新的短信</li> - <li> 电池电量过低</li> -</ul> - -<h2 style="clear:both" id="guidelines">指导原则</h2> - - -<h3 id="MakeItPersonal">个人化</h3> - -<p>对于他人发送的项目通知(例如消息或状态更新),请使用 -{@link android.app.Notification.Builder#setLargeIcon setLargeIcon()} 包含此人的头像。 -另外将有关此人的信息附加到通知的元数据(参阅 {@link android.app.Notification#EXTRA_PEOPLE})。 -</p> - -<p>您通知的主图标仍然会显示,因此,该用户可将其与状态栏中显示的图标相关联。 - -</p> - - -<img src="{@docRoot}images/android-5.0/notifications/Triggered.png" alt="" width="311px" /> -<p style="margin-top:10px" class="img-caption"> - 显示触发通知的用户以及该用户所发送信息的通知。 -</p> - - -<h3 id="navigate_to_the_right_place">导航至正确位置</h3> - -<p>在用户触摸通知的正文时(在操作按钮的外面),打开应用并定位至正确的位置,以便用户可查看通知中引用的数据并据此操作。 - - -在大多数情况下,该位置是某个数据项目(例如消息)的详情视图,但如果是存档通知,那么也可能是摘要视图。 - -如果您的应用将用户带到应用顶层以下的任何位置,可将导航插入应用的返回栈,这样用户就可以通过按下系统返回按钮返回至顶层。 - -如需了解详细信息,请参阅<a href="{@docRoot}design/patterns/navigation.html#into-your-app">导航</a>设计模式中的“通过主屏幕小工具和通知进入您的应用”<em></em>。 - -</p> - -<h3 id="correctly_set_and_manage_notification_priority">正确设置和管理通知优先级。 - -</h3> - -<p>Android 支持通知的优先级标志。该标志可以影响您的通知相对于其他通知出现的位置,并且可以帮助确保用户始终能在第一时间看到对他们最重要的通知。 - - -在发布通知时,您可以选择下列优先级之一: - -</p> -<table> - <tr> - <td class="tab0"> -<p><strong>优先级</strong></p> -</td> - <td class="tab0"> -<p><strong>用法</strong></p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MAX</code></p> -</td> - <td class="tab1"> -<p>用于重要和紧急的通知,告知用户属于时间关键型状况,或者必须予以解决方可继续执行某个特定任务。 - - -</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>HIGH</code></p> -</td> - <td class="tab1"> -<p>主要用于重要通信,例如包含用户特别感兴趣的内容的消息或聊天事件。高优先级通知会触发浮动通知显示。 - -</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>DEFAULT</code></p> -</td> - <td class="tab1"> -<p>用于不属于此处所述其他任何优先级的所有通知。</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>LOW</code></p> -</td> - <td class="tab1"> -<p>用于您希望告知用户但不是很紧急的通知。 -低优先级通知最好显示在列表的底部,这里正适合放置公共事项或无收件人姓名的社交更新之类的通知: - -用户要求接收相关通知,但是这些通知的优先级永远不会高于紧急或直接通信。 - - -</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MIN</code></p> -</td> - <td class="tab1"> -<p>用于上下文或背景信息,例如天气信息或上下文位置信息。最低优先级通知不会出现在状态栏中。 - -用户可在展开的通知栏上找到它们。 -</p> -</td> - </tr> -</table> - - -<h4 id="how_to_choose_an_appropriate_priority"><strong>如何选择合适的优先级</strong> - -</h4> - -<p><code>DEFAULT</code>、<code>HIGH</code> 和 <code>MAX</code> 是中断优先级别,在活动过程中有中断用户的风险。 - -为了避免打扰应用的用户,中断优先级仅保留用于以下通知 -:</p> - -<ul> - <li> 涉及另一个用户</li> - <li> 时间敏感</li> - <li> 可能会立即改变用户在现实世界中的行为</li> -</ul> - -<p>设置为 <code>LOW</code> 和 <code>MIN</code> 的通知可能仍然对用户很重要: -很多通知(如果不是绝大多数)不需要用户立即注意,也不需要振动,但仍然包含用户选择查看通知时将会觉得重要的信息。 - - -<code>LOW</code> 和 <code>MIN</code>优先级通知的条件包括: -</p> - -<ul> - <li> 不涉及其他用户</li> - <li> 不属于时间敏感型</li> - <li> 包含用户可能感兴趣但可选择在空闲时浏览的内容 -</li> -</ul> - - - <img src="{@docRoot}images/android-5.0/notifications/notifications_pattern_priority.png" alt="" width="700" /> - - -<h3 style="clear:both" id="set_a_notification_category">设置通知类别 -</h3> - -<p>如果通知属于以下预定义类别(参阅下文)之一,则为其分配相应的类别。 - -诸如通知栏(或其他任何通知侦听器)这样的系统 UI 项目,可使用该信息来进行评级和筛选决策。 - -</p> -<table> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_CALL">CATEGORY_CALL</a></code></p> -</td> - <td> -<p>来电(语音或视频)或相似的同步通信请求 -</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_MESSAGE">CATEGORY_MESSAGE</a></code></p> -</td> - <td> -<p>传入的直接消息(短信、即时消息等)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EMAIL">CATEGORY_EMAIL</a></code></p> -</td> - <td> -<p>异步群发消息(电子邮件)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EVENT">CATEGORY_EVENT</a></code></p> -</td> - <td> -<p>日历事件</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROMO">CATEGORY_PROMO</a></code></p> -</td> - <td> -<p>促销或广告</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ALARM">CATEGORY_ALARM</a></code></p> -</td> - <td> -<p>闹铃或定时器</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROGRESS">CATEGORY_PROGRESS</a></code></p> -</td> - <td> -<p>长时间运行的后台操作的进度</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SOCIAL">CATEGORY_SOCIAL</a></code></p> -</td> - <td> -<p>社交网络或共享更新</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ERROR">CATEGORY_ERROR</a></code></p> -</td> - <td> -<p>后台操作或身份验证状态中的错误</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_TRANSPORT">CATEGORY_TRANSPORT</a></code></p> -</td> - <td> -<p>媒体传输播放控制</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SYSTEM">CATEGORY_SYSTEM</a></code></p> -</td> - <td> -<p>系统或设备状态更新。保留给系统使用。</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SERVICE">CATEGORY_SERVICE</a></code></p> -</td> - <td> -<p>正在运行的后台服务的指示</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_RECOMMENDATION">CATEGORY_RECOMMENDATION</a></code></p> -</td> - <td> -<p>对于某个事件的特定、及时建议。例如,新闻应用可能会建议用户接下来可能想要阅读的新话题。 - -</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_STATUS">CATEGORY_STATUS</a></code></p> -</td> - <td> -<p>有关设备或上下文状态的持续信息</p> -</td> - </tr> -</table> - -<h3 id="summarize_your_notifications">通知摘要</h3> - -<p>如果特定类型的通知已经在您的应用尝试发送同类型的新通知时挂起,可将它们合并到单个应用摘要通知中,而不要新建对象。 - -</p> - -<p>摘要通知会生成摘要说明,让用户了解特定类型的通知有多少处于挂起状态。 - -</p> - -<div class="col-6"> - -<p><strong>禁忌用法</strong></p> - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Dont.png" alt="" width="311px" /> -</div> - -<div> -<p><strong>建议用法</strong></p> - - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Do.png" alt="" width="311px" /> -</div> - -<p style="clear:left; padding-top:30px; padding-bottom:20px">您可通过使用展开的摘要布局提供有关组成摘要的各个通知的更多详情。 - -此方法可让用户更好地了解哪些通知处于挂起状态,如果他们有足够的兴趣,还可在相关联的应用中阅读详情。 - - - -</p> -<div class="col-6"> - <img src="{@docRoot}images/android-5.0/notifications/Stack.png" style="margin-bottom:20px" alt="" width="311px" /> - <p class="img-caption"> - 展开和收起的摘要通知(使用 <code>InboxStyle</code>) - </p> -</div> - -<h3 style="clear:both" id="make_notifications_optional">将通知设置为可选 -</h3> - -<p>用户应始终能控制通知。允许用户通过将某个通知设置项目添加至您的应用设置,禁用应用的通知或更改其提醒属性,例如警报声和是否使用振动。 - - - -</p> - -<h3 id="use_distinct_icons">使用不同的图标</h3> -<p>通过扫一眼通知区域,用户可以了解哪些类型的通知当前处于挂起状态。 - -</p> - -<div class="figure"> - <img src="{@docRoot}images/android-5.0/notifications/ProductIcons.png" alt="" width="420" /> -</div> - - <div><p><strong>建议用法</strong></p> - <p>查看 Android 应用已经提供的通知图标并为您的应用创建外观明显不同的通知图标。 - -</p> - - <p><strong>建议用法</strong></p> - <p>对小图标使用正确的<a href="/design/style/iconography.html#notification">通知图标样式</a>,对操作图标使用相应的材料灯<a href="/design/style/iconography.html#action-bar">操作栏图标</a>。 - - - -</p> -<p ><strong>建议用法</strong></p> -<p >图标外观要简洁清晰,避免使用过于精细、难以辨认的图标。 -</p> - - <div><p><strong>禁忌用法</strong></p> - <p>对小图标和操作图标设置任何附加的阿尔法通道属性(变暗或变淡);这些图标会有抗锯齿边缘,但是由于 Android 使用这些图标作为蒙板(即仅使用阿尔法通道),因此通常应以完全不透明的方式绘制图像。 - - - - -</p> - -</div> -<p style="clear:both"><strong>禁忌用法</strong></p> - -<p>利用色彩将您的应用与其他应用区分开来。通知图标应该是纯白透明背景图像。 -</p> - - -<h3 id="pulse_the_notification_led_appropriately">对通知 LED 施加相应的脉冲 -</h3> - -<p>许多 Android 设备都配有通知 LED,用于让用户在屏幕关闭时了解事件。 - -优先级为 <code>MAX</code>、 -<code>HIGH</code> 或 <code>DEFAULT</code> 的通知应让 LED 发光,而优先级较低的通知(<code>LOW</code> 和 <code>MIN</code>)则不应让 LED 发光。 - -</p> - -<p>用户对通知的控制应延伸至 LED。当您使用 DEFAULT_LIGHTS 时,LED 将发出白光。 - -您的通知不应使用不同的颜色,除非用户明确对其进行了自定义。 - -</p> - -<h2 id="building_notifications_that_users_care_about">构建用户关注的通知 -</h2> - -<p>要创建用户喜爱的应用,精心设计通知很重要。通知是应用的代言人,还可增强应用的个性化特征。 - - -无用或者不重要的通知会给用户带来烦恼,或者由于过分分散用户的注意力而使其感到愤怒,因此请谨慎使用通知。 - - -</p> - -<h3 id="when_to_display_a_notification">何时显示通知</h3> - -<p>要创建人们乐于使用的应用,就需要认识到用户的注意力和关注点是一种必须予以保护的资源,这一点很重要。 - -尽管 Android 的通知系统在设计上希望最小化通知对用户注意力的影响,但是仍然要重视通知会中断用户任务流程这一事实。在您计划通知时,要问问自己,它们是否足够重要,是否适合让用户中断手上的任务。 - - - - - - -如果您不确定,可允许用户使用应用的通知设置来选择是否接收通知,或者将通知优先级标志调整为 <code>LOW</code> 或 <code>MIN</code>,从而避免在用户做其他事情时分散他们的注意力。 - - - -</p> - - <img src="{@docRoot}images/android-5.0/notifications/TimeSensitive.png" alt="" width="311px" /> - <p style="margin-top:10px" class="img-caption"> - 时间敏感通知的示例 - </p> - -<p>尽管行为良好的应用通常只在用户对其操作后才会发出通知,但在极少数情况下,应用通过无提示的通知形式打断用户也是值得的。 -</p> - -<p>将通知主要用于<strong>时间敏感的事件</strong>,尤其是这些同步事件<strong>涉及其他用户时</strong>。 -例如,传入的聊天属于实时同步通信形式: - -另一个用户在主动等待您的回应。 -日历事件是使用通知并引起用户注意的另一个好例子,因为事件已经迫近,并且日历事件通常涉及其他人员。 - - -</p> - -<h3 style="clear:both" id="when_not_to_display_a_notification">何时不显示通知 -</h3> - -<div class="figure" style="margin-top:60px"> - <img src="{@docRoot}images/android-5.0/notifications/AntiSample1.png" alt="" width="311px" /> -</div> - -<p>在其他很多情况下都不适合显示通知:</p> - -<ul> - <li> 不要将并非特定于用户的信息或并非确实时间敏感的信息告知用户。 - -例如,流经社交网络的异步和未经订阅的更新,通常不适合引发实时中断。 - - -对于确实关注它们的用户,可让他们选择接收通知。 -</li> - <li> 如果相关的新信息当前显示在屏幕上,则不要创建通知。 -不过可以使用应用本身的 UI 在上下文中将新信息直接告知用户。 - - - 例如,聊天应用不应在用户主动和另一名用户聊天时创建系统通知。 -</li> - <li> 对于技术要求不高的操作(例如保存或同步信息或更新应用),如果应用或系统无需用户参与就可解决问题,请不要中断用户。 - -</li> - <li> 如果可以让应用自行恢复错误,而不必让用户采取任何操作,则不要中断用户来告知他们发生此错误。 - -</li> - <li> 请不要创建没有实际通知内容和仅仅是为您的应用做宣传的通知。通知应当提供有用、及时、最新的信息,而不应仅用于推广应用。 - - - -</li> - <li> 请不要为了向用户宣传您的品牌而创建过多的通知。 - - 此类通知会让用户不满,从而很可能离您而去。提供少量更新信息并让用户保持与您的应用交互的最佳方式是开发一个小工具,让用户可以选择是否将其放在主屏幕上。 - - - - -</li> -</ul> - -<h2 style="clear:left" id="interacting_with_notifications">与通知交互 -</h2> - -<p>通知由状态栏中的图标指示,并且可以通过打开抽屉式通知栏进行访问。 - -</p> - -<p>触摸通知会打开相关联的应用并进入与通知匹配的详细内容。在通知上向左或向右滑动会将其从抽屉式通知栏中删除。 - -</p> - -<h3 id="ongoing_notifications">持续性通知</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/MusicPlayback.png" alt="" width="311px" /> - <p class="img-caption"> - 因播放音乐而持续显示的通知 - </p> -</div> -<p>持续性通知可让用户持续了解后台运行的进度。例如,音乐播放器在通知系统中通告当前播放的曲目,并继续进行播放,直至用户停止播放。 - - - -持续性通知也可为持续时间较长的任务(例如下载文件或视频编码之类的任务)向用户显示反馈。 - -用户无法手动从抽屉式通知栏中删除持续性通知。 -</p> - -<h3 id="ongoing_notifications">媒体播放</h3> -<p>在 Android 5.0 中,锁定屏幕不会为弃用的 -{@link android.media.RemoteControlClient} 类显示传输控件。但是它<em>确实</em>会显示通知,因此每个应用的播放通知现在是用户在锁屏状态控制播放的主要方式。 - -此行为可让应用更好地控制显示哪些按钮,这样,无论是否锁屏,都可以为用户提供一致的体验。 - - -</p> - -<h3 style="clear:both" -id="dialogs_and_toasts_are_for_feedback_not_notification">对话框和 Toast -</h3> - -<p>如果您的应用当前未显示在屏幕上,则不应创建对话框或 Toast。 -对话框或 Toast 应仅限用于即时响应用户在应用内部采取的操作。有关使用对话框和 Toast 的进一步指导,请参阅<a href="/design/patterns/confirming-acknowledging.html">确认和确知</a>。 - - - -</p> - -<h3>排名和排序</h3> - -<p>通知属于新闻,因此基本以时间倒序显示,并且会特别考虑应用规定的通知<a href="#correctly_set_and_manage_notification_priority">优先级</a>。 - - -</p> - -<p>通知是锁定屏幕的关键部分,并且在设备显示屏每次亮起时突出显示。 - -锁定屏幕上的空间有限,因此确定哪些通知最为紧急或最密切相关非常重要。 - -由于这个原因,Android 在处理通知时使用了更为精密的排序算法,考虑到以下因素: - -</p> - -<ul> - <li> 时间戳以及应用规定的优先级。</li> - <li> 通知是否最近以声音或振动形式告知过用户。 -(也就是说,如果手机刚发出了铃声,并且用户希望知道“刚才发生了什么?”,那么锁定屏幕应让用户一眼看到相应的通知。) - - -</li> - <li> 与使用 {@link android.app.Notification#EXTRA_PEOPLE} 的通知相关的任何人,尤其是加星标的联系人。 -</li> -</ul> - -<p>为了充分利用此排序功能,请专注于您希望建立的用户体验,而不是拘泥于列表上的某个特定项。 - -</p> - - <img src="{@docRoot}images/android-5.0/notifications/AntiSample3.png" alt="" width="700px" /> - - <p class="img-caption" style="margin-top:10px">Gmail 通知使用的是默认优先级,因此它们的顺序通常低于来自即时通讯应用(例如环聊)的消息,但是在有新邮件送达时会临时占位。 - - - - - </p> - - -<h3>在锁定屏幕上</h3> - -<p>由于通知在锁定屏幕上可见,所以用户隐私是特别重要的考虑事项。 - -通知通常包含敏感信息,并且不一定需要让所有拿起设备并打开显示屏的人看到。 - -</p> - -<ul> - <li> 对于配置了安全锁定屏幕(PIN 码、图案或密码)的设备,界面分为公用和私人部分。 -公用界面可显示在安全锁定屏幕上,因此任何人都可看见。 -私人界面是锁定屏幕背后的内容,只有在用户登录设备后才会显示。 -</li> -</ul> - -<h3>用户对显示在安全锁定屏幕上的信息的控制</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/LockScreen@2x.png" srcset="{@docRoot}images/android-5.0/notifications/LockScreen.png 1x" alt="" width="311px" /> - <p class="img-caption"> - 位于锁定屏幕上的通知,具有用户解锁设备后可显示的内容。 - </p> -</div> - -<p>在设置安全锁定屏幕时,用户可以选择从安全锁定屏幕隐藏敏感的详细信息。 -在这种情况下,系统 UI 会考虑通知的<em>可见性级别</em>,从而确定哪些内容可以安全地显示出来。 - -</p> -<p> 要控制可见性级别,可调用 <code><a -href="/reference/android/app/Notification.Builder.html#setVisibility(int)">Notification.Builder.setVisibility()</a></code>,然后指定以下值之一: - -</p> - -<ul> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PUBLIC">VISIBILITY_PUBLIC</a></code>。显示通知的完整内容。 - - 在未指定可见性的情况下,此设置是系统的默认设置。</li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PRIVATE">VISIBILITY_PRIVATE</a></code>。在锁定屏幕上,会显示通知的基本信息,包括其图标以及发布此通知的应用名称。 - -剩下的通知详细信息不会显示。需要注意的一些有用建议如下: - - <ul> - <li> 如果您希望为通知提供不同的公用版本,供系统显示在安全锁定屏幕上,可在 <code><a -href="/reference/android/app/Notification.html#publicVersion">Notification.publicVersion</a></code> 字段中提供替换通知对象。 - - - - <li> 该设置可让您的应用有机会创建有用内容的删减版本,但是不会显示个人信息。 -可参考短信应用的示例,这种应用的通知包括短信的文本以及发信者的姓名和联系人图标。该通知应为 <code>VISIBILITY_PRIVATE</code>,但是 <code>publicVersion</code> 仍然可以包含“有 3 条新消息”这样的有用信息,而不会提供其他识别性详细信息。 - - - - - </ul> - </li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_SECRET">Notification.VISIBILITY_SECRET</a></code>。仅显示最为精简的信息,甚至不包括通知图标。 -</li> -</ul> -<h2 style="clear:both" id="notifications_on_android_wear">Android Wear 上的通知 -</h2> - -<p>通知及其<em>操作</em>默认会和穿戴设备桥接。开发者可以控制哪些通知会从手机桥接至手表,反之亦然。 - - -开发者也可以控制哪些操作会进行桥接。如果您的应用包含无法通过单次点击完成的操作,则可以将这些操作隐藏在您的 Android Wear 设备通知中,或者考虑将它们连接至 Android Wear 设备应用,从而可让用户在其手表上完成操作。 - - - - - -</p> - -<h4>桥接通知和操作</h4> - -<p>连接的设备,例如手机,可将通知桥接至 Android Wear 设备,从而将通知显示在此处。 -与此相似,您也可以桥接操作,从而让用户可在 Android Wear 设备上直接操作通知。 -</p> - -<p><strong>桥接</strong></p> - -<ul> - <li> 新的即时通讯</li> - <li> 单次点击操作,例如 +1、赞、收藏</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/WearBasic.png" width="156px" height="156px" alt="" /> - -<p><strong>不要桥接</strong></p> - -<ul> - <li> 新收到的播客通知</li> - <li> 映射至手表上无法使用的功能的操作</li> -</ul> - - - -<p><h4>为 Android Wear 设备定义的独特操作</h4></p> - -<p>有些操作只能在 Android Wear 上执行。包括以下情况:</p> - -<ul> - <li> 例如“马上回来”这样的预设回复快速列表</li> - <li> 在手机上打开</li> - <li> 调出语音输入屏幕的“评论”或“回复”操作</li> - <li> 启动 Android Wear 专用应用的操作</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/ReplyAction.png" width="156px" height="156px" alt="" /> 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 306a7a4130ca..20f8b57822b0 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 6473fc85c8d5..83d50b42f277 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 @@ page.tags=Android N -<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/preview/features/security-config.jd b/docs/html-intl/intl/zh-cn/training/articles/security-config.jd index e029a035ca06..19e29b33c55b 100644 --- a/docs/html-intl/intl/zh-cn/preview/features/security-config.jd +++ b/docs/html-intl/intl/zh-cn/training/articles/security-config.jd @@ -4,8 +4,8 @@ page.image=images/cards/card-nyc_2x.jpg @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/playback/picture-in-picture.jd b/docs/html-intl/intl/zh-cn/training/tv/playback/picture-in-picture.jd index 782b5b868d63..6cfa815eca8b 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 @@ page.tags=androidn @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 2dec87d68724..754e0651fcb9 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 @@ page.image=images/cards/card-nyc_2x.jpg @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/design/patterns/notifications.jd b/docs/html-intl/intl/zh-tw/design/patterns/notifications.jd deleted file mode 100644 index 3e3f59c6d049..000000000000 --- a/docs/html-intl/intl/zh-tw/design/patterns/notifications.jd +++ /dev/null @@ -1,872 +0,0 @@ -page.title=通知 -page.tags="notifications","design","L" -@jd:body - - <a class="notice-developers" href="{@docRoot}training/notify-user/index.html"> - <div> - <h3>開發人員文件</h3> - <p>通知使用者</p> - </div> -</a> - -<a class="notice-designers" href="notifications_k.html"> - <div> - <h3>Android 4.4 及較早版本中的通知</h3> - </div> -</a> - -<!-- video box --> -<a class="notice-developers-video" href="https://www.youtube.com/watch?v=Uiq2kZ2JHVY"> -<div> - <h3>影片</h3> - <p>DevBytes:Android L 開發者預覽版中的通知</p> -</div> -</a> - -<style> - .col-5, .col-6, .col-7 { - margin-left:0px; - } -</style> - -<p>通知系統可以隨時知會使用者有關應用程式中的相關事件與及時事件,例如來自朋友的新聊天訊息。您可以將通知視為一種事件發生時警示使用者的新聞管道,或是在使用者沒注意時,記錄事件的日誌 — 並會視情況跨所有 Android 裝置且同步處理。 - - - - - -</p> - -<h4 id="New"><strong>Android 5.0 新功能</strong></h4> - -<p>在 Android 5.0 中,通知會透過結構化、視覺化和功能化的效果接收重要更新: -</p> - -<ul> - <li>通知已經有視覺方面的變更,與新的材料設計風格一致。 -</li> - <li> 現在可在裝置的鎖定螢幕上提供通知,而敏感內容仍可隱藏於其背後。 - -</li> - <li>當裝置於使用中收到高優先順序的通知時,會使用稱為預告 (heads-up) 通知的新格式。 -</li> - <li>雲端同步化通知:關閉您其中一部 Android 裝置的通知,隨之也會在其他裝置上關閉此通知。 - -</li> -</ul> - -<p class="note"><strong>注意:</strong>此版本 Android 中的通知設計和先前版本大相徑庭。 - -如需有關先前版本通知的設計資訊,請參閱 -<a href="./notifications_k.html">Android 4.4 及較早版本中的通知</a>。</p> - -<h2 id="Anatomy">通知的詳細分析</h2> - -<p>本節會重溫通知的基礎功能,以及其如何可在不同類型裝置上出現。 -</p> - -<h3 id="BaseLayout">基礎版面配置</h3> - -<p>至少,所有通知都必須包含一個基礎版面配置,它包含:</p> - -<ul> - <li> 通知的<strong>圖示</strong>。該圖示代表原始應用程式。如果應用程式會產生一種以上的通知類型,則圖示也有可能表示通知類型。 - - -</li> - <li> 一個通知<strong>標題</strong>和額外<strong>文字</strong>。 -</li> - <li> 一個<strong>時間戳記</strong>。</li> -</ul> - -<p>針對先前平台版本,使用 {@link android.app.Notification.Builder Notification.Builder} -所建立的通知其外觀與運作方式和在 Android 5.0 -中的一樣,只是在系統為您處理的方式上有一點樣式上的變更。 -如需更多有關 Android 先前版本通知的詳細資訊,請參閱 -<a href="./notifications_k.html">Android 4.4 及較早版本中的通知</a>。 -</p></p> - - - <img style="margin:20px 0 0 0" src="{@docRoot}images/android-5.0/notifications/basic_combo.png" alt="" width="700px" /> - - -<div style="clear:both;margin-top:20px"> - <p class="img-caption"> - 手持裝置通知的基礎版面配置 (左),以及穿戴裝置上的相同通知 (右),都帶有使用者相片及一個通知圖示 - - </p> - </div> - -<h3 id="ExpandedLayouts">擴充的版面配置</h3> - - -<p>您可以選擇到底要讓您應用程式的通知提供多詳細的資料。 -通知可以顯示訊息的前幾行,也可以顯示較大的影像預覽。 -此額外資訊可提供使用者更多內容,而且 — 在某些情況下 — 可讓使用者讀取完整訊息。 - - -使用者可以捏合縮放或執行單手指滑動,在精簡的版面配置與擴充的版面配置間切換。 - - - 對於單一事件通知,Android 提供三個擴充版面配置範本 -(文字、收件匣和影像),讓您可以在應用程式中使用。 -以下的影像顯示單一事件通知在手持裝置 (左) 和穿戴裝置 (右) 上的外觀。 - -</p> - -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/expandedtext_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/stack_combo.png" - alt="" width="700px" height;="284px" /> -<img style="margin-top:30px" -src="{@docRoot}images/android-5.0/notifications/ExpandedImage.png" - alt="" width="311px" height;="450px" /> - -<h3 id="actions" style="clear:both; margin-top:40px">動作</h3> - -<p>Android 支援可以在通知底端顯示的選用動作。透過動作,使用者可針對特定通知,從通知欄 (notification shade) 內處理最常見的工作,而無需開啟原始啟動的應用程式。這可加速互動,而且在配合滑動關閉 -(swipe-to-dismiss) -時,有助使用者專注於高重要性的通知。 - - - -</p> - - - <img src="{@docRoot}images/android-5.0/notifications/action_combo.png" alt="" width="700px" /> - - - -<p style="clear:both">明智地決定要在通知中要納入多少個動作。 -您納入的動作愈多,就會發現創造出愈複雜的通知。 -請納入最緊迫重要且有意義的動作,限制自己儘可能使用最少數目的動作。 - - -</p> - -<p>適合用於通知上的動作包含:</p> - -<ul> - <li> 必須是必要、頻繁且典型的想要顯示內容類型 - - <li> 可讓使用者快速完成工作 -</ul> - -<p>避免下列狀況:</p> - -<ul> - <li> 模稜兩可 - <li> 和通知的預設動作相同 (如「讀取」或「開啟」) - -</ul> - - - -<p>您最多可以指定三個動作,每個動作都由一個動作圖示與名稱組成。 - - 為簡單的基礎版面配置新增動作,可讓通知變得更具擴充性 --- -即使通知並未具備擴充的版面配置。由於動作只針對擴充的通知顯示,其他時候則隱藏,請確認使用者可從通知內呼叫的任何動作,也可以從關聯的應用程式中使用。 - - - - -</p> - -<h2 style="clear:left">預告通知</h2> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/hun-example.png" alt="" width="311px" /> - <p class="img-caption"> - 預告通知 (來電、高優先順序) -出現在沉浸式應用程式之上的範例 - - </p> -</div> - -<p>當高優先順序的通知到達 (如右) 時,會對使用者呈現很短的時間,且會顯示可能執行動作的擴充版面配置。 - -</p> -<p> 在這段時間之後,通知會退回至通知欄。 -如果通知的<a href="#correctly_set_and_manage_notification_priority">優先順序</a>被標記為「高」、「最大」或「全螢幕」,就會取得預告通知。 -</p> - -<p><b>預告通知的好範例</b></p> - -<ul> - <li> 使用裝置時有來電</li> - <li> 使用裝置時啟動鬧鐘功能</li> - <li> 新簡訊</li> - <li> 電池電力不足</li> -</ul> - -<h2 style="clear:both" id="guidelines">指導方針</h2> - - -<h3 id="MakeItPersonal">提供個人設定</h3> - -<p>針對由另一人傳送項目的通知 -(如郵件或狀態更新),使用 -{@link android.app.Notification.Builder#setLargeIcon setLargeIcon()} 納入對方提供的影像。也將對方的資訊附加至通知的中繼資料中 -(請參閱 {@link android.app.Notification#EXTRA_PEOPLE})。</p> - -<p>您通知的主要圖示仍會顯示,這樣使用者就可以將主要圖示與狀態列中的可見圖示關聯起來。 - -</p> - - -<img src="{@docRoot}images/android-5.0/notifications/Triggered.png" alt="" width="311px" /> -<p style="margin-top:10px" class="img-caption"> - 通知會顯示觸發通知的人及其傳送的內容。 -</p> - - -<h3 id="navigate_to_the_right_place">導覽至正確的地方</h3> - -<p>當輕觸通知的本文時 -(在動作按鈕之外),請將您的應用程式開啟至使用者可以檢視的地方,並根據通知中引用資料進行動作。 - -在多數情況下,這將是單一資料項目 (如訊息) 的詳細資料檢視,但如果通知被堆疊時,也可能會是概述檢視。 - -如果您的應用程式會將使用者帶到應用程式頂層之下的任何地方,則請將導覽過程插入應用程式的返回堆疊中,這可以讓使用者能夠按下系統的返回按鈕,返回至頂層。 - -如需詳細資訊,請見<a href="{@docRoot}design/patterns/navigation.html#into-your-app">導覽</a>設計模式中的「透過主螢幕視窗小工具和通知,導覽至您的應用程式」<em></em>。 - -</p> - -<h3 id="correctly_set_and_manage_notification_priority">正確設定和管理通知優先順序 - -</h3> - -<p>Android 支援對通知設定優先順序的旗標。此旗標可與其他通知旗標比較,影響通知顯示的位置,這有助於確保使用者一律會先看到最重要的通知。 - - -在發佈通知時,您可以從以下優先順序等級選擇: - -</p> -<table> - <tr> - <td class="tab0"> -<p><strong>優先順序</strong></p> -</td> - <td class="tab0"> -<p><strong>使用</strong></p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MAX</code></p> -</td> - <td class="tab1"> -<p>用於關鍵且緊急的通知,警示使用者注意此通知具時效性或必須在繼續特定工作前先解決的情況。 - - -</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>HIGH</code></p> -</td> - <td class="tab1"> -<p>主要用於重要通訊,例如內容為使用者特別感興趣的郵件或聊天事件。高優先順序通知會觸發預告通知的顯示。 - -</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>DEFAULT</code></p> -</td> - <td class="tab1"> -<p>用於不屬於此處所述任何其他優先事項類型的所有通知。</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>LOW</code></p> -</td> - <td class="tab1"> -<p>用於您希望使用者能夠被告知,但不那麼緊急的通知。 -低優先順序通知往往出現在清單的底端,因此適合於公共或間接的社交更新: - -使用者已要求針對這類事件通知,但這些通知一律不會優先於緊急或直接通訊。 - - -</p> -</td> - </tr> - <tr> - <td class="tab1"> -<p><code>MIN</code></p> -</td> - <td class="tab1"> -<p>用於內容關聯或背景資訊,例如天氣資訊或內容關聯位置的資訊。最低優先順序通知不會出現在狀態列。 - -使用者會在展開通知欄時找到這些通知。 -</p> -</td> - </tr> -</table> - - -<h4 id="how_to_choose_an_appropriate_priority"><strong>如何選擇合適的優先順序</strong> - -</h4> - -<p><code>DEFAULT</code>、<code>HIGH</code> 和 <code>MAX</code> 為可中斷的優先順序等級,且有打斷使用者正進行動作的風險。 - -如要避免惹惱您應用程式的使用者,請將可中斷的優先順序保留給下列通知: -</p> - -<ul> - <li> 涉及另一人</li> - <li> 具時效性</li> - <li> 可能會立即變更使用者在現實世界中的行為</li> -</ul> - -<p>對使用者而言,設定為 <code>LOW</code> 和 <code>MIN</code> 的通知仍可能很有價值: -很多通知 -- 就算不是大多數 -- 並不需要使用者立即注意,或透過振動使用者的手腕加以提醒;但在使用者選擇查看通知時,這些通知仍會包含使用者覺得有價值的資訊。 - - -<code>LOW</code> 和 <code>MIN</code> - 優先順序通知的準則包含:</p> - -<ul> - <li> 不會牽涉到別人</li> - <li> 不具時效性</li> - <li> 包含使用者可能感興趣,但可能在空閒時才會瀏覽的內容 -</li> -</ul> - - - <img src="{@docRoot}images/android-5.0/notifications/notifications_pattern_priority.png" alt="" width="700" /> - - -<h3 style="clear:both" id="set_a_notification_category">設定通知類別 -</h3> - -<p>如果您的通知屬於某個預先定義的類別 -(詳見下列說明),則請據以指派。 -通知欄 (或任何其他通知接聽器) 等系統 UI -可能會使用此資訊,決定排名和篩選結果。 -</p> -<table> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_CALL">CATEGORY_CALL</a></code></p> -</td> - <td> -<p>來電 (語音或視訊) 或類似的同步化通訊要求 -</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_MESSAGE">CATEGORY_MESSAGE</a></code></p> -</td> - <td> -<p>傳入的直接訊息 (簡訊、即時訊息等)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EMAIL">CATEGORY_EMAIL</a></code></p> -</td> - <td> -<p>非同步大量郵件 (電子郵件)</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_EVENT">CATEGORY_EVENT</a></code></p> -</td> - <td> -<p>「行事曆」事件</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROMO">CATEGORY_PROMO</a></code></p> -</td> - <td> -<p>宣傳或廣告</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ALARM">CATEGORY_ALARM</a></code></p> -</td> - <td> -<p>鬧鐘或計時器</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_PROGRESS">CATEGORY_PROGRESS</a></code></p> -</td> - <td> -<p>長時間執行的背景操作其進度</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SOCIAL">CATEGORY_SOCIAL</a></code></p> -</td> - <td> -<p>社交網路或共用更新</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_ERROR">CATEGORY_ERROR</a></code></p> -</td> - <td> -<p>背景操作或驗證狀態中的錯誤</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_TRANSPORT">CATEGORY_TRANSPORT</a></code></p> -</td> - <td> -<p>播放的媒體傳輸控制</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SYSTEM">CATEGORY_SYSTEM</a></code></p> -</td> - <td> -<p>系統或裝置狀態更新。保留供系統使用。</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_SERVICE">CATEGORY_SERVICE</a></code></p> -</td> - <td> -<p>執行背景服務的表示</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_RECOMMENDATION">CATEGORY_RECOMMENDATION</a></code></p> -</td> - <td> -<p>針對單一件事的特定、及時建議。例如,新聞應用程式可能會想推薦其認為使用者下一步想要閱讀的新聞報導。 - -</p> -</td> - </tr> - <tr> - <td> -<p><code><a -href="/reference/android/app/Notification.html#CATEGORY_STATUS">CATEGORY_STATUS</a></code></p> -</td> - <td> -<p>有關裝置或內容關聯狀態的進行中資訊</p> -</td> - </tr> -</table> - -<h3 id="summarize_your_notifications">概述您的通知</h3> - -<p>當您的應用程式嘗試傳送的通知,但已有類型相同的通知仍在等待中,則請針對應用程式將這些相同類型的通知合併為單一概述通知,而不要建立新物件。 - -</p> - -<p>概述通知會建立概述描述,並讓使用者瞭解特定種類的通知有多少數目正在等待處理。 - -</p> - -<div class="col-6"> - -<p><strong>不要這樣做</strong></p> - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Dont.png" alt="" width="311px" /> -</div> - -<div> -<p><strong>請這樣做</strong></p> - - <img src="{@docRoot}images/android-5.0/notifications/Summarise_Do.png" alt="" width="311px" /> -</div> - -<p style="clear:left; padding-top:30px; padding-bottom:20px">您可以使用擴充摘要版面配置,針對組成概述的個別通知,提供更多詳細資料。 - -這種方法可讓使用者更能感覺出哪些通知正處於等待處理,以及是否夠有趣,以便在關聯應用程式中詳細閱讀。 - - - -</p> -<div class="col-6"> - <img src="{@docRoot}images/android-5.0/notifications/Stack.png" style="margin-bottom:20px" alt="" width="311px" /> - <p class="img-caption"> - 概述實際上是通知的展開和收縮 (使用 <code>InboxStyle</code>) - </p> -</div> - -<h3 style="clear:both" id="make_notifications_optional">讓通知成為可選用的 -</h3> - -<p>使用者應該總是能夠控制通知。讓使用者可以停用您應用程式的通知,或變更其警示屬性,如鬧鐘聲音或是否要使用振動,方法則是為您的應用程式設定新增通知設定項目。 - - - -</p> - -<h3 id="use_distinct_icons">使用易於分辨的的圖示</h3> -<p>使用者應該能瞄一下通知區域,即可以分辨哪些種類的通知目前正在等待處理。 - -</p> - -<div class="figure"> - <img src="{@docRoot}images/android-5.0/notifications/ProductIcons.png" alt="" width="420" /> -</div> - - <div><p><strong>請這樣做</strong></p> - <p>查看 Android 應用程式圖示, -Android 應用程式已為您的應用程式提供外觀易於分辨的通知圖示。 -</p> - - <p><strong>請這樣做</strong></p> - <p>針對小圖示使用<a href="/design/style/iconography.html#notification">通知圖示樣式</a>,針對您的動作列圖示使用 Material Light <a href="/design/style/iconography.html#action-bar">動作列圖示樣式</a>。 - - - -</p> -<p ><strong>請這樣做</strong></p> -<p >讓圖示保持看起來簡單的狀態,避免因過多的詳細資料造成使用者難以看清楚。 -</p> - - <div><p><strong>不要這樣做</strong></p> - <p>將任何額外的 -Alpha -(變暗或淡出) -置入您的小圖示和動作圖示之中;它們的邊緣可能會有反鋸齒狀,但因為 Android 使用這些圖示做為遮罩 -(也就是說,只使用 Alpha 通道),所以影像通常會以完全透明度來繪製。 -</p> - -</div> -<p style="clear:both"><strong>不要這樣做</strong></p> - -<p>使用顏色以區分您與其他人的應用程式。通知圖示應該只是個白色圖示透明背景的背景影像。 -</p> - - -<h3 id="pulse_the_notification_led_appropriately">可以調整通知 LED 適當開啟 -</h3> - -<p>許多 Android 裝置具備通知 LED,可用於當螢幕關閉時通知使用者有新事件。 - -優先順序等級為<code>MAX</code>、<code>HIGH</code> 和 <code>DEFAULT</code> 的通知, -應該要讓 LED 亮起,而只有低優先順序 (<code>LOW</code> 和 <code>MIN</code>) 的通知則不需要。 - -</p> - -<p>使用者對通知的控制應該延伸到 LED 上。當您使用 DEFAULT_LIGHTS,LED 會亮白色。 - -除非使用者已明確自訂通知,否則您的通知不應該使用其他顏色。 - -</p> - -<h2 id="building_notifications_that_users_care_about">建立使用者喜歡的通知 -</h2> - -<p>若要建立使用者喜歡的應用程式,精心設計您的通知非常重要。通知代表您應用程式的聲音,並有助於您應用程式的個性。 - - -非必要或非重要的通知會讓使用者不高興,這會讓他們覺得應用程式想要吸引注目不擇手段,所以請明智地使用通知。 - - -</p> - -<h3 id="when_to_display_a_notification">顯示通知的時機</h3> - -<p>若要建立人們喜歡使用的應用程式,重要的是要體認到使用者的注意與專注是必須加以保護的資源。 - -雖然 Android 的通知系統已重新設計,儘量降低通知對使用者注意力的影響。但仍然必須警覺,通知會中斷使用者的工作流程。在規劃您的通知時,請先自問:通知是否足夠重要到可以合理地中斷使用者。 - - - - - - -如果您不確定,則讓使用者可以使用您應用程式的通知設定,或調整通知優先順序旗標為 <code>LOW</code> 或 <code>MIN</code>,避免使用者在從事其他工作時因此分心。 - - - -</p> - - <img src="{@docRoot}images/android-5.0/notifications/TimeSensitive.png" alt="" width="311px" /> - <p style="margin-top:10px" class="img-caption"> - 具時效性的通知範例 - </p> - -<p>妥善規劃的應用程式只會在必要時才出現,但有幾個情況的確有益於應用程式透過無提示通知中斷使用者的行為。 -</p> - -<p>通知主要還是使用於<strong>具時效性時間的事件</strong>,特別是當這些同步事件<strong>涉及其他人</strong>的時候。 -比如說,傳入的聊天是通訊的即時、同步形式: - -另一個使用者正主動等待您的回應。 -「行事曆」事件是何時使用通知吸引使用者注意的另一個好例子,因為事件即將發生,而「行事曆」事件通常牽涉到其他人。 - - -</p> - -<h3 style="clear:both" id="when_not_to_display_a_notification">不顯示通知的時機 -</h3> - -<div class="figure" style="margin-top:60px"> - <img src="{@docRoot}images/android-5.0/notifications/AntiSample1.png" alt="" width="311px" /> -</div> - -<p>在許多其他情況下,通知並不適當:</p> - -<ul> - <li> 當通知並非直接針對使用者,或者資訊並非真正具時效性時,請避免通知使用者。 - -例如,來自社交網路的非同步與間接更新,通常不是即時中斷的好時機。 - - -對於重視這些狀況的使用者,可以讓他們自行選擇加入通知。 -</li> - <li> 如果相關的新資訊目前正在螢幕上,則不要建立另一個通知。 -反之,直接在前後關係中使用應用程式本身的 UI 通知使用者有新資訊。 - - - 例如,當使用者正與另一位使用者聊天時,聊天應用程式不應建立系統通知。 -</li> - <li> 如果應用程式或系統可以不干擾使用者而解決問題,就不要因為如儲存或同步化資訊,或更新應用程式等低層級的技術操作而中斷使用者活動。 - -</li> - <li> 如果可能的話,就讓應用程式能自行從錯誤恢復,在不需要使用者進行任何動作時,就不要告知他們錯誤而中斷使用者的活動。 - -</li> - <li> 不要建立無實質內容的通知,也不要建立內容僅是在廣告您應用程式的通知。 - -通知應該要能夠提供實用、及時的新資訊,而非只是為了啟動一個應用程式。 - -</li> - <li> 請不要為了讓您的品牌出現在使用者面前,而建立多餘的通知。 - - 這類通知會讓您的使用者感到失望並不願意使用您的應用程式。能夠提供少量的更新資訊並可以吸引使用者注意您應用程式的最佳方式,是開發一個小工具,讓使用者可以選擇放置在主畫面上。 - - - - -</li> -</ul> - -<h2 style="clear:left" id="interacting_with_notifications">與通知互動 -</h2> - -<p>通知可由狀態列上的圖示表示,並可以透過開啟通知匣來存取。 - -</p> - -<p>輕觸通知會開啟相關應用程式,顯示符合通知的詳細資料內容。對通知往左右滑動,可以將通知從通知匣中移除。 - -</p> - -<h3 id="ongoing_notifications">進行中通知</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/MusicPlayback.png" alt="" width="311px" /> - <p class="img-caption"> - 因為音樂播放的緣故所以有進行中通知 - </p> -</div> -<p>進行中通知可讓使用者得知在背景中正在進行程序的資訊。例如,音樂播放程式會在通知系統中宣告正在播放的曲目,除非使用者停止曲目,否則就會繼續宣告。 - - - -進行中通知也可以針對如下載檔案或編碼影片等耗時較長的工作,向使用者顯示目前進度。 - -使用者無法手動將進行中通知從通知匣移除。 -</p> - -<h3 id="ongoing_notifications">媒體播放</h3> -<p>在 Android 5.0 中,鎖定螢幕不會針對已過時的 -{@link android.media.RemoteControlClient} 類別,顯示傳輸控制項。但鎖定螢幕「的確」<em></em>會顯示通知,所以每個應用程式的播放通知,現在都已經是使用者從鎖定狀態控制播放的主要方法。 - -這個行為可讓應用程式進一步控制以何種方式顯示哪些按鈕,同時無論螢幕是否鎖定,都能為使用者提供一致性的體驗。 - - -</p> - -<h3 style="clear:both" -id="dialogs_and_toasts_are_for_feedback_not_notification">對話和快顯通知 -</h3> - -<p>您的應用程式目前若不在畫面上,就不應建立對話或快顯通知。 -對話或快顯通知只在使用者於您應用程式內採取動作時產生立即回應時才顯示。至於使用對話與快顯通知的進一步指引,請參閱<a href="/design/patterns/confirming-acknowledging.html">確認和確認完成</a>。 - - - -</p> - -<h3>排名和排序</h3> - -<p>通知就是新聞,所以基本上是以逆時間順序顯示,同時會針對應用程式指定的通知<a href="#correctly_set_and_manage_notification_priority">優先順序</a>,給與特殊考慮。 - - -</p> - -<p>通知是鎖定螢幕的重要部分,並會在裝置重新顯示螢幕時明確作用。 - -鎖定螢幕上的空間有限,所以更重要的是辨別出最緊急或相關的通知。 - -基於這個理由,Android 針對通知提供了更複雜的排序演算法,並同時考慮: - -</p> - -<ul> - <li> 時間戳記和應用程式指定的優先順序。</li> - <li> 通知最近是否以聲音或振動干擾使用者。 -(也就是說,如果電話剛發出一個聲響,而使用者想要知道「剛剛發生什麼事?」,鎖定螢幕應該以瞄一下就能取得通知的方式來回應使用者。 -) - -</li> - <li> 任何使用 {@link android.app.Notification#EXTRA_PEOPLE} 附加至該通知的人員,尤其是他們是否為標記星號的連絡人。 -</li> -</ul> - -<p>要善用這種排序,請著重於您想要建立的使用者體驗,而非著眼於清單上的任何特定排名位置。 - -</p> - - <img src="{@docRoot}images/android-5.0/notifications/AntiSample3.png" alt="" width="700px" /> - - <p class="img-caption" style="margin-top:10px">Gmail 通知使用預設的優先順序,所以通常排序低於像 Hangouts 等即時訊息應用程式,但當有新郵件進來時,會暫時立即提升。 - - - - - </p> - - -<h3>在鎖定螢幕上</h3> - -<p>由於通知可見於鎖定螢幕上,因此使用者隱私是特別重要的考量。 - -通知通常包含敏感資訊,而且不一定要顯示給拿起裝置並打開顯示的任何人。 - -</p> - -<ul> - <li> 針對具有安全鎖定螢幕 (PIN、圖案或密碼) 的裝置,介面有公用和私密兩部分。 -公用介面可以顯示在安全鎖定螢幕上,因此任何人都可看見。 -私密介面是鎖定螢幕背後的世界,只在使用者登入裝置時才會顯示。 -</li> -</ul> - -<h3>使用者控制安全鎖定螢幕上顯示的資訊</h3> -<div class="figure" style="width:311px"> - <img src="{@docRoot}images/android-5.0/notifications/LockScreen@2x.png" srcset="{@docRoot}images/android-5.0/notifications/LockScreen.png 1x" alt="" width="311px" /> - <p class="img-caption"> - 鎖定螢幕上的通知,以及使用者解鎖裝置後顯示的內容。 - </p> -</div> - -<p>當設定安全鎖定螢幕時,使用者可以選擇隱藏來自安全鎖定螢幕的機密詳細資料。 -在這種情況下,系統 UI 會考慮通知的「可見度」<em></em>等級,判斷可以顯示何種內容。 - -</p> -<p> 如要控制可見度等級,可以呼叫 -<code><a -href="/reference/android/app/Notification.Builder.html#setVisibility(int)">Notification.Builder.setVisibility()</a></code>,並指定下列值之一: -</p> - -<ul> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PUBLIC">VISIBILITY_PUBLIC</a></code>。 -顯示通知的完整內容。 - 如果未指定可見度,則這會是系統預設值。</li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_PRIVATE">VISIBILITY_PRIVATE</a></code>。 -在鎖定螢幕上,顯示這個通知存在的基本資訊, -包括通知圖示和發佈通知的應用程式。通知詳細資料的其他部分則不會顯示。 -但請記住的下列幾點: - <ul> - <li> 如果您想要提供您通知的不同公用版本, -以便顯示在安全鎖定螢幕上, -請在 <code><a -href="/reference/android/app/Notification.html#publicVersion">Notification.publicVersion</a></code> -欄位中提供一個取代的「通知」物件。 - <li> 此設定可以讓您的應用程式有機會建立內容的改編版本,非常實用但卻不會透露個人資訊。 -考慮簡訊應用程式的例子, -其通知包含簡訊的文字和傳送者的姓名與連絡人圖示。 -此通知應該是 <code>VISIBILITY_PRIVATE</code>,但 <code>publicVersion</code> 仍包含像「3 個新訊息」等實用資訊, -但卻又不提供任何其他可用來識別的詳細資料。 - - </ul> - </li> - <li><code><a -href="/reference/android/app/Notification.html#VISIBILITY_SECRET">Notification.VISIBILITY_SECRET</a></code>。僅顯示最起碼的資訊, -甚至連通知圖示都排除。</li> -</ul> -<h2 style="clear:both" id="notifications_on_android_wear">Android Wear 上的通知 -</h2> - -<p>預設情況下,通知和其<em>動作</em>會橋接至穿戴裝置。 -開發人員可以控制哪些通知可從電話橋接至手錶上, -反之亦然。 -開發人員還可以控制哪些動作可以橋接。如果您的 -應用程式包含 -無法以單一點選完成的動作, -請在您的穿戴通知上隱藏這些動作 -,或考慮將其連結至穿戴應用程式, -讓使用者可以在手錶上完成動作。 -</p> - -<h4>橋接通知和動作</h4> - -<p>例如電話等已連線的裝置, -可以橋接通知至穿戴裝置,讓通知可以在該處顯示。同樣的,也可以橋接動作, -這樣使用者就可以直接從穿戴裝置對通知執行動作。</p> - -<p><strong>橋接</strong></p> - -<ul> - <li> 新的即時訊息</li> - <li> 例如 +1 等單點選動作,像 Heart</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/WearBasic.png" width="156px" height="156px" alt="" /> - -<p><strong>請勿橋接</strong></p> - -<ul> - <li> 新到播客的通知</li> - <li> 對應至手錶上不可能執行的動作</li> -</ul> - - - -<p><h4>要在穿戴裝置上定義的獨特動作</h4></p> - -<p>有些動作只能在穿戴裝置上執行。這些動作包含:</p> - -<ul> - <li> 罐頭回應的快速清單,例如「會馬上回來」</li> - <li> 在手機上開啟</li> - <li> 帶出語音輸入畫面的「註解」或「回覆」動作</li> - <li> 啟動穿戴裝置特定的應用程式動作</li> -</ul> - -<img src="{@docRoot}images/android-5.0/notifications/ReplyAction.png" width="156px" height="156px" alt="" /> 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 7e4ea732b244..fdcb1727cea4 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 0aa0034a1d1e..b1c1a76ebb09 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 @@ page.tags=androidn @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/preview/features/security-config.jd b/docs/html-intl/intl/zh-tw/training/articles/security-config.jd index 4fe8d0d896b0..9b42b58defd6 100644 --- a/docs/html-intl/intl/zh-tw/preview/features/security-config.jd +++ b/docs/html-intl/intl/zh-tw/training/articles/security-config.jd @@ -4,8 +4,8 @@ page.image=images/cards/card-nyc_2x.jpg @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/playback/picture-in-picture.jd b/docs/html-intl/intl/zh-tw/training/tv/playback/picture-in-picture.jd index b05198573eba..e643f65dbc1a 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 @@ page.tags=androidn @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 d857477d760b..8b3a5ce62cac 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 @@ page.image=images/cards/card-nyc_2x.jpg @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 c12297437cd1..3dcc736d3c90 100644 --- a/docs/html/_redirects.yaml +++ b/docs/html/_redirects.yaml @@ -23,6 +23,8 @@ redirects: to: /studio/debug/index.html - from: /sdk/compatibility-library.html to: /topic/libraries/support-library/index.html +- from: /billions + to: /topic/billions/index.html - from: /tools/extras/support-library.html to: /topic/libraries/support-library/index.html - from: /training/basics/fragments/support-lib.html @@ -1231,3 +1233,20 @@ redirects: to: /guide/topics/resources/multilingual-support.html - from: /preview/j8-jack.html to: /guide/platform/j8-jack.html +- from: /about/versions/marshmallow/samples.html + to: /about/versions/marshmallow/android-6.0-samples.html +- from: /preview/behavior-changes.html + to: /about/versions/nougat/android-7.0-changes.html +- from: /preview/samples.html + to: /about/versions/nougat/android-7.0-samples.html +- from: /preview/guide.html + to: /about/versions/nougat/android-7.0-testing.html +- from: /preview/api-overview.html + to: /about/versions/nougat/android-7.0.html +- from: /preview/index.html + to: /about/versions/nougat/index.html +- from: /preview/features/background-optimization.html + to: /topic/performance/background-optimization.html +- from: /preview/features/data-saver.html + to: /training/basics/network-ops/data-saver.html + diff --git a/docs/html/about/_book.yaml b/docs/html/about/_book.yaml index fdbe53faeaae..958435d5e894 100644 --- a/docs/html/about/_book.yaml +++ b/docs/html/about/_book.yaml @@ -1,4 +1,16 @@ toc: +- title: Nougat + path: /about/versions/nougat/index.html + section: + - title: Android 7.0 APIs + path: /about/versions/nougat/android-7.0.html + - title: Android 7.0 Changes + path: /about/versions/nougat/android-7.0-changes.html + - title: Android 7.0 Samples + path: /about/versions/nougat/android-7.0-samples.html + - title: Android 7.0 Testing + path: /about/versions/nougat/android-7.0-testing.html + - title: Marshmallow path: /about/versions/marshmallow/index.html section: @@ -7,7 +19,9 @@ toc: - title: Android 6.0 Changes path: /about/versions/marshmallow/android-6.0-changes.html - title: Android 6.0 Samples - path: /about/versions/marshmallow/samples.html + path: /about/versions/marshmallow/android-6.0-samples.html + - title: Android 6.0 Testing + path: /about/versions/marshmallow/android-6.0-testing.html - title: Lollipop path: /about/versions/lollipop.html diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd index 3cbfde9cc386..f5d23e8b4032 100644 --- a/docs/html/about/dashboards/index.jd +++ b/docs/html/about/dashboards/index.jd @@ -59,7 +59,7 @@ Platform Versions</a>.</p> </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 @@ Screens</a>.</p> </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 @@ support for any lower version (for example, support for version 2.0 also implies <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 @@ uses.</p> </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 @@ var SCREEN_DATA = "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 @@ var SCREEN_DATA = "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 SCREEN_DATA = 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 @@ var VERSION_DATA = { "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/about/versions/marshmallow/samples.jd b/docs/html/about/versions/marshmallow/android-6.0-samples.jd index 14221514c3c6..14221514c3c6 100644 --- a/docs/html/about/versions/marshmallow/samples.jd +++ b/docs/html/about/versions/marshmallow/android-6.0-samples.jd diff --git a/docs/html/about/versions/marshmallow/android-6.0-testing.jd b/docs/html/about/versions/marshmallow/android-6.0-testing.jd new file mode 100644 index 000000000000..f9d9265ad549 --- /dev/null +++ b/docs/html/about/versions/marshmallow/android-6.0-testing.jd @@ -0,0 +1,183 @@ +page.title=Android 6.0 Testing Guide +page.image=images/cards/card-n-guide_2x.png +meta.tags="preview", "testing" +page.tags="preview", "developer preview" + +@jd:body + +<div id="qv-wrapper"> + <div id="qv"> + <h2>In this document</h2> + <ol> + <li><a href="#runtime-permissions">Testing Permissions</a></li> + <li><a href="#doze-standby">Testing Doze and App Standby</a></li> + <li><a href="#ids">Auto Backup and Device Identifiers</a></li> + </ol> + </div> +</div> + +<p> + Android 6.0 gives you an opportunity to ensure your apps work with the next + version of the platform. This preview includes a number of APIs and behavior changes that can + impact your app, as described in the <a href="{@docRoot}preview/api-overview.html">API + Overview</a> and <a href="{@docRoot}preview/behavior-changes.html">Behavior Changes</a>. In testing + your app with the preview, there are some specific system changes that you should focus on to + ensure that users have a good experience. +</p> + +<p> + This guide describes the what and how to test preview features with your app. You should + prioritize testing of these specific preview features, due to their high potential impact on your + app's behavior: +</p> + +<ul> + <li><a href="#runtime-permissions">Permissions</a> + </li> + <li><a href="#doze-standby">Doze and App Standby</a> + </li> + <li><a href="#ids">Auto Backup and Device Identifiers</a></li> +</ul> + +<h2 id="runtime-permissions">Testing Permissions</h2> + +<p> + The new <a href="{@docRoot}preview/features/runtime-permissions.html">Permissions</a> model + changes the way that permissions are allocated to your app by the user. Instead of granting all + permissions during the install procedure, your app must ask the user for individual permissions + at runtime. For users this behavior provides more granular control over each app’s activities, as + well as better context for understanding why the app is requesting a specific permission. Users + can grant or revoke the permissions granted to an app individually at any time. This feature of + the preview is most likely to have an impact on your app's behavior and may prevent some of your + app features from working, or they may work in a degraded state. +</p> + +<p class="caution"> + This change affects all apps running on the new platform, even those not targeting the new + platform version. The platform provides a limited compatibility behavior for legacy apps, but you + should begin planning your app’s migration to the new permissions model now, with a goal of + publishing an updated version of your app at the official platform launch. +</p> + + +<h3 id="permission-test-tips">Test tips</h3> + +<p> + Use the following test tips to help you plan and execute testing of your app with the new + permissions behavior. +</p> + +<ul> + <li>Identify your app’s current permissions and the related code paths.</li> + <li>Test user flows across permission-protected services and data.</li> + <li>Test with various combinations of granted/revoked permission.</li> + <li>Use the {@code adb} tool to manage permssions from the command line: + <ul> + <li>List permissions and status by group: + <pre>adb shell pm list permissions -d -g</pre> + </li> + <li>Grant or revoke one or more permissions using the following syntax:<br> + <pre>adb shell pm [grant|revoke] <permission.name> ...</pre> + </li> + </ul> + </li> + <li>Analyze your app for services that use permissions.</li> +</ul> + +<h3 id="permission-test-strategy">Test strategy</h3> + +<p> + The permissions change affects the structure and design of your app, as well as + the user experience and flows you provide to users. You should assess your app’s current + permissions use and start planning for the new flows you want to offer. The official release of + the platform provides compatibility behavior, but you should plan on updating your app and not + rely on these behaviors. +</p> + +<p> + Identify the permissions that your app actually needs and uses, and then find the various code + paths that use the permission-protected services. You can do this through a combination of + testing on the new platform and code analysis. In testing, you should focus on opting in to + runtime permissions by changing the app’s {@code targetSdkVersion} to the preview version. For + more information, see <a href="{@docRoot}preview/setup-sdk.html#">Set up +the Android N SDK</a>. +</p> + +<p> + Test with various combinations of permissions revoked and added, to highlight the user flows that + depend on permissions. Where a dependency is not obvious or logical you should consider + refactoring or compartmentalizing that flow to eliminate the dependency or make it clear why the + permission is needed. +</p> + +<p> + For more information on the behavior of runtime permissions, testing, and best practices, see the + <a href="{@docRoot}preview/features/runtime-permissions.html">Permissions</a> developer + preview page. +</p> + + +<h2 id="doze-standby">Testing Doze and App Standby</h2> + +<p> + The power saving features of Doze and App Standby limit the amount of background processing that + your app can perform when a device is in an idle state or while your app is not in focus. The + restrictions the system may impose on apps include limited or no network access, + suspended background tasks, suspended Notifications, ignored wake requests, and alarms. To ensure + that your app behaves properly with these power saving optimizations, you should test your app by + simulating these low power states. +</p> + +<h4 id="doze">Testing your app with Doze</h4> + +<p>To test Doze with your app:</p> + +<ol> +<li>Configure a hardware device or virtual device with an Android N system image.</li> +<li>Connect the device to your development machine and install your app.</li> +<li>Run your app and leave it active.</li> +<li>Simulate the device going into Doze mode by running the following commands: + +<pre> +$ adb shell dumpsys battery unplug +$ adb shell dumpsys deviceidle step +$ adb shell dumpsys deviceidle -h +</pre> + + </li> + <li>Observe the behavior of your app when the device is re-activated. Make sure it + recovers gracefully when the device exits Doze.</li> +</ol> + + +<h4 id="standby">Testing apps with App Standby</h4> + +<p>To test the App Standby mode with your app:</p> + +<ol> + <li>Configure a hardware device or virtual device with an Android N system image.</li> + <li>Connect the device to your development machine and install your app.</li> + <li>Run your app and leave it active.</li> + <li>Simulate the app going into standby mode by running the following commands: + +<pre> +$ adb shell am broadcast -a android.os.action.DISCHARGING +$ adb shell am set-idle <packageName> true +</pre> + + </li> + <li>Simulate waking your app using the following command: + <pre>$ adb shell am set-idle <packageName> false</pre> + </li> + <li>Observe the behavior of your app when it is woken. Make sure it recovers gracefully + from standby mode. In particular, you should check if your app's Notifications and background + jobs continue to function as expected.</li> +</ol> + +<h2 id="ids">Auto Backup for Apps and Device-Specific Identifiers</h2> + +<p>If your app is persisting any device-specific identifiers, such as Google +Cloud Messaging registration ID, in internal storage, +make sure to follow best practices to exclude the storage +location from auto-backup, as described in <a href="{@docRoot}preview/backup/index.html">Auto +Backup for Apps</a>. </p> diff --git a/docs/html/preview/behavior-changes.jd b/docs/html/about/versions/nougat/android-7.0-changes.jd index ba08d9b16411..4f9054c7d526 100644 --- a/docs/html/preview/behavior-changes.jd +++ b/docs/html/about/versions/nougat/android-7.0-changes.jd @@ -1,7 +1,7 @@ -page.title=Behavior Changes +page.title=Android 7.0 Changes page.keywords=preview,sdk,compatibility -meta.tags="preview", "compatibility" -page.tags="preview", "developer preview" +meta.tags="Android 7.0", "Nougat", "android n", "compatibility" +page.tags="Android 7.0", "Nougat", "android n", "developer preview" page.image=images/cards/card-n-changes_2x.png @jd:body @@ -44,7 +44,7 @@ page.image=images/cards/card-n-changes_2x.png <h2>See Also</h2> <ol> <li><a href="{@docRoot}preview/api-overview.html"> - Android N for Developers</a></li> + Android 7.0 APIs</a></li> </ol> </div> @@ -52,7 +52,7 @@ page.image=images/cards/card-n-changes_2x.png <p> - Along with new features and capabilities, Android N + Along with new features and capabilities, Android 7.0 includes a variety of system and API behavior changes. This document highlights some of the key changes that you should understand and account for in your apps. @@ -67,7 +67,7 @@ page.image=images/cards/card-n-changes_2x.png <h2 id="perf">Battery and Memory</h2> <p> -Android N includes system behavior changes aimed at improving the battery life +Android 7.0 includes system behavior changes aimed at improving the battery life of devices and reducing RAM usage. These changes can affect your app’s access to system resources, along with the way your app interacts with other apps via certain implicit intents. @@ -78,14 +78,14 @@ certain implicit intents. <p> Introduced in Android 6.0 (API level 23), Doze improves battery life by deferring CPU and network activities when a user leaves a device unplugged, - stationary, and with the screen turned off. Android N brings further + stationary, and with the screen turned off. Android 7.0 brings further enhancements to Doze by applying a subset of CPU and network restrictions while the device is unplugged with the screen turned off, but not necessarily stationary, for example, when a handset is traveling in a user’s pocket. </p> -<img src="{@docRoot}preview/images/doze-diagram-1.png" +<img src="{@docRoot}images/android-7.0/doze-diagram-1.png" alt="" height="251px" id="figure1" /> <p class="img-caption"> <strong>Figure 1.</strong> Illustration of how Doze applies a first level of @@ -105,7 +105,7 @@ certain implicit intents. </p> -<img src="{@docRoot}preview/images/doze-diagram-2.png" +<img src="{@docRoot}images/android-7.0/doze-diagram-2.png" alt="" id="figure2" /> <p class="img-caption"> <strong>Figure 2.</strong> Illustration of how Doze applies a second level of @@ -128,7 +128,7 @@ certain implicit intents. <h3 id="bg-opt">Project Svelte: Background Optimizations</h3> <p> - Android N removes three implicit broadcasts in order to help optimize both + Android 7.0 removes three implicit broadcasts in order to help optimize both memory use and power consumption. This change is necessary because implicit broadcasts frequently start apps that have registered to listen for them in the background. Removing these broadcasts can substantially benefit device @@ -154,12 +154,12 @@ certain implicit intents. </p> <p> - To alleviate these issues, Android N applies the following + To alleviate these issues, Android 7.0 applies the following optimizations: </p> <ul> - <li>Apps targeting Android N do not receive {@link + <li>Apps targeting Android 7.0 do not receive {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION} broadcasts, even if they have manifest entries to request notification of these events. Apps that are running can still listen for {@code CONNECTIVITY_CHANGE} on their main thread @@ -169,12 +169,12 @@ certain implicit intents. <li>Apps cannot send or receive {@link android.hardware.Camera#ACTION_NEW_PICTURE} or {@link android.hardware.Camera#ACTION_NEW_VIDEO} broadcasts. This optimization - affects all apps, not only those targeting Android N. + affects all apps, not only those targeting Android 7.0. </li> </ul> <p>If your app uses any of these intents, you should remove dependencies - on them as soon as possible so that you can target Android N devices properly. + on them as soon as possible so that you can target Android 7.0 devices properly. The Android framework provides several solutions to mitigate the need for these implicit broadcasts. For example, the {@link android.app.job.JobScheduler} API provides a robust mechanism to schedule @@ -193,14 +193,14 @@ certain implicit intents. <h2 id="perm">Permissions Changes</h2> <p> - Android N includes changes to permissions that may affect your app. + Android 7.0 includes changes to permissions that may affect your app. </p> <h3 id="permfilesys">File system permission changes</h3> <p> In order to improve the security of private files, the private directory of - apps targeting Android N or higher has restricted access (<code>0700</code>). + apps targeting Android 7.0 or higher has restricted access (<code>0700</code>). This setting prevents leakage of metadata of private files, such as their size or existence. This permission change has multiple side effects: </p> @@ -232,7 +232,7 @@ certain implicit intents. stored files by filename. Legacy applications may end up with an unaccessible path when accessing {@link android.app.DownloadManager#COLUMN_LOCAL_FILENAME}. Apps targeting - Android N or higher trigger a {@link java.lang.SecurityException} when + Android 7.0 or higher trigger a {@link java.lang.SecurityException} when attempting to access {@link android.app.DownloadManager#COLUMN_LOCAL_FILENAME}. Legacy applications that set the download location to a public location by @@ -255,7 +255,7 @@ certain implicit intents. <h2 id="sharing-files">Sharing Files Between Apps</h2> <p> -For apps targeting Android N, the Android framework enforces +For apps targeting Android 7.0, the Android framework enforces the {@link android.os.StrictMode} API policy that prohibits exposing {@code file://} URIs outside your app. If an intent containing a file URI leaves your app, the app fails with a {@code FileUriExposedException} exception. @@ -272,7 +272,7 @@ see <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a <h2 id="accessibility">Accessibility Improvements</h2> <p> - Android N includes changes intended to improve the usability of the + Android 7.0 includes changes intended to improve the usability of the platform for users with low or impaired vision. These changes should generally not require code changes in your app, however you should review these feature and test them with your app to assess potential impacts to user @@ -283,7 +283,7 @@ see <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a <h3 id="screen-zoom">Screen Zoom</h3> <p> - Android N enables users to set <strong>Display size</strong>which magnifies + Android 7.0 enables users to set <strong>Display size</strong>which magnifies or shrinks all elements on the screen, thereby improving device accessibility for users with low vision. Users cannot zoom the screen past a minimum screen width of <a href= @@ -294,16 +294,16 @@ see <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a <div class="cols"> <div class="col-6"> - <img src="{@docRoot}preview/images/screen-zoom-1.png" alt="" height="XXX" id="figure1" /> + <img src="{@docRoot}images/android-7.0/screen-zoom-1.png" alt="" height="XXX" id="figure1" /> </div> <div class="col-6"> - <img src="{@docRoot}preview/images/screen-zoom-2.png" alt="" height="XXX" id="figure1" /> + <img src="{@docRoot}images/android-7.0/screen-zoom-2.png" alt="" height="XXX" id="figure1" /> </div> </div> <!-- end cols --> <p class="img-caption"> <strong>Figure 3.</strong> The screen on the right shows the effect of - increasing the Display size of a device running an Android N system image. + increasing the Display size of a device running an Android 7.0 system image. </p> @@ -323,7 +323,7 @@ see <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a Runtime Changes</a>, just as if the device's orientation had changed. </li> - <li>If an app targets Android N, all of its processes + <li>If an app targets Android 7.0, all of its processes (foreground and background) are notified of the configuration change as described in <a href= "{@docRoot}guide/topics/resources/runtime-changes.html">Handling @@ -365,7 +365,7 @@ see <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a <h3 id="vision-settings">Vision Settings in Setup Wizard</h3> <p> - Android N includes Vision Settings on the Welcome screen, where users can + Android 7.0 includes Vision Settings on the Welcome screen, where users can set up the following accessibility settings on a new device: <strong>Magnification gesture</strong>, <strong>Font size</strong>, <strong>Display size</strong> and <strong>TalkBack</strong>. This change @@ -378,13 +378,13 @@ see <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a <h2 id="ndk">NDK Apps Linking to Platform Libraries</h2> <p> - Starting in Android N, the system prevents apps from dynamically linking + Starting in Android 7.0, the system prevents apps from dynamically linking against non-NDK libraries, which may cause your app to crash. This change in behavior aims to create a consistent app experience across platform updates and different devices. Even though your code might not be linking against private libraries, it's possible that a third-party static library in your app could be doing so. Therefore, all developers should check to make sure - that their apps do not crash on devices running Android N. If your app uses + that their apps do not crash on devices running Android 7.0. If your app uses native code, you should only be using <a href= "{@docRoot}ndk/guides/stable_apis.html">public NDK APIs</a>. </p> @@ -595,7 +595,7 @@ see <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a <p> To help you identify issues loading private libraries, logcat may generate a warning or runtime error. For example, if your app targets API level 23 or - lower, and tries to access a private library on a device running Android N, + lower, and tries to access a private library on a device running Android 7.0, you may see a warning similar to the following: </p> @@ -626,7 +626,7 @@ java.lang.UnsatisfiedLinkError: dlopen failed: library "libcutils.so" <p> You may also see these logcat outputs if your app uses third-party libraries that dynamically link to private platform APIs. The readelf tool in the - Android NDK allows you to generate a list of all dynamically linked shared + Android 7.0DK allows you to generate a list of all dynamically linked shared libraries of a given <code>.so</code> file by running the following command: </p> @@ -692,7 +692,7 @@ JavaVM::AttachCurrentThread from <jni.h>. <h2 id="afw">Android for Work</h2> <p> - Android N contains changes for apps that target Android for Work, including + Android 7.0 contains changes for apps that target Android for Work, including changes to certificate installation, password resetting, secondary user management, and access to device identifiers. If you are building apps for Android for Work environments, you should review these changes and modify @@ -749,7 +749,7 @@ JavaVM::AttachCurrentThread from <jni.h>. DER-encoded format under a .crt or .cer file extension. </li> - <li>Starting in Android N, fingerprint enrollment and storage are managed per user. + <li>Starting in Android 7.0, fingerprint enrollment and storage are managed per user. If a profile owner’s Device Policy Client (DPC) targets pre-N on an N device, the user is still able to set fingerprint on the device, but work applications cannot access device fingerprint. When the DPC targets N and @@ -765,7 +765,7 @@ JavaVM::AttachCurrentThread from <jni.h>. is returned, even if the encryption key is specific to the user or profile. </li> - <li>In Android N, several methods that would ordinarily affect the entire + <li>In Android 7.0, several methods that would ordinarily affect the entire device behave differently if the device has a work profile installed with a separate work challenge. Rather than affecting the entire device, these methods apply only to the work profile. (The complete list of such methods is @@ -785,14 +785,14 @@ JavaVM::AttachCurrentThread from <jni.h>. </ul> <p> - For more information about changes to Android for Work in Android N, see + For more information about changes to Android for Work in Android 7.0, see <a href="{@docRoot}preview/features/afw.html">Android for Work Updates</a>. </p> <h2 id="annotations">Annotations Retention</h2> <p> -Android N fixes a bug where the visibility of annotations was being ignored. +Android 7.0 fixes a bug where the visibility of annotations was being ignored. This issue enabled the runtime to access annotations that it should not have been able to. These annotations included: </p> @@ -811,7 +811,7 @@ be available at runtime. You do so by using {@code @Retention(RetentionPolicy.RU <h2 id="other">Other Important Points</h2> <ul> -<li>When an app is running on Android N, but targets a lower API level, +<li>When an app is running on Android 7.0, but targets a lower API level, and the user changes display size, the app process is killed. The app must be able to gracefully handle this scenario. Otherwise, it crashes when the user restores it from Recents. @@ -830,7 +830,7 @@ however, they may still respond poorly to configuration changes. </li> <li> -Apps on Android N should be able to gracefully handle configuration changes, +Apps on Android 7.0 should be able to gracefully handle configuration changes, and should not crash on subsequent starts. You can verify app behavior by changing font size (<strong>Setting</strong> > <strong>Display</strong> > <strong>Font size</strong>), and then restoring @@ -839,7 +839,7 @@ the app from Recents. <li> Due to a bug in previous versions of Android, the system did not flag writing -to a TCP socket on the main thread as a strict-mode violation. Android N fixes this bug. +to a TCP socket on the main thread as a strict-mode violation. Android 7.0 fixes this bug. Apps that exhibit this behavior now throw an {@code android.os.NetworkOnMainThreadException}. Generally, performing network operations on the main thread is a bad idea because these operations usually have a high tail latency that causes ANRs and jank. @@ -860,7 +860,7 @@ as {@code RuntimeExceptions}, instead of silently logging or suppressing them. common example is storing too much data in {@link android.app.Activity#onSaveInstanceState Activity.onSaveInstanceState()}, which causes {@code ActivityThread.StopInfo} to throw a -{@code RuntimeException} when your app targets Android N. +{@code RuntimeException} when your app targets Android 7.0. </li> <li> @@ -881,7 +881,7 @@ to a window. This behavior fixes the following bugs: </li> <li> -If an app on Android N with +If an app on Android 7.0 with {@link android.Manifest.permission#DELETE_PACKAGES DELETE_PACKAGES} permission tries to delete a package, but a different app had installed that package, the system requires user confirmation. In this scenario, apps should expect diff --git a/docs/html/preview/samples.jd b/docs/html/about/versions/nougat/android-7.0-samples.jd index 1544d9c92a8b..98f7090bbb22 100644 --- a/docs/html/preview/samples.jd +++ b/docs/html/about/versions/nougat/android-7.0-samples.jd @@ -1,10 +1,10 @@ -page.title=Samples -page.tags="preview", "samples", "android" +page.title=Android 7.0 Samples +page.tags="Android 7.0", "nougat", "samples", "android" page.image=images/cards/card-n-samples_2x.png @jd:body <p> - The following code samples are provided for Android N. To + The following code samples are provided for Android 7.0. To download the samples in Android Studio, select the <b>File > Import Samples</b> menu option. </p> @@ -16,7 +16,7 @@ page.image=images/cards/card-n-samples_2x.png <h3 id="mw">Multi-Window Playground</h3> -<img src="{@docRoot}preview/images/sample-multiwindow.png" style="float: left; padding-right: 0.5em" height="250" width="156"/> +<img src="{@docRoot}images/android-7.0/sample-multiwindow.png" style="float: left; padding-right: 0.5em" height="250" width="156"/> <p> This sample demonstrates how to take advantage of multiple window user interfaces with your app. @@ -28,7 +28,7 @@ page.image=images/cards/card-n-samples_2x.png <div style="clear: both;"></div> <h3 id="an">Active Notifications</h3> -<img src="{@docRoot}preview/images/sample-activenotifications.png" style="float: left; padding-right: 0.5em" height="250" width="141" /> +<img src="{@docRoot}images/android-7.0/sample-activenotifications.png" style="float: left; padding-right: 0.5em" height="250" width="141" /> <p> This is a pre-existing sample which shows a simple service that sends notifications using NotificationCompat. Each unread conversation from a user @@ -45,7 +45,7 @@ page.image=images/cards/card-n-samples_2x.png <div style="clear: both;"></div> <h3 id="ms">Messaging Service</h3> -<img src="{@docRoot}preview/images/sample-messagingservice.png" style="float: left; padding-right: 0.5em" height="250" width="150" /> +<img src="{@docRoot}images/android-7.0/sample-messagingservice.png" style="float: left; padding-right: 0.5em" height="250" width="150" /> <p> This is a pre-existing sample which demonstrates how to use NotificationManager to tell how many notifications an application is currently @@ -62,7 +62,7 @@ page.image=images/cards/card-n-samples_2x.png <div style="clear: both;"></div> <h3 id="fbe">Direct Boot</h3> -<img src="{@docRoot}preview/images/sample-directboot.png" style="float: left; padding-right: 0.5em" height="250" width="141" /> +<img src="{@docRoot}images/android-7.0/sample-directboot.png" style="float: left; padding-right: 0.5em" height="250" width="141" /> <p> This sample demonstrates how to store and access data in a device encrypted storage which is always available while the device is booted. @@ -74,7 +74,7 @@ page.image=images/cards/card-n-samples_2x.png <div style="clear: both;"></div> <h3 id="sda">Scoped Directory Access</h3> -<img src="{@docRoot}preview/images/sample-scopeddirectoryaccess.png" style="float: left; padding-right: 0.5em" height="250" width="141" /> +<img src="{@docRoot}images/android-7.0/sample-scopeddirectoryaccess.png" style="float: left; padding-right: 0.5em" height="250" width="141" /> <p> This sample demonstrates how to read and write data from specific directories, while requiring fewer permissions. @@ -82,4 +82,4 @@ page.image=images/cards/card-n-samples_2x.png <p> <a href="https://github.com/googlesamples/android-ScopedDirectoryAccess"> Get it on GitHub</a> -</p>
\ No newline at end of file +</p> diff --git a/docs/html/preview/guide.jd b/docs/html/about/versions/nougat/android-7.0-testing.jd index 28c0fe9f7fd9..f30382e0decc 100644 --- a/docs/html/preview/guide.jd +++ b/docs/html/about/versions/nougat/android-7.0-testing.jd @@ -1,4 +1,4 @@ -page.title=Testing Guide +page.title=Android 7.0 Testing Guide page.image=images/cards/card-n-guide_2x.png meta.tags="preview", "testing" page.tags="preview", "developer preview" @@ -17,7 +17,7 @@ page.tags="preview", "developer preview" </div> <p> - Android N gives you an opportunity to ensure your apps work with the next + Android 7.0 gives you an opportunity to ensure your apps work with the next version of the platform. This preview includes a number of APIs and behavior changes that can impact your app, as described in the <a href="{@docRoot}preview/api-overview.html">API Overview</a> and <a href="{@docRoot}preview/behavior-changes.html">Behavior Changes</a>. In testing diff --git a/docs/html/preview/api-overview.jd b/docs/html/about/versions/nougat/android-7.0.jd index c7ffb7a06b76..87c8d936c9ab 100644 --- a/docs/html/preview/api-overview.jd +++ b/docs/html/about/versions/nougat/android-7.0.jd @@ -1,6 +1,6 @@ -page.title=Android N for Developers -meta.tags="preview", "androidn" -page.tags="preview", "developer preview" +page.title=Android 7.0 APIs +meta.tags="Android 7.0", "android n", "Nougat" +page.tags="Android 7.0", "Nougat", "android n", "developer preview" page.image=images/cards/card-n-apis_2x.png @jd:body @@ -51,29 +51,27 @@ page.image=images/cards/card-n-apis_2x.png -<p>Android N is still in active development, but you can try it -now as part of the N Developer Preview. The sections below highlight some of -the new features for developers. </p> - <p> - Make sure to check out the <a href= - "{@docRoot}preview/behavior-changes.html">Behavior Changes</a> to learn about - areas where platform changes may affect your apps, take a look at the - developer guides to learn more about key features, and download the <a href= - "{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a> for details on - new APIs. +Android 7.0 +(<a href="{@docRoot}reference/android/os/Build.VERSION_CODES.html#N">N</a>) +offers new features for users and app developers. This document provides +an introduction to the most notable APIs. Make sure, also, +to check out the <href="{@docRoot}about/versions/nougat/behavior.changes.html"> +Behavior Changes</a> to learn about areas where platform changes +may affect your apps. In addition, the various developer guides +can provide more information about key features. </p> <h2 id="multi-window_support">Multi-window Support</h2> -<p>In Android N, we're introducing a new and much-requested multitasking feature -into the platform — multi-window support. </p> +<p>In Android 7.0, we're introducing a new and much-requested +multitasking feature into the platform — multi-window support. </p> <p>Users can now pop open two apps on the screen at once. </p> <ul> <li>On phones and tablets -running Android N, users can run two apps side-by-side or +running Android 7.0, users can run two apps side-by-side or one-above-the-other in splitscreen mode. Users can resize the apps by dragging the divider between them. </li> @@ -84,7 +82,7 @@ interacts with other apps.</li> </ul> <div class="col-4of10"> -<img src="{@docRoot}preview/images/mw-portrait.png" alt="" style="height:460px;padding-left:1em;" +<img src="{@docRoot}images/android-7.0/mw-portrait.png" alt="" style="height:460px;padding-left:1em;" id="img-split-screen" /> <p class="img-caption"> <strong>Figure 1.</strong> Apps running in split-screen mode. @@ -111,8 +109,8 @@ that size. You can also disable multi-window display for your app, which <h2 id="notification_enhancements">Notification Enhancements</h2> -<p>In Android N we've redesigned notifications to make them easier and faster to -use. Some of the changes include:</p> +<p>In Android 7.0 we've redesigned notifications to make them easier and +faster to use. Some of the changes include:</p> <ul> <li> @@ -150,17 +148,17 @@ use. Some of the changes include:</p> </ul> <div class="col-4of12"> - <img src="{@docRoot}preview/images/notifications-1.png" alt="" + <img src="{@docRoot}images/android-7.0/notifications-1.png" alt="" style="padding:.5em;max-width:226px"> </div> <div class="col-4of12"> - <img src="{@docRoot}preview/images/notifications-3.png" alt="" + <img src="{@docRoot}images/android-7.0/notifications-3.png" alt="" style="padding:.5em;max-width:226px"> </div> <div class="col-4of12"> - <img src="{@docRoot}preview/images/notifications-2.png" alt="" + <img src="{@docRoot}images/android-7.0/notifications-2.png" alt="" style="padding:.5em;max-width:226px"> </div> @@ -177,17 +175,17 @@ use. Some of the changes include:</p> <h2 id="jit_aot">Profile-guided JIT/AOT Compilation</h2> -<p>In Android N, we've added a Just in Time (JIT) compiler with code profiling to -ART, which lets it constantly improve the performance of Android apps as they -run. The JIT compiler complements ART's current Ahead of Time (AOT) compiler -and helps improve runtime performance, save storage space, and speed up app -updates and system updates.</p> +<p>In Android 7.0, we've added a Just in Time (JIT) compiler with code +profiling to ART, which lets it constantly improve the performance of +Android apps as they run. The JIT compiler complements ART's current +Ahead of Time (AOT) compiler and helps improve runtime performance, save +storage space, and speed up app updates and system updates.</p> -<p>Profile-guided compilation lets ART manage the AOT/JIT compilation for each app -according to its actual usage, as well as conditions on the device. For -example, ART maintains a profile of each app's hot methods and can precompile -and cache those methods for best performance. It leaves other parts of the app -uncompiled until they are actually used.</p> +<p>Profile-guided compilation lets ART manage the AOT/JIT compilation for +each app according to its actual usage, as well as conditions on the device. +For example, ART maintains a profile of each app's hot methods and can +precompile and cache those methods for best performance. It leaves other parts +of the app uncompiled until they are actually used.</p> <p>Besides improving performance for key parts of the app, profile-guided compilation helps reduce an app's overall RAM footprint, including associated @@ -210,14 +208,14 @@ seconds. System updates are also faster, since there's no more optimizing step. apps' CPU and network activities when the device is idle, such as when it's sitting on a table or in a drawer. </p> -<p>Now in Android N, Doze takes a step further and saves battery while on the go. +<p>Now in Android 7.0, Doze takes a step further and saves battery while on the go. Any time the screen is off for a period of time and the device is unplugged, Doze applies a subset of the familiar CPU and network restrictions to apps. This means users can save battery even when carrying their devices in their pockets.</p> -<img src="/preview/images/doze-diagram-1.png" +<img src="/images/android-7.0/doze-diagram-1.png" alt="" id="figure1" /> <p class="img-caption"> <strong>Figure 3.</strong> Doze now applies @@ -245,7 +243,7 @@ your app to Doze</a> now.</p> <h2 id="background_optimizations">Project Svelte: Background Optimizations</h2> <p>Project Svelte is an ongoing effort to minimize RAM use by system and apps -across the range of Android devices in the ecosystem. In Android N, Project +across the range of Android devices in the ecosystem. In Android 7.0, Project Svelte is focused on optimizing the way apps run in the background. </p> <p>Background processing is an essential part of most apps. When handled right, it @@ -269,17 +267,17 @@ simplicity, and we want all apps to use it. </p> <p>We're continuing to extend <code>JobScheduler</code> and <code>GCMNetworkManager</code> to meet more of -your use cases — for example, in Android N you can now schedule background +your use cases — for example, in Android 7.0 you can now schedule background work based on changes in Content Providers. At the same time we're starting to deprecate some of the older patterns that can reduce system performance, especially on low-memory devices.</p> -<p>In Android N we're removing three commonly-used implicit broadcasts — +<p>In Android 7.0 we're removing three commonly-used implicit broadcasts — {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION}, {@link android.hardware.Camera#ACTION_NEW_PICTURE}, and {@link android.hardware.Camera#ACTION_NEW_VIDEO} — since those can wake the background processes of multiple apps at once and strain memory and battery. If -your app is receiving these, take advantage of the N Developer Preview to +your app is receiving these, take advantage of the Android 7.0 to migrate to <code>JobScheduler</code> and related APIs instead. </p> <p> @@ -290,7 +288,7 @@ your app is receiving these, take advantage of the N Developer Preview to <h2 id="surfaceview">SurfaceView</h2> <p> -Android N brings synchronous movement to the {@link android.view.SurfaceView} +Android 7.0 brings synchronous movement to the {@link android.view.SurfaceView} class, which provides better battery performance than {@link android.view.TextureView} in certain cases: When rendering video or 3D content, apps with scrolling and animated video position use less power with @@ -311,14 +309,14 @@ no longer produce black bars alongside the view as it moves. </p> <p> -Starting with Android N, we strongly recommend that you save power by using +Starting with Android 7.0, we strongly recommend that you save power by using {@link android.view.SurfaceView} instead of {@link android.view.TextureView}. </p> <h2 id="data_saver">Data Saver</h2> <div class="col-5of12" style="margin-right:1.5em;"> -<img src="{@docRoot}preview/images/datasaver.png" style="border:2px solid #ddd"> +<img src="{@docRoot}images/android-7.0/datasaver.png" style="border:2px solid #ddd"> <p class="img-caption" style="padding-right:2em;"> <strong>Figure 4.</strong> Data Saver in Settings. @@ -329,7 +327,7 @@ Starting with Android N, we strongly recommend that you save power by using exceeds the cost of the device itself. For many users, cellular data is an expensive resource that they want to conserve. </p> -<p>Android N introduces Data Saver mode, a new system service that helps reduce +<p>Android 7.0 introduces Data Saver mode, a new system service that helps reduce cellular data use by apps, whether roaming, near the end of the billing cycle, or on a small prepaid data pack. Data Saver gives users control over how apps use cellular data and lets developers provide more efficient service when Data @@ -342,7 +340,7 @@ bit rate for streaming, reducing image quality, deferring optimistic precaching, and so on. Users can whitelist specific apps to allow background metered data usage even when Data Saver is turned on.</p> -<p>Android N extends the {@link android.net.ConnectivityManager} to provide apps a +<p>Android 7.0 extends the {@link android.net.ConnectivityManager} to provide apps a way to <a href="{@docRoot}preview/features/data-saver.html#status">retrieve the user's Data Saver preferences</a> and <a href="{@docRoot}preview/features/data-saver.html#monitor-changes">monitor @@ -353,7 +351,7 @@ Saver and make an effort to limit foreground and background data usage.</p> <h2 id="vulkan">Vulkan API</h2> <p> - Android N integrates <a href="http://www.khronos.org/vulkan" class= + Android 7.0 integrates <a href="http://www.khronos.org/vulkan" class= "external-link">Vulkan™</a>, a new 3D rendering API, into the platform. Like <a href="https://www.khronos.org/opengles/" class="external-link">OpenGL™ ES</a>, Vulkan is an open standard for 3D graphics and rendering maintained @@ -368,7 +366,7 @@ Saver and make an effort to limit foreground and background data usage.</p> </p> <p> - Vulkan development tools and libraries are rolled into the Android NDK. They + Vulkan development tools and libraries are rolled into the Android 7.0DK. They include: </p> @@ -401,7 +399,7 @@ Saver and make an effort to limit foreground and background data usage.</p> <div style="float:right;max-width:320px"> -<img src="{@docRoot}preview/images/quicksettings.png" style="padding-left:1.5em;"> +<img src="{@docRoot}images/android-7.0/quicksettings.png" style="padding-left:1.5em;"> <p class="img-caption" style="padding-left:2em;"> <strong>Figure 5.</strong> Quick Settings tiles in the notification shade. @@ -409,7 +407,7 @@ Saver and make an effort to limit foreground and background data usage.</p> </div><p>Quick Settings is a popular and simple way to expose key settings and actions, -directly from the notification shade. In Android N, we've expanded the scope of +directly from the notification shade. In Android 7.0, we've expanded the scope of Quick Settings to make it even more useful and convenient. </p> <p>We've added more room for additional Quick Settings tiles, which users can @@ -417,7 +415,7 @@ access across a paginated display area by swiping left or right. We've also given users control over what Quick Settings tiles appear and where they are displayed — users can add or move tiles just by dragging and dropping them. </p> -<p>For developers, Android N also adds a new API that lets you define your own +<p>For developers, Android 7.0 also adds a new API that lets you define your own Quick Settings tiles to give users easy access to key controls and actions in your app.</p> <p> @@ -441,7 +439,7 @@ displayed — users can add or move tiles just by dragging and dropping them <h2 id="number-blocking">Number Blocking</h2> -<p>Android N now supports number blocking in the platform and provides a +<p>Android 7.0 now supports number blocking in the platform and provides a framework API to let service providers maintain a blocked-number list. The default SMS app, the default phone app, and carrier apps can read from and write to the blocked-number list. The list is not accessible to other apps.</p> @@ -471,7 +469,7 @@ through any medium, such as a VOIP endpoint or forwarding phones.</p> <h2 id="call_screening">Call Screening</h2> <p> - Android N allows the default phone app to screen incoming calls. The phone + Android 7.0 allows the default phone app to screen incoming calls. The phone app does this by implementing the new <code>CallScreeningService</code>, which allows the phone app to perform a number of actions based on an incoming call's {@link android.telecom.Call.Details Call.Details}, such as: @@ -493,20 +491,20 @@ through any medium, such as a VOIP endpoint or forwarding phones.</p> <h2 id="multi-locale_languages">Multi-locale Support, More Languages</h2> -<p>Android N now lets users select <strong>multiple locales</strong> in Settings, +<p>Android 7.0 now lets users select <strong>multiple locales</strong> in Settings, to better support bilingual use-cases. Apps can use a new API to get the user's selected locales and then offer more sophisticated user experiences for multi-locale users — such as showing search results in multiple languages and not offering to translate webpages in a language the user already knows.</p> -<p>Along with multi-locale support, Android N also expands the range of languages +<p>Along with multi-locale support, Android 7.0 also expands the range of languages available to users. It offers more than 25 variants each for commonly used languages such as English, Spanish, French, and Arabic. It also adds partial support for more than 100 new languages.</p> <p>Apps can get the list of locales set by the user by calling -<code>LocaleList.GetDefault()</code>. To support the expanded number of locales, Android N is +<code>LocaleList.GetDefault()</code>. To support the expanded number of locales, Android 7.0 is changing the way that it resolves resources. Make sure that you test and verify that your apps working as expected with the new resource resolution logic.</p> @@ -518,7 +516,7 @@ should follow, see <a href="{@docRoot}preview/features/multilingual-support.html <h2 id="emoji">New Emojis</h2> <p> - Android N introduces additional emojis and emoji-related features including + Android 7.0 introduces additional emojis and emoji-related features including skin tone emojis and support for variation selectors. If your app supports emojis, follow the guidelines below to take advantage of these emoji-related features. @@ -544,7 +542,7 @@ should follow, see <a href="{@docRoot}preview/features/multilingual-support.html Unicode documentation on variations</a>. </li> <li> - <strong>Check that an emoji supports skin tone.</strong> Android N allows users to modify the + <strong>Check that an emoji supports skin tone.</strong> Android 7.0 allows users to modify the rendered skin tone of emojis to their preference. Keyboard apps should provide visual indications for emojis that have multiple skin tones and should allow users to select the skin tone that they prefer. To determine which system emojis have @@ -560,7 +558,7 @@ should follow, see <a href="{@docRoot}preview/features/multilingual-support.html <h2 id="icu4">ICU4J APIs in Android</h2> <p> - Android N now offers a subset of <a href= + Android 7.0 now offers a subset of <a href= "http://site.icu-project.org/">ICU4J</a> APIs in the Android framework under the <code>android.icu</code> package. Migration is easy, and mostly entails simply changing from the <code>com.java.icu</code> namespace to @@ -579,7 +577,7 @@ should follow, see <a href="{@docRoot}preview/features/multilingual-support.html <h3>Chrome + WebView, Together</h3> <p> - Starting with Chrome version 51 on Android N and above, the Chrome APK on your device + Starting with Chrome version 51 on Android 7.0 and above, the Chrome APK on your device is used to provide and render Android System WebViews. This approach improves memory usage on the device itself and also reduces the bandwidth required to keep WebView up to date (as the standalone WebView APK will no longer be updated @@ -596,7 +594,7 @@ should follow, see <a href="{@docRoot}preview/features/multilingual-support.html <h3>Multiprocess</h3> <p> - Starting with Chrome version 51 in Android N, WebView will run web content in a + Starting with Chrome version 51 in Android 7.0, WebView will run web content in a separate sandboxed process when the developer option "Multiprocess WebView" is enabled. </p> @@ -617,7 +615,7 @@ should follow, see <a href="{@docRoot}preview/features/multilingual-support.html <h3>Javascript run before page load</h3> <p> - Starting with apps targeting Android N, the Javascript context will be reset + Starting with apps targeting Android 7.0, the Javascript context will be reset when a new page is loaded. Currently, the context is carried over for the first page loaded in a new WebView instance. </p> @@ -630,7 +628,7 @@ should follow, see <a href="{@docRoot}preview/features/multilingual-support.html <h3>Geolocation on insecure origins</h3> <p> - Starting with apps targeting Android N, the geolocation API will only be + Starting with apps targeting Android 7.0, the geolocation API will only be allowed on secure origins (over HTTPS.) This policy is designed to protect users’ private information when they’re using an insecure connection. </p> @@ -640,7 +638,7 @@ should follow, see <a href="{@docRoot}preview/features/multilingual-support.html <p> WebView is updated regularly, so we recommend that you test compatibility with your app frequently using WebView’s beta channel. To get started testing - pre-release versions of WebView on Android N, download and install either + pre-release versions of WebView on Android 7.0, download and install either Chrome Dev or Chrome Beta, and select it as the WebView implementation under developer options as described above. Please report issues via the <a href= "https://bugs.chromium.org/p/chromium/issues/entry?template=Webview%20Bugs">Chromium @@ -656,7 +654,7 @@ should follow, see <a href="{@docRoot}preview/features/multilingual-support.html <h2 id="gles_32">OpenGL™ ES 3.2 API</h2> -<p>Android N adds framework interfaces and platform support for OpenGL ES 3.2, including:</p> +<p>Android 7.0 adds framework interfaces and platform support for OpenGL ES 3.2, including:</p> <ul> <li> All extensions from the <a class="external-link" @@ -667,7 +665,7 @@ Android Extension Pack</a></a> (AEP) except for <code>EXT_texture_sRGB_decode</c <li> Robust buffer access control to reduce WebGL overhead. </ul> -<p>The framework API for OpenGL ES 3.2 on Android N is provided with the +<p>The framework API for OpenGL ES 3.2 on Android 7.0 is provided with the <code>GLES32</code> class. When using OpenGL ES 3.2, be sure to declare the requirement in your manifest file, using the <code><uses-feature></code> tag and the <code>android:glEsVersion</code> attribute. </p> @@ -679,7 +677,7 @@ href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL ES API guide</a>.</p> <h2 id="android_tv_recording">Android TV Recording</h2> -<p>Android N adds the ability to record and playback content from Android TV input +<p>Android 7.0 adds the ability to record and playback content from Android TV input services via new recording APIs. Building on top of existing time-shifting APIs, TV input services can control what channel data can be recorded, how recorded sessions are saved, and manage user interaction with recorded content. </p> @@ -690,7 +688,7 @@ href="{@docRoot}preview/features/tv-recording-api.html">Android TV Recording API <h2 id="android_for_work">Android for Work</h2> -<p>Android for Work adds many new features and APIs for devices running Android N. +<p>Android for Work adds many new features and APIs for devices running Android 7.0. Some highlights are below — for a complete list of changes, see <a href="{@docRoot}preview/features/afw.html">Android for Work Updates</a>.</p> @@ -763,7 +761,7 @@ action <code>android.net.VpnService</code>. </p> <h2 id="accessibility_enhancements">Accessibility Enhancements</h2> -<p>Android N now offers Vision Settings directly on the Welcome screen for new +<p>Android 7.0 now offers Vision Settings directly on the Welcome screen for new device setup. This makes it much easier for users to discover and configure accessibility features on their devices, including magnification gesture, font size, display size, and TalkBack. </p> @@ -773,7 +771,7 @@ are more likely to try your app with them enabled. Make sure you test your apps early with these settings enabled. You can enable them from Settings > Accessibility.</p> -<p>Also in Android N, accessibility services can now help users with motor +<p>Also in Android 7.0, accessibility services can now help users with motor impairments to touch the screen. The new API allows building services with features such as face-tracking, eye-tracking, point scanning, and so on, to meet the needs of those users.</p> @@ -791,7 +789,7 @@ registered alarms, messages and incoming calls can now continue to notify the user as normal. This also means accessibility services can also be available immediately after a restart.</p> -<p>Direct boot takes advantage of file based encryption in Android N +<p>Direct boot takes advantage of file based encryption in Android 7.0 to enable fine grained encryption policies for both system and app data. The system uses a device-encrypted store for select system data and explicitly registered app data. By default a credential-encrypted store is used for all @@ -812,7 +810,7 @@ For more information, see <a href="{@docRoot}preview/features/direct-boot.html"> <h2 id="key_attestation">Key Attestation</h2> <p> - Android N introduces <em>key attestation</em>, a new security tool that helps + Android 7.0 introduces <em>key attestation</em>, a new security tool that helps you make sure that the key pairs stored within a device's <a class= "external-link" href= "https://source.android.com/security/keystore/"><em>hardware-backed @@ -836,8 +834,8 @@ For more information, see <a href="{@docRoot}preview/features/direct-boot.html"> </p> <p class="note"> - <strong>Note: </strong>Only a small number of devices running Android N - support hardware-level key attestation; all other devices running Android N + <strong>Note: </strong>Only a small number of devices running Android 7.0 + support hardware-level key attestation; all other devices running Android 7.0 use software-level key attestation instead. Before you verify the properties of a device's hardware-backed keys in a production-level environment, you should make sure that the device supports hardware-level key attestation. To @@ -857,7 +855,7 @@ For more information, see <a href="{@docRoot}preview/features/direct-boot.html"> <h2 id="network_security_config">Network Security Config</h2> -<p>In Android N, apps can customize the behavior of their secure (HTTPS, TLS) +<p>In Android 7.0, apps can customize the behavior of their secure (HTTPS, TLS) connections safely, without any code modification, by using the declarative <em>Network Security Config</em> instead of using the conventional error-prone programmatic APIs (e.g. X509TrustManager).</p> @@ -884,7 +882,7 @@ Config</a>.</p> <h2 id="default_trusted_ca">Default Trusted Certificate Authority</h2> -<p>By default, apps that target Android N only trust system-provided certificates +<p>By default, apps that target Android 7.0 only trust system-provided certificates and no longer trust user-added Certificate Authorities (CA). Apps targeting Android N that wish to trust user-added CAs should use the <a href="{@docRoot}preview/features/security-config.html">Network Security Config</a> to @@ -893,7 +891,7 @@ specify how user CAs should be trusted.</p> <h2 id="apk_signature_v2">APK Signature Scheme v2</h2> <p> - Android N introduces APK Signature Scheme v2, a new app-signing scheme that + Android 7.0 introduces APK Signature Scheme v2, a new app-signing scheme that offers faster app install times and more protection against unauthorized alterations to APK files. By default, Android Studio 2.2 and the Android Plugin for Gradle 2.2 sign your app using both APK Signature Scheme v2 and @@ -943,7 +941,7 @@ specify how user CAs should be trusted.</p> <h2 id="scoped_directory_access">Scoped Directory Access</h2> -<p>In Android N, apps can use new APIs to request access to specific <a +<p>In Android 7.0, apps can use new APIs to request access to specific <a href="{@docRoot}guide/topics/data/data-storage.html#filesExternal">external storage</a> directories, including directories on removable media such as SD cards. The new APIs greatly simplify how your application accesses standard @@ -965,7 +963,7 @@ Directory Access</a> developer documentation.</p> <h2 id="keyboard_shortcuts_helper">Keyboard Shortcuts Helper</h2> <p> - In Android N, the user can press <strong>Meta + /</strong> to trigger a + In Android 7.0, the user can press <strong>Meta + /</strong> to trigger a <em>Keyboard Shortcuts</em> screen that displays all shortcuts available both from the system and from the app in focus. The system retrieves these shortcuts automatically from the app’s menu if the shortcuts exist. You can @@ -992,7 +990,7 @@ Directory Access</a> developer documentation.</p> </h2> <p> - Android N introduces the Custom Pointer API, which lets you customize the + Android 7.0 introduces the Custom Pointer API, which lets you customize the appearance, visibility, and behavior of the pointer. This capability is especially useful when a user is using a mouse or touchpad to interact with UI objects. The default pointer uses a standard icon. This API also includes @@ -1017,7 +1015,7 @@ developers creating high-performance, long-running apps. </p> <p> -To address these limitations, Android N includes support for +To address these limitations, Android 7.0 includes support for <em>sustained performance mode</em>, enabling OEMs to provide hints about device-performance capabilities for long-running apps. App developers can use these hints to tune apps for a predictable, @@ -1025,7 +1023,7 @@ consistent level of device performance over long periods of time. </p> <p> -App developers can try out this new API in the N Developer Preview on +App developers can try out this new API in Android 7.0 on Nexus 6P devices only. To use this feature, set the sustained performance window flag for the window you want to run in sustained performance mode. Set this flag using the @@ -1036,12 +1034,12 @@ disables this mode when the window is no longer in focus. <h2 id="vr">VR Support</h2> <p> -Android N adds platform support and optimizations for a new VR Mode to let developers +Android 7.0 adds platform support and optimizations for a new VR Mode to let developers build high-quality mobile VR experiences for users. There are a number of performance enhancements, including access to an exclusive CPU core for VR apps. Within your apps, you can take advantage of intelligent head-tracking, -and stereo notifications that work for VR. Most importantly, Android N provides for -very low latency graphics. For complete information about building VR apps for Android N, +and stereo notifications that work for VR. Most importantly, Android 7.0 provides for +very low latency graphics. For complete information about building VR apps for Android 7.0, see the <a href="https://developers.google.com/vr/android/">Google VR SDK for Android</a>. </p> @@ -1049,7 +1047,7 @@ see the <a href="https://developers.google.com/vr/android/">Google VR SDK for An <h2 id="print_svc">Print Service Enhancements</h2> <p> - In Android N, print service developers can now surface additional information + In Android 7.0, print service developers can now surface additional information about individual printers and print jobs. </p> @@ -1138,11 +1136,11 @@ The supported metrics are: {@code UNKNOWN_DELAY_DURATION}, </p> <p> - Android N adds the concept of <em>virtual files</em> to the Storage Access + Android 7.0 adds the concept of <em>virtual files</em> to the Storage Access Framework. The virtual files feature allows your {@link android.provider.DocumentsProvider} to return document URIs that can be used with an {@link android.content.Intent#ACTION_VIEW} intent even if they - don't have a direct bytecode representation. Android N also allows you to + don't have a direct bytecode representation. Android 7.0 also allows you to provide alternate formats for user files, virtual or otherwise. </p> diff --git a/docs/html/preview/index.jd b/docs/html/about/versions/nougat/index.jd index 241a98e737a0..aaf7e92d55ab 100644 --- a/docs/html/preview/index.jd +++ b/docs/html/about/versions/nougat/index.jd @@ -22,10 +22,9 @@ footer.hide=1 <div class="cols dac-hero-content" style="padding-bottom:1em;"> <div class="col-7of16 col-push-9of16" style="padding-left:2em"> - <h1 class="dac-hero-title">Android N Developer Preview</h1> + <h1 class="dac-hero-title">Android 7.0 Nougat</h1> <p class="dac-hero-description"> - <strong>Android N final SDK is now available!</strong> - Get ready for Android N! + <strong>Android 7.0 Nougat brings a new crop of sweet features to your Android device.</strong> <strong>Test your apps</strong> on Nexus and other devices. Support new system behaviors to <strong>save power and memory</strong>. Extend your apps with <strong>multi-window UI</strong>, @@ -49,9 +48,9 @@ footer.hide=1 </div> <div class="dac-section dac-small"> <div class="resource-widget resource-flow-layout col-16" - data-query="collection:preview/landing/resources" + data-query="collection:nougat/landing/resources" data-cardSizes="6x2" - data-maxResults="6"></div> + data-maxResults="3"></div> </div> </div> </section> @@ -128,7 +127,8 @@ footer.hide=1 data-cardSizes="6x6" data-items-per-page="6" data-maxResults="15" - data-initial-results="3"></div> + data-initial-results="3"> + </div> </div></section> diff --git a/docs/html/distribute/googleplay/developer-console.jd b/docs/html/distribute/googleplay/developer-console.jd index c826e82ca6f2..5a6c96fcb80e 100644 --- a/docs/html/distribute/googleplay/developer-console.jd +++ b/docs/html/distribute/googleplay/developer-console.jd @@ -10,30 +10,30 @@ Xnonavpage=true <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 @@ Xnonavpage=true <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,103 +54,110 @@ Xnonavpage=true 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> + + <h3 id="cloud-test">Cloud Test Lab</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>. + Get free automated testing of your app on physical devices covering + nearly every brand, model, and version of the devices your users might + 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= + "external-link">Learn more and sign up for updates.</a> </p> </div> <div class="col-8of12 col-push-1of12"> <img src= - "{@docRoot}images/distribute/googleplay/dev-console_running-a-beta-test.png" + "{@docRoot}images/distribute/googleplay/dev-console_cloud-test-lab.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" + "{@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="cloud-test">Cloud Test Lab</h3> + <h3 id="alpha-beta">Alpha and beta tests</h3> <div class="cols" style="margin-top:2em;"> <div class="col-3of12"> <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 - Developer Console to become an early tester before this feature becomes - more widely available. <a href= - "https://developers.google.com/cloud-test-lab/" class= - "external-link">Learn more and sign up for updates.</a> + 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_cloud-test-lab.png" + "{@docRoot}images/distribute/googleplay/dev-console_running-a-beta-test.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_running-a-beta-test.png 1x, + {@docRoot}images/distribute/googleplay/dev-console_running-a-beta-test_2x.png 2x" width="500"> </div> </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 @@ Xnonavpage=true <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 @@ Xnonavpage=true <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 @@ Xnonavpage=true <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 @@ Xnonavpage=true <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 @@ Xnonavpage=true <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/google/play/billing/billing_overview.jd b/docs/html/google/play/billing/billing_overview.jd index a05cc8d76992..7d932b7058ad 100644 --- a/docs/html/google/play/billing/billing_overview.jd +++ b/docs/html/google/play/billing/billing_overview.jd @@ -7,19 +7,20 @@ parent.link=index.html <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 @@ same look-and-feel as for app purchases.</li> <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 @@ exposed by the Google Play app that is installed on the device. The Google Play 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 @@ products and product list, see 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 @@ processing the financial transaction.</p> <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 @@ provides a sample application that demonstrates how to sell in-app products and 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 @@ and Design</a>.</p> <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 ccf50fc601c3..4fe1abfc4aa3 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 @@ meta.tags="monetization, inappbilling, promotions" <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 @@ meta.tags="monetization, inappbilling, promotions" <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 @@ meta.tags="monetization, inappbilling, promotions" <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 @@ meta.tags="monetization, inappbilling, promotions" <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 @@ meta.tags="monetization, inappbilling, promotions" <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 @@ meta.tags="monetization, inappbilling, promotions" 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 @@ meta.tags="monetization, inappbilling, promotions" 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 @@ meta.tags="monetization, inappbilling, promotions" <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 @@ registerReceiver(myPromoReceiver, promoFilter);</pre> <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 @@ registerReceiver(myPromoReceiver, promoFilter);</pre> 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 @@ registerReceiver(myPromoReceiver, promoFilter);</pre> 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 @@ registerReceiver(myPromoReceiver, promoFilter);</pre> <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 @@ registerReceiver(myPromoReceiver, promoFilter);</pre> <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 @@ registerReceiver(myPromoReceiver, promoFilter);</pre> <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/guide/platform/Images/android-stack_2x.png b/docs/html/guide/platform/images/android-stack_2x.png Binary files differindex 33bb14414d91..33bb14414d91 100644 --- a/docs/html/guide/platform/Images/android-stack_2x.png +++ b/docs/html/guide/platform/images/android-stack_2x.png diff --git a/docs/html/guide/topics/resources/complex-xml-resources.jd b/docs/html/guide/topics/resources/complex-xml-resources.jd index 66dcb58347ab..ebf7bc3f0228 100644 --- a/docs/html/guide/topics/resources/complex-xml-resources.jd +++ b/docs/html/guide/topics/resources/complex-xml-resources.jd @@ -93,8 +93,7 @@ Since we’re making an animated vector drawable, we put the file under <code>re </vector> <strong><aapt:attr /></strong> - <target - android:name="rotationGroup" /> + <target android:name="rotationGroup"> <strong><aapt:attr name="android:animation" ></strong> <objectAnimator android:duration="6000" @@ -102,6 +101,7 @@ Since we’re making an animated vector drawable, we put the file under <code>re android:valueFrom="0"
android:valueTo="360" /> <strong><aapt:attr></strong> + </target> </animated-vector> </pre> </dd> diff --git a/docs/html/preview/images/datasaver.png b/docs/html/images/android-7.0/datasaver.png Binary files differindex c5a58fb1f39b..c5a58fb1f39b 100644 --- a/docs/html/preview/images/datasaver.png +++ b/docs/html/images/android-7.0/datasaver.png diff --git a/docs/html/preview/images/doze-diagram-1.png b/docs/html/images/android-7.0/doze-diagram-1.png Binary files differindex 08144479f559..08144479f559 100644 --- a/docs/html/preview/images/doze-diagram-1.png +++ b/docs/html/images/android-7.0/doze-diagram-1.png diff --git a/docs/html/preview/images/doze-diagram-2.png b/docs/html/images/android-7.0/doze-diagram-2.png Binary files differindex c20c6cb2e323..c20c6cb2e323 100644 --- a/docs/html/preview/images/doze-diagram-2.png +++ b/docs/html/images/android-7.0/doze-diagram-2.png diff --git a/docs/html/preview/images/m-preview-timeline-crop.png b/docs/html/images/android-7.0/m-preview-timeline-crop.png Binary files differindex 724a6af8bc51..724a6af8bc51 100644 --- a/docs/html/preview/images/m-preview-timeline-crop.png +++ b/docs/html/images/android-7.0/m-preview-timeline-crop.png diff --git a/docs/html/preview/images/m-preview-timeline.png b/docs/html/images/android-7.0/m-preview-timeline.png Binary files differindex e9a339ef8276..e9a339ef8276 100644 --- a/docs/html/preview/images/m-preview-timeline.png +++ b/docs/html/images/android-7.0/m-preview-timeline.png diff --git a/docs/html/preview/images/mw-portrait.png b/docs/html/images/android-7.0/mw-portrait.png Binary files differindex e752387f11c3..e752387f11c3 100644 --- a/docs/html/preview/images/mw-portrait.png +++ b/docs/html/images/android-7.0/mw-portrait.png diff --git a/docs/html/preview/images/mw-splitscreen.png b/docs/html/images/android-7.0/mw-splitscreen.png Binary files differindex bf719997635d..bf719997635d 100644 --- a/docs/html/preview/images/mw-splitscreen.png +++ b/docs/html/images/android-7.0/mw-splitscreen.png diff --git a/docs/html/preview/images/mw-splitscreen_2x.png b/docs/html/images/android-7.0/mw-splitscreen_2x.png Binary files differindex 38114db497aa..38114db497aa 100644 --- a/docs/html/preview/images/mw-splitscreen_2x.png +++ b/docs/html/images/android-7.0/mw-splitscreen_2x.png diff --git a/docs/html/preview/images/n-preview-setup.png b/docs/html/images/android-7.0/n-preview-setup.png Binary files differindex 612e0316bc96..612e0316bc96 100644 --- a/docs/html/preview/images/n-preview-setup.png +++ b/docs/html/images/android-7.0/n-preview-setup.png diff --git a/docs/html/preview/images/quicksettings.png b/docs/html/images/android-7.0/quicksettings.png Binary files differindex 68e1f740a6d2..68e1f740a6d2 100644 --- a/docs/html/preview/images/quicksettings.png +++ b/docs/html/images/android-7.0/quicksettings.png diff --git a/docs/html/preview/images/sample-activenotifications.png b/docs/html/images/android-7.0/sample-activenotifications.png Binary files differindex 8817469feb9d..8817469feb9d 100644 --- a/docs/html/preview/images/sample-activenotifications.png +++ b/docs/html/images/android-7.0/sample-activenotifications.png diff --git a/docs/html/preview/images/sample-directboot.png b/docs/html/images/android-7.0/sample-directboot.png Binary files differindex cc409d381263..cc409d381263 100644 --- a/docs/html/preview/images/sample-directboot.png +++ b/docs/html/images/android-7.0/sample-directboot.png diff --git a/docs/html/preview/images/sample-messagingservice.png b/docs/html/images/android-7.0/sample-messagingservice.png Binary files differindex 0d8fb3e6e10c..0d8fb3e6e10c 100644 --- a/docs/html/preview/images/sample-messagingservice.png +++ b/docs/html/images/android-7.0/sample-messagingservice.png diff --git a/docs/html/preview/images/sample-multiwindow.png b/docs/html/images/android-7.0/sample-multiwindow.png Binary files differindex 979bf619f5e8..979bf619f5e8 100644 --- a/docs/html/preview/images/sample-multiwindow.png +++ b/docs/html/images/android-7.0/sample-multiwindow.png diff --git a/docs/html/preview/images/sample-scopeddirectoryaccess.png b/docs/html/images/android-7.0/sample-scopeddirectoryaccess.png Binary files differindex 58515dcac0b3..58515dcac0b3 100644 --- a/docs/html/preview/images/sample-scopeddirectoryaccess.png +++ b/docs/html/images/android-7.0/sample-scopeddirectoryaccess.png diff --git a/docs/html/images/android-7.0/scoped-folder-access-dont-ask.png b/docs/html/images/android-7.0/scoped-folder-access-dont-ask.png Binary files differnew file mode 100644 index 000000000000..5c505d956f5e --- /dev/null +++ b/docs/html/images/android-7.0/scoped-folder-access-dont-ask.png diff --git a/docs/html/images/android-7.0/scoped-folder-access-dont-ask_2x.png b/docs/html/images/android-7.0/scoped-folder-access-dont-ask_2x.png Binary files differnew file mode 100644 index 000000000000..612b69f8926f --- /dev/null +++ b/docs/html/images/android-7.0/scoped-folder-access-dont-ask_2x.png diff --git a/docs/html/images/android-7.0/scoped-folder-access-framed.png b/docs/html/images/android-7.0/scoped-folder-access-framed.png Binary files differnew file mode 100644 index 000000000000..0169e4196aff --- /dev/null +++ b/docs/html/images/android-7.0/scoped-folder-access-framed.png diff --git a/docs/html/images/android-7.0/scoped-folder-access-framed_2x.png b/docs/html/images/android-7.0/scoped-folder-access-framed_2x.png Binary files differnew file mode 100644 index 000000000000..fd59ef17d94c --- /dev/null +++ b/docs/html/images/android-7.0/scoped-folder-access-framed_2x.png diff --git a/docs/html/preview/images/screen-zoom-1.png b/docs/html/images/android-7.0/screen-zoom-1.png Binary files differindex f62d04e2a186..f62d04e2a186 100644 --- a/docs/html/preview/images/screen-zoom-1.png +++ b/docs/html/images/android-7.0/screen-zoom-1.png diff --git a/docs/html/preview/images/screen-zoom-2.png b/docs/html/images/android-7.0/screen-zoom-2.png Binary files differindex 172b5b3dc3b2..172b5b3dc3b2 100644 --- a/docs/html/preview/images/screen-zoom-2.png +++ b/docs/html/images/android-7.0/screen-zoom-2.png diff --git a/docs/html/preview/images/studio-jdk-location.jpg b/docs/html/images/android-7.0/studio-jdk-location.jpg Binary files differindex 1b1ba2357726..1b1ba2357726 100644 --- a/docs/html/preview/images/studio-jdk-location.jpg +++ b/docs/html/images/android-7.0/studio-jdk-location.jpg diff --git a/docs/html/jd_extras_en.js b/docs/html/jd_extras_en.js index ef94cc415a5a..c79ad88524fd 100644 --- a/docs/html/jd_extras_en.js +++ b/docs/html/jd_extras_en.js @@ -5556,15 +5556,12 @@ METADATA['en'].collections = { "https://medium.com/google-developers/writing-more-code-by-writing-less-code-with-android-studio-live-templates-244f648d17c7#.hczcm02du", ] }, - "preview/landing/resources": { + "nougat/landing/resources": { "title": "", "resources": [ - "preview/overview.html", - "preview/api-overview.html", - "preview/behavior-changes.html", - "preview/setup-sdk.html", - "preview/samples.html", - "preview/support.html" + "about/versions/nougat/api-overview.html", + "about/versions/nougat/behavior-changes.html", + "about/versions/nougat/samples.html", ] }, diff --git a/docs/html/preview/_book.yaml b/docs/html/preview/_book.yaml deleted file mode 100644 index a3458ddeaf6c..000000000000 --- a/docs/html/preview/_book.yaml +++ /dev/null @@ -1,323 +0,0 @@ -toc: -- title: Program Overview - path: /preview/overview.html - path_attributes: - - name: es-lang - value: Información general del programa - - name: in-lang - value: Ikhtisar Program - - name: ja-lang - value: プログラム概要 - - name: ko-lang - value: 프로그램 개요 - - name: pt-br-lang - value: Visão geral do programa - - name: ru-lang - value: Обзор программы - - name: vi-lang - value: Tổng quan về Chương trình - - name: zh-cn-lang - value: 计划概览 - - name: zh-tw-lang - value: 程式總覽 - -- title: Support and Release Notes - path: /preview/support.html - -- title: Set Up the Preview - path: /preview/setup-sdk.html - path_attributes: - - name: es-lang - value: Configurar el SDK de la versión preliminar - - name: in-lang - value: Menyiapkan Preview - - name: ja-lang - value: Preview SDK のセットアップ - - name: ko-lang - value: 미리 보기 SDK 설정하기 - - name: pt-br-lang - value: Configuração do Preview SDK - - name: ru-lang - value: Настройка пакета SDK Preview - - name: vi-lang - value: Kiểm thử trên Thiết bị - - name: zh-cn-lang - value: 设置预览版 SDK - - name: zh-tw-lang - value: 設定預覽版 SDK - -- title: Test on a Device - path: /preview/download.html - path_attributes: - - name: es-lang - value: Pruebe en un dispositivo - - name: in-lang - value: Menguji pada Perangkat - - name: ja-lang - value: デバイス上でテストする - - name: ko-lang - value: 기기에서 테스트 - - name: pt-br-lang - value: Testar em um dispositivo - - name: ru-lang - value: Тестирование на устройстве - - name: vi-lang - value: Kiểm thử trên Thiết bị - - name: zh-cn-lang - value: 在设备上测试 - - name: zh-tw-lang - value: 在裝置上測試 - -- title: Behavior Changes - path: /preview/behavior-changes.html - path_attributes: - - name: es-lang - value: Cambios en los comportamientos - - name: in-lang - value: Perubahan Perilaku - - name: ja-lang - value: 動作の変更点 - - name: ko-lang - value: 동작 변경 - - name: pt-br-lang - value: Mudanças de comportamento - - name: ru-lang - value: Изменения в работе - - name: vi-lang - value: Các thay đổi Hành vi - - name: zh-cn-lang - value: 行为变更 - - name: zh-tw-lang - value: 行為變更 - section: - - title: Background Optimizations - path: /preview/features/background-optimization.html - path_attributes: - - name: es-lang - value: Optimizaciones en segundo plano - - name: in-lang - value: Optimisasi Latar Belakang - - name: ja-lang - value: バックグラウンド処理の最適化 - - name: ko-lang - value: 백그라운드 최적화 - - name: pt-br-lang - value: Otimizações em segundo plano - - name: ru-lang - value: Оптимизация фоновых процессов - - name: vi-lang - value: Tối ưu hóa Chạy ngầm - - name: zh-cn-lang - value: 后台优化 - - name: zh-tw-lang - value: 背景最佳化 - - title: Language and Locale - path: /preview/features/multilingual-support.html - path_attributes: - - name: es-lang - value: Idioma y configuración regional - - name: in-lang - value: Bahasa dan Lokal - - name: ja-lang - value: 言語とロケール - - name: ko-lang - value: 언어 및 로케일 - - name: pt-br-lang - value: Idioma e localidade - - name: ru-lang - value: Язык и языковой стандарт - - name: vi-lang - value: Ngôn ngữ và Bản địa - - name: zh-cn-lang - value: 语言和区域设置 - - name: zh-tw-lang - value: 語言和地區設定 - -- title: Android N for Developers - path: /preview/api-overview.html - path_attributes: - - name: es-lang - value: Información general de la API - - name: in-lang - value: Android N untuk Pengembang - - name: ja-lang - value: API の概要 - - name: ko-lang - value: API 개요 - - name: pt-br-lang - value: Visão geral da API - - name: ru-lang - value: Обзор API-интерфейсов - - name: vi-lang - value: Android N cho Nhà phát triển - - name: zh-cn-lang - value: API 概览 - - name: zh-tw-lang - value: API 總覽 - section: - - title: Multi-Window Support - path: /preview/features/multi-window.html - path_attributes: - - name: es-lang - value: Compatibilidad con ventanas múltiples - - name: in-lang - value: Dukungan Multi-Jendela - - name: ja-lang - value: マルチ ウィンドウのサポート - - name: ko-lang - value: 다중 창 지원 - - name: pt-br-lang - value: Suporte a várias janelas - - name: ru-lang - value: Поддержка многооконного режима - - name: vi-lang - value: Hỗ trợ đa cửa sổ - - name: zh-cn-lang - value: 多窗口支持 - - name: zh-tw-lang - value: 多視窗支援 - - title: Notifications - path: /preview/features/notification-updates.html - path_attributes: - - name: es-lang - value: Notificaciones - - name: in-lang - value: Pemberitahuan - - name: ja-lang - value: 通知 - - name: ko-lang - value: 알림 - - name: pt-br-lang - value: Notificações - - name: ru-lang - value: Уведомления - - name: vi-lang - value: Thông báo - - name: zh-cn-lang - value: 通知 - - name: zh-tw-lang - value: 通知 - - title: Data Saver - path: /preview/features/data-saver.html - - title: TV Recording - path: /preview/features/tv-recording-api.html - path_attributes: - - name: es-lang - value: Grabación de TV - - name: in-lang - value: Perekaman TV - - name: ja-lang - value: TV の録画 - - name: ko-lang - value: TV 녹화 - - name: pt-br-lang - value: Gravação para TV - - name: ru-lang - value: Запись ТВ - - name: vi-lang - value: Ghi lại TV - - name: zh-cn-lang - value: TV 录制 - - name: zh-tw-lang - value: 電視錄製 - - title: Key Attestation - path: /preview/features/key-attestation.html - - title: Network Security Configuration - path: /preview/features/security-config.html - path_attributes: - - name: es-lang - value: Configuración de seguridad de la red - - name: ja-lang - value: ネットワーク セキュリティ構成 - - name: ko-lang - value: 네트워크 보안 구성 - - name: pt-br-lang - value: Configurações de segurança de rede - - name: ru-lang - value: Конфигурация сетевой безопасности - - name: vi-lang - value: Cấu hình Bảo mật mạng - - name: zh-cn-lang - value: 网络安全配置 - - name: zh-tw-lang - value: 網路安全性設定 - - title: ICU4J Support - path: /preview/features/icu4j-framework.html - path_attributes: - - name: es-lang - value: API de ICU4J del framework de Android - - name: in-lang - value: ICU4J Android Framework API - - name: ja-lang - value: ICU4J Android フレームワーク API - - name: ko-lang - value: ICU4J Android 프레임워크 API - - name: pt-br-lang - value: APIs de estrutura do Android para ICU4J - - name: ru-lang - value: API-интерфейсы ICU4J в платформе Android - - name: vi-lang - value: API Khuôn khổ Android ICU4J - - name: zh-cn-lang - value: ICU4J Android 框架 API - - name: zh-tw-lang - value: ICU4J Android 架構 API - - title: Android for Work Updates - path: /preview/features/afw.html - - title: Scoped Directory Access - path: /preview/features/scoped-folder-access.html - path_attributes: - - name: es-lang - value: Acceso a directorios determinados - - name: ja-lang - value: 特定のディレクトリへのアクセス - - name: ko-lang - value: 범위가 지정된 디렉터리 액세스 - - name: pt-br-lang - value: Acesso a diretórios com escopo - - name: ru-lang - value: Доступ к выделенным каталогам - - name: vi-lang - value: Truy cập Thư mục theo Phạm vi - - name: zh-cn-lang - value: 作用域目录访问 - - name: zh-tw-lang - value: 限定範圍目錄存取 - -- title: Samples - path: /preview/samples.html - path_attributes: - - name: es-lang - value: Ejemplos - - name: in-lang - value: Contoh - - name: ja-lang - value: サンプル - - name: ko-lang - value: 샘플 - - name: pt-br-lang - value: Exemplos - - name: ru-lang - value: Примеры - - name: zh-cn-lang - value: 示例 - - name: zh-tw-lang - value: 範例 - -- title: License Agreement - path: /preview/license.html - path_attributes: - - name: es-lang - value: Contrato de licencia - - name: ja-lang - value: 使用許諾契約 - - name: ko-lang - value: 라이선스 계약 - - name: pt-br-lang - value: Contrato de licença - - name: ru-lang - value: Лицензионное соглашение - - name: zh-cn-lang - value: 许可协议 - - name: zh-tw-lang - value: 授權協議 diff --git a/docs/html/preview/_project.yaml b/docs/html/preview/_project.yaml deleted file mode 100644 index 3ec851aa3346..000000000000 --- a/docs/html/preview/_project.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: "Preview" -home_url: /preview/ -description: "Android N final SDK is now available." -content_license: cc3-apache2 -buganizer_id: 30209417 diff --git a/docs/html/preview/download-ota.jd b/docs/html/preview/download-ota.jd deleted file mode 100644 index 65f7f9f746f2..000000000000 --- a/docs/html/preview/download-ota.jd +++ /dev/null @@ -1,332 +0,0 @@ -page.title=Applying a Device OTA Image - -@jd:body - -<div style="position:relative; min-height:600px"> - - <div class="wrap" id="tos" style="position:absolute;display:none;width:inherit;"> - - <p class="sdk-terms-intro">Before downloading and installing components of - the Android Preview SDK, you must agree to the following terms and - conditions.</p> - - <h2 class="norule">Terms and Conditions</h2> - - <div class="sdk-terms" onfocus="this.blur()" style="width:678px"> -This is the Android SDK Preview License Agreement (the “License Agreement”). - -1. Introduction - -1.1 The Android SDK Preview (referred to in the License Agreement as the “Preview” and specifically including the Android system files, packaged APIs, and Preview library files, if and when they are made available) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the Preview. - -1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. - -1.3 “Android-compatible” means any Android implemation that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS). - -1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. - -2. Accepting the License Agreement - -2.1 In order to use the Preview, you must first agree to the License Agreement. You may not use the Preview if you do not accept the License Agreement. - -2.2 By clicking to accept and/or using the Preview, you hereby agree to the terms of the License Agreement. - -2.3 You may not use the Preview and may not accept the License Agreement if you are a person barred from receiving the Preview under the laws of the United States or other countries including the country in which you are resident or from which you use the Preview. - -2.4 If you will use the Preview internally within your company or organization you agree to be bound by the License Agreement on behalf of your employer or other entity, and you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the Preview on behalf of your employer or other entity. - -3. Preview License from Google - -3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the Preview solely to develop applications for compatible implementations of Android. - -3.2 You may not use this Preview to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this Preview is not used for that purpose. - -3.3 You agree that Google or third parties owns all legal right, title and interest in and to the Preview, including any Intellectual Property Rights that subsist in the Preview. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. - -3.4 You may not use the Preview for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Preview or any part of the Preview; or (b) load any part of the Preview onto a mobile handset or any other hardware device except a personal computer, combine any part of the Preview with other software, or distribute any software or device incorporating a part of the Preview. - -3.5 Use, reproduction and distribution of components of the Preview licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. You agree to remain a licensee in good standing in regard to such open source software licenses under all the rights granted and to refrain from any actions that may terminate, suspend, or breach such rights. - -3.6 You agree that the form and nature of the Preview that Google provides may change without prior notice to you and that future versions of the Preview may be incompatible with applications developed on previous versions of the Preview. You agree that Google may stop (permanently or temporarily) providing the Preview (or any features within the Preview) to you or to users generally at Google's sole discretion, without prior notice to you. - -3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Preview. - -4. Use of the Preview by You - -4.1 Google agrees that nothing in the License Agreement gives Google any right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the Preview, including any intellectual property rights that subsist in those applications. - -4.2 You agree to use the Preview and write applications only for purposes that are permitted by (a) the License Agreement, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). - -4.3 You agree that if you use the Preview to develop applications, you will protect the privacy and legal rights of users. If users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If users provide you with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, each user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the Preview, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of Google or any third party. - -4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. - -4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. - -4.7 The Preview is in development, and your testing and feedback are an important part of the development process. By using the Preview, you acknowledge that implementation of some features are still under development and that you should not rely on the Preview having the full functionality of a stable release. You agree not to publicly distribute or ship any application using this Preview as this Preview will no longer be supported after the official Android SDK is released. - -5. Your Developer Credentials - -5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. - -6. Privacy and Information - -6.1 In order to continually innovate and improve the Preview, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Preview are being used and how they are being used. Before any of this information is collected, the Preview will notify you and seek your consent. If you withhold consent, the information will not be collected. - -6.2 The data collected is examined in the aggregate to improve the Preview and is maintained in accordance with Google's Privacy Policy located at http://www.google.com/policies/privacy/. - -7. Third Party Applications - -7.1 If you use the Preview to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. - -7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. - -7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. - -8. Using Google APIs - -8.1 Google APIs - -8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. - -8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. - -9. Terminating the License Agreement - -9.1 the License Agreement will continue to apply until terminated by either you or Google as set out below. - -9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the Preview and any relevant developer credentials. - -9.3 Google may at any time, terminate the License Agreement, with or without cause, upon notice to you. - -9.4 The License Agreement will automatically terminate without notice or other action upon the earlier of: -(A) when Google ceases to provide the Preview or certain parts of the Preview to users in the country in which you are resident or from which you use the service; and -(B) Google issues a final release version of the Android SDK. - -9.5 When the License Agreement is terminated, the license granted to you in the License Agreement will terminate, you will immediately cease all use of the Preview, and the provisions of paragraphs 10, 11, 12 and 14 shall survive indefinitely. - -10. DISCLAIMERS - -10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE PREVIEW IS AT YOUR SOLE RISK AND THAT THE PREVIEW IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. - -10.2 YOUR USE OF THE PREVIEW AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE PREVIEW IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. WITHOUT LIMITING THE FOREGOING, YOU UNDERSTAND THAT THE PREVIEW IS NOT A STABLE RELEASE AND MAY CONTAIN ERRORS, DEFECTS AND SECURITY VULNERABILITIES THAT CAN RESULT IN SIGNIFICANT DAMAGE, INCLUDING THE COMPLETE, IRRECOVERABLE LOSS OF USE OF YOUR COMPUTER SYSTEM OR OTHER DEVICE. - -10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - -11. LIMITATION OF LIABILITY - -11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -12. Indemnification - -12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ fees) arising out of or accruing from (a) your use of the Preview, (b) any application you develop on the Preview that infringes any Intellectual Property Rights of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you of the License Agreement. - -13. Changes to the License Agreement - -13.1 Google may make changes to the License Agreement as it distributes new versions of the Preview. When these changes are made, Google will make a new version of the License Agreement available on the website where the Preview is made available. - -14. General Legal Terms - -14.1 the License Agreement constitutes the whole legal agreement between you and Google and governs your use of the Preview (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the Preview. - -14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. - -14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable. - -14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement. - -14.5 EXPORT RESTRICTIONS. THE PREVIEW IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE PREVIEW. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. - -14.6 The License Agreement may not be assigned or transferred by you without the prior written approval of Google, and any attempted assignment without such approval will be void. You shall not delegate your responsibilities or obligations under the License Agreement without the prior written approval of Google. - -14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. - </div><!-- sdk terms --> - - - - <div id="sdk-terms-form"> - <p> - <input id="agree" type="checkbox" name="agree" value="1" onclick="onAgreeChecked()" /> - <label id="agreeLabel" for="agree">I have read and agree with the above terms and conditions</label> - </p> - <p><a href="" class="button disabled" id="downloadForRealz" onclick="return onDownloadForRealz(this);"></a></p> - </div> - - - </div><!-- end TOS --> - - - <div id="landing"> - -<p> - This page provides links to over-the-air (OTA) device images and describes - how to manually apply an OTA update to a device. This procedure may be useful - in recovering devices that received OTA updates through the Android Beta - Program and do not start up after the update is installed. -</p> - -<h2 id="install-ota">Installing OTA Images</h2> - -<p></p> - -<p>To install an OTA package to a device:</p> - -<ol> - <li>Download an OTA device image from the table below.</li> - <li>Reboot the device into Recovery mode. For more information on putting - Nexus devices in this mode, see - <a href="https://support.google.com/nexus/answer/4596836">Reset your Nexus - device to factory settings</a>. - </li> - <li>On the device, select <strong>ADB sideload</strong>.</li> - <li>Connect the device to a computer with the Android development environment - loaded and the Android Debug Bridge (adb) tool installed.</li> - <li>Run the following command: - <pre>adb sideload <em><ota-package></em></pre> - </li> -</ol> - - - -<h2 id="ota-images">Device OTA Images</h2> - -<table> - <tr> - <th scope="col">Device</th> - <th scope="col">Download / Checksums</th> - </tr> - - <tr id="bullhead"> - <td>Nexus 5X <br>"bullhead"</td> - <td><a href="#top" onclick="onDownload(this)" - >bullhead-ota-npd90g-0a874807.zip</a><br> - MD5: 4b83b803fac1a6eec13f66d0afc6f46e<br> - SHA-1: a9920bcc8d475ce322cada097d085448512635e2 - </td> - </tr> - - <tr id="shamu"> - <td>Nexus 6 <br>"shamu"</td> - <td><a href="#top" onclick="onDownload(this)" - >shamu-ota-npd90g-06f5d23d.zip</a><br> - MD5: 513570bb3a91878c2d1a5807d2340420<br> - SHA-1: 2d2f40636c95c132907e6ba0d10b395301e969ed - </td> - </tr> - - <tr id="angler"> - <td>Nexus 6P <br>"angler"</td> - <td><a href="#top" onclick="onDownload(this)" - >angler-ota-npd90g-5baa69c2.zip</a><br> - MD5: 096fe26c5d50606a424d2f3326c0477b<br> - SHA-1: 468d2e7aea444505513ddc183c85690c00fab0c1 - </td> - </tr> - - <tr id="volantis"> - <td>Nexus 9 <br>"volantis"</td> - <td><a href="#top" onclick="onDownload(this)" - >volantis-ota-npd90g-c04785e1.zip</a><br> - MD5: 6aecd3b0b3a839c5ce1ce4d12187b03e<br> - SHA-1: 31633180635b831e59271a7d904439f278586f49 - </td> - </tr> - - <tr id="volantisg"> - <td>Nexus 9G <br>"volantisg"</td> - <td><a href="#top" onclick="onDownload(this)" - >volantisg-ota-npd90g-c56aa1b0.zip</a><br> - MD5: 0493fa79763d67bcdde8007299e1888d<br> - SHA-1: f709daf81968a1b27ed41fe40d42e0d106f3c494 - </td> - </tr> - - <tr id="fugu"> - <td>Nexus Player <br>"fugu"</td> - <td><a href="#top" onclick="onDownload(this)" - >fugu-ota-npd90g-3a0643ae.zip</a><br> - MD5: 9c38b6647fe5a4f2965196b7c409f0f7<br> - SHA-1: 77c6fb05191f0c2ae0956bae18f1c80b2f922f05 - </td> - </tr> - - <tr id="ryu"> - <td>Pixel C <br>"ryu"</td> - <td><a href="#top" onclick="onDownload(this)" - >ryu-ota-npd90g-ec931914.zip</a><br> - MD5: 4c6135498ca156a9cdaf443ddfdcb2ba<br> - SHA-1: 297cc9a204685ef5507ec087fc7edf5b34551ce6 - </td> - </tr> - - <tr id="seed"> - <td>General Mobile 4G (Android One) <br>"seed"</td> - <td><a href="#top" onclick="onDownload(this)" - >seed_l8150-ota-npd90g-dcb0662d.zip</a><br> - MD5: f40ea6314a13ea6dd30d0e68098532a2<br> - SHA-1: 11af10b621f4480ac63f4e99189d61e1686c0865 - </td> - </tr> - -</table> - - - </div><!-- landing --> - -</div><!-- relative wrapper --> - - - -<script> - var urlRoot = "http://storage.googleapis.com/androiddevelopers/shareables/preview/ota/"; - function onDownload(link) { - - $("#downloadForRealz").html("Download " + $(link).text()); - $("#downloadForRealz").attr('href', urlRoot + $(link).text()); - - $("#tos").fadeIn('fast'); - $("#landing").fadeOut('fast'); - - return true; - } - - - function onAgreeChecked() { - /* verify that the TOS is agreed */ - if ($("input#agree").is(":checked")) { - /* reveal the download button */ - $("a#downloadForRealz").removeClass('disabled'); - } else { - $("a#downloadForRealz").addClass('disabled'); - } - } - - function onDownloadForRealz(link) { - if ($("input#agree").is(':checked')) { - /* - $("#tos").fadeOut('fast'); - $("#landing").fadeIn('fast'); - */ - - ga('send', 'event', 'M Preview', 'System Image', $("#downloadForRealz").html()); - - /* - location.hash = ""; - */ - return true; - } else { - return false; - } - } - - $(window).hashchange( function(){ - if (location.hash == "") { - location.reload(); - } - }); - -</script> diff --git a/docs/html/preview/download.jd b/docs/html/preview/download.jd deleted file mode 100644 index e4db8901b46f..000000000000 --- a/docs/html/preview/download.jd +++ /dev/null @@ -1,562 +0,0 @@ -page.title=Test on a Device -meta.tags="preview", "nexus","system image" -page.tags="preview", "androidn" -page.image=images/cards/card-n-downloads_2x.png - -@jd:body - -<div style="position:relative; min-height:600px"> - - <div class="wrap" id="tos" style="position:absolute;display:none;width:inherit;"> - - <p class="sdk-terms-intro">Before downloading and installing components of - the Android Preview SDK, you must agree to the following terms and - conditions.</p> - - <h2 class="norule">Terms and Conditions</h2> - - <div class="sdk-terms" onfocus="this.blur()" style="width:678px"> -This is the Android SDK Preview License Agreement (the “License Agreement”). - -1. Introduction - -1.1 The Android SDK Preview (referred to in the License Agreement as the “Preview” and specifically including the Android system files, packaged APIs, and Preview library files, if and when they are made available) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the Preview. - -1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. - -1.3 “Android-compatible” means any Android implemation that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS). - -1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. - -2. Accepting the License Agreement - -2.1 In order to use the Preview, you must first agree to the License Agreement. You may not use the Preview if you do not accept the License Agreement. - -2.2 By clicking to accept and/or using the Preview, you hereby agree to the terms of the License Agreement. - -2.3 You may not use the Preview and may not accept the License Agreement if you are a person barred from receiving the Preview under the laws of the United States or other countries including the country in which you are resident or from which you use the Preview. - -2.4 If you will use the Preview internally within your company or organization you agree to be bound by the License Agreement on behalf of your employer or other entity, and you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the Preview on behalf of your employer or other entity. - -3. Preview License from Google - -3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the Preview solely to develop applications for compatible implementations of Android. - -3.2 You may not use this Preview to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this Preview is not used for that purpose. - -3.3 You agree that Google or third parties owns all legal right, title and interest in and to the Preview, including any Intellectual Property Rights that subsist in the Preview. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. - -3.4 You may not use the Preview for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Preview or any part of the Preview; or (b) load any part of the Preview onto a mobile handset or any other hardware device except a personal computer, combine any part of the Preview with other software, or distribute any software or device incorporating a part of the Preview. - -3.5 Use, reproduction and distribution of components of the Preview licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. You agree to remain a licensee in good standing in regard to such open source software licenses under all the rights granted and to refrain from any actions that may terminate, suspend, or breach such rights. - -3.6 You agree that the form and nature of the Preview that Google provides may change without prior notice to you and that future versions of the Preview may be incompatible with applications developed on previous versions of the Preview. You agree that Google may stop (permanently or temporarily) providing the Preview (or any features within the Preview) to you or to users generally at Google's sole discretion, without prior notice to you. - -3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Preview. - -4. Use of the Preview by You - -4.1 Google agrees that nothing in the License Agreement gives Google any right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the Preview, including any intellectual property rights that subsist in those applications. - -4.2 You agree to use the Preview and write applications only for purposes that are permitted by (a) the License Agreement, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). - -4.3 You agree that if you use the Preview to develop applications, you will protect the privacy and legal rights of users. If users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If users provide you with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, each user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the Preview, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of Google or any third party. - -4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. - -4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. - -4.7 The Preview is in development, and your testing and feedback are an important part of the development process. By using the Preview, you acknowledge that implementation of some features are still under development and that you should not rely on the Preview having the full functionality of a stable release. You agree not to publicly distribute or ship any application using this Preview as this Preview will no longer be supported after the official Android SDK is released. - -5. Your Developer Credentials - -5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. - -6. Privacy and Information - -6.1 In order to continually innovate and improve the Preview, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Preview are being used and how they are being used. Before any of this information is collected, the Preview will notify you and seek your consent. If you withhold consent, the information will not be collected. - -6.2 The data collected is examined in the aggregate to improve the Preview and is maintained in accordance with Google's Privacy Policy located at http://www.google.com/policies/privacy/. - -7. Third Party Applications - -7.1 If you use the Preview to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. - -7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. - -7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. - -8. Using Google APIs - -8.1 Google APIs - -8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. - -8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. - -9. Terminating the License Agreement - -9.1 the License Agreement will continue to apply until terminated by either you or Google as set out below. - -9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the Preview and any relevant developer credentials. - -9.3 Google may at any time, terminate the License Agreement, with or without cause, upon notice to you. - -9.4 The License Agreement will automatically terminate without notice or other action upon the earlier of: -(A) when Google ceases to provide the Preview or certain parts of the Preview to users in the country in which you are resident or from which you use the service; and -(B) Google issues a final release version of the Android SDK. - -9.5 When the License Agreement is terminated, the license granted to you in the License Agreement will terminate, you will immediately cease all use of the Preview, and the provisions of paragraphs 10, 11, 12 and 14 shall survive indefinitely. - -10. DISCLAIMERS - -10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE PREVIEW IS AT YOUR SOLE RISK AND THAT THE PREVIEW IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. - -10.2 YOUR USE OF THE PREVIEW AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE PREVIEW IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. WITHOUT LIMITING THE FOREGOING, YOU UNDERSTAND THAT THE PREVIEW IS NOT A STABLE RELEASE AND MAY CONTAIN ERRORS, DEFECTS AND SECURITY VULNERABILITIES THAT CAN RESULT IN SIGNIFICANT DAMAGE, INCLUDING THE COMPLETE, IRRECOVERABLE LOSS OF USE OF YOUR COMPUTER SYSTEM OR OTHER DEVICE. - -10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - -11. LIMITATION OF LIABILITY - -11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -12. Indemnification - -12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ fees) arising out of or accruing from (a) your use of the Preview, (b) any application you develop on the Preview that infringes any Intellectual Property Rights of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you of the License Agreement. - -13. Changes to the License Agreement - -13.1 Google may make changes to the License Agreement as it distributes new versions of the Preview. When these changes are made, Google will make a new version of the License Agreement available on the website where the Preview is made available. - -14. General Legal Terms - -14.1 the License Agreement constitutes the whole legal agreement between you and Google and governs your use of the Preview (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the Preview. - -14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. - -14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable. - -14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement. - -14.5 EXPORT RESTRICTIONS. THE PREVIEW IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE PREVIEW. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. - -14.6 The License Agreement may not be assigned or transferred by you without the prior written approval of Google, and any attempted assignment without such approval will be void. You shall not delegate your responsibilities or obligations under the License Agreement without the prior written approval of Google. - -14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. - </div><!-- sdk terms --> - - - - <div id="sdk-terms-form"> - <p> - <input id="agree" type="checkbox" name="agree" value="1" onclick="onAgreeChecked()" /> - <label id="agreeLabel" for="agree">I have read and agree with the above terms and conditions</label> - </p> - <p><a href="" class="button disabled" id="downloadForRealz" onclick="return onDownloadForRealz(this);"></a></p> - </div> - - - </div><!-- end TOS --> - - - <div id="landing"> - -<div id="qv-wrapper"> - <div id="qv"> - <h2>In this document</h2> - <ol> - <li><a href="#device-preview">Set up a hardware device</a> - <ol> - <li><a href="#ota">Get over-the-air updates</a></li> - <li><a href="#flash">Manually flash a device</a></li> - <li><a href="#revertDevice">Uninstalling</a></li> - </ol> - </li> - <li><a href="#setupAVD">Set up an emulator</a></li> - </ol> - </div> -</div> - -<p> - To run and test your app on the new platform you need to set up an Android N - runtime environment. You can do that in either of these ways: -</p> - -<ul> - <li>Install Android N on a supported hardware device, or</li> - <li>Set up an Android emulator running Android N</li> -</ul> - -<p> - If you want an environment for basic compatibility testing of your app on the - new platform, all you need is your current APK and a hardware device or - emulator. You don't necessarily need to update your full development - environment to do basic testing. -</p> - -<p> - If you want to modify your app to target Android N or use new Android N APIs, - you need to set up a development environment that's updated to support - Android N. <a href="{@docRoot}preview/setup-sdk.html">Set Up to Develop for - Android N</a> has details. -</p> - - -<h2 id="device-preview">Set up a hardware device</h2> - -<p> - The N Developer Preview offers system updates for a range of hardware devices - that you can use for testing your app, from phones to tablets and TV. -</p> - -<p> - If you have access to a supported device, you can update it to a Developer - Preview milestone build in one of these ways: -</p> - -<ul> - <li> - <strong>Enroll the device in automatic OTA system updates</strong> through - the <a href="https://g.co/androidbeta">Android Beta Program</a>. Once - enrolled, your device will receive regular over-the-air (OTA) updates of - all milestone builds in the N Developer Preview. When the next version of - Android is released, your device will automatically update to the final - version. This approach is recommended because it lets you seamlessly - transition from your current environment, through the various releases of - the N Developer Preview, to the release version. - </li> - - <li> - <strong>Download a Developer Preview system image and flash the - device</strong>. OTA updates are not provided automatically for devices - that you flash manually, but you can enroll those devices in Android Beta - Program to get OTA updates. When the next version of Android is released, - you can download the final device image from the <a href= - "https://developers.google.com/android/nexus/images" type= - "external-link">factory images</a> page. - </li> -</ul> - -<h3 id="ota">Enroll the device in automatic OTA updates</h3> - -<p> - If you have access to a supported device (see the list in the Downloads - table), you can receive over-the-air updates to preview versions of Android - by enrolling that device in the <a href="https://g.co/androidbeta">Android - Beta Program</a>. These updates are automatically downloaded and will update - your device just like official system updates. When the next version of - Android is released, the device will automatically update to the production - version. -</p> - -<p> - You can un-enroll a device at any time. The device will receive an OTA update - to the most recent production version of Android available for that device - (for example, Android 6.0 Marshmallow). The update requires a full device - reset, so user data on the device will be removed. Make sure to <strong>back - up important data</strong> before un-enrolling a device. -</p> - -<p> - For more information and to enroll your device, see - the <a href="https://g.co/androidbeta">Android Beta Program</a> web site. -</p> - -<p class="note"><strong>Note:</strong> - Un-enrolling requires a full device reset. Back up - important data first. -</p> - -<h3 id="flash">Flashing a device manually</h3> - -<p> - At any time you can download the latest Developer Preview system image and - manually flash it to your device. See the table below to download the system - image for your test device. Manually flashing a device is useful if you need - precise control over the test environment or need to reinstall frequently, - such as for automated testing. -</p> - -<!-- You can flash by ota or system image --><p> - Installing a system image on a device <strong>removes all data from the - device</strong>, so you should back up your data first. -</p> - -<p> - After you back up your device data and download the system image below that - matches your device, follow the instructions at <a href= - "https://developers.google.com/android/nexus/images#instructions">developers.google.com/android</a> - to flash the image onto your device. -</p> - -<p> - Manually flashed system images <strong>do not - automatically receive OTA updates</strong> to later Developer Preview - milestone builds or the final, production version. Make sure to keep your - environment up-to-date and flash a - new system image at each Developer Preview milestone. -</p> - -<p> - If you decide you want to get OTA updates after manually flashing a device, - all you need to do is enroll the device in the <a href="https://g.co/androidbeta">Android - Beta Program</a>. You can enroll the device at any time to receive the next Preview - update over the air. -</p> - -<table> - <tr> - <th scope="col">Device</th> - <th scope="col">Download / Checksums</th> - </tr> - - <tr id="bullhead"> - <td>Nexus 5X <br>"bullhead"</td> - <td><a href="#top" onclick="onDownload(this)" - >bullhead-npd90g-factory-7a0ca1bc.tgz</a><br> - MD5: e7a9a3061335c1e0c8be2588f13290af<br> - SHA-1: 7a0ca1bcfa51bbefde34243603bc79c7dec214a1 - </td> - </tr> - - <tr id="shamu"> - <td>Nexus 6 <br>"shamu"</td> - <td><a href="#top" onclick="onDownload(this)" - >shamu-npd90g-factory-f7a4e3a9.tgz</a><br> - MD5: 2fb572ddcfca67bb1d741be97492a9ed<br> - SHA-1: f7a4e3a96c797827492998e855c8f9efbfc8559a - </td> - </tr> - - <tr id="angler"> - <td>Nexus 6P <br>"angler"</td> - <td><a href="#top" onclick="onDownload(this)" - >angler-npd90g-factory-cd9ac81e.tgz</a><br> - MD5: 2370c30f3ef1d0684c1de5216a5d90fe<br> - SHA-1: cd9ac81ec7f4a646ac6054eecbf2ea4c4b89b054 - </td> - </tr> - - <tr id="volantis"> - <td>Nexus 9 <br>"volantis"</td> - <td><a href="#top" onclick="onDownload(this)" - >volantis-npd90g-factory-41b55406.tgz</a><br> - MD5: cefa78950141da2a7c75e887717e3c8f<br> - SHA-1: 41b554060263a7ef16e4be8422cbd6caca26e00f - </td> - </tr> - - <tr id="volantisg"> - <td>Nexus 9G <br>"volantisg"</td> - <td><a href="#top" onclick="onDownload(this)" - >volantisg-npd90g-factory-610492be.tgz</a><br> - MD5: 2f36dc0d0fab02ab78be500677ec239f<br> - SHA-1: 610492bedfc4127023040ecb2c89239a78a900ad - </td> - </tr> - - <tr id="fugu"> - <td>Nexus Player <br>"fugu"</td> - <td><a href="#top" onclick="onDownload(this)" - >fugu-npd90g-factory-0fe95694.tgz</a><br> - MD5: f4cb48f919e4c29c631de21416c612e2<br> - SHA-1: 0fe95694e7bc41e4c3ac0e4438cd77102a0aa8b4 - </td> - </tr> - - <tr id="ryu"> - <td>Pixel C <br>"ryu"</td> - <td><a href="#top" onclick="onDownload(this)" - >ryu-npd90g-factory-f4da981c.tgz</a><br> - MD5: d9f0e40b6c20d274831e8a7d285fd887<br> - SHA-1: f4da981c70576133321e2858e52fe2c990e68a75 - </td> - </tr> - - <tr id="seed"> - <td>General Mobile 4G (Android One) <br>"seed"</td> - <td><a href="#top" onclick="onDownload(this)" - >seed_l8150-npd90g-factory-48f59c99.tgz</a><br> - MD5: 0ed565c509594072822d71c65b48ec8e<br> - SHA-1: 48f59c99ac43d1cd2f5656a283bb9868581663a8 - </td> - </tr> - -</table> - -<h3 id="revertDevice">Uninstalling the Preview from a device</h3> - -<p> - If you want to uninstall the preview from a device, you can do so in one of - these ways: </p> - <ul> - <li><strong>Obtain a factory spec system image</strong> and then manually - flash it to the device. - <ul> - <li>For <strong>Nexus devices and Pixel C devices</strong>, see - the <a href="http://developers.google.com/android/nexus/images">Factory Images - for Nexus Devices</a> page for downloads. </li> - <li>For <strong>other devices</strong>, please contact the device manufacturer - directly. Alternatively, if the device is supported - in the Android Beta Program, you can enroll the device in the - program and then un-enroll it (see below).</li> - </ul> - </li> - <li><strong>Un-enroll the device from Android Beta Program</strong>. If the - device is enrolled in the <a href="https://g.co/androidbeta">Android Beta - Program</a>, regardless of device, you can simply un-enroll it from the program. - <p> - The device will receive an OTA update to the most recent production version - of Android available for that device (for example, Android 6.0 Marshmallow). - The update requires a full device reset, so user data on the device will be - removed. Make sure to <strong>back up important data</strong> before - un-enrolling a device. - </p> - </li> -</ul> - -<p class="note"><strong>Note:</strong> - Uninstalling a Developer Preview system image prior to - the end of the program requires a full device reset and removes all user data - on the device. -</p> - - -<h2 id="setupAVD">Set up an emulator</h2> - -<p>To use the Android Emulator to run the Android N Preview, you need to -download the Android N Preview SDK and create a virtual device for the -emulator.</p> - -<p>First, download the Android N Preview SDK as follows (if you -already got it while <a href="{@docRoot}preview/setup-sdk.html">setting up -to develop for Android N</a>, you can skip this part): - -<ol> - <li>In Android Studio, open the Settings dialog - (<strong>File > Settings</strong> on Windows/Linux, or - <strong>Android Studio > Preferences</strong> on Mac). In the left - panel, select <strong>Appearance & Behavior > - System Settings > Android SDK</strong>. - - <li>Click the <strong>SDK Platforms</strong> tab, then select the - <strong>Android N Preview</strong> check box.</li> - - <li>Click the <strong>SDK Tools</strong> tab, then select the - <strong>Android SDK Build Tools</strong>, <strong>Android SDK - Platform-Tools</strong>, and <strong>Android SDK Tools</strong> check - boxes. - </li> - - <li>Click <strong>OK</strong> and accept the license - agreements for any packages to be installed. - </li> -</ol> - -<p>You should now have <strong>Android SDK Built-Tools 24.0 0 rc1</strong>, -<strong>Platform-Tools 24.0.0 rc1</strong>, and <strong>SDK Tools -25.0.9</strong>. If you do not update the SDK Tools to 25.0.9, then you won't -be able to run the x86_64 system images for Android N.</p> - - -<p>Now create a virtual device with the Android N system image:</p> - -<ol> - <li>Open the AVD Manager by selecting <strong>Tools > Android > - AVD Manager</strong>.</li> - <li>Click <strong>Create Virtual Device</strong>.</li> - <li>Select a device such as Nexus 5X, Nexus 6P, Nexus 9, or Android TV, - then click <strong>Next</strong>.</li> - <li>Select the <strong>N</strong> system image (with the - <strong>x86</strong> ABI), then click <strong>Next</strong>. - (Only x86 system images are currently supported with the Android Emulator -for the Android N Preview.) - <li>Complete the rest of the AVD configuration and click - <strong>Finish</strong>.</li> -</ol> - -<p>You can now launch the Android Emulator with the Android N Preview AVD.</p> - -<p> -For the best experience in the Android Emulator, make sure you're using -Android Studio 2.1 or higher, which supports <a -href="http://tools.android.com/tech-docs/emulator">Android Emulator 2.0</a> -with much faster performance compared to the emulator in -Android Studio 1.5.</p> - -<p>For more information about creating virtual devices, see <a href= - "{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>. -</p> - - - - - - - - - - - - - - - </div><!-- landing --> - -</div><!-- relative wrapper --> - - - -<script> - var urlRoot = "http://storage.googleapis.com/androiddevelopers/shareables/preview/"; - function onDownload(link) { - - $("#downloadForRealz").html("Download " + $(link).text()); - $("#downloadForRealz").attr('href', urlRoot + $(link).text()); - - $("#tos").fadeIn('fast'); - $("#landing").fadeOut('fast'); - - return true; - } - - - function onAgreeChecked() { - /* verify that the TOS is agreed */ - if ($("input#agree").is(":checked")) { - /* reveal the download button */ - $("a#downloadForRealz").removeClass('disabled'); - } else { - $("a#downloadForRealz").addClass('disabled'); - } - } - - function onDownloadForRealz(link) { - if ($("input#agree").is(':checked')) { - /* - $("#tos").fadeOut('fast'); - $("#landing").fadeIn('fast'); - */ - - ga('send', 'event', 'M Preview', 'System Image', $("#downloadForRealz").html()); - - /* - location.hash = ""; - */ - return true; - } else { - return false; - } - } - - $(window).hashchange( function(){ - if (location.hash == "") { - location.reload(); - } - }); - -</script> diff --git a/docs/html/preview/license.jd b/docs/html/preview/license.jd deleted file mode 100644 index ae02aae58a19..000000000000 --- a/docs/html/preview/license.jd +++ /dev/null @@ -1,145 +0,0 @@ -page.title=License Agreement - -@jd:body - -<p> -To get started with the Android SDK Preview, you must agree to the following terms and conditions. -As described below, please note that this is a preview version of the Android SDK, subject to change, that you use at your own risk. The Android SDK Preview is not a stable release, and may contain errors and defects that can result in serious damage to your computer systems, devices and data. -</p> - -<p> -This is the Android SDK Preview License Agreement (the “License Agreement”). -</p> -<div class="sdk-terms" style="height:auto;border:0;padding:0;width:700px"> -1. Introduction - -1.1 The Android SDK Preview (referred to in the License Agreement as the “Preview” and specifically including the Android system files, packaged APIs, and Preview library files, if and when they are made available) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the Preview. - -1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. - -1.3 “Android-compatible” means any Android implemation that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS). - -1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. - -2. Accepting the License Agreement - -2.1 In order to use the Preview, you must first agree to the License Agreement. You may not use the Preview if you do not accept the License Agreement. - -2.2 By clicking to accept and/or using the Preview, you hereby agree to the terms of the License Agreement. - -2.3 You may not use the Preview and may not accept the License Agreement if you are a person barred from receiving the Preview under the laws of the United States or other countries including the country in which you are resident or from which you use the Preview. - -2.4 If you will use the Preview internally within your company or organization you agree to be bound by the License Agreement on behalf of your employer or other entity, and you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the Preview on behalf of your employer or other entity. - -3. Preview License from Google - -3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the Preview solely to develop applications for compatible implementations of Android. - -3.2 You may not use this Preview to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this Preview is not used for that purpose. - -3.3 You agree that Google or third parties owns all legal right, title and interest in and to the Preview, including any Intellectual Property Rights that subsist in the Preview. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. - -3.4 You may not use the Preview for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Preview or any part of the Preview; or (b) load any part of the Preview onto a mobile handset or any other hardware device except a personal computer, combine any part of the Preview with other software, or distribute any software or device incorporating a part of the Preview. - -3.5 Use, reproduction and distribution of components of the Preview licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. You agree to remain a licensee in good standing in regard to such open source software licenses under all the rights granted and to refrain from any actions that may terminate, suspend, or breach such rights. - -3.6 You agree that the form and nature of the Preview that Google provides may change without prior notice to you and that future versions of the Preview may be incompatible with applications developed on previous versions of the Preview. You agree that Google may stop (permanently or temporarily) providing the Preview (or any features within the Preview) to you or to users generally at Google's sole discretion, without prior notice to you. - -3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Preview. - -4. Use of the Preview by You - -4.1 Google agrees that nothing in the License Agreement gives Google any right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the Preview, including any intellectual property rights that subsist in those applications. - -4.2 You agree to use the Preview and write applications only for purposes that are permitted by (a) the License Agreement, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). - -4.3 You agree that if you use the Preview to develop applications, you will protect the privacy and legal rights of users. If users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If users provide you with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, each user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the Preview, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of Google or any third party. - -4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. - -4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. - -4.7 The Preview is in development, and your testing and feedback are an important part of the development process. By using the Preview, you acknowledge that implementation of some features are still under development and that you should not rely on the Preview having the full functionality of a stable release. You agree not to publicly distribute or ship any application using this Preview as this Preview will no longer be supported after the official Android SDK is released. - -5. Your Developer Credentials - -5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. - -6. Privacy and Information - -6.1 In order to continually innovate and improve the Preview, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Preview are being used and how they are being used. Before any of this information is collected, the Preview will notify you and seek your consent. If you withhold consent, the information will not be collected. - -6.2 The data collected is examined in the aggregate to improve the Preview and is maintained in accordance with Google's Privacy Policy located at http://www.google.com/policies/privacy/. - -7. Third Party Applications - -7.1 If you use the Preview to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. - -7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. - -7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. - -8. Using Google APIs - -8.1 Google APIs - -8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. - -8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. - -9. Terminating the License Agreement - -9.1 the License Agreement will continue to apply until terminated by either you or Google as set out below. - -9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the Preview and any relevant developer credentials. - -9.3 Google may at any time, terminate the License Agreement, with or without cause, upon notice to you. - -9.4 The License Agreement will automatically terminate without notice or other action upon the earlier of: -(A) when Google ceases to provide the Preview or certain parts of the Preview to users in the country in which you are resident or from which you use the service; and -(B) Google issues a final release version of the Android SDK. - -9.5 When the License Agreement is terminated, the license granted to you in the License Agreement will terminate, you will immediately cease all use of the Preview, and the provisions of paragraphs 10, 11, 12 and 14 shall survive indefinitely. - -10. DISCLAIMERS - -10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE PREVIEW IS AT YOUR SOLE RISK AND THAT THE PREVIEW IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. - -10.2 YOUR USE OF THE PREVIEW AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE PREVIEW IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. WITHOUT LIMITING THE FOREGOING, YOU UNDERSTAND THAT THE PREVIEW IS NOT A STABLE RELEASE AND MAY CONTAIN ERRORS, DEFECTS AND SECURITY VULNERABILITIES THAT CAN RESULT IN SIGNIFICANT DAMAGE, INCLUDING THE COMPLETE, IRRECOVERABLE LOSS OF USE OF YOUR COMPUTER SYSTEM OR OTHER DEVICE. - -10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - -11. LIMITATION OF LIABILITY - -11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -12. Indemnification - -12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ fees) arising out of or accruing from (a) your use of the Preview, (b) any application you develop on the Preview that infringes any Intellectual Property Rights of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you of the License Agreement. - -13. Changes to the License Agreement - -13.1 Google may make changes to the License Agreement as it distributes new versions of the Preview. When these changes are made, Google will make a new version of the License Agreement available on the website where the Preview is made available. - -14. General Legal Terms - -14.1 the License Agreement constitutes the whole legal agreement between you and Google and governs your use of the Preview (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the Preview. - -14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. - -14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable. - -14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement. - -14.5 EXPORT RESTRICTIONS. THE PREVIEW IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE PREVIEW. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. - -14.6 The License Agreement may not be assigned or transferred by you without the prior written approval of Google, and any attempted assignment without such approval will be void. You shall not delegate your responsibilities or obligations under the License Agreement without the prior written approval of Google. - -14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. - - -</div>
\ No newline at end of file diff --git a/docs/html/preview/overview.jd b/docs/html/preview/overview.jd deleted file mode 100644 index 601442e95fef..000000000000 --- a/docs/html/preview/overview.jd +++ /dev/null @@ -1,450 +0,0 @@ -page.title=Program Overview -page.metaDescription=Get your apps ready for the next version of Android. -page.image=images/cards/card-n-overview_2x.png -meta.tags="preview", "developer", "android" -page.tags="preview", "developer", "android" - -@jd:body - -<!-- -<div class="cols" style= -"background-color:#B2DFDB; padding: 5px 0;margin-bottom:1em; text-align:center;"> -<h3> - Developer Preview X is now available - </h3> - <p>This release includes the ...</p> - <div style="margin:auto 1em"> - <ul class="dac-section-links"> - <li class="dac-section-link"> - <a href="{@docRoot}preview/support.html#dp4"> - <span class="dac-sprite dac-auto-chevron"></span> - Read the Notes</a> - </li> - - <li class="dac-section-link"> - <a href="{@docRoot}preview/download.html"> - <span class="dac-sprite dac-auto-chevron"></span> - Test the Update</a> - </li> - - <li class="dac-section-link"> - <a href="https://code.google.com/p/android-developer-preview/"> - <span class="dac-sprite dac-auto-chevron"></span> - Report Issues</a> - </li> - </ul> - </div> -</div> ---> - -<p> - Welcome to the <strong>Android N Developer Preview</strong>, a program that - gives you everything you need to test and optimize your apps for the next - version of Android. It's free, and you can get started right away just by - downloading the N Developer Preview tools. -</p> - - - - - - - -<div style="background-color:#eceff1;padding:1em;"> -<div class="wrap"> - <div class="cols"> - <div class="col-4of12"> - <h5> - Hardware and emulator images - </h5> - - <p> - Run and test your apps on a range of devices or on an emulator. - - </p> - </div> - - <div class="col-4of12"> - <h5> - Latest platform code - </h5> - - <p> - We’ll provide monthly updates during the Preview, so you’ll be testing against the latest platform changes. - </p> - </div> - - <div class="col-4of12"> - <h5> - Priority for developer issues - </h5> - - <p> - During the first several weeks we’ll give priority to developer-reported - issues, so test and give feedback as soon as possible. - </p> - </div> - - </div> - - <div class="cols"> - - - <div class="col-4of12"> - <h5> - New behaviors and capabilities - </h5> - - <p> - Start work early to support new platform behaviors and develop with new features. - </p> - </div> - - <div class="col-4of12"> - <h5> - Updates delivered by OTA - </h5> - - <p> - Seamless over-the-air updates for any supported device through the - Android Beta Program. No flashing is needed. - </p> - </div> - - <div class="col-4of12"> - <h5> - Feedback and support - </h5> - - <p> - Report issues and give us feedback using our - <a href="{@docRoot}preview/bug">issue tracker</a>. Connect with other - developers in the - <a href="{@docRoot}preview/dev-community">N Developer Community</a>. - </p> - </div> - </div> -</div> -</div> - -<!-- -<p>New in the Android N Developer Preview: </p> - -<ul> - <li> Accompanying Android Beta Program for consumers, starting later in the preview</li> - <li> More supported devices, including devices from OEM partners</li> - <li> Seamless OTAs for your devices, from initial release to final N release without flashing</li> -</ul> ---> - -<h2 id="timeline">Timeline and updates</h2> - -<p> - The N Developer Preview runs from 9 March 2016 until the final Android N - public release to AOSP and OEMs, planned for Q3 2016. -</p> - -<img src="{@docRoot}images/n-preview-updates_2x.png"> - -<p> - At key development milestones, we’ll deliver updates for your development and - testing environment. In general you can expect an update each month (4 to 6 - week interval). The milestones are listed below. -</p> - -<ul> - <li><strong><a href="{@docRoot}preview/support.html#dp1">Preview 1</a></strong> (initial release, alpha)</li> - <li><strong><a href="{@docRoot}preview/support.html#dp2">Preview 2</a></strong> (incremental update, alpha)</li> - <li><strong><a href="{@docRoot}preview/support.html#dp3">Preview 3</a></strong> (incremental update, beta)</li> - <li><strong><a href="{@docRoot}preview/support.html#dp4">Preview 4</a></strong> (final APIs and official SDK, Play publishing)</li> - <li><strong><a href="{@docRoot}preview/support.html#dp5">Preview 5</a></strong> (near-final system images for final testing)</li> - <li><strong>Final release</strong> to AOSP and ecosystem</li> -</ul> - -<p> - Each update includes SDK tools, preview system images, emulators, reference - documentation, and API diffs. -</p> - -<p> - The <strong>first three preview milestones</strong> provide an <strong>early - test and development environment</strong> that help you identify - compatibility issues in your current apps and plan migration or feature work - needed to target the new platform. This is the priority period in which to - give us your feedback on features and APIs and file compatibility issues - — for all of these, please use the <a href="{@docRoot}preview/bug">issue - tracker</a>. You can expect some API changes across these updates. -</p> - -<p> - At <strong>previews 4 and 5</strong> you’ll have access to the <strong>final - N APIs and SDK</strong> to develop with, as well as near-final system images - to test system behaviors and features. Android N will provide a standard API - level at this time. You can begin final compatibility testing of your legacy - apps and refine any new code that is using the N APIs or features. -</p> - -<p> - Also starting in preview 4, you’ll be able to <strong>publish apps to - devices</strong> running Android N at the official API level, such as - consumer devices that have opted into the Android Beta program. You can - publish into the Google Play alpha and beta channels first, so you can test - your apps with Android Beta consumers before distributing broadly on the - store. -</p> - -<p> - As you test and develop on Android N, we strongly recommend <strong>keeping - your development environment up-to-date</strong> as preview updates are - released. To make the process easier, you can enroll your test devices in the - Android Beta program and get <strong>updates over-the-air (OTA)</strong> at - each milestone. Alternatively, updated preview images are available that you - download and flash manually. -</p> - -<p> - We’ll notify you when preview updates are available via the <a href= - "http://android-developers.blogspot.com/">Android Developers Blog</a>, as - well as this site and the <a href="{@docRoot}preview/dev-community">Android - N Developer Community</a>. -</p> - - -<h2 id="preview_tools">What's in the N Developer Preview?</h2> - -<p> - The N Developer Preview includes everything you need to test your existing - apps on a variety of screen sizes, network technologies, CPU/GPU chipsets, - and hardware architectures. -</p> - -<h3 id="sdk_tools">SDK tools</h3> - -<p>You can download these components through the SDK Manager in <a href="{@docRoot}studio/intro/update.html">Android Studio</a>:</p> - -<ul> - <li> N Developer Preview <strong>SDK and tools</strong> - <li> N Developer Preview <strong>emulator system image</strong> (32-bit & 64-bit) - <li> N Developer Preview <strong>emulator system Image for Android TV</strong> (32-bit) - <li> N Developer Preview support libraries (for new app templates) -</ul> - -<p> - We’ll provide updates to these development tools at each milestone as needed. -</p> - -<h3 id="hardware_system_images">Hardware system images</h3> - -<p> - The N Developer Preview includes Nexus and other hardware system images that you can use when - testing and developing on physical devices. See the <a href= - "{@docRoot}preview/download.html">Device Images</a> page for the full list - of hardware images. -</p> - -<p> - We’ll deliver updated system images for these devices at each milestone. You - can download and flash the updated system images to your test devices - manually, as frequently as you need. This is especially useful for automated - testing environments where you might need to reflash your device multiple - times. -</p> - -<p class="note"><strong>Note</strong>: - <strong>Devices flashed manually will not get OTA updates</strong> like in - last year’s preview. This year, you can get OTAs by enrolling devices in the - Android Beta Program — see details in the next section. -</p> - -<h3 id="android_beta">OTA Updates through Android Beta Program</h3> - -<p> - New for Android N is an Over-the-Air (OTA) update program that automatically - delivers the latest preview updates of Android N directly to devices enrolled - in the program. The program is free, and it’s open to anyone who has a - supported device that’s registered to their Google account. -</p> - -<p> - To enroll in the program visit the <a href="https://g.co/androidbeta">Android - Beta Program</a> site. You’ll - see all of the devices registered to your account that are eligible to enroll - in Android Beta. -</p> - -<ol> - <li> Choose the devices you want to receive the Android N updates - <li> Click Enroll, read and agree to the terms of service, and then click OK -</ol> - -<p> - Once you’ve enrolled, your device will soon receive an update. In most cases, - you will not need to do a full reset of your data to move to Android N, but - it’s recommended that you back up any data you don’t want to lose before - enrolling the device. -</p> - -<p> - As updates are delivered to your device, we recommend downloading and - installing them as soon as possible. You’ll want to stay current with the - latest changes in system UI, behavior, APIs, and features. -</p> - -<p> - At the conclusion of the Developer Preview, your enrolled devices will - receive an update to the official Android N release. -</p> - -<p> - You can un-enroll your devices from the Android Beta program at any time from - the Android Beta site. Before un-enrolling, make sure to back-up your data on - the device. -</p> - - <p class="note"><strong>Note</strong>: - When you un-enroll, <strong>your device will be factory reset</strong> - to the latest version - of Android 6.0 Marshmallow (not necessarily the version that you had - installed prior to enrolling the device). To ensure a clean installation, - your data will be erased from the device, including contacts, messages, - photos, and so on. -</p> - -<h3 id="documentation_and_sample_code">Documentation and sample code</h3> - -<p> - These documentation resources are available on the Developer Preview site to - help you learn about the Android N: -</p> - -<ul> - <li> <a href="{@docRoot}preview/setup-sdk.html">Set Up to Develop for -Android N</a> has - step-by-step instructions for getting started.</li> - <li> <a href="{@docRoot}preview/behavior-changes.html">Behavior - Changes</a> points you to key areas to test.</li> - <li> Documentation of new APIs, including an <a - href="{@docRoot}preview/api-overview.html">API Overview</a>, downloadable - <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API - Reference</a>, and detailed developer guides on key features such as - multi-window support, bundled notifications, multi-locale support, and others. - <li> <a href="{@docRoot}preview/samples.html">Sample code</a> that - demonstrates how to support permissions and other new features. - <li> <a href="{@docRoot}preview/support.html#release-notes">Release notes</a> - for the current version of the N Developer Preview, including change notes and - diff reports. -</ul> - -<h4 id="reference">Downloadable API Reference</h4> - -<p> - During the early preview updates, you can download the latest - <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API Reference - for the Android N platform</a> as a separate zip archive. The reference - download also includes a diff report that helps you identify API changes from - API 23 and the previous update. -</p> - -<p> - When the Android N APIs are final and an official API level is assigned, - we’ll provide the API reference to you online at <a href= - "https://developer.android.com">https://developer.android.com</a>. -</p> - -<h3 id="support_resources"> - Support resources -</h3> - -<p> - As you test and develop on the N Developer Preview, please use these channels - to report issues and give feedback. -</p> - -<ul> - <li> <a href="https://code.google.com/p/android-developer-preview/">N Developer Preview Issue - Tracker</a> is your <strong>primary feedback channel.</strong> You can report bugs, performance - issues, and general feedback through the issue tracker. You can also check for -<a href="{@docRoot}preview/bugs">known issues</a> and - find workaround steps. We’ll keep you updated on your issue as it’s triaged and sent to - the Android engineering team for review. </li> - <li> The <a href="{@docRoot}preview/dev-community">Android N Developer Community</a> is - a Google+ community where you can <strong>connect with other developers</strong>working with - Android N. You can share observations or ideas or find answers to - questions about Android N. We’ll moderate the community and provide answers and - guidance as needed.</li> -</ul> - -<h3 id="targeting">Targeting, preview APIs, and publishing</h3> - -<p> - The N Developer Preview provides a development-only system and Android - library that <strong>does not have a standard API level</strong>. If you want - to opt out of compatibility behaviors to test your app (which is strongly - recommended), you can target the preview version of Android N by setting your - app's <code><a href= - "{@docRoot}preview/setup-sdk.html#create-update">targetSdkVersion</a></code> - to <code>“N”</code>. -</p> - -<p> - The Android N Developer Preview delivers <strong>preview APIs</strong> - — the APIs will not be official until the final SDK is released, - currently planned for the third quarter of 2016. This means that you can - <strong>expect minor API changes</strong> over time, especially during - initial weeks of the program. We’ll provide a summary of changes to you with - each update of the Android N Developer Preview. -</p> - -<p class="note"> - <strong>Note</strong>: Although preview APIs may change, underlying - system behaviors are stable and ready for testing against - right away. -</p> - -<p> - Google Play <strong>prevents publishing of apps targeting the N Developer - Preview</strong>. When the Android N final SDK is available, you’ll be able - to target the official Android N API level and publish your app to Google - Play via the alpha and beta release channels. Meanwhile, if you want to - distribute an app targeting Android N to testers, you can do so via email or - by direct download from your site. -</p> - -<p> - At the full release of Android N to AOSP and OEMs, planned for Q3 2016, - you’ll be able to publish your apps targeting Android N to the public release - channel in Google Play. -</p> - - -<h2 id="how_to_get_started">How to get started</h2> - -<p> - To get started testing your app with Android N: -</p> - -<ol> - <li> Review the <a href="{@docRoot}preview/api-overview.html">API Overview</a> - and <a href="{@docRoot}preview/behavior-changes.html">Behavior Changes</a> to - get an idea of what's new and how it affects your apps. In particular, - learn about the new <a href="{@docRoot}preview/features/notification-updates.html" - >notifications</a> features and - <a href="{@docRoot}preview/features/multi-window.html">multi-window support</a>.</li> - <li> Set up your environment by following the instructions for <a - href="{@docRoot}preview/setup-sdk.html">Setting up the Preview SDK</a> - and configuring test devices.</li> - <li> Follow the <a href="{@docRoot}preview/download.html"> - instructions</a> to update your device to the latest build of the N Developer - Preview. The easiest way is to enroll your device in - <a href="https://www.google.com/android/beta">Android Beta</a> program. </li> - <li> Review the <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a> - and <a href="{@docRoot}preview/samples.html">Android N samples</a> to gain more - insight into new API features and how to use them in your app. - <li> Join the <a href="{@docRoot}preview/dev-community">Android N - Developer Community</a> to get the latest news and connect with other - developers working with the new platform.</li> -</ol> - -<p> - Thank you for your participation in the Android N Developer Preview program! -</p> diff --git a/docs/html/preview/preview_toc.cs b/docs/html/preview/preview_toc.cs deleted file mode 100644 index 34d00a400ef1..000000000000 --- a/docs/html/preview/preview_toc.cs +++ /dev/null @@ -1,235 +0,0 @@ -<ul id="nav"> - - <li class="nav-section"> - <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/overview.html" - es-lang="Información general del programa" - in-lang="Ikhtisar Program" - ja-lang="プログラム概要" - ko-lang="프로그램 개요" - pt-br-lang="Visão geral do programa" - ru-lang="Обзор программы" - vi-lang="Tổng quan về Chương trình" - zh-cn-lang="计划概览" - zh-tw-lang="程式總覽"> - Program Overview</a></div> - </li> - - - <li class="nav-section"> - <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/support.html"> - Support and Release Notes</a></div> - </li> - - <li class="nav-section"> - <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/setup-sdk.html" - es-lang="Configurar el SDK de la versión preliminar" - in-lang="Menyiapkan Preview" - ja-lang="Preview SDK のセットアップ" - ko-lang="미리 보기 SDK 설정하기" - pt-br-lang="Configuração do Preview SDK" - ru-lang="Настройка пакета SDK Preview" - vi-lang="Kiểm thử trên Thiết bị" - zh-cn-lang="设置预览版 SDK" - zh-tw-lang="設定預覽版 SDK"> - Set Up the Preview</a></div> - </li> - - <li class="nav-section"> - <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/download.html" - es-lang="Pruebe en un dispositivo" - in-lang="Menguji pada Perangkat" - ja-lang="デバイス上でテストする" - ko-lang="기기에서 테스트" - pt-br-lang="Testar em um dispositivo" - ru-lang="Тестирование на устройстве" - vi-lang="Kiểm thử trên Thiết bị" - zh-cn-lang="在设备上测试" - zh-tw-lang="在裝置上測試"> - Test on a Device</a></div> - </li> - - - <li class="nav-section"> - <div class="nav-section-header"><a href="<?cs var:toroot ?>preview/behavior-changes.html" - es-lang="Cambios en los comportamientos" - in-lang="Perubahan Perilaku" - ja-lang="動作の変更点" - ko-lang="동작 변경" - pt-br-lang="Mudanças de comportamento" - ru-lang="Изменения в работе" - vi-lang="Các thay đổi Hành vi" - zh-cn-lang="行为变更" - zh-tw-lang="行為變更">Behavior Changes - </a></div> - <ul> - <li><a href="<?cs var:toroot ?>preview/features/background-optimization.html" - es-lang="Optimizaciones en segundo plano" - in-lang="Optimisasi Latar Belakang" - ja-lang="バックグラウンド処理の最適化" - ko-lang="백그라운드 최적화" - pt-br-lang="Otimizações em segundo plano" - ru-lang="Оптимизация фоновых процессов" - vi-lang="Tối ưu hóa Chạy ngầm" - zh-cn-lang="后台优化" - zh-tw-lang="背景最佳化">Background Optimizations - </a></li> - <li><a href="<?cs var:toroot ?>preview/features/multilingual-support.html" - es-lang="Idioma y configuración regional" - in-lang="Bahasa dan Lokal" - ja-lang="言語とロケール" - ko-lang="언어 및 로케일" - pt-br-lang="Idioma e localidade" - ru-lang="Язык и языковой стандарт" - vi-lang="Ngôn ngữ và Bản địa" - zh-cn-lang="语言和区域设置" - zh-tw-lang="語言和地區設定">Language and Locale - </a></li> - </ul> - </li> - - <li class="nav-section"> - <div class="nav-section-header"><a href="<?cs var:toroot ?>preview/api-overview.html" - es-lang="Información general de la API" - in-lang="Android N untuk Pengembang" - ja-lang="API の概要" - ko-lang="API 개요" - pt-br-lang="Visão geral da API" - ru-lang="Обзор API-интерфейсов" - vi-lang="Android N cho Nhà phát triển" - zh-cn-lang="API 概览" - zh-tw-lang="API 總覽">Android N for Developers - </a></div> - <ul> - - <li><a href="<?cs var:toroot ?>preview/features/multi-window.html" - es-lang="Compatibilidad con ventanas múltiples" - in-lang="Dukungan Multi-Jendela" - ja-lang="マルチ ウィンドウのサポート" - ko-lang="다중 창 지원" - pt-br-lang="Suporte a várias janelas" - ru-lang="Поддержка многооконного режима" - vi-lang="Hỗ trợ đa cửa sổ" - zh-cn-lang="多窗口支持" - zh-tw-lang="多視窗支援"> - Multi-Window Support</a></li> - - <li><a href="<?cs var:toroot ?>preview/features/notification-updates.html" - es-lang="Notificaciones" - in-lang="Pemberitahuan" - ja-lang="通知" - ko-lang="알림" - pt-br-lang="Notificações" - ru-lang="Уведомления" - vi-lang="Thông báo" - zh-cn-lang="通知" - zh-tw-lang="通知"> - Notifications</a></li> - - <li><a href="<?cs var:toroot ?>preview/features/data-saver.html"> - Data Saver</a></li> - - <li><a href="<?cs var:toroot ?>preview/features/tv-recording-api.html" - es-lang="Grabación de TV" - in-lang="Perekaman TV" - ja-lang="TV の録画" - ko-lang="TV 녹화" - pt-br-lang="Gravação para TV" - ru-lang="Запись ТВ" - vi-lang="Ghi lại TV" - zh-cn-lang="TV 录制" - zh-tw-lang="電視錄製"> - TV Recording</a></li> - - <li><a href="<?cs var:toroot ?>preview/features/security-config.html" - es-lang="Configuración de seguridad de la red" - in-lang="Network Security Configuration" - ja-lang="ネットワーク セキュリティ構成" - ko-lang="네트워크 보안 구성" - pt-br-lang="Configurações de segurança de rede" - ru-lang="Конфигурация сетевой безопасности" - vi-lang="Cấu hình Bảo mật mạng" - zh-cn-lang="网络安全配置" - zh-tw-lang="網路安全性設定"> - Network Security Configuration</a></li> - - <li><a href="<?cs var:toroot ?>preview/features/icu4j-framework.html" - es-lang="API de ICU4J del framework de Android" - in-lang="ICU4J Android Framework API" - ja-lang="ICU4J Android フレームワーク API" - ko-lang="ICU4J Android 프레임워크 API" - pt-br-lang="APIs de estrutura do Android para ICU4J" - ru-lang="API-интерфейсы ICU4J в платформе Android" - vi-lang="API Khuôn khổ Android ICU4J" - zh-cn-lang="ICU4J Android 框架 API" - zh-tw-lang="ICU4J Android 架構 API"> - ICU4J Support</a></li> - - <li><a href="<?cs var:toroot ?>preview/j8-jack.html" - es-lang="Funciones del lenguaje Java 8" - in-lang="Fitur Bahasa Java 8" - ja-lang="Java 8 の機能" - ko-lang="Java 8 언어 기능" - pt-br-lang="Recursos de linguagem do Java 8" - ru-lang="Возможности языка Java 8" - vi-lang="Tính năng của Ngôn ngữ Java 8" - zh-cn-lang="Java 8 语言功能" - zh-tw-lang="Java 8 語言功能"> - Java 8 Language Features</a></li> - - <li><a href="<?cs var:toroot ?>preview/features/afw.html"> - Android for Work Updates</a></li> - - <li><a href="<?cs var:toroot ?>preview/features/scoped-folder-access.html" - es-lang="Acceso a directorios determinados" - in-lang="Scoped Directory Access" - ja-lang="特定のディレクトリへのアクセス" - ko-lang="범위가 지정된 디렉터리 액세스" - pt-br-lang="Acesso a diretórios com escopo" - ru-lang="Доступ к выделенным каталогам" - vi-lang="Truy cập Thư mục theo Phạm vi" - zh-cn-lang="作用域目录访问" - zh-tw-lang="限定範圍目錄存取"> - Scoped Directory Access</a></li> - </ul> - </li> - - - - - - - - - - - - - - - - <li class="nav-section"> - <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/samples.html" - es-lang="Ejemplos" - in-lang="Contoh" - ja-lang="サンプル" - ko-lang="샘플" - pt-br-lang="Exemplos" - ru-lang="Примеры" - zh-cn-lang="示例" - zh-tw-lang="範例"> - Samples</a></div> - </li> - - <li class="nav-section"> - <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/license.html" - es-lang="Contrato de licencia" - ja-lang="使用許諾契約" - ko-lang="라이선스 계약" - pt-br-lang="Contrato de licença" - ru-lang="Лицензионное соглашение" - zh-cn-lang="许可协议" - zh-tw-lang="授權協議"> - License Agreement</a></div> - </li> - -</ul> diff --git a/docs/html/preview/setup-sdk.jd b/docs/html/preview/setup-sdk.jd deleted file mode 100644 index ff11e8e93c3f..000000000000 --- a/docs/html/preview/setup-sdk.jd +++ /dev/null @@ -1,175 +0,0 @@ -page.title=Set Up the Preview -meta.keywords="preview", "android" -page.tags="preview", "developer preview" -page.image=images/cards/card-n-sdk_2x.png - -@jd:body - - -<div id="qv-wrapper"> - <div id="qv"> -<ol> - <li><a href="#get-as13">Get Android Studio 2.1</a></li> - <li><a href="#get-sdk">Get the Android N SDK</a> - <ol> - <li><a href="#docs-dl">Reference documentation</a> - </ol> - </li> - <li><a href="#java8">Get the Java 8 JDK</a></li> - <li><a href="#create-update">Update or Create a Project</a></li> - <li><a href="#next">Next Steps</a></li> -</ol> - </div> -</div> - -<p>To develop apps for the Android N Preview, you need to make some updates -to your developer environment, as described on this page.</p> - -<p>To simply test your app's compatibility on the -Android N system image, follow the guide to <a -href="{@docRoot}preview/download.html">Test on an Android N Device</a>.</p> - -<img src="{@docRoot}preview/images/n-preview-setup.png" width="700" alt="" /> - - -<h2 id="get-as13">Get Android Studio 2.1</h2> - -<p>The Android N platform adds support for <a -href="{@docRoot}preview/j8-jack.html">Java 8 language features</a>, -which require a new compiler called Jack. The latest version of Jack -is currently supported only in Android Studio 2.1. So if you want to -use Java 8 language features, you need to use Android Studio 2.1 to -build your app. Otherwise, you don't need to use the Jack compiler, but you -still need to update to JDK 8 to compile against the Android N platform, -as described below.</p> - -<p>If you already have Android Studio installed, make sure you have Android -Studio 2.1 or higher by clicking <strong>Help > Check for Update</strong> -(on Mac, <strong>Android Studio > Check for Updates</strong>).</p> - -<p>If you don't have it, <a href="{@docRoot}studio/">download Android Studio -2.1 here</a>.</p> - - -<h2 id="get-sdk">Get the N Preview SDK</h2> - -<p>To start developing with Android N APIs, you need to install the -Android N Preview SDK in Android Studio as follows:</p> - -<ol> - <li>Open the SDK Manager by clicking <strong>Tools > Android > - SDK Manager</strong>.</li> - - <li>In the <strong>SDK Platforms</strong> tab, select the - <strong>Android N Preview</strong> check box.</li> - - <li>Click the <strong>SDK Tools</strong> tab, then select the - <strong>Android SDK Build Tools</strong>, <strong>Android SDK - Platform-Tools</strong>, and <strong>Android SDK Tools</strong> check - boxes. - </li> - - <li>Click <strong>OK</strong>, then accept the licensing - agreements for any packages that need to be installed. - </li> -</ol> - -<h3 id="docs-dl">Get the N Preview reference documentation</h3> - -<p>Beginning with the Preview 4 release, the API reference for the - N platform (API level 24) is now available online at <a href= - "{@docRoot}reference/">developer.android.com/reference/</a>. There is also - an incremental diff report for <a href="{@docRoot}sdk/api_diff/24/changes.html" - >API changes between API levels 23 and 24</a>.</p> - -<h2 id="java8">Get the Java 8 JDK</h2> - -<p>To compile your app against the Android N platform and use some tools with -Android Studio 2.1, you need to install the Java 8 Developer Kit (JDK 8). So, if -you don't already have the latest version, download JDK 8 now.</p> - -<p>Then set the JDK version in Android Studio as follows:</p> - -<ol> - <li>Open an Android project in Android Studio, then open the - Project Structure dialog by selecting <strong>File > - Project Structure</strong>. (Alternatively, you can set the default - for all projects by selecting <strong>File > Other Settings > - Default Project Structure</strong>.) - </li> - <li>In the left panel of the dialog, click <strong>SDK Location</strong>. - </li> - <li>In the <strong>JDK Location</strong> field, enter the location of the - Java 8 JDK (click the button on the right - to browse your files), then click <strong>OK</strong>. - </li> -</ol> - -<img src="{@docRoot}preview/images/studio-jdk-location.jpg" width="700" - alt="" /> - - -<h2 id="create-update">Update or Create a Project</h2> - -<p>Now that the N platform API level is "24" instead -of "N", you can configure your projects normally with this API level (and even -publish your apps compiled with API 24 on Google Play). Just be sure that you've -updated your project to use <strong>Android SDK Build Tools 24.0.0</strong> and -<strong>Android SDK Platform-Tools 24.0.0</strong>.</p> - -<p>If you plan to use Java 8 language features, you should also read -<a href="{@docRoot}preview/j8-jack.html">Java 8 Language Features</a> -for information about the supported Java 8 features and -how to configure your project with the Jack compiler.</p> - - -<h3 id="update">Update an existing project</h3> - -<p>Open the - <code>build.gradle</code> file for your module and update the values as - follows: -</p> - -<pre> -android { - compileSdkVersion <strong>24</strong> - buildToolsVersion <strong>'24.0.0'</strong> - ... - - defaultConfig { - targetSdkVersion <strong>24</strong> - ... - } - ... -}</pre> - -<p>Now that the API level 24 is final, you can compile against it and keep your -<code>minSdkVersion</code> to whatever version is appropriate for your app.</p> - - -<h3 id="create">Create a new project</h3> - - -<p>To create a new project for development with the Android N Preview SDK:</p> - -<ol> - <li>Click <strong>File > New Project</strong>. and follow the steps until - you reach the <strong>Target Android Devices</strong> page. - </li> - <li>On this page, select the <strong>Phone and Tablet</strong> check box.</li> - <li>Under <strong>Phone and Tablet</strong> option, in the <strong>Minimum - SDK</strong> option list, select - <strong>API 24: Android 6.X (N Preview)</strong>.</li> -</ol> - - -<h2 id="next">Next Steps</h2> - -<ul> - <li>Follow the guide to <a -href="{@docRoot}preview/download.html">Test on an Android N Device</a>.</li> - <li>Learn more about the Android N platform with -<a href="{@docRoot}preview/behavior-changes.html">Behavior Changes</a> -and <a href="{@docRoot}preview/api-overview.html">Android N APIs -and Features</a>.</li> -</ul> diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd deleted file mode 100644 index 0d0d9db2f1c8..000000000000 --- a/docs/html/preview/support.jd +++ /dev/null @@ -1,1698 +0,0 @@ -page.title=Support and Release Notes -meta.keywords="preview", "android" -page.tags="preview", "developer preview" -page.image=images/cards/card-n-support_2x.png - -@jd:body - - -<div id="qv-wrapper"> -<div id="qv"> - -<h2>In this document</h2> - -<ul> - <li><a href="#dp5">Developer Preview 5</a> - <ul> - <li><a href="#general">General advisories</a></li> - <li><a href="#new">New in DP5</a></li> - <li><a href="#ki">Known issues</a></li> - <li><a href="#upgrade-notes">Notes on publishing apps - that target API 24</a></li> - </ul> - </li> - <li><a href="#dp4">Developer Preview 4</a></li> - <li><a href="#dp3">Developer Preview 3</a></li> - <li><a href="#dp2">Developer Preview 2</a></li> - <li><a href="#dp1">Developer Preview 1</a></li> -</ul> - -<!-- -<h2>See Also</h2> -<ol> - <li></li> -</ol> ---> - -</div> -</div> - -<p> - Two primary support channels are available to you when developing and testing - with the Android N Developer Preview: Please file bugs at <a href= - "https://developer.android.com/preview/bug" - >https://developer.android.com/preview/bug</a> for - device-specific, system, and Google App bugs. For issues in other apps, - please contact the developer directly. -</p> - -<p> - To discuss issues or ideas with other developers working with Android N, join - the <a href="{@docRoot}preview/dev-community">Developer Preview Google+ - community</a>. -</p> - -<h2 id="dp5">Developer Preview 5</h2> - -<div class="cols"> - <div class="col-6of12"> - <p> - <em>Date: July 2016<br> - Build: NPD90G<br> - Emulator support: x86 & ARM (32/64-bit)<br> - Google Play services: 8.4</em> - </p> - </div> -</div> - -<h3 id="general">General advisories</h3> - -<p> - This Developer Preview release is for <strong>app developers and other early - adopters</strong> and is available for daily use, development, or - compatibility testing. Please be aware of these general notes about the - release: -</p> - -<ul> - <li>This release may have various <strong>stability issues</strong> on - supported devices. - </li> - - <li>Some apps <strong>may not function as expected</strong> on the new - platform version. This includes Google’s apps as well as other apps. - </li> - - <li>Developer Preview 5 is <strong>Compatibility Test Suite (CTS) - approved</strong> on these devices: Nexus 5X, Nexus 6, Nexus 6P, Nexus 9, - and Pixel C. Apps that depend on CTS approved builds should work normally - on these devices (Android Pay for example). - </li> - - <li>Developer Preview 5 is <strong>available</strong> on Nexus 5X, Nexus 6, Nexus 6P, - Nexus 9, Nexus Player, Pixel C, and General Mobile 4G (Android One). - </li> -</ul> - - -<h3 id="new">New in DP5</h3> - -<h4>Updated system images for supported devices and emulator</h4> - -<p> - Developer Preview 5 includes <a href= - "{@docRoot}preview/download.html"><strong>near-final system - images</strong></a> for supported devices and the Android emulator. The - images include the final APIs (API level 24) for the upcoming Android N - platform. When you are done testing, you can publish apps using API - level 24 to Google Play, in alpha, beta, and production release channels. -</p> - - -<!-- - -<h4 id="api-changes">Feature and API changes</h4> - -<ul> - <li>TODO</li> -</ul> - ---> - -<h3 id="ki">Known Issues</h3> - -<h4>Stability</h4> - -<ul> - <li>Users may encounter system instability (such as kernel panics and - crashes). - </li> -</ul> - -<h4>Multi-window</h4> -<ul> - <li>MapView may be blank when resized in multi-window mode and not focused. - </li> -</ul> - -<h4>Do Not Disturb</h4> -<ul> - <li>Do Not Disturb mode may be set at device reboot. To work around - the issue, delete the existing rule for VR as follows: go to - <strong>Settings > Sound > Do not disturb > Automatic Rules</strong> - and tap the trash icon next to the VR rule. - </li> -</ul> - -<h4>Screen zoom and multiple APKs in Google Play</h4> -<ul> - <li>On devices running Developer Preview 5, Google Play services 9.0.83 - incorrectly reports the current screen density rather than the stable screen - density. When screen zoom is enabled on these devices, this can cause Google - Play to select a version of a multi-APK app that’s designed for smaller - screens. This issue is fixed in the next version of Google Play services. - </li> -</ul> - -<h4>Vulkan support and multiple APKs in Google Play</h4> -<ul> - <li>On devices running Developer Preview 5, Google Play services 9.0.83 - currently reports Vulkan support but not Vulkan version. This can cause - Google Play to select a version of a multi-APK app that’s designed for lower - Vulkan support on devices with higher version support. Currently, the Google - Play Store does not accept uploads of Apps which use Vulkan version - targeting. This support will be added to the Google Play Store in the - future any Android N devices using the Google Play services 9.0.83 will - continue to receive versions of Apps targeting basic Vulkan support. - </li> -</ul> - -<h4>Android Auto</h4> -<ul> - <li>The version of Google Maps included in Developer Preview 5 (9.30) - crashes when used with Android Auto. This issue will be fixed in the - next update to Google Maps (9.31), expected in the coming weeks. - </li> -</ul> - - - -<!-- TBA, if any -<h4>Device-specific issues</h4> - -<dl> - <dt> - <strong>Device Name</strong> - </dt> - - <dd> - Issue 1 - </dd> - - <dd> - Issue 2 - </dd> -</dl> - ---> -<!-- TBA, if any - -<h4 id="dp5-fixes">Fixes for issues reported by developers</h4> - -<p> - A number of issues reported by developers have been fixed, including: -</p> - -<ul> - <li>TODO</li> -</ul> - ---> - -<h3 id="upgrade-notes">Notes on publishing apps that target API 24</h3> - -<p> - Before publishing apps that target API 24 in Google Play, keep these points - in mind: -</p> - -<ul> - <li>If your app’s current <code>targetSdkVersion</code> is 22 or lower and - you want to target API 24, you’ll need to support <a href= - "{@docRoot}about/versions/marshmallow/android-6.0-changes.html">behaviors - introduced with Android 6.0 (Marshmallow)</a>, such as <a href= - "{@docRoot}training/permissions/requesting.html">runtime permissions</a>, in - addition to Android N behaviors. - </li> - - <li>Once you publish an app with <code>targetSdkVersion</code> set to 23 or - higher, you can't later publish a version of the app with a higher - <code>versionCode</code> that targets 22 or lower. This restriction applies - in alpha and beta channels as well as production channel. - </li> -</ul> - - -<!-- DP4 Release Notes Archive --> - -<h2 id="dp4">Developer Preview 4</h2> - -<div class="wrap"> - <div class="cols"> - <div class="col-6of12"> - <p> - <em>Date: June 2016<br> - Build: NPD56N<br> - Emulator support: x86 & ARM (32/64-bit)<br> - Google Play services: 8.4</em> - </p> - </div> - </div> -</div> - -<h3 id="dp4-general">General advisories</h3> - -<p> - This Developer Preview release is for <strong>app developers and other early - adopters</strong> and is available for daily use, development, or - compatibility testing. Please be aware of these general notes about the - release: -</p> - -<ul> - <li>This release may have various <strong>stability issues</strong> on - supported devices. - </li> - - <li>Some apps <strong>may not function as expected</strong> on the new - platform version. This includes Google’s apps as well as other apps. - </li> - - <li>Developer Preview 4 is <strong>Compatibility Test Suite (CTS) - approved</strong> on these devices: Nexus 5X, Nexus 6, Nexus 6P, and - Pixel C. Apps that depend on CTS approved builds should work normally - on these devices (Android Pay for example). - </li> - - <li>Developer Preview 4 is <strong>available on all supported - devices:</strong> Nexus 5X, Nexus 6, Nexus 6P, Nexus 9, Nexus Player, - Pixel C, General Mobile 4G (Android One), as well as Sony Xperia Z3 - (D6603 and D6653 models). - </li> -</ul> - - -<h3 id="dp4-new">New in DP4</h3> - -<h4>Android N final APIs</h4> - -<p> - Developer Preview 4 includes the <strong>final APIs</strong> for the upcoming - Android N platform. The new API level is 24. -</p> - -<h4>Play publishing</h4> - -<p> - You can now publish apps that use <strong>API level 24</strong> to Google - Play, in alpha, beta, and production release channels. -</p> - -<h4>Android Studio and tools updates</h4> - -<p> - Along with Developer Preview 4 we’re providing the <strong>final API 24 - SDK</strong> to be used with Android Studio 2.1.2 and higher. In addition, - we’re releasing updated Developer Preview 4 system images for the emulator to - help test your apps. -</p> - -<p> - As new updates roll out for Android Studio, you should see minor improvements in - the new project wizards and AVD manager as we add enhanced support for API 24. - These are primarily cosmetic changes and should not stop you from getting - your app ready for an update in the Play store. -</p> - -<h4 id="dp4-api-changes">Feature and API changes</h4> - -<ul> - <li>In previous versions of Android, an app activates with all of its locale - resources loaded before locale negotiation begins. Starting in Android N DP4, - the system negotiates resource locales individually for each resource object - before the app activates. - </li> - - <li>As announced at Developer Preview 3, we’ve deferred the Launcher - Shortcuts feature to a later release of Android. In Developer Preview 4, - we’ve removed the Launcher Shortcuts APIs. - </li> - - <li>We’ve changed the BLE Scanning behavior starting in DP4. We’ll prevent - applications from starting and stopping scans more than 5 times in 30 - seconds. For long running scans, we’ll convert them into opportunistic scans. - </li> - - <li>The <a href= - "{@docRoot}preview/features/multi-window.html">Multi-Window</a> - <code>android:minimalHeight</code> and <code>android:minimalWidth</code> - attributes have been renamed to <code>android:minHeight</code> and - <code>android:minWidth</code>. - </li> -</ul> - -<h3 id="dp4-ki">Known Issues</h3> - -<h4>Stability</h4> - -<ul> - <li>Users may encounter system instability (such as kernel panics and - crashes). - </li> -</ul> - -<h4>Launcher</h4> - -<ul> - <li>The default launcher’s <strong>All Apps</strong> tray may become - unresponsive after cycling the screen off and on. Returning to the - homescreen and relaunching the <strong>All Apps</strong> tray may resolve - this issue. - </li> -</ul> - -<h4>Setup Wizard</h4> - -<ul> - <li>Crash on selecting "Not now" in "Set up email" screen. - </li> -</ul> - -<h4>Media</h4> - -<ul> - <li>Media playback may be unreliable on Nexus 9 and Nexus Player, including - issues playing HD video. - </li> - - <li>Occasional freeze when running the YouTube app with other apps in - multi-window mode on Pixel C devices. In some cases hard reboot is required. - </li> - - <li>Apps may have issues playing some Widevine DRM-protected content on Nexus - 9 devices. - </li> - - <li>Issues handling VP8 video on Nexus 9 devices. - </li> -</ul> - -<h4>External storage</h4> - -<ul> - <li>Apps may become unstable when the user moves them from internal storage - to adoptable external storage (this can include SD card or devices attached - over USB). - </li> -</ul> - -<h4>Screen zoom and multiple APKs in Google Play</h4> - -<ul> - <li>On devices running Android N, Google Play services 9.0.83 incorrectly - reports the current screen density rather than the stable screen density. - When screen zoom is enabled on these devices, this can cause Google Play to - select a version of a multi-APK app that’s designed for smaller screens. This - issue is fixed in the next version of Google Play services and will be - included in a later Developer Preview release. - </li> -</ul> - -<h4>Vulkan support and multiple APKs in Google Play</h4> - -<ul> - <li>On devices running Android N, Google Play services 9.0.83 currently - reports Vulkan support but not Vulkan version. This can cause Google Play to - select a version of a multi-APK app that’s designed for lower Vulkan support - on devices with higher version support. Currently, the Google Play Store does - not accept uploads of apps which use Vulkan version targeting. This support - will be added to the Google Play Store in the future and fixed in the next - version of Google Play services (to be included in a later Developer Preview - release). Any N devices using the version of Google Play services 9.0.83 will - continue to receive versions of apps targeting basic Vulkan support. - </li> -</ul> - -<h4>Accessibility</h4> -<ul> - <li>Switch access doesn't allow user to navigate web pages in Chrome. - </li> - - <li>Accessibility issues for talkback users with notification dismissal, and - wifi selection screen. - </li> -</ul> - -<h4>Android for Work</h4> - -<ul> - <li>Currently, CA certificates provisioned through {@link - android.app.admin.DevicePolicyManager} are not - available to profiles other than the primary user/profile due to a preload - issue. For example, this could prevent a user from connecting to a trusted - server when in a Work profile. This issue will be resolved in the next - Developer Preview. - </li> - - <li>After reboot with work mode off, solving work challenge does not switch - on work mode. - </li> - - <li>Users receiving a video call in Hangouts have to unlock work challenge - first. - </li> - - <li>Accessing Settings > Security > Device Security crash observed when - separating primary and work challenge. - </li> - - <li>If {@link android.os.UserManager#DISALLOW_CONFIG_VPN} is set before - calling {@link android.app.admin.DevicePolicyManager#setAlwaysOnVpnPackage - DevicePolicyManager.setAlwaysOnVpnPackage()}, then setting always on VPN does - not work. That is, after rebooting the device with the {@link - android.os.UserManager#DISALLOW_CONFIG_VPN} restriction set, VPN is not - autostarted. - </li> -</ul> - -<h4>Android Auto</h4> - -<p> - The version of Google Maps included in Developer Preview 4 (9.30) crashes - when used with Android Auto. This issue will be fixed in the next update to - Google Maps (9.31), expected in the coming weeks. -</p> - - -<!-- TBA, if any -<h4>Device-specific issues</h4> - -<dl> - <dt> - <strong>Device Name</strong> - </dt> - - <dd> - Issue 1 - </dd> - - <dd> - Issue 2 - </dd> -</dl> - ---> - - -<h4 id="dp4-fixes">Fixes for issues reported by developers</h4> - -<p> - A number of issues reported by developers have been fixed, including: -</p> - -<ul> - <li>The active network state ({@link android.net.NetworkInfo#getState - NetworkInfo.getState()} and {@link android.net.NetworkInfo#getDetailedState - NetworkInfo.getDetailedState()}) might return incorrect values during some - restricted background scenarios - </li> - - <li>Data Saver restricts the foreground MMS mobile network request - (<a href="https://code.google.com/p/android/issues/detail?id=208478">bug - 208478</a>) - </li> - - <li>Quick settings tiles and notifications sometimes unresponsive - </li> - - <li>Unable to dismiss Clock notifications - </li> - - <li>Duplication of bluetooth icon and other status icons - </li> - - <li>Additional bluetooth connectivity fixes - </li> - -</ul> - -<p>For the full list of fixed issues, see <a href="https://goo.gl/6uCKtf">the -issue tracker</a>.</p> - -<h3 id="dp4-upgrade-notes">Notes on publishing apps that target API 24</h3> - -<p> - Before publishing apps that target API 24 in Google Play, keep these points - in mind: -</p> - -<ul> - <li>If your app’s current <code>targetSdkVersion</code> is 22 or lower and - you want to target API 24, you’ll need to support <a href= - "{@docRoot}about/versions/marshmallow/android-6.0-changes.html">behaviors - introduced with Android 6.0 (Marshmallow)</a>, such as <a href= - "{@docRoot}training/permissions/requesting.html">runtime permissions</a>, in - addition to Android N behaviors. - </li> - - <li>Once you publish an app with <code>targetSdkVersion</code> set to 23 or - higher, you can't later publish a version of the app with a higher - <code>versionCode</code> that targets 22 or lower. This restriction applies - in alpha and beta channels as well as production channel. - </li> -</ul> - -<!-- DP3 Release Notes Archive --> - -<h2 id="dp3">Developer Preview 3</h2> - -<div class="wrap"> - <div class="cols"> - <div class="col-6of12"> - <p> - <em>Date: May 2016<br> - Build: NPD35K<br> - Emulator support: x86 & ARM (32/64-bit)<br> - Google Play services: 8.4</em> - </p> - </div> - </div> -</div> - -<h3 id="dp3-general">General advisories</h3> - -<p> - This Developer Preview release is for <strong>app developers and other early - adopters</strong> and is available for daily use, development, or - compatibility testing. Please be aware of these general notes about the - release: -</p> - -<ul> - <li>This release may have various <strong>stability issues</strong> on - supported devices. Users may encounter system instability, such as kernel - panics and crashes. - </li> - - <li>Some apps <strong>may not function as expected</strong> on the new - platform version. This includes Google’s apps as well as other apps. - </li> - - <li>Developer Preview 3 is <strong>Compatibility Test Suite (CTS) - approved</strong> on these devices: Nexus 5X, Nexus 6, Nexus 6P, and Pixel - C. Apps that depend on CTS approved builds should - work normally on these devices (Android Pay for example). - </li> - - <li>Developer Preview 3 is <strong>available on all supported - devices:</strong> Nexus 5X, Nexus 6, Nexus 6P, Nexus 9, Nexus Player, Pixel - C, General Mobile 4G (Android One), as well as Sony Xperia Z3 (D6603 and - D6653 models). - - </li> -</ul> - - -<h3 id="dp3-new">New in DP3</h3> - -<h4>VR Mode for Android</h4> - -<p> - Android N adds platform support and optimizations for a new VR Mode to let - developers build high quality mobile VR experiences for users. There are a - number of performance enhancements, including access to an exclusive CPU core - for VR apps. Within your apps, you can take advantage of intelligent - head-tracking, and stereo notifications that work for VR. Most importantly, - Android N provides for very low latency graphics. -</p> - -<p> - For more information, see the <a href= - "https://developers.google.com/vr/android/">Google VR SDK for Android</a>. -</p> - -<h4>Sustained performance mode</h4> - -<p> - Android N includes optional support for <a href= - "{@docRoot}preview/api-overview.html#sustained_performance_api">sustained - performance mode</a>, enabling OEMs to provide hints on device performance - capabilities for long running applications. App developers can then use these - hints to tune applications for a predictable, consistent level of device - performance over long periods of time. App developers can try out this new - API in the developer preview on Nexus 6P devices only. -</p> - -<h4>Multiprocess WebView</h4> - -<p> - Starting with version 51 in Android N, WebView will run web content in a - separate sandboxed process when the developer option "Multiprocess WebView" - is enabled. The WebView team is looking for feedback on compatibility and - runtime performance in N before enabling multiprocess WebView in a future - version of Android. In this version, regressions in startup time, total - memory usage and software rendering performance are expected. -</p> - -<p> - If you find unexpected issues in multiprocess mode we’d like to hear about - them. Please get in touch with the WebView team by <a href= - "https://bugs.chromium.org/p/chromium/issues/entry?template=Webview%20Bugs"> - filing a bug</a>. -</p> - -<h4>Keyboard Shortcuts helper</h4> - -<p> - Android N lets users press <code>Meta+/</code> to trigger a <strong>Keyboard - Shortcuts</strong> screen that displays all shortcuts available both from the - system and from the app in focus. Developers can add their own shortcuts or - trigger the Shortcuts screen from their apps. See <a href= - "{@docRoot}preview/api-overview.html#keyboard_shortcuts_helper">Keyboard - Shortcuts helper</a> for details. -</p> - -<h4>FrameMetrics API</h4> - -<p> - DP3 introduces a new <a href= - "{@docRoot}preview/api-overview.html#framemetrics_api">FrameMetrics API</a> - that allows an app to monitor its UI rendering performance by exposing a - streaming pubsub API to transfer frame timing info for the application’s - current window. <code>FrameMetricsListener</code> can be used to measure - interaction-level UI performance in production with higher granularity and - without the need for a USB connection. -</p> - -<h4 id="dp3-api-changes">Feature and API changes</h4> - -<dl> - <dt> - Launcher Shortcuts and the Launcher Shortcuts API - </dt> - - <dd> - We’ve decided to defer this feature to a future release of Android. We plan - to remove the Launcher Shortcuts APIs (ShortcutManager and others) from the - public Android N API starting in the next developer preview. - </dd> - - <dt> - WebView Javascript run before page load - </dt> - - <dd> - Starting with apps targeting Android N, the Javascript context is reset - when a new page is loaded. Currently, the context is carried over for the - first page loaded in a new {@link android.webkit.WebView} instance. - Developers looking to inject Javascript into the {@link - android.webkit.WebView} should execute the script after the page has - started to load. - </dd> - - <dt> - WebView Geolocation on insecure origins - </dt> - - <dd> - Starting with apps targeting Android N, the geolocation API will only be - allowed on secure origins (over HTTPS.) This policy is designed to protect - users' private information when they're using an insecure connection. - </dd> - - <dt> - Data Saver - </dt> - - <dd> - Starting in Developer Preview 3, apps can use use an intent to display a - system dialog that lets the user directly add the app to the Data Saver - exemption whitelist. See the <a href= - "{@docRoot}preview/api-overview.html#data_saver">Data Saver - documentation</a> for details. - </dd> - - <dt> - <a href= - "{@docRoot}preview/api-overview.html#number-blocking">Number-blocking</a> - </dt> - - <dd> - If an unauthorized user attempts to block or unblock a number, the - operation now fails with {@link java.lang.SecurityException}. (Previously, - the operation threw {@link java.lang.UnsupportedOperationException}.) - </dd> - - <dt> - <a href="{@docRoot}preview/api-overview.html#tile_api">Quick Settings Tile - API</a> - </dt> - - <dd> - The system now uses the activity's metadata to decide on the tile mode. - (Previously, tile mode was determined by the return value of - <code>TileService.onTileAdded()</code>.) For more information, see - <code>TileService.META_DATA_ACTIVE_TILE</code> in the downloadable <a href= - "{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a>. - </dd> -</dl> - -<h4 id="dp3-fixes">Fixes for issues reported by developers</h4> - -<p> - A number of issues reported by developers have been fixed, including: -</p> - -<ul> - <li>Bluetooth Audio playback interrupted after 1 song (bug <a href= - "https://code.google.com/p/android/issues/detail?id=206889">206889</a>) - </li> - - <li>Pixel C Consistently Crashes (bug <a href= - "https://code.google.com/p/android/issues/detail?id=206962">206962</a>) - </li> - - <li>Clock and Toast notification issues (bug <a href= - "https://code.google.com/p/android/issues/detail?id=203094">203094</a>) - </li> - - <li>Pixel C reboots when connected to MacBook Pro via USB C Cable (bug - <a href= - "https://code.google.com/p/android/issues/detail?id=205432">205432</a>) - </li> - - <li>Calandar offset by one day (bug <a href= - "https://code.google.com/p/android/issues/detail?id=203002">203002</a>) - </li> - - <li>TelephonyManager.getAllCellInfo returning invalid data (bug <a href= - "https://code.google.com/p/android/issues/detail?id=203022">203022</a>) - </li> - - <li>Nexus 6p, Bluetooth keeps disconnecting (bug <a href= - "https://code.google.com/p/android/issues/detail?id=208062">208062</a>) - </li> -</ul> - -<p>For the full list of fixed issues, see <a href="https://goo.gl/6uCKtf">the -issue tracker</a>.</p> - -<h3 id="dp3-ki">Known Issues</h3> - -<h4>Accessibility</h4> - -<ul> - <li>Unable to listen to TTS output when pitch is set near maximum level. - </li> - - <li>Accessibility features and settings may be disrupted with the user adds a - Work profile, including magnification gesture and setting. Accessibility - state is restored when the user next touches the associated settings. - </li> -</ul> - -<h4>Camera</h4> - -<ul> - <li>The Camera app has exhibited instability; it may crash in various - circumstances, such as when launched in multi-window mode. - </li> - - <li>Pressing the shutter continuously in panorama mode may cause the Camera - app to crash. - </li> -</ul> - -<h4>Audio</h4> -<ul> - <li>A platform audio player issue prevents some apps from functioning - normally. For example, Skype and other apps are affected by this issue. - </li> -</ul> - -<h4>Connectivity</h4> - - -<ul> - <li>When a Bluetooth Low Energy (BLE) peripheral role device advertises a - service and a BLE central role device connects, the peripheral role device - disconnects very quickly. - </li> - - <li>Wi-Fi connection may be dropped when the screen is off. - </li> - - <li>RFCOMM connections are unstable and may result in data corruption and - dangling connections. - </li> - - <li>The active network state ({@link android.net.NetworkInfo#getState - NetworkInfo.getState()} and {@link android.net.NetworkInfo#getDetailedState - NetworkInfo.getDetailedState()}) might return incorrect values during some - restricted background scenarios. - </li> -</ul> - - -<h4> - Launcher -</h4> - -<ul> - <li>The default launcher’s All Apps tray may become unresponsive after - cycling screen off / screen on. Returning to the homescreen and relaunching - the All Apps tray may resolve this issue. - </li> -</ul> - -<h4> - Keyboard -</h4> - -<ul> - <li>When updating a device running Android 6.0 or earlier to the N Developer - Preview, Google Keyboard does not preserve preferences data such as recent - emoji and sound settings. - </li> - - <li>Google Indic Managed Keyboard may be unstable. - </li> - - <li>When entering text in a password field, the user can select Russian as - the input language but the keyboard remains in English. This prevents the - user from entering Russian-language passwords. - </li> -</ul> - -<h4> - Locale and languages -</h4> - -<ul> - <li>When using a right-to-left (RTL) locale, the system may unexpectedly - switch to left-to-right (LTR) presentation after restarting the device. - </li> -</ul> - -<h4>Media</h4> - -<ul> - <li>Media playback be be unreliable on Nexus 9 and Nexus Player, including - issues playing HD video. - </li> -</ul> - -<h4> - Multi-window mode -</h4> - -<ul> - <li>Device may freeze when changing orientation in multi-window mode. - </li> - - <li>Several apps currently have issues with multi-window mode: - <ul> - <li>The system UI may crash when docking Settings > Display > - Screen brightness to multi-window. - </li> - - <li>The Camera app may crash when launched in multi-window mode. - </li> - - <li>YouTube may crash when launched into multi-window mode. To fix the - issue, you can clear the YouTube app’s data at Storage > Apps > - YouTube. - </li> - </ul> - </li> -</ul> - -<h4> - Google Play services -</h4> - -<ul> - <li>Apps using Google Cast through Google Play services may be unstable when - the user selects a system locale that uses letters and numbers outside of the - ASCII range. - </li> -</ul> - -<h4> - Android for Work and Google Apps Device Policy -</h4> - -<ul> - <li>The Device Policy app may crash when the user unlocks the device with the - "device policy status" screen pinned. - </li> - - <li>After setting up a work profile with file-based encryption enabled and - then turning off Work, users must unlock primary profile screen lock to once - again access Work apps. - </li> - - <li>Device reboots when removing the security pattern lock and opening work - app/personal app in the multi-window. - </li> - - <li>Setting DISALLOW_VPN_CONFIG is causing the consent dialog to appear in - always-on-vpn set by Device Policy Client. - </li> - - <li>Traffic is not locked down until VPN is connected in always-on-vpn mode. - </li> -</ul> - -<h4> - External storage -</h4> - -<ul> - <li>Apps may become unstable when the user moves them from internal storage - to adoptable external storage (this can include SD card or devices attached - over USB). - </li> -</ul> - -<h4> - Screen zoom and multiple APKs in Google Play -</h4> - -<ul> - <li>On devices running Android N, Google Play services 9.0.83 incorrectly reports - the current screen density rather than the stable screen density. When screen - zoom is enabled on these devices, this can cause Google Play to select a - version of a multi-APK app that’s designed for smaller screens. This issue is - fixed in the next version of Google Play services and will be included in a - later Developer Preview release. - </li> - - <li>On devices running Android N, Google Play services 9.0.83 currently reports - Vulkan support but not Vulkan version. This can cause Google Play to select a - version of a multi-APK app that’s designed for lower Vulkan support on - devices with higher version support. Currently, the Google Play Store does - not accept uploads of Apps which use Vulkan version targeting. This support - will be added to the Google Play Store in the future and fixed in the next - version of Google Play services (to be included in a later Developer Preview - release) any N devices using the version of Google Play services 9.0.83 will - continue to receive versions of Apps targeting basic Vulkan support. - </li> -</ul> - -<h4>Notifications</h4> - -<ul> - <li>MessagingStyle does not show notifications with "null" (self) sender. - </li> -</ul> - -<h4>Developer Tools</h4> - -<ul> - <li> - <code>adb</code> may sometimes disconnect while using JDWP debugging. - </li> -</ul> - - -<!-- DP2 Release Notes Archive --> - -<h2 id="dp2">Developer Preview 2</h2> - -<div class="wrap"> - <div class="cols"> - <div class="col-6of12"> - <p> - <em>Date: April 2016<br> - Builds: NPC91K, NPC91O<br> - Emulator support: x86 & ARM (32/64-bit)<br> - Google Play services: 8.4</em> - </p> - </div> - </div> -</div> - -<h3 id="dp2-new">New in DP2</h3> - -<ul> - <li>Platform support for Vulkan, a new 3D rendering API that provides - explicit, low-overhead GPU (Graphics Processor Unit) control and offers - improved performance for draw-call heavy applications. For details, see the - <a href="{@docRoot}ndk/guides/graphics/index.html">documentation</a>. - </li> - - <li>New people emoji with support for skin tones, and new Unicode 9 glyphs. - Skin tone and new emoji will not show up until keyboards build support for - them in the palette. Apps should not need to take any action to take - advantage of these new emoji, unless the apps use a non-system font. IME - developers need to incorporate support for the new emoji. - </li> - - <li> - <a href="{@docRoot}preview/api-overview.html#launcher_shortcuts">Launcher - Shortcuts API</a>: Apps can use <code>ShortcutManager</code> to send - shortcuts to starting points within themselves to the launcher. - </li> - - <li> - <a href="{@docRoot}preview/features/multi-window.html">Multi-Window</a>: - You can now specify a separate minimum height and minimum width for an - activity. In addition, several API names have been slightly changed. - </li> -</ul> - -<h4 id="dp2-fixes">Fixes for issues reported by developers</h4> - -<p> - A number of issues reported by developers have been fixed, including: -</p> - -<ul> - <li>Can’t connect to hidden SSID or non-broadcast Wi-Fi. (bug <a href= - "https://code.google.com/p/android/issues/detail?id=203116">203116</a>) - </li> - - <li>Microphone mute state persists across activities. (bug <a href= - "https://code.google.com/p/android/issues/detail?id=205922">205922</a>) - </li> - - <li>Changing multi-window focus pauses YouTube. (bug <a href= - "https://code.google.com/p/android/issues/detail?id=203424">203424</a>) - </li> - - <li>Direct Reply may close open activity. (bug <a href= - "https://code.google.com/p/android/issues/detail?id=204411">204411</a>) - </li> - - <li>Various stability fixes. - </li> -</ul> - -<h3 id="dp2-general">General advisories</h3> - -<p> - This Developer Preview release is for <strong>app developers only</strong> - and is designed for use in compatibility testing and early development only. - Please be aware of these general notes about the release: -</p> - -<ul> - - <li>The development tool components and support libraries have been updated - for the DP2 release. Make sure to update your preview development environment - before developing for DP2. For instructions on setting up your development - environment, see - <a href="{@docRoot}preview/setup-sdk.html">Set Up the Preview</a>. - </li> - - <li>This release has various stability and performance issues on all devices - that make it <strong>not suitable for daily use on phone or tablet</strong>, - especially for non-developers. - </li> - - <li>Battery life and performance have not yet been optimized with this - release: - - <ul> - <li>System and app <strong>performance is known to be periodically slow / - janky</strong>, and devices may become occasionally unresponsive. These - problems may become more acute with prolonged use. - </li> - - <li>Battery life may be regressed in this release for screen-on and - screen-off use cases. - </li> - </ul> - </li> - - <li>Some <strong>apps may not function normally</strong> on Developer Preview - 2. This includes Google’s apps as well as other apps. - </li> - - <li>This early build is not <strong>Compatibility Test Suite (CTS) - approved</strong>. Apps that depend on CTS approved builds won’t work - (Android Pay for example). - </li> - - <li>This preview release supports the following devices: Nexus 5X, Nexus 6, - Nexus 6P, Nexus 9, and Pixel C, as well as General Mobile 4G - (Android One). Support for Nexus Player is coming soon. - </li> - - - <li><a href= - "https://github.com/googlesamples/android-testdpc/releases">TestDPC</a> has - been updated to handle API changes between DP1 and DP2. - </li> -</ul> - -<h3 id="dp2-ki">Known Issues</h3> - -<h4>Performance and battery</h4> - -<ul> - <li>System and app performance is known to be <strong>periodically slow / - janky</strong>, and device may become occasionally unresponsive. These - problems may become more acute with prolonged use. - </li> -</ul> - -<h4>Google accounts</h4> - -<ul> - <li>In some circumstances, there can be issues with - <code>AccountManagerService</code> that prevent logging in to Google accounts - </li> -</ul> - -<h4>System update</h4> - -<ul> - <li>Device may restart immediately after updating to DP2. - </li> -</ul> - -<h4>Accessibility</h4> - -<ul> - <li>Problem with listening to text-to-speech (TTS) output when pitch is set - near maximum level. - </li> -</ul> - -<h4>Bluetooth</h4> - -<ul> - <li>Bluetooth Low Energy (LE) GATT characteristics are using the wrong write - type and will not be sent to a remote device. Thus, for example, some fitness - devices will not work. - </li> -</ul> - -<h4>Setup wizard</h4> - -<ul> - <li>The option to restore data on a new device (or newly reset device) from - "Your Google Account" is not actionable in the setup wizard. You must restore - data from an existing device by selecting "another Android device" in the - setup wizard, or else set it up as a new device. - </li> -</ul> - -<h4>OEM unlock</h4> - -<ul> - <li>On some devices, <strong>Enable OEM unlock</strong> is grayed out in - "Developer Options" while running DP2.<br> - <strong>Workaround:</strong> Opt in to - the Android Beta Program (if you are not already opted in) by visiting - <a href="https://www.google.com/android/beta" class= - "external-link">www.google.com/android/beta</a>. Then, opt out and accept the - downgrade OTA. Opting out causes the device to downgrade to Android 6.0. You - should now be able to choose <strong>Enable OEM unlock</strong> in - "Developer Options". Personal data is erased when you downgrade the - device; however, unlocking the bootloader would have erased this data anyway. - </li> -</ul> - -<h4>Android for Work</h4> - -<ul> - <li>Work Security Challenge - <ul> - <li>After migration to N, or after the user creates work profiles, work - profiles can't create keys in the keystore until the user changes their - pattern, PIN, or password, or sets up a Work Challenge. - </li> - - <li>In Direct boot mode, applying the passcode restrictions to the device - causes the work profile to be unlocked, even though the device is locked. - This makes the work profile accessible even though it should be protected - by the device lock screen. - </li> - </ul> - </li> - - <li>Always On VPN - <ul> - <li>If Always On VPN mode is turned on, but VPN is not available, apps - connect over the ordinary network. Apps should be offline if they have no - VPN connection available. - </li> - - <li>When Always On mode is on, a VPN connection is not established after - a device reboots into Direct boot mode, even after the user unlocks the - secure lock screen. - </li> - </ul> - </li> - - <li>Suspend Packages - <ul> - <li>Device admins can suspend critical system packages, which may lead to - unexpected behavior, such as placing calls despite the "Telephone - disabled" dialog being displayed. - </li> - </ul> - </li> - - <li>Other - <ul> - <li>The Settings app crashes on launch if {@link - android.os.UserManager#DISALLOW_MOUNT_PHYSICAL_MEDIA} is set to true when - the user inserts physical media such as an SD card. - </li> - - <li>The first check-in in a Work Profile takes several minutes to - complete. - </li> - </ul> - </li> -</ul> - -<h4 id="vulkan">Vulkan</h4> - -<ul> - <li>Nexus 5X/6P</li> - <ul> - <li>Gaps between binding numbers and non-zero - as the first binding number causes {@code vkCreateGraphicsPipeline()} to fail.</li> - <li>Vulkan exhibits incorrect sampling behavior on projected texture coordinates.</li> - <li>in the multithreadCmdBuffer sample, {@code vkCmdClearColorImage()} crashes when - running with the N-DP2 driver.</li> - <li>Return values from {@code vkGetPhysicalDeviceFormatProperties()} do not set a value - for {@code VkFormatProperties::linearTilingFeatures}, which takes a value of 0 as - a result.</li> - <li>Vulkan floating point frame buffer attachments are not handled correctly.</li> - </ul> - <li>Nexus Player</li> - <ul> - <li>SPIR-V shaders may trigger driver asserts.</li> - <li>Some pipeline configurations may cause {@code vkCreateGraphicsPipeline()} - to crash.</li> - </ul> -</ul> - -<h4>Device-specific issues</h4> - -<dl> - <dt> - <strong>Android One</strong> - </dt> - - <dd> - Data connection fails when device is switched from slot 1 to slot 2 SIM. - </dd> - - <dt> - <strong>Pixel C</strong> - </dt> - - <dd> - Unable to toggle Voice Search "Always On" option. - </dd> - - <dt> - <strong>Nexus 6</strong> - </dt> - - <dd> - Camera pictures in portrait orientation are corrupted, except for HDR+ - photos. - </dd> - - <dt> - <strong>Nexus Player</strong> - </dt> - - <dd> - Playback of Netflix HD content may fail on Nexus Player. - </dd> - - <dd> - Any application that relies on dynamic video resolution changes may fail on - Nexus Player. - </dd> - - <dd> - Any application that use the VP9 video codec may fail on Nexus Player. - </dd> -</dl> - -<!-- DP 1 release notes archive --> - -<h2 id="dp1">Developer Preview 1</h2> - -<div class="wrap"> - <div class="cols"> - <div class="col-6of12"> - <p> - <em>Date: March 2016<br> - Builds: NPC56P, NPC56R, updated: NPC56W, NPC56X<br> - Emulator support: x86 & ARM (32/64-bit)<br> - Google Play services: 8.4</em> - </p> - </div> - </div> -</div> - -<h3 id="dp1-general">General advisories</h3> - -<p> - This Developer Preview release is for app developers only and is designed for - use in compatibility testing and early development only. Please be aware of - these general notes about the release: -</p> -<ul> - <li>This release has various stability and performance issues on all devices - that make it <em>not suitable for daily use on phone or tablet</em>, - especially for non-developers. - </li> - - <li>System and app performance is known to be <strong>periodically slow / - janky</strong>, and device may become occasionally unresponsive. These - problems may become more acute with prolonged use. - </li> - - <li>Battery life may be regressed in this release for screen-on and - screen-off use cases. - </li> - - <li>Some apps may not function normally on Developer Preview 1. This includes - Google’s apps as well as other apps. - </li> - - <li>This early build is not Compatibility Test Suite (CTS) approved. Apps - that depend on CTS approved builds (Android Pay for example) won’t work. - </li> - - <li>This preview release supports the following devices: Nexus 5X, Nexus 6, - Nexus 6P, Nexus 9, Nexus Player, and Pixel C, as well as General Mobile 4G - (Android One). - </li> -</ul> - -<h3 id="dp1-platform">Platform Issues</h3> - -<h4>Performance and battery</h4> - -<ul> - <li>System and app performance is known to be <strong>periodically slow / - janky</strong>, and device may become occasionally unresponsive. These - problems may become more acute with prolonged use. - </li> - - <li>Battery life may be regressed in this release for screen-on and - screen-off use cases. - </li> -</ul> -<h4 id="dialer">Dialer</h4> - -<ul> - <li>Dialer app does not support Direct boot. This will be addressed later in - N Developer Preview. - </li> - - <li>Voicemail playback does not work. - </li> -</ul> - -<h4>Microphone</h4> - -<ul> - <li>The system may incorrect persists the microphone mute state across apps and reboots. If you mute the microphone in an app and the state is persisted, open any app that has microphone mute controls and unmute the microphone.</li> -</ul> - -<h4 id="ui">System UI</h4> - -<ul> - <li>Some new or modified strings in the system UI are not translated to all - languages. - </li> - - <li>Overview UI is still in development, and subject to change. For example, - we intend to remove the timer that appears when the user switches between - apps. - </li> - - <li>Settings controls and toggles may be slow or appear to be unresponsive. - </li> - - <li>Visual design of notifications is subject to change. - </li> - - <li>In the Gmail app, direct archiving of emails included in a notification - bundle does not work properly. - </li> -</ul> - -<h4>Android for Work</h4> - -<ul> - <li>Work Security Challenge - <ul> - <li>After migration to N, or after the user creates work profiles, work - profiles can't create keys in the keystore until the user changes their - pattern, PIN, or password, or sets up a Work Challenge. - </li> - - <li>In Direct boot mode, applying the passcode restrictions to the device - causes the work profile to be unlocked, even though the device is locked. - This makes the work profile accessible even though it should be protected - by the device lock screen. - </li> - - <li>When the user enters a wrong password and pin, the system does not - display any informational message; instead, it only clears the input - field. This issue does not affect pattern or fingerprint input. - </li> - - <li>On a tablet, the background displayed with the work challenge is - disproportionately small. - </li> - - <li>The version of <a href= - "https://play.google.com/store/apps/details?id=com.google.android.apps.enterprise.dmagent"> - Google Apps Device Policy</a> that is bundled with N Developer Preview - does not yet support the Work Profile Security Challenge feature. - Developers should instead use <a href= - "https://github.com/googlesamples/android-testdpc/releases">TestDPC</a> - to test this feature. - </li> - </ul> - </li> - - <li>Always On VPN - <ul> - <li>If Always On VPN mode is turned on, but VPN is not available, apps - not specified as exceptions to the Always On policy connect over the - ordinary network. Unless specified as exceptions to Always On VPN policy, - apps should be offline if they have no VPN connection available. - <ul> - <li>When Always On mode is on, a VPN connection is not established - after a device reboots into Direct boot mode, even after the user - unlocks the secure lock screen. - </li> - </ul> - </li> - </ul> - </li> - - <li>Improved Contacts - <ul> - <li>Bluetooth PBAP/MAP devices do not display Caller ID for work - contacts. The next release of Preview resolves this issue. - </li> - </ul> - </li> - - <li>Work Mode - <ul> - <li>The Google Now Launcher does not display whether Work Mode is on or - off. The Launcher also does not show app suspension state. - </li> - - <li>After the user turns Work Mode off and on, the system no longer shows - Work profile app widgets, such as Calendar. - </li> - </ul> - </li> - - <li>Suspend Packages - </li> - - <li>Device admins can suspend critical system packages, which may lead to - unexpected behavior, such as placing calls despite the Telephone disabled - dialog’s being displayed. - </li> - - <li>Other - <ul> - <li>The Settings app crashes on launch if {@link - android.os.UserManager#DISALLOW_MOUNT_PHYSICAL_MEDIA} is set to true when - the user inserts physical media such as an SD card. - </li> - - <li>The {@code DPM.setPackagesSuspended} state does not persist when the - user uninstalls and then reinstalls an app. Either the app should remain - suspended after uninstall/reinstall, or suspended apps should not be - uninstallable - </li> - - <li>The first check-in in a Work Profile takes several minutes to - complete. This may cause the device to take longer than normal to be - visible in the Play EMM API. - </li> - - <li>Notifications from Work Profile apps are not visible to notification - listeners installed in the personal profile. As a result, the system does - not display Notifications as expected. - </li> - - </ul> - </li> -</ul> - -<h4 >Keyboard</h4> - -<ul> - <li>Bluetooth pairing between keyboards and Android devices may be unstable. - </li> -</ul> - -<h4 >Video</h4> - -<ul> -<li>Video playback may lag and show interruptions.</li> -</ul> - -<h4>Wi-Fi</h4> - -<ul> - <li>Wi-Fi has undergone some refactoring which may change API corner case - behavior. Specifically, applications which attempt to connect to specific - networks, or attempt to reconnect to networks should retest. - </li> - - <li>The legacy DHCP client has been removed from the platform. The only DHCP - client that the platform supports is the DHCP client introduced in M. - </li> -</ul> - -<h4>Direct boot</h4> - -<ul> - <li>NFC doesn't function until first unlock. - <ul> - <li>When a phone with Bluetooth enabled is restarted, Bluetooth does not - turn on automatically. You must manually re-enable Bluetooth. - </li> - - <li>Under some circumstances, the default ringtone may not sound for - phone calls and messages. This behavior is fixed in the next N Preview - release, with one exception (and workaround): - </li> - - <li>On a device that is not freshly wiped--one that has been booted at - least once since being set to direct boot mode--the default notification - ringtone does not sound. The user can work around this issue by manually - selecting a ringtone from Settings. - </li> - - <li>Direct boot is not enabled by default on devices running an N - Developer Preview build. To enable direct boot for testing and - development, go to Developer Options and tap Convert to File Encryption. - In this dev preview, this requires a factory reset to repartition and - reformat your device for File-based Encryption. - </li> - </ul> - </li> -</ul> - -<h4>Picture-in-picture for Android TV</h4> - -<ul> - <li>The PIP integration in the Recents UI is not finalized, and is subject to - change. - <ul> - <li>The animation of the PIP window is not smooth. Future releases of the - Preview will improve this. - </li> - </ul> - </li> - - <li style="list-style: none">Future releases of the Preview will improve upon - the visual design and layout alignment of PIP. - </li> -</ul> - -<h4>Bug reports</h4> - -<ul> - <li>Bug reports do not always complete successfully (as a workaround, - sometimes they can still be accessed through the bug report document provider - in internal storage). - </li> -</ul> - -<h4>Split-screen Multi-window</h4> - -<ul> - <li>Apps may experience crashes and unexpected UI behavior when put into - split-screen mode. These are app issues that must be fixed by the app - developer. - </li> - - <li>When an app targets a version of the Android platform earlier than N, the - App may not work with split-screen toast may appear multiple times. - </li> - - <li>Long-pressing the Overview button while using an app with a fixed - orientation may produce unexpected app behavior. - </li> - - <li>Apps may flicker while resizing. - </li> - - <li>Animations are not yet final. - </li> -</ul> - -<h4>Input method</h4> - -<ul> - <li>Google Keyboard unexpectedly falls back to the generic Google keyboard - when <b>Use system language</b>, but Google Keyboard doesn’t support any of - the languages selected in the system-language preferences. It should fall - back to American English. - <p> - You can work around this problem by adding at least one language that - Google Keyboard supports. - </p> - </li> -</ul> - -<h4>Accessibility</h4> - -<ul> - <li>TalkBack exhibits issues with features including Notifications, Quick - Settings Tiles and Multi-window display that may cause system crashing or - lack of spoken feedback from TalkBack. Future releases of the preview will - address these issues. - </li> -</ul> - -<h3 id="dp1-device-sp">Device-Specific Notes and Issues</h3> - -<h4>Nexus Player</h4> -<ul> - <li>Video playback, app compatibility and stability issues are expected on - Nexus Player in this release of the Preview. - </li> -</ul> - -<h4>Pixel C</h4> -<ul> -<li>Multi-window resizing may cause crashing.</li> -</ul> - -<h4>Nexus 9</h4> -<ul> -<li>Nexus 9 devices may not start after receiving an over-the-air (OTA) update - via the Android Beta Program. To recover from this issue, you can try - to manually install the OTA image. For more information, see - <a href="{@docRoot}preview/download-ota.html">Applying a Device OTA Image</a>. -</li> -</ul> - diff --git a/docs/html/topic/libraries/data-binding/index.jd b/docs/html/topic/libraries/data-binding/index.jd index ec6e58c15ca1..454bb59e7983 100644 --- a/docs/html/topic/libraries/data-binding/index.jd +++ b/docs/html/topic/libraries/data-binding/index.jd @@ -246,21 +246,21 @@ android { </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 @@ public class User { </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 @@ public class User { <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 @@ protected void onCreate(Bundle savedInstanceState) { } </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 @@ public class Presenter { </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 @@ public class Presenter { 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 @@ public class Presenter { } </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 @@ public class Presenter { } </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 @@ public class Presenter { } </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 @@ If you need to use an expression with a predicate (e.g. ternary), you can use {@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 @@ any business logic inside the callback method that you invoked from the listener </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 @@ any business logic inside the callback method that you invoked from the listener <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 @@ any business logic inside the callback method that you invoked from the listener <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 @@ any business logic inside the callback method that you invoked from the listener 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 @@ any business logic inside the callback method that you invoked from the listener </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 @@ any business logic inside the callback method that you invoked from the listener <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 @@ android:transitionName='@{"image_" + id}' <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 @@ android:text="@{map[key]}" </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 @@ private static class User { } </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 @@ user.put("age", 17); <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 @@ user.add(17); <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 @@ public abstract void setNote(String note); <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 @@ public abstract void setNote(String note); </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 @@ public void onBindViewHolder(BindingHolder holder, int position) { 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 @@ namespace for the attribute does not matter, only the attribute name itself. </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 @@ public static void loadImage(ImageView view, String url, Drawable error) { } </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 @@ public static void setListener(View view, final OnViewDetachedFromWindow detach, <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/topic/performance/_book.yaml b/docs/html/topic/performance/_book.yaml index 94cfc576aad5..e053a2c1bdfe 100644 --- a/docs/html/topic/performance/_book.yaml +++ b/docs/html/topic/performance/_book.yaml @@ -26,6 +26,8 @@ toc: path: /topic/performance/threads.html - title: Optimizing View Hierarchies path: /topic/performance/optimizing-view-hierarchies.html +- title: Background Optimization + path: /topic/performance/background-optimization.html - title: Intelligent Job-Scheduling path: /topic/performance/scheduling.html - title: Reducing APK Size diff --git a/docs/html/preview/features/background-optimization.jd b/docs/html/topic/performance/background-optimization.jd index 326513b10aed..3e4c041367a0 100644 --- a/docs/html/preview/features/background-optimization.jd +++ b/docs/html/topic/performance/background-optimization.jd @@ -379,7 +379,7 @@ public boolean onStartJob(JobParameters params) { <li style="list-style: none; display: inline"> <pre class="no-pretty-print"> -{@code $ adb shell cmd appops set <package_name> RUN_IN_BACKGROUND ignore} +{@code $ adb shell cmd appops set <package_name> RUN_IN_BACKGROUND ignore} </pre> </li> @@ -389,7 +389,7 @@ public boolean onStartJob(JobParameters params) { <li style="list-style: none; display: inline"> <pre class="no-pretty-print"> -{@code $ adb shell cmd appops set <package_name> RUN_IN_BACKGROUND allow} +{@code $ adb shell cmd appops set <package_name> RUN_IN_BACKGROUND allow} </pre> </li> </ul> diff --git a/docs/html/training/_book.yaml b/docs/html/training/_book.yaml index 953a17655411..0523ec9e12b0 100644 --- a/docs/html/training/_book.yaml +++ b/docs/html/training/_book.yaml @@ -420,6 +420,8 @@ toc: path: /training/basics/network-ops/connecting.html - title: Managing Network Usage path: /training/basics/network-ops/managing.html + - title: Optimizing Network Data Usage + path: /training/basics/network-ops/data-saver.html - title: Parsing XML Data path: /training/basics/network-ops/xml.html - title: Transferring Data Without Draining the Battery diff --git a/docs/html/preview/features/data-saver.jd b/docs/html/training/basics/network-ops/data-saver.jd index abc47eaa3837..75b72645282a 100644 --- a/docs/html/preview/features/data-saver.jd +++ b/docs/html/training/basics/network-ops/data-saver.jd @@ -1,42 +1,39 @@ -page.title=Data Saver -metaDescription=User-enabled data usage optimization. -page.keywords="android N", "data usage", "metered network" -page.image=images/cards/card-nyc_2x.jpg +page.title=Optimizing Network Data Usage +parent.title=Performing Network Operations +parent.link=index.html + +trainingnavtop=true +next.title=Parsing XML Data +next.link=xml.html + @jd:body -<div id="qv-wrapper"> - <div id="qv"> - <h2> - In this document - </h2> - - <ol> - <li> - <a href="#status">Checking Data Saver Preferences</a> - <ol> - <li> - <a href="#request-whitelist">Requesting whitelist permissions</a> - </li> - </ol> - </li> - - <li> - <a href="#monitor-changes">Monitoring Changes to Data Saver - Preferences</a> - </li> - - <li> - <a href="#testing">Testing with Android Debug Bridge Commands</a> - </li> - </ol> - </div> +<div id="tb-wrapper"> +<div id="tb"> + + + +<h2>This lesson teaches you to</h2> +<ol> + <li><a href="#status">Check Data-Saver Preferences</a> + <ul> + <li><a href="#request-whitelist">Request whitelist permissions</a></li> + </ul> + </li> + <li><a href="#monitor-changes">Monitor Changes to Data Saver Preferences</a></li> + <li><a href="#testing">Test with Android Debug Bridge Commands</a></li> +</ol> + +</div> </div> <p> Over the life of a smartphone, the cost of a cellular data plan can easily - exceed the cost of the device itself. In the N Developer Preview, users can - enable Data Saver on a device-wide basis in order to use less data, whether - roaming, near the end of the billing cycle, or on a small prepaid data pack. + exceed the cost of the device itself. From Android 7.0 (API level 24), + users users can enable Data Saver on a device-wide basis in order + optimize their device's data usage, and use less data. This ability + is especially useful when roaming, near the end of the billing cycle, + or for a small prepaid data pack. </p> <p> @@ -253,4 +250,4 @@ if (connMgr.isActiveNetworkMetered()) { Sets wifi with the specified SSID as metered, allowing you to simulate a metered network on an unmetered network. </dd> -</dl>
\ No newline at end of file +</dl> diff --git a/docs/html/training/basics/network-ops/managing.jd b/docs/html/training/basics/network-ops/managing.jd index 2609db5a0160..a29e8745add9 100644 --- a/docs/html/training/basics/network-ops/managing.jd +++ b/docs/html/training/basics/network-ops/managing.jd @@ -6,8 +6,8 @@ trainingnavtop=true previous.title=Connecting to the Network previous.link=connecting.html -next.title=Parsing XML Data -next.link=xml.html +next.title=Optimizing Network Data Usage +next.link=data-saver.html @jd:body diff --git a/docs/html/training/in-app-billing/preparing-iab-app.jd b/docs/html/training/in-app-billing/preparing-iab-app.jd index 2c6e9a074d31..780f2f800a7c 100755..100644 --- 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 @@ next.link=list-iab-products.html </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 @@ presented with the welcome screen.</li> </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 @@ public void onCreate(Bundle savedInstanceState) { } </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 @@ mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() { }); </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 @@ public void onDestroy() { mHelper = null; } </pre> - - - - - diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk index c9d4af69c0df..366ef716c109 100644 --- a/libs/hwui/Android.mk +++ b/libs/hwui/Android.mk @@ -113,6 +113,10 @@ hwui_cflags := \ -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \ -Wall -Wno-unused-parameter -Wunreachable-code -Werror +ifeq ($(TARGET_USES_HWC2),true) + hwui_cflags += -DUSE_HWC2 +endif + # GCC false-positives on this warning, and since we -Werror that's # a problem hwui_cflags += -Wno-free-nonheap-object diff --git a/libs/hwui/FrameInfo.cpp b/libs/hwui/FrameInfo.cpp index 41e22332d8ed..09b3945c7f55 100644 --- a/libs/hwui/FrameInfo.cpp +++ b/libs/hwui/FrameInfo.cpp @@ -35,8 +35,14 @@ const std::string FrameInfoNames[] = { "IssueDrawCommandsStart", "SwapBuffers", "FrameCompleted", + "DequeueBufferDuration", + "QueueBufferDuration", }; +static_assert((sizeof(FrameInfoNames)/sizeof(FrameInfoNames[0])) + == static_cast<int>(FrameInfoIndex::NumIndexes), + "size mismatch: FrameInfoNames doesn't match the enum!"); + void FrameInfo::importUiThreadInfo(int64_t* info) { memcpy(mFrameInfo, info, UI_THREAD_FRAME_INFO_SIZE * sizeof(int64_t)); } diff --git a/libs/hwui/FrameInfo.h b/libs/hwui/FrameInfo.h index 0baca391be79..1fe54591cf7e 100644 --- a/libs/hwui/FrameInfo.h +++ b/libs/hwui/FrameInfo.h @@ -48,6 +48,9 @@ enum class FrameInfoIndex { SwapBuffers, FrameCompleted, + DequeueBufferDuration, + QueueBufferDuration, + // Must be the last value! NumIndexes }; diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp index ebe9c4240221..ed6b211eef1b 100644 --- a/libs/hwui/JankTracker.cpp +++ b/libs/hwui/JankTracker.cpp @@ -16,6 +16,7 @@ #include "JankTracker.h" #include "Properties.h" +#include "utils/TimeUtils.h" #include <algorithm> #include <cutils/ashmem.h> @@ -119,11 +120,27 @@ static uint32_t frameTimeForFrameCountIndex(uint32_t index) { return index; } -JankTracker::JankTracker(nsecs_t frameIntervalNanos) { +JankTracker::JankTracker(const DisplayInfo& displayInfo) { // By default this will use malloc memory. It may be moved later to ashmem // if there is shared space for it and a request comes in to do that. mData = new ProfileData; reset(); + nsecs_t frameIntervalNanos = static_cast<nsecs_t>(1_s / displayInfo.fps); +#if USE_HWC2 + nsecs_t sfOffset = frameIntervalNanos - (displayInfo.presentationDeadline - 1_ms); + nsecs_t offsetDelta = sfOffset - displayInfo.appVsyncOffset; + // There are two different offset cases. If the offsetDelta is positive + // and small, then the intention is to give apps extra time by leveraging + // pipelining between the UI & RT threads. If the offsetDelta is large or + // negative, the intention is to subtract time from the total duration + // in which case we can't afford to wait for dequeueBuffer blockage. + if (offsetDelta <= 4_ms && offsetDelta >= 0) { + // SF will begin composition at VSYNC-app + offsetDelta. If we are triple + // buffered, this is the expected time at which dequeueBuffer will + // return due to the staggering of VSYNC-app & VSYNC-sf. + mDequeueTimeForgiveness = offsetDelta + 4_ms; + } +#endif setFrameInterval(frameIntervalNanos); } @@ -213,6 +230,19 @@ void JankTracker::addFrame(const FrameInfo& frame) { mData->totalFrameCount++; // Fast-path for jank-free frames int64_t totalDuration = frame.duration(sFrameStart, FrameInfoIndex::FrameCompleted); + if (mDequeueTimeForgiveness + && frame[FrameInfoIndex::DequeueBufferDuration] > 500_us) { + nsecs_t expectedDequeueDuration = + mDequeueTimeForgiveness + frame[FrameInfoIndex::Vsync] + - frame[FrameInfoIndex::IssueDrawCommandsStart]; + if (expectedDequeueDuration > 0) { + // Forgive only up to the expected amount, but not more than + // the actual time spent blocked. + nsecs_t forgiveAmount = std::min(expectedDequeueDuration, + frame[FrameInfoIndex::DequeueBufferDuration]); + totalDuration -= forgiveAmount; + } + } uint32_t framebucket = frameCountIndexForFrameTime(totalDuration); // Keep the fast path as fast as possible. if (CC_LIKELY(totalDuration < mFrameInterval)) { diff --git a/libs/hwui/JankTracker.h b/libs/hwui/JankTracker.h index 84b8c3f3f155..126025c00933 100644 --- a/libs/hwui/JankTracker.h +++ b/libs/hwui/JankTracker.h @@ -21,6 +21,7 @@ #include "utils/RingBuffer.h" #include <cutils/compiler.h> +#include <ui/DisplayInfo.h> #include <array> #include <memory> @@ -56,7 +57,7 @@ struct ProfileData { // TODO: Replace DrawProfiler with this class JankTracker { public: - JankTracker(nsecs_t frameIntervalNanos); + JankTracker(const DisplayInfo& displayInfo); ~JankTracker(); void addFrame(const FrameInfo& frame); @@ -79,6 +80,14 @@ private: std::array<int64_t, NUM_BUCKETS> mThresholds; int64_t mFrameInterval; + // The amount of time we will erase from the total duration to account + // for SF vsync offsets with HWC2 blocking dequeueBuffers. + // (Vsync + mDequeueBlockTolerance) is the point at which we expect + // SF to have released the buffer normally, so we will forgive up to that + // point in time by comparing to (IssueDrawCommandsStart + DequeueDuration) + // This is only used if we are in pipelined mode and are using HWC2, + // otherwise it's 0. + nsecs_t mDequeueTimeForgiveness = 0; ProfileData* mData; bool mIsMapped = false; }; diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 4b9d7d5b8328..d68f0e383152 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -67,7 +67,7 @@ CanvasContext::CanvasContext(RenderThread& thread, bool translucent, , mEglManager(thread.eglManager()) , mOpaque(!translucent) , mAnimationContext(contextFactory->createAnimationContext(mRenderThread.timeLord())) - , mJankTracker(thread.timeLord().frameIntervalNanos()) + , mJankTracker(thread.mainDisplayInfo()) , mProfiler(mFrames) , mContentDrawBounds(0, 0, 0, 0) { mRenderNodes.emplace_back(rootRenderNode); @@ -199,6 +199,8 @@ static bool wasSkipped(FrameInfo* info) { } bool CanvasContext::isSwapChainStuffed() { + static const auto SLOW_THRESHOLD = 6_ms; + if (mSwapHistory.size() != mSwapHistory.capacity()) { // We want at least 3 frames of history before attempting to // guess if the queue is stuffed @@ -209,8 +211,8 @@ bool CanvasContext::isSwapChainStuffed() { // Was there a happy queue & dequeue time? If so, don't // consider it stuffed - if (swapA.dequeueDuration < 3_ms - && swapA.queueDuration < 3_ms) { + if (swapA.dequeueDuration < SLOW_THRESHOLD + && swapA.queueDuration < SLOW_THRESHOLD) { return false; } @@ -225,8 +227,8 @@ bool CanvasContext::isSwapChainStuffed() { // Was there a happy queue & dequeue time? If so, don't // consider it stuffed - if (swapB.dequeueDuration < 3_ms - && swapB.queueDuration < 3_ms) { + if (swapB.dequeueDuration < SLOW_THRESHOLD + && swapB.queueDuration < SLOW_THRESHOLD) { return false; } @@ -284,11 +286,6 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo, if (CC_LIKELY(mSwapHistory.size())) { nsecs_t latestVsync = mRenderThread.timeLord().latestVsync(); SwapHistory& lastSwap = mSwapHistory.back(); - int durationUs; - mNativeSurface->query(NATIVE_WINDOW_LAST_DEQUEUE_DURATION, &durationUs); - lastSwap.dequeueDuration = us2ns(durationUs); - mNativeSurface->query(NATIVE_WINDOW_LAST_QUEUE_DURATION, &durationUs); - lastSwap.queueDuration = us2ns(durationUs); nsecs_t vsyncDelta = std::abs(lastSwap.vsyncTime - latestVsync); // The slight fudge-factor is to deal with cases where // the vsync was estimated due to being slow handling the signal. @@ -565,6 +562,15 @@ void CanvasContext::draw() { 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); + mCurrentFrameInfo->set(FrameInfoIndex::DequeueBufferDuration) + = swap.dequeueDuration; + mCurrentFrameInfo->set(FrameInfoIndex::QueueBufferDuration) + = swap.queueDuration; mHaveNewSurface = false; mFrameNumber = -1; } diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp index 9fb30c928c00..f4b44164b84e 100644 --- a/libs/hwui/renderthread/RenderThread.cpp +++ b/libs/hwui/renderthread/RenderThread.cpp @@ -190,7 +190,7 @@ void RenderThread::initThreadLocals() { initializeDisplayEventReceiver(); mEglManager = new EglManager(*this); mRenderState = new RenderState(*this); - mJankTracker = new JankTracker(frameIntervalNanos); + mJankTracker = new JankTracker(mDisplayInfo); } int RenderThread::displayEventReceiverCallback(int fd, int events, void* data) { diff --git a/libs/hwui/utils/TimeUtils.h b/libs/hwui/utils/TimeUtils.h index 8d42d7e55521..ce181b766841 100644 --- a/libs/hwui/utils/TimeUtils.h +++ b/libs/hwui/utils/TimeUtils.h @@ -21,10 +21,18 @@ namespace android { namespace uirenderer { +constexpr nsecs_t operator"" _s (unsigned long long s) { + return seconds_to_nanoseconds(s); +} + constexpr nsecs_t operator"" _ms (unsigned long long ms) { return milliseconds_to_nanoseconds(ms); } +constexpr nsecs_t operator"" _us (unsigned long long us) { + return microseconds_to_nanoseconds(us); +} + } /* namespace uirenderer */ } /* namespace android */ diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/AddPrinterActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/AddPrinterActivity.java index 2f58de531dda..c06e8496a7d5 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 class AddPrinterActivity extends ListActivity implements AdapterView.OnIt 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 aa1a046974f0..1d56668a82d0 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 ee1821dc6bbe..c6a45bcf1e9f 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 @@ public class UsageView extends FrameLayout { 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/values/config.xml b/packages/SystemUI/res/values/config.xml index fa30f49ef7db..f48039ee7fe8 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -126,6 +126,9 @@ <!-- Should "4G" be shown instead of "LTE" when the network is NETWORK_TYPE_LTE? --> <bool name="config_show4GForLTE">true</bool> + <!-- Should "LTE"/"4G" be shown instead of "LTE+"/"4G+" when on NETWORK_TYPE_LTE_CA? --> + <bool name="config_hideLtePlus">false</bool> + <!-- milliseconds before the heads up notification auto-dismisses. --> <integer name="heads_up_notification_decay">5000</integer> 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 63f726b545db..95cb672666fe 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 @@ public class ButtonDispatcher { 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 @@ public class ButtonDispatcher { 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 23aeae8c5b33..0f4d9ed278c7 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 @@ public class NavigationBarView extends LinearLayout { mCarMode = true; uiCarModeChanged = true; } + getHomeButton().setCarMode(mCarMode); } return uiCarModeChanged; } 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 3df759068ae9..61bac2d8d3c4 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 class KeyButtonView extends ImageView implements ButtonDispatcher.ButtonI 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 8178bdaded04..83463e29c080 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java @@ -197,11 +197,22 @@ public class MobileSignalController extends SignalController< if (mConfig.show4gForLte) { mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE, TelephonyIcons.FOUR_G); - mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE_CA, - TelephonyIcons.FOUR_G_PLUS); + if (mConfig.hideLtePlus) { + mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE_CA, + TelephonyIcons.FOUR_G); + } else { + mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE_CA, + TelephonyIcons.FOUR_G_PLUS); + } } else { mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE, TelephonyIcons.LTE); - mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE_CA, TelephonyIcons.LTE_PLUS); + if (mConfig.hideLtePlus) { + mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE_CA, + TelephonyIcons.LTE); + } else { + mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE_CA, + TelephonyIcons.LTE_PLUS); + } } mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_IWLAN, TelephonyIcons.WFC); } @@ -460,6 +471,10 @@ public class MobileSignalController extends SignalController< } mServiceState = state; mDataNetType = state.getDataNetworkType(); + if (mDataNetType == TelephonyManager.NETWORK_TYPE_LTE && mServiceState != null && + mServiceState.isUsingCarrierAggregation()) { + mDataNetType = TelephonyManager.NETWORK_TYPE_LTE_CA; + } updateTelephony(); } @@ -471,6 +486,10 @@ public class MobileSignalController extends SignalController< } mDataState = state; mDataNetType = networkType; + if (mDataNetType == TelephonyManager.NETWORK_TYPE_LTE && mServiceState != null && + mServiceState.isUsingCarrierAggregation()) { + mDataNetType = TelephonyManager.NETWORK_TYPE_LTE_CA; + } updateTelephony(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index a31bc04d8318..7893a1a0880a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -852,6 +852,7 @@ public class NetworkControllerImpl extends BroadcastReceiver boolean showAtLeast3G = false; boolean alwaysShowCdmaRssi = false; boolean show4gForLte = false; + boolean hideLtePlus = false; boolean hspaDataDistinguishable; static Config readConfig(Context context) { @@ -864,6 +865,7 @@ public class NetworkControllerImpl extends BroadcastReceiver config.show4gForLte = res.getBoolean(R.bool.config_show4GForLTE); config.hspaDataDistinguishable = res.getBoolean(R.bool.config_hspa_data_distinguishable); + config.hideLtePlus = res.getBoolean(R.bool.config_hideLtePlus); return config; } } diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java index af6fec2f6274..2094c0866d6f 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java @@ -973,6 +973,7 @@ public class VolumeDialog implements TunerService.Tunable { mDialog.dismiss(); mZenFooter.cleanup(); initDialog(); + mDensity = density; } updateWindowWidthH(); mSpTexts.update(); diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 1106262ce190..b7461ee79548 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -479,7 +479,7 @@ public class ConnectivityService extends IConnectivityManager.Stub } } - private final IpConnectivityLog mMetricsLog = new IpConnectivityLog(); + private final IpConnectivityLog mMetricsLog; /** * Implements support for the legacy "one network per network type" model. @@ -677,8 +677,16 @@ public class ConnectivityService extends IConnectivityManager.Stub public ConnectivityService(Context context, INetworkManagementService netManager, INetworkStatsService statsService, INetworkPolicyManager policyManager) { + this(context, netManager, statsService, policyManager, new IpConnectivityLog()); + } + + @VisibleForTesting + protected ConnectivityService(Context context, INetworkManagementService netManager, + INetworkStatsService statsService, INetworkPolicyManager policyManager, + IpConnectivityLog logger) { if (DBG) log("ConnectivityService starting up"); + mMetricsLog = logger; mDefaultRequest = createInternetRequestForTransport(-1); NetworkRequestInfo defaultNRI = new NetworkRequestInfo(null, mDefaultRequest, new Binder()); mNetworkRequests.put(mDefaultRequest, defaultNRI); diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 7531808a8a4a..90e2a5bde5b1 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -12709,6 +12709,7 @@ public final class ActivityManagerService extends ActivityManagerNative return; } if (pr.hasTopUi != hasTopUi) { + Slog.i(TAG, "Setting hasTopUi=" + hasTopUi + " for pid=" + pid); pr.hasTopUi = hasTopUi; changed = true; } @@ -19203,10 +19204,14 @@ public final class ActivityManagerService extends ActivityManagerNative // facilitate this, here we need to determine whether or not it // is currently showing UI. app.systemNoUi = true; - if (app == TOP_APP || app.hasTopUi) { + if (app == TOP_APP) { app.systemNoUi = false; app.curSchedGroup = ProcessList.SCHED_GROUP_TOP_APP; app.adjType = "pers-top-activity"; + } else if (app.hasTopUi) { + app.systemNoUi = false; + app.curSchedGroup = ProcessList.SCHED_GROUP_TOP_APP; + app.adjType = "pers-top-ui"; } else if (activitiesSize > 0) { for (int j = 0; j < activitiesSize; j++) { final ActivityRecord r = app.activities.get(j); @@ -19232,7 +19237,7 @@ public final class ActivityManagerService extends ActivityManagerNative int procState; boolean foregroundActivities = false; BroadcastQueue queue; - if (app == TOP_APP || app.hasTopUi) { + if (app == TOP_APP) { // The last app on the list is the foreground app. adj = ProcessList.FOREGROUND_APP_ADJ; schedGroup = ProcessList.SCHED_GROUP_TOP_APP; @@ -21548,8 +21553,9 @@ public final class ActivityManagerService extends ActivityManagerNative @Override public boolean isUserRunning(int userId, int flags) { - if (userId != UserHandle.getCallingUserId() && checkCallingPermission( - INTERACT_ACROSS_USERS) != PackageManager.PERMISSION_GRANTED) { + if (!mUserController.isSameProfileGroup(userId, UserHandle.getCallingUserId()) + && checkCallingPermission(INTERACT_ACROSS_USERS) + != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: isUserRunning() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() diff --git a/services/core/java/com/android/server/am/PreBootBroadcaster.java b/services/core/java/com/android/server/am/PreBootBroadcaster.java index b24edb9074cb..f4f6b661c0e1 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 @@ public abstract class PreBootBroadcaster extends IIntentReceiver.Stub { 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/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java index e74b3a32a2b8..3fffefbfe48a 100644 --- a/services/core/java/com/android/server/am/ProcessRecord.java +++ b/services/core/java/com/android/server/am/ProcessRecord.java @@ -436,6 +436,9 @@ final class ProcessRecord { pw.print(prefix); pw.print(" - "); pw.println(receivers.valueAt(i)); } } + if (hasTopUi) { + pw.print(prefix); pw.print("hasTopUi="); pw.print(hasTopUi); + } } ProcessRecord(BatteryStatsImpl _batteryStats, ApplicationInfo _info, diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java index 9c22be724bbc..c9283b2283b9 100644 --- a/services/core/java/com/android/server/am/UserController.java +++ b/services/core/java/com/android/server/am/UserController.java @@ -1478,6 +1478,9 @@ final class UserController { } boolean isSameProfileGroup(int callingUserId, int targetUserId) { + if (callingUserId == targetUserId) { + return true; + } synchronized (mUserProfileGroupIdsSelfLocked) { int callingProfile = mUserProfileGroupIdsSelfLocked.get(callingUserId, UserInfo.NO_PROFILE_GROUP_ID); diff --git a/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/services/core/java/com/android/server/connectivity/NetworkMonitor.java index 92c4577f3e0c..42d80fc6fc48 100644 --- a/services/core/java/com/android/server/connectivity/NetworkMonitor.java +++ b/services/core/java/com/android/server/connectivity/NetworkMonitor.java @@ -200,7 +200,7 @@ public class NetworkMonitor extends StateMachine { private final WifiManager mWifiManager; private final AlarmManager mAlarmManager; private final NetworkRequest mDefaultRequest; - private final IpConnectivityLog mMetricsLog = new IpConnectivityLog(); + private final IpConnectivityLog mMetricsLog; private boolean mIsCaptivePortalCheckEnabled; private boolean mUseHttps; @@ -226,10 +226,17 @@ public class NetworkMonitor extends StateMachine { public NetworkMonitor(Context context, Handler handler, NetworkAgentInfo networkAgentInfo, NetworkRequest defaultRequest) { + this(context, handler, networkAgentInfo, defaultRequest, new IpConnectivityLog()); + } + + @VisibleForTesting + protected NetworkMonitor(Context context, Handler handler, NetworkAgentInfo networkAgentInfo, + NetworkRequest defaultRequest, IpConnectivityLog logger) { // Add suffix indicating which NetworkMonitor we're talking about. super(TAG + networkAgentInfo.name()); mContext = context; + mMetricsLog = logger; mConnectivityServiceHandler = handler; mNetworkAgentInfo = networkAgentInfo; mNetId = mNetworkAgentInfo.network.netId; 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 a42d0cd4c831..5d209fc14b5c 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.net.Uri; 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.io.PrintWriter; 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 @@ public class ContentObserverController extends StateController { 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 @@ public class ContentObserverController extends StateController { 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 @@ public class ContentObserverController extends StateController { 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 @@ public class ContentObserverController extends StateController { 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 @@ public class ContentObserverController extends StateController { 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; - } - } - 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); - pw.println(); - } - pw.println(" Changed Authorities:"); - for (int k=0; k<inst.mChangedAuthorities.size(); k++) { - pw.print(" "); - pw.println(inst.mChangedAuthorities.valueAt(k)); + 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 (inst.mChangedUris != null) { - pw.println(" Changed URIs:"); - for (int k = 0; k<inst.mChangedUris.size(); k++) { + } + 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.mChangedUris.valueAt(k)); + 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(); } - } 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 a3f09c03ae74..777eee81473a 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 @@ public class MediaSessionService extends SystemService implements Monitor { 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 @@ public class MediaSessionService extends SystemService implements Monitor { 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 @@ public class MediaSessionService extends SystemService implements Monitor { 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 8b5942c85e4b..de1d7a76f7d8 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.Notification; 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.IBinder; 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.Log; 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.SystemService; 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 @@ public class NotificationManagerService extends SystemService { 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 @@ public class NotificationManagerService extends SystemService { @Nullable StatusBarManagerInternal mStatusBar; Vibrator mVibrator; private VrManagerInternal mVrManagerInternal; + private WindowManagerInternal mWindowManagerInternal; final IBinder mForegroundToken = new Binder(); private Handler mHandler; @@ -452,13 +454,15 @@ public class NotificationManagerService extends SystemService { 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 @@ public class NotificationManagerService extends SystemService { 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 @@ public class NotificationManagerService extends SystemService { } } - 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 @@ public class NotificationManagerService extends SystemService { 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 @@ public class NotificationManagerService extends SystemService { 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 @@ public class NotificationManagerService extends SystemService { // 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 @@ public class NotificationManagerService extends SystemService { } // 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 77c69c905036..c5f3cfd3bc7e 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 @@ public class OtaDexoptService extends IOtaDexopt.Stub { // 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 @@ public class OtaDexoptService extends IOtaDexopt.Stub { @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 @@ public class OtaDexoptService extends IOtaDexopt.Stub { 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; - } - - // Move to the next package, if possible. - if (mDexoptPackages.isEmpty()) { - return "Nothing to do"; - } - - PackageParser.Package nextPackage = mDexoptPackages.remove(0); - - if (DEBUG_DEXOPT) { - Log.i(TAG, "Processing " + nextPackage.packageName + " for OTA dexopt."); - } + if (mDexoptCommands.isEmpty()) { + return "(all done)"; + } - // Generate the next mPackageDexopts state. Ignore errors, this loop is strongly - // monotonically increasing, anyways. - generatePackageDexopts(nextPackage); + String next = mDexoptCommands.remove(0); - // 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 @@ public class OtaDexoptService extends IOtaDexopt.Stub { 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 @@ public class OtaDexoptService extends IOtaDexopt.Stub { // 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/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index a4c90f743b1d..2ed64f18349c 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -15824,6 +15824,12 @@ public class PackageManagerService extends IPackageManager.Stub { + e.getMessage()); return false; } + try { + // update shared libraries for the newly re-installed system package + updateSharedLibrariesLPw(newPkg, null); + } catch (PackageManagerException e) { + Slog.e(TAG, "updateAllSharedLibrariesLPw failed: " + e.getMessage()); + } prepareAppDataAfterInstallLIF(newPkg); diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java index 68ccbdfceca9..c9ad49a565c1 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 class UserManagerService extends IUserManager.Stub { 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 09c2b2774f68..625396313ef3 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { /** 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { 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) { @@ -7306,7 +7321,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { private boolean areSystemNavigationKeysEnabled() { return Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, 1) == 1; + Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, 0) == 1; } @Override diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java index 7e275584a27d..bcae481c583f 100644 --- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java +++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java @@ -59,6 +59,7 @@ public class KeyguardServiceDelegate { showingAndNotOccluded = true; secure = true; deviceHasKeyguard = true; + currentUser = UserHandle.USER_NULL; } boolean showing; boolean showingAndNotOccluded; @@ -157,6 +158,10 @@ public class KeyguardServiceDelegate { if (mKeyguardState.systemIsReady) { // If the system is ready, it means keyguard crashed and restarted. mKeyguardService.onSystemReady(); + if (mKeyguardState.currentUser != UserHandle.USER_NULL) { + // There has been a user switch earlier + mKeyguardService.setCurrentUser(mKeyguardState.currentUser); + } // This is used to hide the scrim once keyguard displays. if (mKeyguardState.interactiveState == INTERACTIVE_STATE_AWAKE) { mKeyguardService.onStartedWakingUp(); diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 2215cbb90480..2824e6e66ffa 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 @@ public final class PowerManagerService extends SystemService 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 8be5dfb3c7fd..d2d5c2878889 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 @@ final class AccessibilityController { 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 @@ final class AccessibilityController { 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/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java index 18f97a7f606f..a976b3649554 100644 --- a/services/core/java/com/android/server/wm/WallpaperController.java +++ b/services/core/java/com/android/server/wm/WallpaperController.java @@ -246,7 +246,10 @@ class WallpaperController { boolean updateWallpaperOffset(WindowState wallpaperWin, int dw, int dh, boolean sync) { boolean rawChanged = false; - float wpx = mLastWallpaperX >= 0 ? mLastWallpaperX : 0.5f; + // Set the default wallpaper x-offset to either edge of the screen (depending on RTL), to + // match the behavior of most Launchers + float defaultWallpaperX = wallpaperWin.isRtl() ? 1f : 0f; + float wpx = mLastWallpaperX >= 0 ? mLastWallpaperX : defaultWallpaperX; float wpxs = mLastWallpaperXStep >= 0 ? mLastWallpaperXStep : -1.0f; int availw = wallpaperWin.mFrame.right - wallpaperWin.mFrame.left - dw; int offset = availw > 0 ? -(int)(availw * wpx + .5f) : 0; diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 6451c7492fa8..70a1ee623183 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.Context; 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_NAVIGATION_BAR; 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 @@ public class WindowManagerService extends IWindowManager.Stub boolean reportNewConfig = false; WindowState attachedWindow = null; long origId; + final int callingUid = Binder.getCallingUid(); final int type = attrs.type; synchronized(mWindowMap) { @@ -1914,6 +1917,8 @@ public class WindowManagerService extends IWindowManager.Stub 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 @@ public class WindowManagerService extends IWindowManager.Stub + 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 @@ public class WindowManagerService extends IWindowManager.Stub + 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 @@ public class WindowManagerService extends IWindowManager.Stub 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 @@ public class WindowManagerService extends IWindowManager.Stub 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 @@ public class WindowManagerService extends IWindowManager.Stub 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 class WindowManagerService extends IWindowManager.Stub 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 @@ public class WindowManagerService extends IWindowManager.Stub 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 @@ public class WindowManagerService extends IWindowManager.Stub // 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 @@ public class WindowManagerService extends IWindowManager.Stub 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 155d8d05b1ff..10f01e4cf9c1 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 @@ final class WindowState implements WindowManagerPolicy.WindowState { 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 class WindowState implements WindowManagerPolicy.WindowState { 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 @@ final class WindowState implements WindowManagerPolicy.WindowState { // 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 @@ final class WindowState implements WindowManagerPolicy.WindowState { } } + public void markPermanentlyHiddenLw() { + if (!mPermanentlyHidden) { + mPermanentlyHidden = true; + hideLw(true, true); + } + } + public void pokeDrawLockLw(long timeout) { if (isVisibleOrAdding()) { if (mDrawLock == null) { @@ -2612,7 +2625,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { 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 @@ final class WindowState implements WindowManagerPolicy.WindowState { 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); @@ -2939,4 +2953,8 @@ final class WindowState implements WindowManagerPolicy.WindowState { return -1; } } + + public boolean isRtl() { + return mMergedConfiguration.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; + } } diff --git a/services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java b/services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java index 848017063bff..7a3b461a6ff7 100644 --- a/services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java +++ b/services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java @@ -18,12 +18,14 @@ package com.android.server.retaildemo; import android.app.AppGlobals; import android.app.PackageInstallObserver; +import android.content.Context; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Environment; import android.os.RemoteException; import android.os.UserHandle; +import android.provider.Settings; import android.util.ArrayMap; import android.util.Log; import android.util.Slog; @@ -47,15 +49,17 @@ class PreloadAppsInstaller { private final IPackageManager mPackageManager; private final File preloadsAppsDirectory; + private final Context mContext; private final Map<String, String> mApkToPackageMap; - PreloadAppsInstaller() { - this(AppGlobals.getPackageManager(), Environment.getDataPreloadsAppsDirectory()); + PreloadAppsInstaller(Context context) { + this(context, AppGlobals.getPackageManager(), Environment.getDataPreloadsAppsDirectory()); } @VisibleForTesting - PreloadAppsInstaller(IPackageManager packageManager, File preloadsAppsDirectory) { + PreloadAppsInstaller(Context context, IPackageManager packageManager, File preloadsAppsDirectory) { + mContext = context; mPackageManager = packageManager; mApkToPackageMap = Collections.synchronizedMap(new ArrayMap<>()); this.preloadsAppsDirectory = preloadsAppsDirectory; @@ -66,28 +70,34 @@ class PreloadAppsInstaller { if (ArrayUtils.isEmpty(files)) { return; } + AppInstallCounter counter = new AppInstallCounter(mContext, userId); + int expectedCount = 0; for (File file : files) { String apkName = file.getName(); if (apkName.endsWith(PRELOAD_APK_EXT) && file.isFile()) { String packageName = mApkToPackageMap.get(apkName); if (packageName != null) { try { - installExistingPackage(packageName, userId); + expectedCount++; + installExistingPackage(packageName, userId, counter); } catch (Exception e) { Slog.e(TAG, "Failed to install existing package " + packageName, e); } } else { try { - installPackage(file, userId); + installPackage(file, userId, counter); + expectedCount++; } catch (Exception e) { Slog.e(TAG, "Failed to install package from " + file, e); } } } } + counter.setExpectedAppsCount(expectedCount); } - private void installExistingPackage(String packageName, int userId) { + private void installExistingPackage(String packageName, int userId, + AppInstallCounter counter) { if (DEBUG) { Log.d(TAG, "installExistingPackage " + packageName + " u" + userId); } @@ -95,10 +105,13 @@ class PreloadAppsInstaller { mPackageManager.installExistingPackageAsUser(packageName, userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); + } finally { + counter.appInstallFinished(); } } - private void installPackage(File file, final int userId) throws IOException, RemoteException { + private void installPackage(File file, final int userId, AppInstallCounter counter) + throws IOException, RemoteException { final String apkName = file.getName(); if (DEBUG) { Log.d(TAG, "installPackage " + apkName + " u" + userId); @@ -111,15 +124,49 @@ class PreloadAppsInstaller { Log.d(TAG, "Package " + basePackageName + " installed u" + userId + " returnCode: " + returnCode + " msg: " + msg); } + // Don't notify the counter for now, we'll do it in installExistingPackage if (returnCode == PackageManager.INSTALL_SUCCEEDED) { mApkToPackageMap.put(apkName, basePackageName); // Install on user 0 so that the package is cached when demo user is re-created - installExistingPackage(basePackageName, UserHandle.USER_SYSTEM); + installExistingPackage(basePackageName, UserHandle.USER_SYSTEM, counter); } else if (returnCode == PackageManager.INSTALL_FAILED_ALREADY_EXISTS) { - installExistingPackage(basePackageName, userId); + // This can only happen in first session after a reboot + if (!mApkToPackageMap.containsKey(apkName)) { + mApkToPackageMap.put(apkName, basePackageName); + } + installExistingPackage(basePackageName, userId, counter); } } }.getBinder(), 0, SYSTEM_SERVER_PACKAGE_NAME, userId); } + private static class AppInstallCounter { + private int expectedCount = -1; // -1 means expectedCount not set + private int finishedCount; + private final Context mContext; + private final int userId; + + AppInstallCounter(Context context, int userId) { + mContext = context; + this.userId = userId; + } + + synchronized void appInstallFinished() { + this.finishedCount++; + checkIfAllFinished(); + } + + synchronized void setExpectedAppsCount(int expectedCount) { + this.expectedCount = expectedCount; + checkIfAllFinished(); + } + + private void checkIfAllFinished() { + if (expectedCount == finishedCount) { + Log.i(TAG, "All preloads finished installing for user " + userId); + Settings.Secure.putStringForUser(mContext.getContentResolver(), + Settings.Secure.DEMO_USER_SETUP_COMPLETE, "1", userId); + } + } + } }
\ No newline at end of file diff --git a/services/retaildemo/java/com/android/server/retaildemo/RetailDemoModeService.java b/services/retaildemo/java/com/android/server/retaildemo/RetailDemoModeService.java index 1a605929bdc5..8d5971f1ca97 100644 --- a/services/retaildemo/java/com/android/server/retaildemo/RetailDemoModeService.java +++ b/services/retaildemo/java/com/android/server/retaildemo/RetailDemoModeService.java @@ -224,8 +224,7 @@ public class RetailDemoModeService extends SystemService { if (mDeviceDemoModeUri.equals(uri)) { mDeviceInDemoMode = UserManager.isDeviceInDemoMode(getContext()); if (mDeviceInDemoMode) { - SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "1"); - mHandler.sendEmptyMessage(MSG_START_NEW_SESSION); + putDeviceInDemoMode(); } else { SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "0"); if (mWakeLock.isHeld()) { @@ -287,7 +286,6 @@ public class RetailDemoModeService extends SystemService { synchronized (mActivityLock) { mFirstUserActivityTime = mLastUserActivityTime = SystemClock.uptimeMillis(); } - mPreloadAppsInstaller = new PreloadAppsInstaller(); } private Notification createResetNotification() { @@ -465,6 +463,11 @@ public class RetailDemoModeService extends SystemService { return mSystemUserConfiguration; } + private void putDeviceInDemoMode() { + SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "1"); + mHandler.sendEmptyMessage(MSG_START_NEW_SESSION); + } + @Override public void onStart() { if (DEBUG) { @@ -479,26 +482,31 @@ public class RetailDemoModeService extends SystemService { @Override public void onBootPhase(int bootPhase) { - if (bootPhase != PHASE_THIRD_PARTY_APPS_CAN_START) { - return; - } - mPm = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE); - mAmi = LocalServices.getService(ActivityManagerInternal.class); - mWakeLock = mPm - .newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, TAG); - mNm = NotificationManager.from(getContext()); - mCameraManager = (CameraManager) getContext().getSystemService(Context.CAMERA_SERVICE); - mCameraIdsWithFlash = getCameraIdsWithFlash(); - - if (UserManager.isDeviceInDemoMode(getContext())) { - mDeviceInDemoMode = true; - SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "1"); - mHandler.sendEmptyMessage(MSG_START_NEW_SESSION); + switch (bootPhase) { + case PHASE_THIRD_PARTY_APPS_CAN_START: + mPreloadAppsInstaller = new PreloadAppsInstaller(getContext()); + mPm = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE); + mAmi = LocalServices.getService(ActivityManagerInternal.class); + mWakeLock = mPm + .newWakeLock( + PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, + TAG); + mNm = NotificationManager.from(getContext()); + mCameraManager = (CameraManager) getContext() + .getSystemService(Context.CAMERA_SERVICE); + mCameraIdsWithFlash = getCameraIdsWithFlash(); + SettingsObserver settingsObserver = new SettingsObserver(mHandler); + settingsObserver.register(); + settingsObserver.refreshTimeoutConstants(); + registerBroadcastReceiver(); + break; + case PHASE_BOOT_COMPLETED: + if (UserManager.isDeviceInDemoMode(getContext())) { + mDeviceInDemoMode = true; + putDeviceInDemoMode(); + } + break; } - SettingsObserver settingsObserver = new SettingsObserver(mHandler); - settingsObserver.register(); - settingsObserver.refreshTimeoutConstants(); - registerBroadcastReceiver(); } @Override diff --git a/services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java b/services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java index f2a93155d3f5..59ccbd93f3fb 100644 --- a/services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java @@ -51,6 +51,7 @@ import android.net.NetworkInfo.DetailedState; import android.net.NetworkMisc; import android.net.NetworkRequest; import android.net.RouteInfo; +import android.net.metrics.IpConnectivityLog; import android.os.ConditionVariable; import android.os.Handler; import android.os.HandlerThread; @@ -585,8 +586,9 @@ public class ConnectivityServiceTest extends AndroidTestCase { public String gen204ProbeRedirectUrl = null; public WrappedNetworkMonitor(Context context, Handler handler, - NetworkAgentInfo networkAgentInfo, NetworkRequest defaultRequest) { - super(context, handler, networkAgentInfo, defaultRequest); + NetworkAgentInfo networkAgentInfo, NetworkRequest defaultRequest, + IpConnectivityLog log) { + super(context, handler, networkAgentInfo, defaultRequest, log); } @Override @@ -599,8 +601,9 @@ public class ConnectivityServiceTest extends AndroidTestCase { private WrappedNetworkMonitor mLastCreatedNetworkMonitor; public WrappedConnectivityService(Context context, INetworkManagementService netManager, - INetworkStatsService statsService, INetworkPolicyManager policyManager) { - super(context, netManager, statsService, policyManager); + INetworkStatsService statsService, INetworkPolicyManager policyManager, + IpConnectivityLog log) { + super(context, netManager, statsService, policyManager, log); mLingerDelayMs = TEST_LINGER_DELAY_MS; } @@ -639,8 +642,8 @@ public class ConnectivityServiceTest extends AndroidTestCase { @Override public NetworkMonitor createNetworkMonitor(Context context, Handler handler, NetworkAgentInfo nai, NetworkRequest defaultRequest) { - final WrappedNetworkMonitor monitor = new WrappedNetworkMonitor(context, handler, nai, - defaultRequest); + final WrappedNetworkMonitor monitor = new WrappedNetworkMonitor( + context, handler, nai, defaultRequest, mock(IpConnectivityLog.class)); mLastCreatedNetworkMonitor = monitor; return monitor; } @@ -705,7 +708,8 @@ public class ConnectivityServiceTest extends AndroidTestCase { mService = new WrappedConnectivityService(mServiceContext, mock(INetworkManagementService.class), mock(INetworkStatsService.class), - mock(INetworkPolicyManager.class)); + mock(INetworkPolicyManager.class), + mock(IpConnectivityLog.class)); mService.systemReady(); mCm = new WrappedConnectivityManager(getContext(), mService); diff --git a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java index e5c91aaacb5d..78f95c4d217e 100644 --- a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java +++ b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java @@ -1055,6 +1055,9 @@ public class ShortcutManagerTestUtils { public static void retryUntil(BooleanSupplier checker, String message) { final long timeOut = System.currentTimeMillis() + 30 * 1000; // wait for 30 seconds. while (!checker.getAsBoolean()) { + if (System.currentTimeMillis() > timeOut) { + break; + } try { Thread.sleep(200); } catch (InterruptedException ignore) { diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 8446dd04326c..6151e5b2c58d 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -240,6 +240,8 @@ public class ServiceState implements Parcelable { private boolean mIsDataRoamingFromRegistration; + private boolean mIsUsingCarrierAggregation; + /** * get String description of roaming type * @hide @@ -318,6 +320,7 @@ public class ServiceState implements Parcelable { mCdmaEriIconMode = s.mCdmaEriIconMode; mIsEmergencyOnly = s.mIsEmergencyOnly; mIsDataRoamingFromRegistration = s.mIsDataRoamingFromRegistration; + mIsUsingCarrierAggregation = s.mIsUsingCarrierAggregation; } /** @@ -346,6 +349,7 @@ public class ServiceState implements Parcelable { 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 @@ public class ServiceState implements Parcelable { 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 @@ public class ServiceState implements Parcelable { && equalsHandlesNulls(mCdmaDefaultRoamingIndicator, s.mCdmaDefaultRoamingIndicator) && mIsEmergencyOnly == s.mIsEmergencyOnly - && mIsDataRoamingFromRegistration == s.mIsDataRoamingFromRegistration); + && mIsDataRoamingFromRegistration == s.mIsDataRoamingFromRegistration + && mIsUsingCarrierAggregation == s.mIsUsingCarrierAggregation); } /** @@ -788,7 +794,8 @@ public class ServiceState implements Parcelable { + " RoamInd=" + mCdmaRoamingIndicator + " DefRoamInd=" + mCdmaDefaultRoamingIndicator + " EmergOnly=" + mIsEmergencyOnly - + " IsDataRoamingFromRegistration=" + mIsDataRoamingFromRegistration); + + " IsDataRoamingFromRegistration=" + mIsDataRoamingFromRegistration + + " IsUsingCarrierAggregation=" + mIsUsingCarrierAggregation); } private void setNullState(int state) { @@ -815,6 +822,7 @@ public class ServiceState implements Parcelable { mCdmaEriIconMode = -1; mIsEmergencyOnly = false; mIsDataRoamingFromRegistration = false; + mIsUsingCarrierAggregation = false; } public void setStateOutOfService() { @@ -988,6 +996,7 @@ public class ServiceState implements Parcelable { mCdmaDefaultRoamingIndicator = m.getInt("cdmaDefaultRoamingIndicator"); mIsEmergencyOnly = m.getBoolean("emergencyOnly"); mIsDataRoamingFromRegistration = m.getBoolean("isDataRoamingFromRegistration"); + mIsUsingCarrierAggregation = m.getBoolean("isUsingCarrierAggregation"); } /** @@ -1017,21 +1026,42 @@ public class ServiceState implements Parcelable { 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); } |