OSDN Git Service

docs: Fixed bugs for Auto docs.
authorQuddus Chong <quddusc@google.com>
Tue, 18 Nov 2014 17:32:16 +0000 (09:32 -0800)
committerQuddus Chong <quddusc@google.com>
Tue, 18 Nov 2014 21:46:44 +0000 (13:46 -0800)
Change-Id: Iba8406a95374e5c621eb607c6bb0a8ad6a892f59

docs/html/auto/images/logos/apps/TextMe.png [new file with mode: 0644]
docs/html/auto/images/logos/apps/soundcloud.png [new file with mode: 0644]
docs/html/auto/index.jd
docs/html/distribute/essentials/quality/auto.jd
docs/html/training/auto/audio/index.jd

diff --git a/docs/html/auto/images/logos/apps/TextMe.png b/docs/html/auto/images/logos/apps/TextMe.png
new file mode 100644 (file)
index 0000000..b96f81a
Binary files /dev/null and b/docs/html/auto/images/logos/apps/TextMe.png differ
diff --git a/docs/html/auto/images/logos/apps/soundcloud.png b/docs/html/auto/images/logos/apps/soundcloud.png
new file mode 100644 (file)
index 0000000..a5bdbe3
Binary files /dev/null and b/docs/html/auto/images/logos/apps/soundcloud.png differ
index ddb265b..129478a 100644 (file)
@@ -223,46 +223,47 @@ page.type=about
           </div>
           <div class="landing-body">
           <div class="cols">
-
             <div class="col-4">
-              <img src="/auto/images/logos/apps/kik.png"
-                   width="120" height="120" class="img-logo" style="margin-top:20px"/>
+              <img src="{@docRoot}auto/images/logos/apps/iheartradio.png"
+                   width="160" height="160" class="img-logo" />
             </div>
             <div class="col-4">
-              <img src="/auto/images/logos/apps/textplus.png"
-                   width="120" height="24" class="img-logo" style="margin-top:70px" />
+              <img src="{@docRoot}auto/images/logos/apps/joyride.png"
+                   width="160" height="160" class="img-logo" />
             </div>
             <div class="col-4">
-              <img src="/auto/images/logos/apps/iheartradio.png"
-                   width="160" height="160" class="img-logo" />
+              <img src="{@docRoot}auto/images/logos/apps/kik.png"
+                   width="120" height="120" class="img-logo" style="margin-top:30px" />
             </div>
             <div class="col-4">
-              <img src="/auto/images/logos/apps/spotify.png"
+              <img src="{@docRoot}auto/images/logos/apps/mlb.png"
                    width="160" height="160" class="img-logo" />
             </div>
           </div>
-          <div class="cols">
 
+          <div class="cols">
             <div class="col-4">
-              <img src="{@docRoot}auto/images/logos/apps/joyride.png"
+              <img src="{@docRoot}auto/images/logos/apps/pandora.png"
                    width="160" height="160" class="img-logo" />
             </div>
             <div class="col-4">
-              <img src="{@docRoot}auto/images/logos/apps/mlb.png"
+              <img src="{@docRoot}auto/images/logos/apps/pocketcasts.png"
                    width="160" height="160" class="img-logo" />
             </div>
             <div class="col-4">
-              <img src="{@docRoot}auto/images/logos/apps/pandora.png"
+              <img src="{@docRoot}auto/images/logos/apps/songza.png"
                    width="160" height="160" class="img-logo" />
             </div>
             <div class="col-4">
-              <img src="{@docRoot}auto/images/logos/apps/pocketcasts.png"
-                   width="160" height="160" class="img-logo" />
+              <img src="/auto/images/logos/apps/soundcloud.png"
+                   width="100" height="100" class="img-logo"
+                   style="margin-top:30px" />
             </div>
           </div>
+
           <div class="cols">
             <div class="col-4">
-              <img src="{@docRoot}auto/images/logos/apps/songza.png"
+              <img src="/auto/images/logos/apps/spotify.png"
                    width="160" height="160" class="img-logo" />
             </div>
             <div class="col-4">
@@ -270,14 +271,26 @@ page.type=about
                    width="160" height="160" class="img-logo" />
             </div>
             <div class="col-4">
+              <img src="/auto/images/logos/apps/TextMe.png"
+                   width="100" height="100" class="img-logo" style="margin-top:30px" />
+            </div>
+            <div class="col-4">
+              <img src="/auto/images/logos/apps/textplus.png"
+                   width="120" height="24" class="img-logo" style="margin-top:70px" />
+            </div>
+          </div>
+
+          <div class="cols">
+            <div class="col-4">
               <img src="{@docRoot}auto/images/logos/apps/tunein.png"
-                   width="160" height="160" class="img-logo" />
+                   width="160" height="160" class="img-logo" style="margin-left:160px" />
             </div>
             <div class="col-4">
               <img src="{@docRoot}auto/images/logos/apps/umano.png"
-                   width="160" height="160" class="img-logo" />
+                   width="160" height="160" class="img-logo" style="margin-left:370px" />
             </div>
           </div>
+
           <div class="cols" style="margin-top:40px">
               <div class="col-4">
                 <img src="/auto/images/logos/apps/whatsapp.png"
@@ -292,6 +305,7 @@ page.type=about
                 user-friendly and highly safety-minded."</em></p>
               </div>
           </div>
+
           <div class="cols" style="margin-top:60px">
 
               <div class="col-4">
index 55b02a0..757305e 100644 (file)
@@ -19,9 +19,9 @@ page.image=/distribute/images/gp-auto-quality.png
       Core App Quality</a></li>
     <li><a href="{@docRoot}distribute/essentials/optimizing-your-app.html">
       Optimize Your App</a></li>
-    <li><a href="{@docRoot}/shareables/auto/AndroidAuto-media-apps.pdf">Android Auto UX Guidelines
+    <li><a href="{@docRoot}shareables/auto/AndroidAuto-media-apps.pdf">Android Auto UX Guidelines
       for Media Applications</a></li>
-    <li><a href="{@docRoot}/shareables/auto/AndroidAuto-messaging-apps.pdf">Android Auto UX Guidelines
+    <li><a href="{@docRoot}shareables/auto/AndroidAuto-messaging-apps.pdf">Android Auto UX Guidelines
       for Messaging Applications</a></li>
   </ol>
 </div>
@@ -310,7 +310,7 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6">
     <p style="margin-bottom:.5em;">
      App has no more than four primary actions plus one optional action overflow toggle (or five if
      no action overflow is used). For more information, see details on the media control card in the
-     <a href="{@docRoot}/shareables/auto/AndroidAuto-media-apps.pdf">Android Auto UX Guidelines
+     <a href="{@docRoot}shareables/auto/AndroidAuto-media-apps.pdf">Android Auto UX Guidelines
       for Media Applications</a>.
     </p>
   </td>
@@ -324,7 +324,7 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6">
     <p style="margin-bottom:.5em;">
      App has no more than four optional secondary actions plus one action overflow toggle. For more
      information, see details on the media control card in the
-     <a href="{@docRoot}/shareables/auto/AndroidAuto-media-apps.pdf">Android Auto UX Guidelines
+     <a href="{@docRoot}shareables/auto/AndroidAuto-media-apps.pdf">Android Auto UX Guidelines
       for Media Applications</a>.
     </p>
   </td>
index 2656b96..aa25769 100644 (file)
@@ -301,31 +301,30 @@ look like this:</p>
 public BrowserRoot onGetRoot(String clientPackageName, int clientUid,
     Bundle rootHints) {
 
-    // Check the calling client to make sure it's one you approve.
-    // For example, to limit access to just Auto, the Auto emulator,
-    // and this app:
-
-    if (!clientPackageName.equals("com.google.android.projection.gearhead") &amp;&amp;
-            !clientPackageName.equals("com.example.android.media") &amp;&amp;
-            !clientPackageName.equals(getApplication().getPackageName()) {
-
+    // To ensure you are not allowing any arbitrary app to browse your app's
+    // contents, you need to check the origin:
+    if (!PackageValidator.isCallerAllowed(this, clientPackageName, clientUid)) {
         // If the request comes from an untrusted package, return null.
         // No further calls will be made to other media browsing methods.
+        LogHelper.w(TAG, "OnGetRoot: IGNORING request from untrusted package "
+                + clientPackageName);
         return null;
-        }
-
-        // Return a BrowserRoot. If you wish, you could have multiple BrowserRoot
-        // objects and return different ones depending on the calling client.
-        // In this example, there's just a single BrowserRoot.
-        return new BrowserRoot(MEDIA_BROWSER_ROOT, null);
     }
+    if (ANDROID_AUTO_PACKAGE_NAME.equals(clientPackageName)) {
+        // Optional: if your app needs to adapt ads, music library or anything
+        // else that needs to run differently when connected to the car, this
+        // is where you should handle it.
+    }
+    return new BrowserRoot(MEDIA_ID_ROOT, null);
+}
 </pre>
 
 <p>
   The Auto device client builds the top-level menu by calling {@link
-  android.service.media.MediaBrowserService#onLoadChildren onLoadChildren()} with the root node
-  object and getting it's children. The client builds submenus by calling the same method with
-  other child nodes. The following example code shows a simple implementation of {@link
+  android.service.media.MediaBrowserService#onLoadChildren onLoadChildren()}
+  with the root node object and getting it's children. The client builds
+  submenus by calling the same method with other child nodes. The following
+  example code shows a simple implementation of {@link
   android.service.media.MediaBrowserService#onLoadChildren onLoadChildren()} method:
 </p>