Merge "More work on issue #17656716: Unhandled exception in Window Manager" into lmp-dev
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 5ba7d50..cc0d51c 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -132,6 +132,7 @@
" am to-uri [INTENT]\n" +
" am to-intent-uri [INTENT]\n" +
" am switch-user <USER_ID>\n" +
+ " am start-user <USER_ID>\n" +
" am stop-user <USER_ID>\n" +
" am stack start <DISPLAY_ID> <INTENT>\n" +
" am stack movetask <TASK_ID> <STACK_ID> [true|false]\n" +
@@ -233,8 +234,11 @@
"am switch-user: switch to put USER_ID in the foreground, starting\n" +
" execution of that user if it is currently stopped.\n" +
"\n" +
+ "am start-user: start USER_ID in background if it is currently stopped,\n" +
+ " use switch-user if you want to start the user in foreground.\n" +
+ "\n" +
"am stop-user: stop execution of USER_ID, not allowing it to run any\n" +
- " code until a later explicit switch to it.\n" +
+ " code until a later explicit start or switch to it.\n" +
"\n" +
"am stack start: start a new activity on <DISPLAY_ID> using <INTENT>.\n" +
"\n" +
@@ -340,6 +344,8 @@
runToUri(true);
} else if (op.equals("switch-user")) {
runSwitchUser();
+ } else if (op.equals("start-user")) {
+ runStartUserInBackground();
} else if (op.equals("stop-user")) {
runStopUser();
} else if (op.equals("stack")) {
@@ -1133,6 +1139,16 @@
mAm.switchUser(Integer.parseInt(user));
}
+ private void runStartUserInBackground() throws Exception {
+ String user = nextArgRequired();
+ boolean success = mAm.startUserInBackground(Integer.parseInt(user));
+ if (success) {
+ System.out.println("Success: user started");
+ } else {
+ System.err.println("Error: could not start user");
+ }
+ }
+
private void runStopUser() throws Exception {
String user = nextArgRequired();
int res = mAm.stopUser(Integer.parseInt(user), null);
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 3d14c58..cd6088f 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -579,7 +579,7 @@
public TaskDescription(TaskDescription td) {
mLabel = td.mLabel;
mIcon = td.mIcon;
- setPrimaryColor(td.mColorPrimary);
+ mColorPrimary = td.mColorPrimary;
mIconFilename = td.mIconFilename;
}
@@ -600,7 +600,11 @@
* @hide
*/
public void setPrimaryColor(int primaryColor) {
- mColorPrimary = 0xFF000000 | primaryColor;
+ // Ensure that the given color is valid
+ if ((primaryColor != 0) && (Color.alpha(primaryColor) != 255)) {
+ throw new RuntimeException("A TaskDescription's primary color should be opaque");
+ }
+ mColorPrimary = primaryColor;
}
/**
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 31b39ebb2..4b3aefe 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -798,8 +798,8 @@
public static final String EXTRA_TEMPLATE = "android.template";
/**
- * {@link #extras} key: An array of people that this notification relates to, specified
- * by contacts provider contact URI.
+ * {@link #extras} key: A String array containing the people that this notification relates to,
+ * each of which was supplied to {@link Builder#addPerson(String)}.
*/
public static final String EXTRA_PEOPLE = "android.people";
@@ -2393,10 +2393,27 @@
/**
* Add a person that is relevant to this notification.
*
+ * <P>
+ * Depending on user preferences, this annotation may allow the notification to pass
+ * through interruption filters, and to appear more prominently in the user interface.
+ * </P>
+ *
+ * <P>
+ * The person should be specified by the {@code String} representation of a
+ * {@link android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI}.
+ * </P>
+ *
+ * <P>The system will also attempt to resolve {@code mailto:} and {@code tel:} schema
+ * URIs. The path part of these URIs must exist in the contacts database, in the
+ * appropriate column, or the reference will be discarded as invalid. Telephone schema
+ * URIs will be resolved by {@link android.provider.ContactsContract.PhoneLookup}.
+ * </P>
+ *
+ * @param uri A URI for the person.
* @see Notification#EXTRA_PEOPLE
*/
- public Builder addPerson(String handle) {
- mPeople.add(handle);
+ public Builder addPerson(String uri) {
+ mPeople.add(uri);
return this;
}
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index 35fff74..5d6acd8 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -760,6 +760,9 @@
/**
* Returns whether the notification matches the user's interruption
* filter.
+ *
+ * @return {@code true} if the notification is allowed by the filter, or
+ * {@code false} if it is blocked.
*/
public boolean matchesInterruptionFilter() {
return mMatchesInterruptionFilter;
diff --git a/core/java/android/view/AccessibilityManagerInternal.java b/core/java/android/view/AccessibilityManagerInternal.java
new file mode 100644
index 0000000..7bb2dc5
--- /dev/null
+++ b/core/java/android/view/AccessibilityManagerInternal.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2014 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.view;
+
+/**
+ * Accessibility manager local system service interface.
+ *
+ * @hide Only for use within the system server.
+ */
+public abstract class AccessibilityManagerInternal {
+
+ /**
+ * Queries if the accessibility manager service permits setting
+ * a non-default encryption password.
+ */
+ public abstract boolean isNonDefaultEncryptionPasswordAllowed();
+}
diff --git a/core/java/android/view/GhostView.java b/core/java/android/view/GhostView.java
index 50c927a..20baad0 100644
--- a/core/java/android/view/GhostView.java
+++ b/core/java/android/view/GhostView.java
@@ -324,19 +324,27 @@
final ArrayList<View> preorderedList = parent.buildOrderedChildList();
final boolean customOrder = preorderedList == null
&& parent.isChildrenDrawingOrderEnabled();
+
+ // This default value shouldn't be used because both view and comparedWith
+ // should be in the list. If there is an error, then just return an arbitrary
+ // view is on top.
+ boolean isOnTop = true;
for (int i = 0; i < childrenCount; i++) {
int childIndex = customOrder ? parent.getChildDrawingOrder(childrenCount, i) : i;
final View child = (preorderedList == null)
? parent.getChildAt(childIndex) : preorderedList.get(childIndex);
if (child == view) {
- return false;
+ isOnTop = false;
+ break;
} else if (child == comparedWith) {
- return true;
+ isOnTop = true;
+ break;
}
}
- // Shouldn't get here. Neither of the children is in the parent.
- // Just return an arbitrary one.
- return true;
+ if (preorderedList != null) {
+ preorderedList.clear();
+ }
+ return isOnTop;
}
}
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 42fc613..c00d209 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -6732,7 +6732,6 @@
Message m = mHandler.obtainMessage(MSG_REPORT_POWER_CHANGE);
m.arg1 = onBattery ? 1 : 0;
mHandler.sendMessage(m);
- mOnBattery = mOnBatteryInternal = onBattery;
final long uptime = mSecUptime * 1000;
final long realtime = mSecRealtime * 1000;
@@ -6745,10 +6744,11 @@
boolean reset = false;
if (!mNoAutoReset && (oldStatus == BatteryManager.BATTERY_STATUS_FULL
|| level >= 90
- || getLowDischargeAmountSinceCharge() >= 60)
- || (getHighDischargeAmountSinceCharge() >= 60
- && mHistoryBuffer.dataSize() >= MAX_HISTORY_BUFFER)) {
+ || (mDischargeCurrentLevel < 20 && level >= 80)
+ || (getHighDischargeAmountSinceCharge() >= 200
+ && mHistoryBuffer.dataSize() >= MAX_HISTORY_BUFFER))) {
Slog.i(TAG, "Resetting battery stats: level=" + level + " status=" + oldStatus
+ + " dischargeLevel=" + mDischargeCurrentLevel
+ " lowAmount=" + getLowDischargeAmountSinceCharge()
+ " highAmount=" + getHighDischargeAmountSinceCharge());
// Before we write, collect a snapshot of the final aggregated
@@ -6785,6 +6785,7 @@
reset = true;
mNumDischargeStepDurations = 0;
}
+ mOnBattery = mOnBatteryInternal = onBattery;
mLastDischargeStepLevel = level;
mMinDischargeStepLevel = level;
mLastDischargeStepTime = -1;
@@ -6812,6 +6813,7 @@
mDischargeAmountScreenOff = 0;
updateTimeBasesLocked(true, !screenOn, uptime, realtime);
} else {
+ mOnBattery = mOnBatteryInternal = onBattery;
pullPendingStateUpdatesLocked();
mHistoryCur.batteryLevel = (byte)level;
mHistoryCur.states |= HistoryItem.STATE_BATTERY_PLUGGED_FLAG;
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 16fa88e..2b7af4b 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -878,6 +878,30 @@
}
/**
+ * Gets whether the device is encrypted.
+ *
+ * @return Whether the device is encrypted.
+ */
+ public static boolean isDeviceEncrypted() {
+ IMountService mountService = IMountService.Stub.asInterface(
+ ServiceManager.getService("mount"));
+ try {
+ return mountService.getEncryptionState() != IMountService.ENCRYPTION_STATE_NONE
+ && mountService.getPasswordType() != StorageManager.CRYPT_TYPE_DEFAULT;
+ } catch (RemoteException re) {
+ Log.e(TAG, "Error getting encryption state", re);
+ }
+ return true;
+ }
+
+ /**
+ * Clears the encryption password.
+ */
+ public void clearEncryptionPassword() {
+ updateEncryptionPassword(StorageManager.CRYPT_TYPE_DEFAULT, null);
+ }
+
+ /**
* Retrieves the quality mode we're in.
* {@see DevicePolicyManager#getPasswordQuality(android.content.ComponentName)}
*
diff --git a/core/res/res/layout/preference_header_item_material.xml b/core/res/res/layout/preference_header_item_material.xml
index 594189f..88e1cb2 100644
--- a/core/res/res/layout/preference_header_item_material.xml
+++ b/core/res/res/layout/preference_header_item_material.xml
@@ -45,7 +45,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
- android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textAppearance="?android:attr/textAppearanceListItem"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
@@ -54,7 +54,7 @@
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignStart="@android:id/title"
- android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:ellipsize="end"
android:maxLines="2" />
diff --git a/core/res/res/layout/preference_list_content_material.xml b/core/res/res/layout/preference_list_content_material.xml
index 7856799..1bc527e 100644
--- a/core/res/res/layout/preference_list_content_material.xml
+++ b/core/res/res/layout/preference_list_content_material.xml
@@ -48,7 +48,8 @@
android:drawSelectorOnTop="false"
android:cacheColorHint="@color/transparent"
android:listPreferredItemHeight="48dp"
- android:scrollbarAlwaysDrawVerticalTrack="true" />
+ android:scrollbarAlwaysDrawVerticalTrack="true"
+ android:divider="@null" />
<FrameLayout android:id="@+id/list_footer"
android:layout_width="match_parent"
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 7a2bbc1..824ed9e 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -380,7 +380,7 @@
<dimen name="datepicker_month_day_label_text_size">12sp</dimen>
<dimen name="datepicker_month_list_item_header_height">48dp</dimen>
<dimen name="datepicker_day_number_select_circle_radius">16dp</dimen>
- <dimen name="datepicker_view_animator_height">250dp</dimen>
+ <dimen name="datepicker_view_animator_height">244dp</dimen>
<dimen name="datepicker_year_picker_padding_top">8dp</dimen>
<dimen name="datepicker_year_label_height">64dp</dimen>
diff --git a/docs/html/google/play/billing/billing_overview.jd b/docs/html/google/play/billing/billing_overview.jd
index 12f8c9a..1c20d78 100644
--- a/docs/html/google/play/billing/billing_overview.jd
+++ b/docs/html/google/play/billing/billing_overview.jd
@@ -7,11 +7,11 @@
<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 goods, including one-time items and
recurring subscriptions.</li>
- <li>Supported for any app published on Google Play. You only need a Google
+ <li>Supported for any app published on Google Play. You only need a Google
Play Developer Console account and a Google Wallet merchant account.</li>
- <li>Checkout processing is automatically handled by Google Play, with the
+ <li>Checkout processing is automatically handled by Google Play, with the
same look-and-feel as for app purchases.</li>
</ul>
<h2>In this document</h2>
@@ -24,18 +24,18 @@
</li>
<li><a href="#console">Google Play Developer Console</a></li>
<li><a href="#checkout">Google Play Purchase Flow</a></li>
- <li><a href="#samples">Sample App</a></li>
+ <li><a href="#samples">Sample App</a></li>
<li><a href="#migration">Migration Considerations</a></li>
</ol>
<h2>Related Samples</h2>
<ol>
<li><a href="{@docRoot}training/in-app-billing/preparing-iab-app.html#GetSample">Sample Application (V3)</a></li>
- </ol>
+ </ol>
</div>
</div>
-<p>This documentation describes the fundamental In-app Billing components and
-features that you need to understand in order to add In-app
+<p>This documentation 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
@@ -49,130 +49,132 @@
</p>
<h2 id="api">In-app Billing API</h2>
-<p>Your application accesses the In-app Billing service using an API that is
-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
-communication (IPC) and receives responses from the Google Play app.
-Your application does not manage any network connections between itself and
+<p>Your application accesses the In-app Billing service using an API that is
+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
+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
-through Google Play. To complete in-app purchase requests, the Google Play app
+<p>In-app Billing can be implemented 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
-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
+<p>In-app billing Version 3 is the latest version, and 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 href="{@docRoot}about/dashboards/index.html">a vast majority</a> of active devices).</p>
<h4>Version 3 features</h4>
<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
+<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
+<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
+<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
+<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>
</ul>
-<p>For details about other versions of In-app Billing, see the
+<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,
-application feature upgrades that enhance the user experience, and new content
+<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,
+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
+<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>
-<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
+<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>
<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
+<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
+<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>
<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
+<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
+<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>
-<p>You can also create test accounts to authorize
+<p>You can also create test accounts to authorize
access for testing applications that are unpublished.</p>
-<p>To learn how to use the Developer Console to configure your in-app
-products and product list, see
-<a href="{@docRoot}google/play/billing/billing_admin.html">Administering
+<p>To learn how to use the Developer Console to configure your in-app
+products and product list, see
+<a href="{@docRoot}google/play/billing/billing_admin.html">Administering
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 checkout backend service as 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 Wallet
merchant account to use the In-app Billing service on Google Play.</p>
-<p>To initiate a purchase, your application sends a billing request for a
-specific in-app product. Google Play then handles all of the checkout details for
-the transaction, including requesting and validating the form of payment and
-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
+<p>To initiate a purchase, your application sends a billing request for a
+specific in-app product. Google Play then handles all of the checkout details for
+the transaction, including requesting and validating the form of payment and
+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>
<h2 id="samples">Sample Application</h2>
-<p>To help you integrate In-app Billing into your application, the Android SDK
-provides a sample application that demonstrates how to sell in-app products and subscriptions
+<p>To help you integrate In-app Billing into your application, the Android SDK
+provides a sample application that demonstrates how to sell in-app products and subscriptions
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 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
-synchronous responses from Google Play. The application also shows how to record
-item consumption with the API. The Version 3 sample includes convenience classes
-for processing In-app Billing operations as well as perform automatic signature
+<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 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
+synchronous responses from Google Play. The application also shows how to record
+item 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>: Make 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
+<a href="{@docRoot}google/play/billing/billing_best_practices.html">Security
and Design</a>.</p>
<h2 id="migration">Migration Considerations</h2>
-<p>If you have an existing In-app Billing implementation that uses Version 2 or
-earlier, it is strongly recommended that you migrate to <a href="{@docRoot}google/play/billing/api.html">In-app Billing Version 3</a> at your earliest convenience.</p>
+<p>The In-app Billing Version 2 API is deprecated and will be 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>
<p>If you have published apps selling in-app products, note that:</p>
<ul>
-<li>Managed items and subscriptions that you have previously defined in the Developer Console will
+<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. They will still continue to be treated as unmanaged items if you make a
-purchase request for them using the Version 2 or earlier API.
+<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. They will still continue to be treated as unmanaged items if you make a
+purchase request for them using the Version 2 or earlier API.
</ul>
diff --git a/docs/html/sdk/installing/studio-build.jd b/docs/html/sdk/installing/studio-build.jd
index 29ba12d..bff3bc0 100644
--- a/docs/html/sdk/installing/studio-build.jd
+++ b/docs/html/sdk/installing/studio-build.jd
@@ -454,8 +454,8 @@
for debugging purposes.</p>
<p>After you build the project, the output APK for the app module is located in
-<code>app/build/apk/</code>, and the output AAR for the lib module is located in
-<code>lib/build/libs/</code>.</p>
+<code>app/build/outputs/apk/</code>, and the output AAR for the lib module is located in
+<code>lib/build/outputs/libs/</code>.</p>
<p>To see a list of all available build tasks for your project, type this command:</p>
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index 0b052f4..4a719fe 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -177,11 +177,10 @@
@Override
public void setTintList(ColorStateList tint) {
- mDrawableContainerState.mHasTint = tint != null
- && mDrawableContainerState.mTintMode != null;
+ mDrawableContainerState.mHasTintList = true;
- if (mDrawableContainerState.mTint != tint) {
- mDrawableContainerState.mTint = tint;
+ if (mDrawableContainerState.mTintList != tint) {
+ mDrawableContainerState.mTintList = tint;
if (mCurrDrawable != null) {
mCurrDrawable.mutate().setTintList(tint);
@@ -191,8 +190,7 @@
@Override
public void setTintMode(Mode tintMode) {
- mDrawableContainerState.mHasTint = mDrawableContainerState.mTint != null
- && tintMode != null;
+ mDrawableContainerState.mHasTintMode = true;
if (mDrawableContainerState.mTintMode != tintMode) {
mDrawableContainerState.mTintMode = tintMode;
@@ -449,10 +447,15 @@
d.setAlpha(mAlpha);
}
if (mDrawableContainerState.mHasColorFilter) {
+ // Color filter always overrides tint.
d.setColorFilter(mDrawableContainerState.mColorFilter);
- } else if (mDrawableContainerState.mHasTint) {
- d.setTintList(mDrawableContainerState.mTint);
- d.setTintMode(mDrawableContainerState.mTintMode);
+ } else {
+ if (mDrawableContainerState.mHasTintList) {
+ d.setTintList(mDrawableContainerState.mTintList);
+ }
+ if (mDrawableContainerState.mHasTintMode) {
+ d.setTintMode(mDrawableContainerState.mTintMode);
+ }
}
d.setVisible(isVisible(), true);
d.setDither(mDrawableContainerState.mDither);
@@ -623,9 +626,10 @@
ColorFilter mColorFilter;
boolean mHasColorFilter;
- ColorStateList mTint;
+ ColorStateList mTintList;
Mode mTintMode;
- boolean mHasTint;
+ boolean mHasTintList;
+ boolean mHasTintMode;
DrawableContainerState(DrawableContainerState orig, DrawableContainer owner,
Resources res) {
@@ -649,9 +653,10 @@
mAutoMirrored = orig.mAutoMirrored;
mColorFilter = orig.mColorFilter;
mHasColorFilter = orig.mHasColorFilter;
- mTint = orig.mTint;
+ mTintList = orig.mTintList;
mTintMode = orig.mTintMode;
- mHasTint = orig.mHasTint;
+ mHasTintList = orig.mHasTintList;
+ mHasTintMode = orig.mHasTintMode;
// Cloning the following values may require creating futures.
mConstantPadding = orig.getConstantPadding();
diff --git a/packages/CaptivePortalLogin/AndroidManifest.xml b/packages/CaptivePortalLogin/AndroidManifest.xml
index c5fb167..2ec15be 100644
--- a/packages/CaptivePortalLogin/AndroidManifest.xml
+++ b/packages/CaptivePortalLogin/AndroidManifest.xml
@@ -20,6 +20,7 @@
package="com.android.captiveportallogin" >
<uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:label="@string/app_name" >
<activity
diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
index ae52a1e..b3a6e88 100644
--- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -20,7 +20,10 @@
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
+import android.net.ConnectivityManager.NetworkCallback;
import android.net.Network;
+import android.net.NetworkCapabilities;
+import android.net.NetworkRequest;
import android.os.Bundle;
import android.provider.Settings;
import android.provider.Settings.Global;
@@ -55,6 +58,7 @@
private URL mURL;
private int mNetId;
+ private NetworkCallback mNetworkCallback;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -73,7 +77,27 @@
getActionBar().setDisplayShowHomeEnabled(false);
mNetId = Integer.parseInt(getIntent().getStringExtra(Intent.EXTRA_TEXT));
- ConnectivityManager.setProcessDefaultNetwork(new Network(mNetId));
+ final Network network = new Network(mNetId);
+ ConnectivityManager.setProcessDefaultNetwork(network);
+
+ // Exit app if Network disappears.
+ final NetworkCapabilities networkCapabilities =
+ ConnectivityManager.from(this).getNetworkCapabilities(network);
+ if (networkCapabilities == null) {
+ finish();
+ return;
+ }
+ mNetworkCallback = new NetworkCallback() {
+ @Override
+ public void onLost(Network lostNetwork) {
+ if (network.equals(lostNetwork)) done(false);
+ }
+ };
+ final NetworkRequest.Builder builder = new NetworkRequest.Builder();
+ for (int transportType : networkCapabilities.getTransportTypes()) {
+ builder.addTransportType(transportType);
+ }
+ ConnectivityManager.from(this).registerNetworkCallback(builder.build(), mNetworkCallback);
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
@@ -84,6 +108,7 @@
}
private void done(boolean use_network) {
+ ConnectivityManager.from(this).unregisterNetworkCallback(mNetworkCallback);
Intent intent = new Intent(ACTION_CAPTIVE_PORTAL_LOGGED_IN);
intent.putExtra(Intent.EXTRA_TEXT, String.valueOf(mNetId));
intent.putExtra(LOGGED_IN_RESULT, use_network ? "1" : "0");
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
index 34bbc2e..954046c 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
@@ -95,10 +95,11 @@
log("dozing " + dozing);
}
- public static void traceFling(boolean expand, boolean aboveThreshold, boolean thresholdNeeded) {
+ public static void traceFling(boolean expand, boolean aboveThreshold, boolean thresholdNeeded,
+ boolean screenOnFromTouch) {
if (!ENABLED) return;
log("fling expand=" + expand + " aboveThreshold=" + aboveThreshold + " thresholdNeeded="
- + thresholdNeeded);
+ + thresholdNeeded + " screenOnFromTouch=" + screenOnFromTouch);
}
public static void traceEmergencyCall() {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
index 5caf1ac..8416ad7 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
@@ -112,15 +112,11 @@
mTaskStackBounds = new Rect();
}
- public void onStart() {}
-
- public void onBootCompleted() {
+ public void onStart() {
// Initialize some static datastructures
TaskStackViewLayoutAlgorithm.initializeCurve();
// Load the header bar layout
reloadHeaderBarLayout();
- mBootCompleted = true;
-
// Try and pre-emptively bind the search widget on startup to ensure that we
// have the right thumbnail bounds to animate to.
if (Constants.DebugFlags.App.EnableSearchLayout) {
@@ -138,6 +134,10 @@
}
}
+ public void onBootCompleted() {
+ mBootCompleted = true;
+ }
+
/** Shows the recents */
public void onShowRecents(boolean triggeredFromAltTab, View statusBarView) {
mStatusBarView = statusBarView;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index b9efb22..26420e1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -1551,7 +1551,8 @@
@Override
protected void onEdgeClicked(boolean right) {
if ((right && getRightIcon().getVisibility() != View.VISIBLE)
- || (!right && getLeftIcon().getVisibility() != View.VISIBLE)) {
+ || (!right && getLeftIcon().getVisibility() != View.VISIBLE)
+ || isDozing()) {
return;
}
mHintAnimationRunning = true;
@@ -1747,6 +1748,7 @@
updateKeyguardStatusBarVisibility();
}
+ @Override
public boolean isDozing() {
return mDozing;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index cacc2df7..c612e4c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -337,7 +337,8 @@
boolean expand = flingExpands(vel, vectorVel);
onTrackingStopped(expand);
DozeLog.traceFling(expand, mTouchAboveFalsingThreshold,
- mStatusBar.isFalsingThresholdNeeded());
+ mStatusBar.isFalsingThresholdNeeded(),
+ mStatusBar.isScreenOnComingFromTouch());
fling(vel, expand);
mUpdateFlingOnLayout = expand && mPanelClosedOnDown && !mHasLayoutedSinceDown;
if (mUpdateFlingOnLayout) {
@@ -914,7 +915,9 @@
private boolean onMiddleClicked() {
switch (mStatusBar.getBarState()) {
case StatusBarState.KEYGUARD:
- startUnlockHintAnimation();
+ if (!isDozing()) {
+ startUnlockHintAnimation();
+ }
return true;
case StatusBarState.SHADE_LOCKED:
mStatusBar.goToKeyguard();
@@ -932,6 +935,8 @@
protected abstract void onEdgeClicked(boolean right);
+ protected abstract boolean isDozing();
+
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
pw.println(String.format("[PanelView(%s): expandedHeight=%f maxPanelHeight=%d closing=%s"
+ " tracking=%s justPeeked=%s peekAnim=%s%s timeAnim=%s%s touchDisabled=%s"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 79d769a..3625997 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -646,19 +646,10 @@
mLastSignalLevel = iconLevel = mSignalStrength.getLevel();
}
- if (isCdma()) {
- if (isCdmaEri()) {
- iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition];
- } else {
- iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition];
- }
+ if (isRoaming()) {
+ iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition];
} else {
- // Though mPhone is a Manager, this call is not an IPC
- if (mPhone.isNetworkRoaming()) {
- iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition];
- } else {
- iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition];
- }
+ iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition];
}
mPhoneSignalIconId = iconList[iconLevel];
mQSPhoneSignalIconId =
@@ -811,14 +802,9 @@
}
}
- if (isCdma()) {
- if (isCdmaEri()) {
- mDataTypeIconId = TelephonyIcons.ROAMING_ICON;
- mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition];
- }
- } else if (mPhone.isNetworkRoaming()) {
- mDataTypeIconId = TelephonyIcons.ROAMING_ICON;
- mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition];
+ if (isRoaming()) {
+ mDataTypeIconId = TelephonyIcons.ROAMING_ICON;
+ mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition];
}
}
@@ -836,6 +822,14 @@
return false;
}
+ private boolean isRoaming() {
+ if (isCdma()) {
+ return isCdmaEri();
+ } else {
+ return mServiceState != null && mServiceState.getRoaming();
+ }
+ }
+
private final void updateDataIcon() {
int iconId;
boolean visible = true;
@@ -1233,12 +1227,7 @@
mDataTypeIconId = 0;
mQSDataTypeIconId = 0;
- if (isCdma()) {
- if (isCdmaEri()) {
- mDataTypeIconId = TelephonyIcons.ROAMING_ICON;
- mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition];
- }
- } else if (mPhone.isNetworkRoaming()) {
+ if (isRoaming()) {
mDataTypeIconId = TelephonyIcons.ROAMING_ICON;
mQSDataTypeIconId = TelephonyIcons.QS_DATA_R[mInetCondition];
}
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index be3fc47..1253bc7c 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -67,6 +67,7 @@
import android.util.Pools.SimplePool;
import android.util.Slog;
import android.util.SparseArray;
+import android.view.AccessibilityManagerInternal;
import android.view.Display;
import android.view.IWindow;
import android.view.InputDevice;
@@ -91,6 +92,7 @@
import com.android.internal.R;
import com.android.internal.content.PackageMonitor;
import com.android.internal.statusbar.IStatusBarService;
+import com.android.internal.widget.LockPatternUtils;
import com.android.server.LocalServices;
import org.xmlpull.v1.XmlPullParserException;
@@ -202,6 +204,8 @@
private final UserManager mUserManager;
+ private final LockPatternUtils mLockPatternUtils;
+
private int mCurrentUserId = UserHandle.USER_OWNER;
//TODO: Remove this hack
@@ -225,9 +229,11 @@
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
mSecurityPolicy = new SecurityPolicy();
mMainHandler = new MainHandler(mContext.getMainLooper());
+ mLockPatternUtils = new LockPatternUtils(context);
registerBroadcastReceivers();
new AccessibilityContentObserver(mMainHandler).register(
context.getContentResolver());
+ LocalServices.addService(AccessibilityManagerInternal.class, new LocalService());
}
private UserState getUserStateLocked(int userId) {
@@ -1294,6 +1300,7 @@
updateTouchExplorationLocked(userState);
updateEnhancedWebAccessibilityLocked(userState);
updateDisplayColorAdjustmentSettingsLocked(userState);
+ updateEncryptionState(userState);
scheduleUpdateInputFilter(userState);
scheduleUpdateClientsIfNeededLocked(userState);
}
@@ -1570,6 +1577,21 @@
DisplayAdjustmentUtils.applyAdjustments(mContext, userState.mUserId);
}
+ private void updateEncryptionState(UserState userState) {
+ if (userState.mUserId != UserHandle.USER_OWNER) {
+ return;
+ }
+ if (hasRunningServicesLocked(userState) && LockPatternUtils.isDeviceEncrypted()) {
+ // If there are running accessibility services we do not have encryption as
+ // the user needs the accessibility layer to be running to authenticate.
+ mLockPatternUtils.clearEncryptionPassword();
+ }
+ }
+
+ private boolean hasRunningServicesLocked(UserState userState) {
+ return !userState.mBoundServices.isEmpty() || !userState.mBindingServices.isEmpty();
+ }
+
private MagnificationSpec getCompatibleMagnificationSpecLocked(int windowId) {
IBinder windowToken = mGlobalWindowTokens.get(windowId);
if (windowToken == null) {
@@ -3883,4 +3905,14 @@
}
}
}
+
+ private final class LocalService extends AccessibilityManagerInternal {
+ @Override
+ public boolean isNonDefaultEncryptionPasswordAllowed() {
+ synchronized (mLock) {
+ UserState userState = getCurrentUserStateLocked();
+ return !hasRunningServicesLocked(userState);
+ }
+ }
+ }
}
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 0b1a627..85ab249 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -516,11 +516,13 @@
return;
}
- if (list.isEmpty() || isDefaultNetwork(nai)) {
+ list.add(nai);
+
+ // Send a broadcast if this is the first network of its type or if it's the default.
+ if (list.size() == 1 || isDefaultNetwork(nai)) {
maybeLogBroadcast(nai, true, type);
sendLegacyNetworkBroadcast(nai, true, type);
}
- list.add(nai);
}
/** Removes the given network from the specified legacy type list. */
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index 7f24d07..b0535b3 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -63,6 +63,7 @@
import android.util.Slog;
import android.util.Xml;
+import android.view.AccessibilityManagerInternal;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.app.IMediaContainerService;
@@ -557,6 +558,8 @@
private final Handler mHandler;
+ private final AccessibilityManagerInternal mAccessibilityManagerInternal;
+
void waitForAsecScan() {
waitForLatch(mAsecsScanned);
}
@@ -1454,6 +1457,9 @@
hthread.start();
mHandler = new MountServiceHandler(hthread.getLooper());
+ mAccessibilityManagerInternal = LocalServices.getService(
+ AccessibilityManagerInternal.class);
+
// Watch for user changes
final IntentFilter userFilter = new IntentFilter();
userFilter.addAction(Intent.ACTION_USER_ADDED);
@@ -2254,8 +2260,15 @@
final NativeDaemonEvent event;
try {
+ // The accessibility layer may veto having a non-default encryption
+ // password because if there are enabled accessibility services the
+ // user cannot authenticate as the latter need access to the data.
+ if (!TextUtils.isEmpty(password)
+ && !mAccessibilityManagerInternal.isNonDefaultEncryptionPasswordAllowed()) {
+ return getEncryptionState();
+ }
event = mConnector.execute("cryptfs", "changepw", CRYPTO_TYPES[type],
- new SensitiveArg(toHex(password)));
+ new SensitiveArg(toHex(password)));
return Integer.parseInt(event.getMessage());
} catch (NativeDaemonConnectorException e) {
// Encryption failed
@@ -2302,7 +2315,7 @@
* @return The type, one of the CRYPT_TYPE_XXX consts from StorageManager.
*/
@Override
- public int getPasswordType() throws RemoteException {
+ public int getPasswordType() {
waitForReady();
diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java
index 9292d45..adc96f7 100644
--- a/services/core/java/com/android/server/content/SyncManager.java
+++ b/services/core/java/com/android/server/content/SyncManager.java
@@ -311,7 +311,9 @@
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "Reconnection detected: clearing all backoffs");
}
- mSyncStorageEngine.clearAllBackoffs(mSyncQueue);
+ synchronized (mSyncQueue) {
+ mSyncStorageEngine.clearAllBackoffsLocked(mSyncQueue);
+ }
}
sendCheckAlarmsMessage();
}
diff --git a/services/core/java/com/android/server/content/SyncStorageEngine.java b/services/core/java/com/android/server/content/SyncStorageEngine.java
index 9499370..0d5f240 100644
--- a/services/core/java/com/android/server/content/SyncStorageEngine.java
+++ b/services/core/java/com/android/server/content/SyncStorageEngine.java
@@ -834,17 +834,16 @@
return changed;
}
- public void clearAllBackoffs(SyncQueue syncQueue) {
+ public void clearAllBackoffsLocked(SyncQueue syncQueue) {
boolean changed = false;
synchronized (mAuthorities) {
- synchronized (syncQueue) {
// Clear backoff for all sync adapters.
for (AccountInfo accountInfo : mAccounts.values()) {
for (AuthorityInfo authorityInfo : accountInfo.authorities.values()) {
if (authorityInfo.backoffTime != NOT_IN_BACKOFF_MODE
|| authorityInfo.backoffDelay != NOT_IN_BACKOFF_MODE) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, "clearAllBackoffs:"
+ Log.v(TAG, "clearAllBackoffsLocked:"
+ " authority:" + authorityInfo.target
+ " account:" + accountInfo.accountAndUser.account.name
+ " user:" + accountInfo.accountAndUser.userId
@@ -868,7 +867,6 @@
authorityInfo.backoffDelay = NOT_IN_BACKOFF_MODE;
}
}
- }
syncQueue.clearBackoffs();
}
}
diff --git a/services/core/java/com/android/server/media/MediaSessionRecord.java b/services/core/java/com/android/server/media/MediaSessionRecord.java
index d9730aa..a0ec1d5 100644
--- a/services/core/java/com/android/server/media/MediaSessionRecord.java
+++ b/services/core/java/com/android/server/media/MediaSessionRecord.java
@@ -23,6 +23,7 @@
import android.content.pm.ParceledListSlice;
import android.media.AudioManager;
import android.media.AudioManagerInternal;
+import android.media.AudioSystem;
import android.media.MediaDescription;
import android.media.MediaMetadata;
import android.media.Rating;
@@ -237,6 +238,7 @@
*/
public void adjustVolume(int direction, int flags, String packageName, int uid,
boolean useSuggested) {
+ int previousFlagPlaySound = flags & AudioManager.FLAG_PLAY_SOUND;
if (isPlaybackActive(false) || hasFlag(MediaSession.FLAG_EXCLUSIVE_GLOBAL_PRIORITY)) {
flags &= ~AudioManager.FLAG_PLAY_SOUND;
}
@@ -248,8 +250,15 @@
if (mVolumeType == PlaybackInfo.PLAYBACK_TYPE_LOCAL) {
int stream = AudioAttributes.toLegacyStreamType(mAudioAttrs);
if (useSuggested) {
- mAudioManagerInternal.adjustSuggestedStreamVolumeForUid(stream, direction, flags,
- packageName, uid);
+ if (AudioSystem.isStreamActive(stream, 0)) {
+ mAudioManagerInternal.adjustSuggestedStreamVolumeForUid(stream, direction,
+ flags, packageName, uid);
+ } else {
+ flags |= previousFlagPlaySound;
+ mAudioManagerInternal.adjustSuggestedStreamVolumeForUid(
+ AudioManager.USE_DEFAULT_STREAM_TYPE, direction, flags, packageName,
+ uid);
+ }
} else {
mAudioManagerInternal.adjustStreamVolumeForUid(stream, direction, flags,
packageName, uid);