OSDN Git Service

Merge "Revert "LauncherApps should also throw when user is locked"" into nyc-mr1-dev
authorMakoto Onuki <omakoto@google.com>
Mon, 1 Aug 2016 17:30:30 +0000 (17:30 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Mon, 1 Aug 2016 17:30:31 +0000 (17:30 +0000)
72 files changed:
core/java/android/app/IActivityManager.java
core/java/android/net/ConnectivityMetricsLogger.java
core/java/android/net/metrics/IpConnectivityLog.java
core/java/android/provider/Settings.java
core/java/com/android/internal/os/BatteryStatsImpl.java
core/java/com/android/internal/os/KernelUidCpuTimeReader.java
core/res/res/layout/alert_dialog_material.xml
core/res/res/values/strings.xml
docs/html-intl/intl/es/design/patterns/notifications.jd [deleted file]
docs/html-intl/intl/es/training/articles/security-config.jd [moved from docs/html-intl/intl/es/preview/features/security-config.jd with 99% similarity]
docs/html-intl/intl/in/training/articles/security-config.jd [moved from docs/html-intl/intl/in/preview/features/security-config.jd with 99% similarity]
docs/html-intl/intl/ja/design/patterns/notifications.jd [deleted file]
docs/html-intl/intl/ja/training/articles/security-config.jd [moved from docs/html-intl/intl/ja/preview/features/security-config.jd with 99% similarity]
docs/html-intl/intl/ko/design/patterns/notifications.jd [deleted file]
docs/html-intl/intl/ko/training/articles/security-config.jd [moved from docs/html-intl/intl/ko/preview/features/security-config.jd with 99% similarity]
docs/html-intl/intl/pt-br/design/patterns/notifications.jd [deleted file]
docs/html-intl/intl/pt-br/training/articles/security-config.jd [moved from docs/html-intl/intl/pt-br/preview/features/security-config.jd with 99% similarity]
docs/html-intl/intl/ru/design/patterns/notifications.jd [deleted file]
docs/html-intl/intl/ru/training/articles/security-config.jd [moved from docs/html-intl/intl/ru/preview/features/security-config.jd with 99% similarity]
docs/html-intl/intl/vi/training/articles/security-config.jd [moved from docs/html-intl/intl/vi/preview/features/security-config.jd with 99% similarity]
docs/html-intl/intl/zh-cn/design/patterns/notifications.jd [deleted file]
docs/html-intl/intl/zh-cn/training/articles/security-config.jd [moved from docs/html-intl/intl/zh-cn/preview/features/security-config.jd with 99% similarity]
docs/html-intl/intl/zh-tw/design/patterns/notifications.jd [deleted file]
docs/html-intl/intl/zh-tw/training/articles/security-config.jd [moved from docs/html-intl/intl/zh-tw/preview/features/security-config.jd with 99% similarity]
docs/html/_redirects.yaml
docs/html/about/dashboards/index.jd
docs/html/distribute/googleplay/developer-console.jd
docs/html/google/play/billing/billing_overview.jd
docs/html/google/play/billing/billing_promotions.jd
docs/html/guide/platform/images/android-stack_2x.png [moved from docs/html/guide/platform/Images/android-stack_2x.png with 100% similarity]
docs/html/guide/topics/resources/complex-xml-resources.jd
docs/html/topic/libraries/data-binding/index.jd
docs/html/training/in-app-billing/preparing-iab-app.jd [changed mode: 0755->0644]
libs/hwui/Android.mk
libs/hwui/FrameInfo.cpp
libs/hwui/FrameInfo.h
libs/hwui/JankTracker.cpp
libs/hwui/JankTracker.h
libs/hwui/renderthread/CanvasContext.cpp
libs/hwui/renderthread/RenderThread.cpp
libs/hwui/utils/TimeUtils.h
packages/PrintSpooler/src/com/android/printspooler/ui/AddPrinterActivity.java
packages/SettingsLib/res/layout/usage_view.xml
packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java
packages/SystemUI/res/values/config.xml
packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
services/core/java/com/android/server/ConnectivityService.java
services/core/java/com/android/server/am/ActivityManagerService.java
services/core/java/com/android/server/am/PreBootBroadcaster.java
services/core/java/com/android/server/am/ProcessRecord.java
services/core/java/com/android/server/am/UserController.java
services/core/java/com/android/server/connectivity/NetworkMonitor.java
services/core/java/com/android/server/job/controllers/ContentObserverController.java
services/core/java/com/android/server/media/MediaSessionService.java
services/core/java/com/android/server/pm/OtaDexoptService.java
services/core/java/com/android/server/pm/PackageManagerService.java
services/core/java/com/android/server/pm/UserManagerService.java
services/core/java/com/android/server/policy/PhoneWindowManager.java
services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
services/core/java/com/android/server/power/PowerManagerService.java
services/core/java/com/android/server/wm/AccessibilityController.java
services/core/java/com/android/server/wm/WallpaperController.java
services/core/java/com/android/server/wm/WindowState.java
services/retaildemo/java/com/android/server/retaildemo/PreloadAppsInstaller.java
services/retaildemo/java/com/android/server/retaildemo/RetailDemoModeService.java
services/tests/servicestests/src/com/android/server/ConnectivityServiceTest.java
telephony/java/android/telephony/ServiceState.java

index d54ce4b..e411e03 100644 (file)
@@ -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;
index 029c5bd..9a2d4e0 100644 (file)
@@ -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);
 
index a7c1d40..dd7bd1b 100644 (file)
@@ -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;
         }
index 5e4cd33..5da55b1 100755 (executable)
@@ -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.
index b174e33..17635ae 100644 (file)
@@ -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);
index c828d11..e8919ed 100644 (file)
@@ -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;
index 6d33de6..178505c 100644 (file)
@@ -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" />
index dcec07d..8d3cd48 100644 (file)
     <!-- [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>
 
 
     <!-- [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 (file)
index 5499e8b..0000000
+++ /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="" />
@@ -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>
@@ -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/ja/design/patterns/notifications.jd b/docs/html-intl/intl/ja/design/patterns/notifications.jd
deleted file mode 100644 (file)
index 8c5b6ba..0000000
+++ /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>通知システムを使用すると、ユーザーは友人からの新しいチャット メッセージやカレンダー イベントなど、自分に関係のあるタイムリーなイベントについてアプリで常に通知を受けることができます。通知は、重要な出来事が起こるとすぐに知らせてくれるニュース チャンネルであり、ユーザーが意識していない間に出来事を時系列的に記録するログであると捉えることができます &mdash; さらに、すべての 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>通知にどこまでの詳細を表示するかを選択できます。
-メッセージの最初の数行を表示したり、大きな画像プレビューを表示したりできます。
-追加情報はユーザーにより多くのコンテキストを提供し、&mdash;場合によっては&mdash;メッセージ全体が表示されることもあります。
-
-
-ユーザーは、ピンチ ズームまたは 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="" />
@@ -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/design/patterns/notifications.jd b/docs/html-intl/intl/ko/design/patterns/notifications.jd
deleted file mode 100644 (file)
index aab5eac..0000000
+++ /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="" />
@@ -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/pt-br/design/patterns/notifications.jd b/docs/html-intl/intl/pt-br/design/patterns/notifications.jd
deleted file mode 100644 (file)
index 5560e85..0000000
+++ /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 &mdash; 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 &mdash; em alguns casos &mdash; 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="" />
@@ -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/ru/design/patterns/notifications.jd b/docs/html-intl/intl/ru/design/patterns/notifications.jd
deleted file mode 100644 (file)
index 4d339c2..0000000
+++ /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>Разработчик может выбрать степень подробности уведомлений, генерируемых его
-приложением. Уведомление может содержать первые
-несколько строк сообщения или миниатюру изображения. В качестве дополнительной
-информации можно предоставлять пользователю
-контекст и, &mdash;в некоторых случаях, &mdash;давать ему возможность прочитать сообщение
-целиком. Чтобы переключаться
- между компактной и расширенной компоновкой, пользователь может применить жест сжатия/масштабирования или
-провести пальцем по экрану.
- Для уведомлений о единичных событиях 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="" />
@@ -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>
@@ -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/zh-cn/design/patterns/notifications.jd b/docs/html-intl/intl/zh-cn/design/patterns/notifications.jd
deleted file mode 100644 (file)
index 57e02e4..0000000
+++ /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>通知系统可让用户随时了解应用中的相关和即时事件,例如来自好友的新聊天信息或日历事件。可将通知视作新闻频道,在重要的事件发生时提醒用户注意,或者当作日志,在用户未注意时记录事件&mdash;可在用户的所有 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="" />
@@ -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/design/patterns/notifications.jd b/docs/html-intl/intl/zh-tw/design/patterns/notifications.jd
deleted file mode 100644 (file)
index 3e3f59c..0000000
+++ /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>通知系統可以隨時知會使用者有關應用程式中的相關事件與及時事件,例如來自朋友的新聊天訊息。您可以將通知視為一種事件發生時警示使用者的新聞管道,或是在使用者沒注意時,記錄事件的日誌 &mdash; 並會視情況跨所有 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>您可以選擇到底要讓您應用程式的通知提供多詳細的資料。
-通知可以顯示訊息的前幾行,也可以顯示較大的影像預覽。
-此額外資訊可提供使用者更多內容,而且 &mdash; 在某些情況下 &mdash; 可讓使用者讀取完整訊息。
-
-
-使用者可以捏合縮放或執行單手指滑動,在精簡的版面配置與擴充的版面配置間切換。
-
-
- 對於單一事件通知,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="" />
@@ -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>
index 59e4e0f..3dcc736 100644 (file)
@@ -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
index 3cbfde9..f5d23e8 100644 (file)
@@ -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"
       }
     ]
   }
index c826e82..5a6c96f 100644 (file)
@@ -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&mdash;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&mdash;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">
index a05cc8d..7d932b7 100644 (file)
@@ -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>
index ccf50fc..4fe1abf 100644 (file)
@@ -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>
index 66dcb58..ebf7bc3 100644 (file)
@@ -93,8 +93,7 @@ Since we’re making an animated vector drawable, we put the file under <code>re
         &lt;/vector&gt;
     <strong>&lt;aapt:attr /&gt;</strong>
 
-    &lt;target
-        android:name="rotationGroup" /&gt;
+    &lt;target android:name="rotationGroup"&gt;
         <strong>&lt;aapt:attr name="android:animation" &gt;</strong>
             &lt;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" /&gt;
         <strong>&lt;aapt:attr&gt;</strong>
+    &lt;/target&gt;
 &lt;/animated-vector&gt;
 </pre>
 </dd>
index ec6e58c..454bb59 100644 (file)
@@ -246,21 +246,21 @@ android {
 </pre>
 <p>
   Expressions within the layout are written in the attribute properties using
-  the “<code>&amp;commat;{}</code>” syntax. Here, the TextView’s text is set to
+  the "<code>&commat;{}</code>" syntax. Here, the TextView's text is set to
   the firstName property of user:
 </p>
 
 <pre>
 &lt;TextView android:layout_width="wrap_content"
           android:layout_height="wrap_content"
-          android:text="&amp;commat;{user.firstName}"/&gt;
+          android:text="&commat;{user.firstName}"/&gt;
 </pre>
 <h3 id="data_object">
   Data Object
 </h3>
 
 <p>
-  Lets 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>&amp;commat;{user.firstName}</code></strong> used
-  for the TextViews <strong><code>android:text</code></strong> attribute will
+  expression <strong><code>&commat;{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 layouts 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>
-  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
-  &lt;layout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
+  &lt;?xml version="1.0" encoding="utf-8"?&gt;
+  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"&gt;
       &lt;data&gt;
-          &lt;variable name=&quot;task&quot; type=&quot;com.android.example.Task&quot; /&gt;
-          &lt;variable name=&quot;presenter&quot; type=&quot;com.android.example.Presenter&quot; /&gt;
+          &lt;variable name="task" type="com.android.example.Task" /&gt;
+          &lt;variable name="presenter" type="com.android.example.Presenter" /&gt;
       &lt;/data&gt;
-      &lt;LinearLayout android:layout_width=&quot;match_parent&quot; android:layout_height=&quot;match_parent&quot;&gt;
-          &lt;Button android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot;
-          android:onClick=&quot;@{() -&gt; presenter.onSaveClick(task)}&quot; /&gt;
+      &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"&gt;
+          &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content"
+          android:onClick="@{() -&gt; presenter.onSaveClick(task)}" /&gt;
       &lt;/LinearLayout&gt;
   &lt;/layout&gt;
 </pre>
@@ -465,7 +465,7 @@ public class Presenter {
   above could be written as:
 </p>
 <pre>
-  android:onClick=&quot;@{(view) -&gt; presenter.onSaveClick(task)}&quot;
+  android:onClick="@{(view) -&gt; 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=&quot;@{(theView) -&gt; presenter.onSaveClick(theView, task)}&quot;
+  android:onClick="@{(theView) -&gt; 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>
-  &lt;CheckBox android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot;
-        android:onCheckedChanged=&quot;@{(cb, isChecked) -&gt; presenter.completeChanged(task, isChecked)}&quot; /&gt;
+  &lt;CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content"
+        android:onCheckedChanged="@{(cb, isChecked) -&gt; presenter.completeChanged(task, isChecked)}" /&gt;
 </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=&quot;@{(theView) -&gt; presenter.onLongClick(theView, task)}&quot;
+  android:onLongClick="@{(theView) -&gt; 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=&quot;@{(v) -&gt; v.isVisible() ? doSomething() : void}&quot;
+  android:onClick="@{(v) -&gt; 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
     &lt;import type="com.example.User"/&gt;
     &lt;import type="java.util.List"/&gt;
     &lt;variable name="user" type="User"/&gt;
-    &lt;variable name="userList" type="List&amp;lt;User&gt;"/&gt;
+    &lt;variable name="userList" type="List&lt;User&gt;"/&gt;
 &lt;/data&gt;
 </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&apos;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="&commat;{String.valueOf(index + 1)}"
-android:visibility="&commat;{age &amp;lt; 13 ? View.GONE : View.VISIBLE}"
-android:transitionName=&apos;&commat;{"image_" + id}&apos;
+android:visibility="&commat;{age &lt; 13 ? View.GONE : View.VISIBLE}"
+android:transitionName='&commat;{"image_" + id}'
 </pre>
 <h4 id="missing_operations">
   Missing Operations
@@ -945,9 +945,9 @@ android:transitionName=&apos;&commat;{"image_" + id}&apos;
     &lt;import type="android.util.SparseArray"/&gt;
     &lt;import type="java.util.Map"/&gt;
     &lt;import type="java.util.List"/&gt;
-    &lt;variable name="list" type="List&amp;lt;String&gt;"/&gt;
-    &lt;variable name="sparse" type="SparseArray&amp;lt;String&gt;"/&gt;
-    &lt;variable name="map" type="Map&amp;lt;String, String&gt;"/&gt;
+    &lt;variable name="list" type="List&lt;String&gt;"/&gt;
+    &lt;variable name="sparse" type="SparseArray&lt;String&gt;"/&gt;
+    &lt;variable name="map" type="Map&lt;String, String&gt;"/&gt;
     &lt;variable name="index" type="int"/&gt;
     &lt;variable name="key" type="String"/&gt;
 &lt;/data&gt;
@@ -969,17 +969,17 @@ android:text="&commat;{map[key]}"
 </p>
 
 <pre>
-android:text=&apos;&commat;{map["firstName"]}&apos;
+android:text='&commat;{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 &amp;quot; or back quote
+  When doing so, String literals should either use the ' or back quote
   (`).
 </p>
 
 <pre>
 android:text="&commat;{map[`firstName`}"
-android:text="&commat;{map[&amp;quot;firstName&amp;quot;]}"
+android:text="&commat;{map['firstName']}"
 </pre>
 <h4 id="resources">
   Resources
@@ -1216,7 +1216,7 @@ private static class User {
 }
 </pre>
 <p>
-  That&apos;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>
 &lt;data&gt;
     &lt;import type="android.databinding.ObservableMap"/&gt;
-    &lt;variable name="user" type="ObservableMap&amp;lt;String, Object&gt;"/&gt;
+    &lt;variable name="user" type="ObservableMap&lt;String, Object&gt;"/&gt;
 &lt;/data&gt;
 …
 &lt;TextView
-   android:text=&apos;&commat;{user["lastName"]}&apos;
+   android:text='&commat;{user["lastName"]}'
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/&gt;
 &lt;TextView
-   android:text=&apos;&commat;{String.valueOf(1 + (Integer)user["age"])}&apos;
+   android:text='&commat;{String.valueOf(1 + (Integer)user["age"])}'
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/&gt;
 </pre>
@@ -1277,15 +1277,15 @@ user.add(17);
 &lt;data&gt;
     &lt;import type="android.databinding.ObservableList"/&gt;
     &lt;import type="com.example.my.app.Fields"/&gt;
-    &lt;variable name="user" type="ObservableList&amp;lt;Object&gt;"/&gt;
+    &lt;variable name="user" type="ObservableList&lt;Object&gt;"/&gt;
 &lt;/data&gt;
 …
 &lt;TextView
-   android:text=&apos;&commat;{user[Fields.LAST_NAME]}&apos;
+   android:text='&commat;{user[Fields.LAST_NAME]}'
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/&gt;
 &lt;TextView
-   android:text=&apos;&commat;{String.valueOf(1 + (Integer)user[Fields.AGE])}&apos;
+   android:text='&commat;{String.valueOf(1 + (Integer)user[Fields.AGE])}'
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/&gt;
 </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>&apos;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&apos;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&apos;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&apos;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&apos;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&apos;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>
-&lt;ImageView app:imageUrl=“&commat;{venue.imageUrl}”
-app:error=“&commat;{&commat;drawable/venueError}”/&gt;
+&lt;ImageView app:imageUrl="&commat;{venue.imageUrl}"
+app:error="&commat;{&commat;drawable/venueError}"/&gt;
 </pre>
 
 <p>
@@ -1747,7 +1747,7 @@ public static void setListener(View view, final OnViewDetachedFromWindow detach,
 
 <pre>
 &lt;TextView
-   android:text=&apos;&commat;{userMap["lastName"]}&apos;
+   android:text='&commat;{userMap["lastName"]}'
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/&gt;
 </pre>
old mode 100755 (executable)
new mode 100644 (file)
index 2c6e9a0..780f2f8
@@ -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>
 &lt;uses-permission android:name="com.android.vending.BILLING" /&gt;
 </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>
 &#64;Override
@@ -156,8 +236,3 @@ public void onDestroy() {
    mHelper = null;
 }
 </pre>
-
-
-
-
-
index c9d4af6..366ef71 100644 (file)
@@ -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
index 41e2233..09b3945 100644 (file)
@@ -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));
 }
index 0baca39..1fe5459 100644 (file)
@@ -48,6 +48,9 @@ enum class FrameInfoIndex {
     SwapBuffers,
     FrameCompleted,
 
+    DequeueBufferDuration,
+    QueueBufferDuration,
+
     // Must be the last value!
     NumIndexes
 };
index ebe9c42..ed6b211 100644 (file)
@@ -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)) {
index 84b8c3f..126025c 100644 (file)
@@ -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;
 };
index 4b9d7d5..d68f0e3 100644 (file)
@@ -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;
     }
index 9fb30c9..f4b4416 100644 (file)
@@ -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) {
index 8d42d7e..ce181b7 100644 (file)
 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 */
 
index 2f58de5..c06e849 100644 (file)
@@ -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();
index aa1a046..1d56668 100644 (file)
         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" />
 
index ee1821d..c6a45bc 100644 (file)
@@ -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);
             }
index fa30f49..f48039e 100644 (file)
     <!-- 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>
 
index 63f726b..95cb672 100644 (file)
@@ -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);
     }
 }
index 23aeae8..0f4d9ed 100644 (file)
@@ -624,6 +624,7 @@ public class NavigationBarView extends LinearLayout {
                 mCarMode = true;
                 uiCarModeChanged = true;
             }
+            getHomeButton().setCarMode(mCarMode);
         }
         return uiCarModeChanged;
     }
index 3df7590..61bac2d 100644 (file)
@@ -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
+    }
 }
 
 
index 8178bda..83463e2 100644 (file)
@@ -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();
         }
 
index a31bc04..7893a1a 100644 (file)
@@ -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;
         }
     }
index af6fec2..2094c08 100644 (file)
@@ -973,6 +973,7 @@ public class VolumeDialog implements TunerService.Tunable {
                 mDialog.dismiss();
                 mZenFooter.cleanup();
                 initDialog();
+                mDensity = density;
             }
             updateWindowWidthH();
             mSpTexts.update();
index 1106262..b7461ee 100644 (file)
@@ -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);
index 7531808..90e2a5b 100644 (file)
@@ -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()
index b24edb9..f4f6b66 100644 (file)
@@ -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",
index e74b3a3..3fffefb 100644 (file)
@@ -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,
index 9c22be7..c9283b2 100644 (file)
@@ -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);
index 92c4577..42d80fc 100644 (file)
@@ -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;
index a42d0cd..5d209fc 100644 (file)
@@ -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();
                     }
                 }
             }
index a3f09c0..777eee8 100644 (file)
@@ -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);
index 77c69c9..c5f3cfd 100644 (file)
@@ -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.");
         }
 
index a4c90f7..2ed64f1 100644 (file)
@@ -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);
 
index 68ccbdf..c9ad49a 100644 (file)
@@ -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();
         }
index 09c2b27..e502764 100644 (file)
@@ -7306,7 +7306,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
index 7e27558..bcae481 100644 (file)
@@ -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();
index 2215cbb..2824e6e 100644 (file)
@@ -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;
index 8be5dfb..d2d5c28 100644 (file)
@@ -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.
index 18f97a7..a976b36 100644 (file)
@@ -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;
index 155d8d0..a00ac5d 100644 (file)
@@ -829,10 +829,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,
@@ -2939,4 +2939,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
             return -1;
         }
     }
+
+    public boolean isRtl() {
+        return mMergedConfiguration.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
+    }
 }
index 8480170..7a3b461 100644 (file)
@@ -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
index 1a60592..8d5971f 100644 (file)
@@ -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
index f2a9315..59ccbd9 100644 (file)
@@ -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);
index 8446dd0..6151e5b 100644 (file)
@@ -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);
     }