Merge "docs: Removing extra semicolons in Wear notif examples." into lmp-dev
diff --git a/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp b/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp
index b64ab0d..a67740c 100644
--- a/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp
+++ b/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp
@@ -78,6 +78,8 @@
env->ExceptionDescribe();
env->ExceptionClear();
SkDebugf("---- read threw an exception\n");
+ // Consider the stream to be at the end, since there was an error.
+ fIsAtEnd = true;
return 0;
}
@@ -92,6 +94,9 @@
env->ExceptionDescribe();
env->ExceptionClear();
SkDebugf("---- read:GetByteArrayRegion threw an exception\n");
+ // The error was not with the stream itself, but consider it to be at the
+ // end, since we do not have a way to recover.
+ fIsAtEnd = true;
return 0;
}
diff --git a/docs/html/about/versions/android-5.0.jd b/docs/html/about/versions/android-5.0.jd
index f8d8ab6..a438420 100644
--- a/docs/html/about/versions/android-5.0.jd
+++ b/docs/html/about/versions/android-5.0.jd
@@ -23,6 +23,7 @@
<li><a href="#BehaviorGetRecentTasks">If your app uses getRecentTasks()...</a></li>
<li><a href="#64BitSupport">If you are using the Android Native Development Kit (NDK)...</a></li>
<li><a href="#BindService">If your app binds to a Service...</a></li>
+<li><a href="#BehaviorWebView">If your app uses a WebView...</a></li>
</ol>
</li>
<li><a href="#UI">User Interface</a>
@@ -234,8 +235,8 @@
vibration.</p>
<p>Setting the device to
-{@link android.media.AudioManager#RINGER_MODE_SILENT RINGER_MODE_SILENT} now
-causes the device to enter the new priority mode. The device leaves priority
+{@link android.media.AudioManager#RINGER_MODE_SILENT RINGER_MODE_SILENT} causes
+the device to enter the new priority mode. The device leaves priority
mode if you set it to
{@link android.media.AudioManager#RINGER_MODE_NORMAL RINGER_MODE_NORMAL} or
{@link android.media.AudioManager#RINGER_MODE_NORMAL RINGER_MODE_VIBRATE}.</p>
@@ -366,6 +367,31 @@
To ensure your app is secure, use an explicit intent when starting or binding
your {@link android.app.Service}, and do not declare intent filters for the service.</p>
+<h3 id="BehaviorWebView">If your app uses WebView...</h3>
+
+<p>Android 5.0 changes the default behavior for your app.</p>
+<ul>
+<li><strong>If your app targets API level 21 or higher:</strong>
+ <ul>
+ <li>The system
+ blocks <a href="https://developer.mozilla.org/en-US/docs/Security/MixedContent"
+ class="external-link">mixed content</a> and third party cookies by default. To allow mixed
+ content and third party cookies, use the
+ {@link android.webkit.WebSettings#setMixedContentMode(int) setMixedContentMode()}
+and {@link android.webkit.CookieManager#setAcceptThirdPartyCookies(android.webkit.WebView, boolean) setAcceptThirdPartyCookies()}
+methods respectively.</li>
+ <li>The system now intelligently chooses portions of the HTML
+ document to draw. This new default behavior helps to reduce memory
+ footprint and increase performance. If you want to
+ render the whole document at once, disable this optimization by calling
+ {@link android.webkit.WebView#enableSlowWholeDocumentDraw()}.</li>
+ </ul>
+</li>
+<li><strong>If your app targets API levels lower than 21:</strong> The system
+ allows mixed content and third party cookies, and always renders the whole
+ document at once.</li>
+</ul>
+
<h2 id="UI">User Interface</h2>
<h3 id="MaterialDesign">Material design support</h3>
@@ -470,7 +496,7 @@
method.</p>
<p>For an example of how to use the new APIs, see the {@code MediaProjectionDemo}
-class in the {@code ApiDemos} sample project.</p>
+class in the sample project.</p>
<h2 id="Notifications">Notifications</h2>
diff --git a/docs/html/about/versions/lollipop.jd b/docs/html/about/versions/lollipop.jd
index b9ad0dd..085dc24 100644
--- a/docs/html/about/versions/lollipop.jd
+++ b/docs/html/about/versions/lollipop.jd
@@ -26,14 +26,14 @@
<li><a href="#Documents">Document-centric apps</a></li>
<li><a href="#Connectivity">Advanced connectivity</a></li>
<li><a href="#Graphics">High-performance graphics</a></li>
- <li><a href="#Audio">More Powerful Audio</a></li>
- <li><a href="#Camera">Enhanced Camera & Video</a></li>
+ <li><a href="#Audio">More powerful audio</a></li>
+ <li><a href="#Camera">Enhanced camera & video</a></li>
<li><a href="#Work">Android in the workplace</a></li>
<li><a href="#ScreenCapture">Screen capturing and sharing</a></li>
<li><a href="#Sensors">New types of sensors</a></li>
<li><a href="#WebView">Chromium WebView</a></li>
- <li><a href="#Accessibility">Accessibility & Input</a></li>
- <li><a href="#Battery">Tools for building battery-efficient apps</a></li>
+ <li><a href="#Accessibility">Accessibility & input</a></li>
+ <li><a href="#Battery">Tools for battery-efficient apps</a></li>
</ul>
</div>
</div>
@@ -94,12 +94,13 @@
</div>
-<p>Ripple animations are available for buttons, checkboxes, and other touch controls in your app.</p>
+<p>Ripple animations are available for buttons, checkboxes, and other touch controls in your app.
+
+<p>You can also define vector drawables in XML and animate them in a variety of ways. Vector drawables scale without losing definition, so they are perfect for single-color in-app icons.</p>
<p>A new system-managed processing thread called <strong>RenderThread</strong> keeps animations smooth even when there are delays in the main UI thread. </p>
-
<h2 id="Perf">Performance focus</h2>
<p>Android 5.0 provides a faster, smoother and more powerful computing experience.</p>
@@ -179,7 +180,7 @@
<p>Android 5.0 also introduces the <strong>Android Extension Pack</strong> (AEP), a set of OpenGL ES extensions that give you access to features like tessellation shaders, geometry shaders, ASTC texture compression, per-sample interpolation and shading, and other advanced rendering capabilities. With AEP you can deliver high-performance graphics across a range of GPUs.</p>
-<h2 id="Audio">More Powerful Audio</h2>
+<h2 id="Audio">More powerful audio</h2>
<p>A new audio-capture design offers <strong>low-latency audio input</strong>. The new design includes: a fast capture thread that never blocks except during a read; fast track capture clients at native sample rate, channel count, and bit depth; and normal capture clients offer resampling, up/down channel mix, and up/down bit depth.</p>
@@ -194,7 +195,7 @@
<p>New <strong>{@link android.media.session.MediaSession}</strong> APIs for controlling media playback now make it easier to provide consistent media controls across screens and other controllers.</p>
-<h2 id="Camera">Enhanced Camera & Video</h2>
+<h2 id="Camera">Enhanced camera & video</h2>
<p>Android 5.0 introduces <strong>all new camera APIs</strong> that let you capture raw formats such as YUV and Bayer RAW, and control parameters such as exposure time, ISO sensitivity, and frame duration on a per-frame basis. The new fully-synchronized camera pipeline allows you to capture uncompressed full-resolution YUV images at 30 FPS on supported devices.</p>
@@ -205,11 +206,15 @@
<p>Android 5.0 also adds support for <strong>multimedia tunneling</strong> to provide the best experience for ultra-high definition (4K) content and the ability to play compressed audio and video data together. </p>
-
-<img style="float:right; margin:0 0 40px 60px"
+<!--
+<div class="figure" style="width:320px; margin:1em 0 0 20px;padding-left:2em;">
+<img style="float:right; margin:0 1em 1em 2em"
src="{@docRoot}images/android-5.0/managed_apps_launcher@2x.png"
srcset="{@docRoot}images/android-5.0/managed_apps_launcher@2x.png 2x"
alt="" width="300" />
+<p class="img-caption">Android Work users have a unified view of their personal and work apps, which are badged for easy identification.</p>
+</div>
+-->
<h2 id="Work">Android in the workplace</h2>
@@ -253,13 +258,15 @@
<p>The initial release for Android 5.0 includes a version of Chromium for {@link android.webkit.WebView} based on the Chromium M37 release, adding support for <strong>WebRTC</strong>, <strong>WebAudio</strong>, and <strong>WebGL</strong>. </p>
+<p>Chromium M37 also includes native support for all of the <strong>Web Components</strong> specifications: Custom Elements, Shadow DOM, HTML Imports, and Templates. This means you can use <a href="http://polymer-project.org/">Polymer</a> and its <a href="https://www.polymer-project.org/docs/elements/material.html">material design elements</a> in a WebView without needing polyfills.</p>
+
<p>Although WebView has been based on Chromium since Android 4.4, the Chromium layer is now updatable from Google Play.</p>
<p>As new versions of Chromium become available, users can update from Google Play to ensure they get the latest enhancements and bug fixes for WebView, providing the latest web APIs and bug fixes for apps using WebView on Android 5.0 and higher.</p>
-<h2 id="Accessibility">Accessibility & Input</h2>
+<h2 id="Accessibility">Accessibility & input</h2>
<p>New accessibility APIs can retrieve detailed information about the properties of windows on the screen that sighted users can interact with and define standard or customized input actions for UI elements.</p>
diff --git a/media/java/android/media/session/MediaSession.java b/media/java/android/media/session/MediaSession.java
index ad018ad..86da80a 100644
--- a/media/java/android/media/session/MediaSession.java
+++ b/media/java/android/media/session/MediaSession.java
@@ -1157,6 +1157,7 @@
break;
case MSG_SKIP_TO_ITEM:
mCallback.onSkipToQueueItem((Long) msg.obj);
+ break;
case MSG_PAUSE:
mCallback.onPause();
break;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
index eb808c2..5c7909a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
@@ -571,6 +571,9 @@
cancel();
} else {
dismiss();
+ if (ActivityManager.isUserAMonkey()) {
+ return;
+ }
UserInfo user = mUserManager.createSecondaryUser(
mContext.getString(R.string.user_new_user_name), 0 /* flags */);
if (user == null) {
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 60d1520..2cf4865 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -1025,6 +1025,7 @@
@Override
public HdmiDeviceInfo getActiveSource() {
+ enforceAccessPermission();
HdmiCecLocalDeviceTv tv = tv();
if (tv == null) {
Slog.w(TAG, "Local tv device not available");
@@ -1344,11 +1345,13 @@
@Override
public void setHdmiRecordListener(IHdmiRecordListener listener) {
+ enforceAccessPermission();
HdmiControlService.this.setHdmiRecordListener(listener);
}
@Override
public void startOneTouchRecord(final int recorderAddress, final byte[] recordSource) {
+ enforceAccessPermission();
runOnServiceThread(new Runnable() {
@Override
public void run() {
@@ -1363,6 +1366,7 @@
@Override
public void stopOneTouchRecord(final int recorderAddress) {
+ enforceAccessPermission();
runOnServiceThread(new Runnable() {
@Override
public void run() {
@@ -1378,6 +1382,7 @@
@Override
public void startTimerRecording(final int recorderAddress, final int sourceType,
final byte[] recordSource) {
+ enforceAccessPermission();
runOnServiceThread(new Runnable() {
@Override
public void run() {
@@ -1393,6 +1398,7 @@
@Override
public void clearTimerRecording(final int recorderAddress, final int sourceType,
final byte[] recordSource) {
+ enforceAccessPermission();
runOnServiceThread(new Runnable() {
@Override
public void run() {
diff --git a/services/core/java/com/android/server/trust/TrustManagerService.java b/services/core/java/com/android/server/trust/TrustManagerService.java
index fefbe0a..f9b1704 100644
--- a/services/core/java/com/android/server/trust/TrustManagerService.java
+++ b/services/core/java/com/android/server/trust/TrustManagerService.java
@@ -120,8 +120,9 @@
if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY && !isSafeMode()) {
mPackageMonitor.register(mContext, mHandler.getLooper(), UserHandle.ALL, true);
mReceiver.register(mContext);
- maybeEnableFactoryTrustAgents(mLockPatternUtils, UserHandle.USER_OWNER);
refreshAgentList(UserHandle.USER_ALL);
+ } else if (phase == SystemService.PHASE_BOOT_COMPLETED && !isSafeMode()) {
+ maybeEnableFactoryTrustAgents(mLockPatternUtils, UserHandle.USER_OWNER);
}
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index fe4b7b9..9ee44b9 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -1687,7 +1687,6 @@
.setContentTitle(mContext.getString(R.string.ssl_ca_cert_warning))
.setContentText(contentText)
.setContentIntent(notifyIntent)
- .setOngoing(true)
.setPriority(Notification.PRIORITY_HIGH)
.setShowWhen(false)
.setColor(mContext.getResources().getColor(
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index b5f6692..4c1f75f 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -901,6 +901,13 @@
}
/**
+ * @hide
+ */
+ public final ConnectionService getConnectionService() {
+ return mConnectionService;
+ }
+
+ /**
* Sets the conference that this connection is a part of. This will fail if the connection is
* already part of a conference call. {@link #resetConference} to un-set the conference first.
*
diff --git a/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java
index bef5181..4993262 100644
--- a/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java
@@ -213,6 +213,10 @@
return null;
}
+ @Nullable
+ /*package*/ static String getFontLocation() {
+ return sFontLocation;
+ }
// ---- native methods ----
diff --git a/tools/layoutlib/bridge/src/android/graphics/Typeface_Accessor.java b/tools/layoutlib/bridge/src/android/graphics/Typeface_Accessor.java
deleted file mode 100644
index adad2ac..0000000
--- a/tools/layoutlib/bridge/src/android/graphics/Typeface_Accessor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.graphics;
-
-/**
- * Class allowing access to package-protected methods/fields.
- */
-public class Typeface_Accessor {
-
- public static void resetDefaults() {
- Typeface.sDefaults = null;
- }
-}
diff --git a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
index 276e134..b9460b4 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
@@ -27,6 +27,8 @@
import java.util.ArrayList;
import java.util.List;
+import static android.graphics.FontFamily_Delegate.getFontLocation;
+
/**
* Delegate implementing the native methods of android.graphics.Typeface
*
@@ -48,8 +50,6 @@
private static final DelegateManager<Typeface_Delegate> sManager =
new DelegateManager<Typeface_Delegate>(Typeface_Delegate.class);
- // ---- delegate helper data ----
- private static String sFontLocation;
// ---- delegate data ----
@@ -61,11 +61,8 @@
private static long sDefaultTypeface;
+
// ---- Public Helper methods ----
- public static synchronized void setFontLocation(String fontLocation) {
- sFontLocation = fontLocation;
- FontFamily_Delegate.setFontLocation(fontLocation);
- }
public static Typeface_Delegate getDelegate(long nativeTypeface) {
return sManager.getDelegate(nativeTypeface);
@@ -131,6 +128,18 @@
return fonts;
}
+ /**
+ * Clear the default typefaces when disposing bridge.
+ */
+ public static void resetDefaults() {
+ // Sometimes this is called before the Bridge is initialized. In that case, we don't want to
+ // initialize Typeface because the SDK fonts location hasn't been set.
+ if (FontFamily_Delegate.getFontLocation() != null) {
+ Typeface.sDefaults = null;
+ }
+ }
+
+
// ---- native methods ----
@LayoutlibDelegate
@@ -193,7 +202,7 @@
@LayoutlibDelegate
/*package*/ static File getSystemFontConfigLocation() {
- return new File(sFontLocation);
+ return new File(getFontLocation());
}
// ---- Private delegate/helper methods ----
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
index 3d0e1e8..825731b 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -38,7 +38,7 @@
import android.content.res.BridgeAssetManager;
import android.graphics.Bitmap;
-import android.graphics.Typeface_Accessor;
+import android.graphics.FontFamily_Delegate;
import android.graphics.Typeface_Delegate;
import android.os.Looper;
import android.os.Looper_Accessor;
@@ -250,7 +250,7 @@
}
// load the fonts.
- Typeface_Delegate.setFontLocation(fontLocation.getAbsolutePath());
+ FontFamily_Delegate.setFontLocation(fontLocation.getAbsolutePath());
// now parse com.android.internal.R (and only this one as android.R is a subset of
// the internal version), and put the content in the maps.
@@ -303,7 +303,7 @@
BridgeAssetManager.clearSystem();
// dispose of the default typeface.
- Typeface_Accessor.resetDefaults();
+ Typeface_Delegate.resetDefaults();
return true;
}