Merge "Fix minor spelling and grammar errors in public JavaDoc"
diff --git a/api/current.txt b/api/current.txt
index 582b7b3..e240197 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -25897,10 +25897,6 @@
public static final class Telephony.Mms.Intents {
field public static final java.lang.String CONTENT_CHANGED_ACTION = "android.intent.action.CONTENT_CHANGED";
field public static final java.lang.String DELETED_CONTENTS = "deleted_contents";
- field public static final java.lang.String EXTRA_MMS_CONTENT_URI = "android.provider.Telephony.extra.MMS_CONTENT_URI";
- field public static final java.lang.String EXTRA_MMS_LOCATION_URL = "android.provider.Telephony.extra.MMS_LOCATION_URL";
- field public static final java.lang.String MMS_DOWNLOAD_ACTION = "android.provider.Telephony.MMS_DOWNLOAD";
- field public static final java.lang.String MMS_SEND_ACTION = "android.provider.Telephony.MMS_SEND";
}
public static final class Telephony.Mms.Outbox implements android.provider.Telephony.BaseMmsColumns {
@@ -26005,10 +26001,8 @@
field public static final java.lang.String SMS_CB_RECEIVED_ACTION = "android.provider.Telephony.SMS_CB_RECEIVED";
field public static final java.lang.String SMS_DELIVER_ACTION = "android.provider.Telephony.SMS_DELIVER";
field public static final java.lang.String SMS_EMERGENCY_CB_RECEIVED_ACTION = "android.provider.Telephony.SMS_EMERGENCY_CB_RECEIVED";
- field public static final java.lang.String SMS_FILTER_ACTION = "android.provider.Telephony.SMS_FILTER";
field public static final java.lang.String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED";
field public static final java.lang.String SMS_REJECTED_ACTION = "android.provider.Telephony.SMS_REJECTED";
- field public static final java.lang.String SMS_SEND_ACTION = "android.provider.Telephony.SMS_SEND";
field public static final java.lang.String SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED_ACTION = "android.provider.Telephony.SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED";
field public static final java.lang.String WAP_PUSH_DELIVER_ACTION = "android.provider.Telephony.WAP_PUSH_DELIVER";
field public static final java.lang.String WAP_PUSH_RECEIVED_ACTION = "android.provider.Telephony.WAP_PUSH_RECEIVED";
@@ -28752,9 +28746,6 @@
method public void sendMultimediaMessage(android.content.Context, android.net.Uri, java.lang.String, android.os.Bundle, android.app.PendingIntent);
method public void sendMultipartTextMessage(java.lang.String, java.lang.String, java.util.ArrayList<java.lang.String>, java.util.ArrayList<android.app.PendingIntent>, java.util.ArrayList<android.app.PendingIntent>);
method public void sendTextMessage(java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent);
- method public void updateMmsDownloadStatus(android.content.Context, int, int, android.net.Uri);
- method public void updateMmsSendStatus(android.content.Context, int, byte[], int, android.net.Uri);
- method public void updateSmsSendStatus(int, boolean);
field public static final java.lang.String EXTRA_MMS_DATA = "android.telephony.extra.MMS_DATA";
field public static final java.lang.String EXTRA_MMS_HTTP_STATUS = "android.telephony.extra.MMS_HTTP_STATUS";
field public static final java.lang.String MMS_CONFIG_ALIAS_ENABLED = "aliasEnabled";
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index fbdbb25..c86fd53 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -146,8 +146,10 @@
static const char kInstructionSet[] = "arm";
#elif defined(__i386__)
static const char kInstructionSet[] = "x86";
-#elif defined (__mips__)
+#elif defined (__mips__) && !defined(__LP64__)
static const char kInstructionSet[] = "mips";
+#elif defined (__mips__) && defined(__LP64__)
+ static const char kInstructionSet[] = "mips64";
#else
#error "Unknown instruction set"
#endif
diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java
index 3d390bf..39ae65c 100644
--- a/core/java/android/app/ActivityOptions.java
+++ b/core/java/android/app/ActivityOptions.java
@@ -384,6 +384,8 @@
* of the animation.
* @param startX The x starting location of the bitmap, relative to <var>source</var>.
* @param startY The y starting location of the bitmap, relative to <var>source</var>.
+ * @param handler If <var>listener</var> is non-null this must be a valid
+ * Handler on which to dispatch the callback; otherwise it should be null.
* @param listener Optional OnAnimationStartedListener to find out when the
* requested animation has started running. If for some reason the animation
* is not executed, the callback will happen immediately.
@@ -393,9 +395,9 @@
*/
public static ActivityOptions makeThumbnailAspectScaleUpAnimation(View source,
Bitmap thumbnail, int startX, int startY, int targetWidth, int targetHeight,
- OnAnimationStartedListener listener) {
+ Handler handler, OnAnimationStartedListener listener) {
return makeAspectScaledThumbnailAnimation(source, thumbnail, startX, startY,
- targetWidth, targetHeight, listener, true);
+ targetWidth, targetHeight, handler, listener, true);
}
/**
@@ -408,6 +410,8 @@
* of the animation.
* @param startX The x end location of the bitmap, relative to <var>source</var>.
* @param startY The y end location of the bitmap, relative to <var>source</var>.
+ * @param handler If <var>listener</var> is non-null this must be a valid
+ * Handler on which to dispatch the callback; otherwise it should be null.
* @param listener Optional OnAnimationStartedListener to find out when the
* requested animation has started running. If for some reason the animation
* is not executed, the callback will happen immediately.
@@ -417,14 +421,14 @@
*/
public static ActivityOptions makeThumbnailAspectScaleDownAnimation(View source,
Bitmap thumbnail, int startX, int startY, int targetWidth, int targetHeight,
- OnAnimationStartedListener listener) {
+ Handler handler, OnAnimationStartedListener listener) {
return makeAspectScaledThumbnailAnimation(source, thumbnail, startX, startY,
- targetWidth, targetHeight, listener, false);
+ targetWidth, targetHeight, handler, listener, false);
}
private static ActivityOptions makeAspectScaledThumbnailAnimation(View source, Bitmap thumbnail,
int startX, int startY, int targetWidth, int targetHeight,
- OnAnimationStartedListener listener, boolean scaleUp) {
+ Handler handler, OnAnimationStartedListener listener, boolean scaleUp) {
ActivityOptions opts = new ActivityOptions();
opts.mPackageName = source.getContext().getPackageName();
opts.mAnimationType = scaleUp ? ANIM_THUMBNAIL_ASPECT_SCALE_UP :
@@ -436,7 +440,7 @@
opts.mStartY = pts[1] + startY;
opts.mWidth = targetWidth;
opts.mHeight = targetHeight;
- opts.setOnAnimationStartedListener(source.getHandler(), listener);
+ opts.setOnAnimationStartedListener(handler, listener);
return opts;
}
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index bcd8fb4..a5cdcfd 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -4187,22 +4187,24 @@
final void handleDispatchPackageBroadcast(int cmd, String[] packages) {
boolean hasPkgInfo = false;
if (packages != null) {
- for (int i=packages.length-1; i>=0; i--) {
- //Slog.i(TAG, "Cleaning old package: " + packages[i]);
- if (!hasPkgInfo) {
- WeakReference<LoadedApk> ref;
- ref = mPackages.get(packages[i]);
- if (ref != null && ref.get() != null) {
- hasPkgInfo = true;
- } else {
- ref = mResourcePackages.get(packages[i]);
+ synchronized (mResourcesManager) {
+ for (int i=packages.length-1; i>=0; i--) {
+ //Slog.i(TAG, "Cleaning old package: " + packages[i]);
+ if (!hasPkgInfo) {
+ WeakReference<LoadedApk> ref;
+ ref = mPackages.get(packages[i]);
if (ref != null && ref.get() != null) {
hasPkgInfo = true;
+ } else {
+ ref = mResourcePackages.get(packages[i]);
+ if (ref != null && ref.get() != null) {
+ hasPkgInfo = true;
+ }
}
}
+ mPackages.remove(packages[i]);
+ mResourcePackages.remove(packages[i]);
}
- mPackages.remove(packages[i]);
- mResourcePackages.remove(packages[i]);
}
}
ApplicationPackageManager.handlePackageBroadcast(cmd, packages,
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index fd0412b..860b9cc 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -3056,6 +3056,11 @@
* Apply any necessary background to smallIcons being used in the largeIcon spot.
*/
private void processSmallIconAsLarge(int largeIconId, RemoteViews contentView) {
+ if (!isLegacy()) {
+ contentView.setDrawableParameters(R.id.icon, false, -1,
+ 0xFFFFFFFF,
+ PorterDuff.Mode.SRC_ATOP, -1);
+ }
if (!isLegacy() || mColorUtil.isGrayscaleIcon(mContext, largeIconId)) {
applyLargeIconBackground(contentView);
}
@@ -3103,11 +3108,12 @@
*/
private void processSmallRightIcon(int smallIconDrawableId,
RemoteViews contentView) {
- if (!isLegacy() || mColorUtil.isGrayscaleIcon(mContext, smallIconDrawableId)) {
+ if (!isLegacy()) {
contentView.setDrawableParameters(R.id.right_icon, false, -1,
0xFFFFFFFF,
PorterDuff.Mode.SRC_ATOP, -1);
-
+ }
+ if (!isLegacy() || mColorUtil.isGrayscaleIcon(mContext, smallIconDrawableId)) {
contentView.setInt(R.id.right_icon,
"setBackgroundResource",
R.drawable.notification_icon_legacy_bg);
@@ -3772,8 +3778,24 @@
}
private RemoteViews makeBigContentView() {
+
+ // Replace mLargeIcon with mBigLargeIcon if mBigLargeIconSet
+ // This covers the following cases:
+ // 1. mBigLargeIconSet -> mBigLargeIcon (null or non-null) applies, overrides
+ // mLargeIcon
+ // 2. !mBigLargeIconSet -> mLargeIcon applies
+ Bitmap oldLargeIcon = null;
+ if (mBigLargeIconSet) {
+ oldLargeIcon = mBuilder.mLargeIcon;
+ mBuilder.mLargeIcon = mBigLargeIcon;
+ }
+
RemoteViews contentView = getStandardView(mBuilder.getBigPictureLayoutResource());
+ if (mBigLargeIconSet) {
+ mBuilder.mLargeIcon = oldLargeIcon;
+ }
+
contentView.setImageViewBitmap(R.id.big_picture, mPicture);
applyTopPadding(contentView);
@@ -3804,6 +3826,7 @@
super.restoreFromExtras(extras);
if (extras.containsKey(EXTRA_LARGE_ICON_BIG)) {
+ mBigLargeIconSet = true;
mBigLargeIcon = extras.getParcelable(EXTRA_LARGE_ICON_BIG);
}
mPicture = extras.getParcelable(EXTRA_PICTURE);
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index df6cc73..ae32311 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -2803,6 +2803,8 @@
/**
* Called by the profile owner of a managed profile so that some intents sent in the managed
* profile can also be resolved in the parent, or vice versa.
+ * Only activity intents are supported.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param filter The {@link IntentFilter} the intent has to match to be also resolved in the
* other profile
diff --git a/core/java/android/appwidget/AppWidgetHost.java b/core/java/android/appwidget/AppWidgetHost.java
index 24c6793..1af4953 100644
--- a/core/java/android/appwidget/AppWidgetHost.java
+++ b/core/java/android/appwidget/AppWidgetHost.java
@@ -16,6 +16,7 @@
package android.appwidget;
+import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
@@ -57,19 +58,29 @@
static IAppWidgetService sService;
private DisplayMetrics mDisplayMetrics;
- Context mContext;
- Handler mHandler;
- int mHostId;
- Callbacks mCallbacks = new Callbacks();
- final HashMap<Integer,AppWidgetHostView> mViews = new HashMap<Integer, AppWidgetHostView>();
+ private String mContextOpPackageName;
+ private final Handler mHandler;
+ private final int mHostId;
+ private final Callbacks mCallbacks;
+ private final HashMap<Integer,AppWidgetHostView> mViews = new HashMap<>();
private OnClickHandler mOnClickHandler;
- class Callbacks extends IAppWidgetHost.Stub {
+ static class Callbacks extends IAppWidgetHost.Stub {
+ private final WeakReference<Handler> mWeakHandler;
+
+ public Callbacks(Handler handler) {
+ mWeakHandler = new WeakReference<>(handler);
+ }
+
public void updateAppWidget(int appWidgetId, RemoteViews views) {
if (isLocalBinder() && views != null) {
views = views.clone();
}
- Message msg = mHandler.obtainMessage(HANDLE_UPDATE, appWidgetId, 0, views);
+ Handler handler = mWeakHandler.get();
+ if (handler == null) {
+ return;
+ }
+ Message msg = handler.obtainMessage(HANDLE_UPDATE, appWidgetId, 0, views);
msg.sendToTarget();
}
@@ -77,20 +88,36 @@
if (isLocalBinder() && info != null) {
info = info.clone();
}
- Message msg = mHandler.obtainMessage(HANDLE_PROVIDER_CHANGED,
+ Handler handler = mWeakHandler.get();
+ if (handler == null) {
+ return;
+ }
+ Message msg = handler.obtainMessage(HANDLE_PROVIDER_CHANGED,
appWidgetId, 0, info);
msg.sendToTarget();
}
public void providersChanged() {
- mHandler.obtainMessage(HANDLE_PROVIDERS_CHANGED).sendToTarget();
+ Handler handler = mWeakHandler.get();
+ if (handler == null) {
+ return;
+ }
+ handler.obtainMessage(HANDLE_PROVIDERS_CHANGED).sendToTarget();
}
public void viewDataChanged(int appWidgetId, int viewId) {
- Message msg = mHandler.obtainMessage(HANDLE_VIEW_DATA_CHANGED,
+ Handler handler = mWeakHandler.get();
+ if (handler == null) {
+ return;
+ }
+ Message msg = handler.obtainMessage(HANDLE_VIEW_DATA_CHANGED,
appWidgetId, viewId);
msg.sendToTarget();
}
+
+ private static boolean isLocalBinder() {
+ return Process.myPid() == Binder.getCallingPid();
+ }
}
class UpdateHandler extends Handler {
@@ -128,10 +155,11 @@
* @hide
*/
public AppWidgetHost(Context context, int hostId, OnClickHandler handler, Looper looper) {
- mContext = context;
+ mContextOpPackageName = context.getOpPackageName();
mHostId = hostId;
mOnClickHandler = handler;
mHandler = new UpdateHandler(looper);
+ mCallbacks = new Callbacks(mHandler);
mDisplayMetrics = context.getResources().getDisplayMetrics();
bindService();
}
@@ -154,7 +182,7 @@
int[] updatedIds;
ArrayList<RemoteViews> updatedViews = new ArrayList<RemoteViews>();
try {
- updatedIds = sService.startListening(mCallbacks, mContext.getOpPackageName(), mHostId,
+ updatedIds = sService.startListening(mCallbacks, mContextOpPackageName, mHostId,
updatedViews);
}
catch (RemoteException e) {
@@ -173,7 +201,7 @@
*/
public void stopListening() {
try {
- sService.stopListening(mContext.getOpPackageName(), mHostId);
+ sService.stopListening(mContextOpPackageName, mHostId);
}
catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
@@ -191,7 +219,7 @@
*/
public int allocateAppWidgetId() {
try {
- return sService.allocateAppWidgetId(mContext.getOpPackageName(), mHostId);
+ return sService.allocateAppWidgetId(mContextOpPackageName, mHostId);
}
catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
@@ -221,7 +249,7 @@
int appWidgetId, int intentFlags, int requestCode, @Nullable Bundle options) {
try {
IntentSender intentSender = sService.createAppWidgetConfigIntentSender(
- mContext.getOpPackageName(), appWidgetId, intentFlags);
+ mContextOpPackageName, appWidgetId, intentFlags);
if (intentSender != null) {
activity.startIntentSenderForResult(intentSender, requestCode, null, 0, 0, 0,
options);
@@ -245,16 +273,12 @@
if (sService == null) {
bindService();
}
- return sService.getAppWidgetIdsForHost(mContext.getOpPackageName(), mHostId);
+ return sService.getAppWidgetIdsForHost(mContextOpPackageName, mHostId);
} catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
}
}
- private boolean isLocalBinder() {
- return Process.myPid() == Binder.getCallingPid();
- }
-
/**
* Stop listening to changes for this AppWidget.
*/
@@ -262,7 +286,7 @@
synchronized (mViews) {
mViews.remove(appWidgetId);
try {
- sService.deleteAppWidgetId(mContext.getOpPackageName(), appWidgetId);
+ sService.deleteAppWidgetId(mContextOpPackageName, appWidgetId);
}
catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
@@ -280,7 +304,7 @@
*/
public void deleteHost() {
try {
- sService.deleteHost(mContext.getOpPackageName(), mHostId);
+ sService.deleteHost(mContextOpPackageName, mHostId);
}
catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
@@ -310,7 +334,7 @@
*/
public final AppWidgetHostView createView(Context context, int appWidgetId,
AppWidgetProviderInfo appWidget) {
- AppWidgetHostView view = onCreateView(mContext, appWidgetId, appWidget);
+ AppWidgetHostView view = onCreateView(context, appWidgetId, appWidget);
view.setOnClickHandler(mOnClickHandler);
view.setAppWidget(appWidgetId, appWidget);
synchronized (mViews) {
@@ -318,7 +342,7 @@
}
RemoteViews views;
try {
- views = sService.getAppWidgetViews(mContext.getOpPackageName(), appWidgetId);
+ views = sService.getAppWidgetViews(mContextOpPackageName, appWidgetId);
} catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
}
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index ab0dad7..1001e27 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -2445,7 +2445,7 @@
LongSparseArray<WeakReference<ConstantState>>> caches) {
final int N = caches.size();
for (int i = N - 1; i >= 0; i--) {
- final LongSparseArray<WeakReference<ConstantState>> cache = caches.get(i);
+ final LongSparseArray<WeakReference<ConstantState>> cache = caches.valueAt(i);
if (pruneCache(cache)) {
caches.removeAt(i);
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index df2196e..f8cc008 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -5924,6 +5924,18 @@
public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
/**
+ * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
+ * from an ephemeral network if there is no BSSID for that network with a non-null score that
+ * has been seen in this time period.
+ *
+ * If this is less than or equal to zero, we use a more conservative behavior and only check
+ * for a non-null score from the currently connected or target BSSID.
+ * @hide
+ */
+ public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
+ "wifi_ephemeral_out_of_range_timeout_ms";
+
+ /**
* The number of milliseconds to delay when checking for data stalls during
* non-aggressive detection. (screen is turned off.)
* @hide
diff --git a/core/java/android/text/util/Linkify.java b/core/java/android/text/util/Linkify.java
index 14be269..c1341e1 100644
--- a/core/java/android/text/util/Linkify.java
+++ b/core/java/android/text/util/Linkify.java
@@ -402,7 +402,7 @@
}
boolean hasPrefix = false;
-
+
for (int i = 0; i < prefixes.length; i++) {
if (url.regionMatches(true, 0, prefixes[i], 0,
prefixes[i].length())) {
@@ -450,7 +450,7 @@
private static final void gatherTelLinks(ArrayList<LinkSpec> links, Spannable s) {
PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
Iterable<PhoneNumberMatch> matches = phoneUtil.findNumbers(s.toString(),
- Locale.getDefault().getCountry(), Leniency.VALID, Long.MAX_VALUE);
+ Locale.getDefault().getCountry(), Leniency.POSSIBLE, Long.MAX_VALUE);
for (PhoneNumberMatch match : matches) {
LinkSpec spec = new LinkSpec();
spec.url = "tel:" + PhoneNumberUtils.normalizeNumber(match.rawString());
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java
index f86d88e..bb945dc 100644
--- a/core/java/android/view/LayoutInflater.java
+++ b/core/java/android/view/LayoutInflater.java
@@ -20,6 +20,7 @@
import android.os.Handler;
import android.os.Message;
import android.os.Trace;
+import android.util.TypedValue;
import android.widget.FrameLayout;
import org.xmlpull.v1.XmlPullParser;
@@ -64,6 +65,7 @@
* @see Context#getSystemService
*/
public abstract class LayoutInflater {
+
private static final String TAG = LayoutInflater.class.getSimpleName();
private static final boolean DEBUG = false;
@@ -90,12 +92,16 @@
private HashMap<String, Boolean> mFilterMap;
+ private TypedValue mTempValue;
+
private static final String TAG_MERGE = "merge";
private static final String TAG_INCLUDE = "include";
private static final String TAG_1995 = "blink";
private static final String TAG_REQUEST_FOCUS = "requestFocus";
private static final String TAG_TAG = "tag";
+ private static final String ATTR_LAYOUT = "layout";
+
private static final int[] ATTRS_THEME = new int[] {
com.android.internal.R.attr.theme };
@@ -866,25 +872,31 @@
}
ta.recycle();
- final TypedArray a = context.obtainStyledAttributes(
- attrs, com.android.internal.R.styleable.Include);
- final int layout = a.getResourceId(
- com.android.internal.R.styleable.Include_layout, 0);
- final int id = a.getResourceId(
- com.android.internal.R.styleable.Include_id, View.NO_ID);
- final int visibility = a.getInt(
- com.android.internal.R.styleable.Include_visibility, -1);
- a.recycle();
+ // If the layout is pointing to a theme attribute, we have to
+ // massage the value to get a resource identifier out of it.
+ int layout = attrs.getAttributeResourceValue(null, ATTR_LAYOUT, 0);
+ if (layout == 0) {
+ final String value = attrs.getAttributeValue(null, ATTR_LAYOUT);
+ if (value == null || value.length() < 1) {
+ throw new InflateException("You must specify a layout in the"
+ + " include tag: <include layout=\"@layout/layoutID\" />");
+ }
+
+ layout = context.getResources().getIdentifier(value.substring(1), null, null);
+ }
+
+ // The layout might be referencing a theme attribute.
+ if (mTempValue == null) {
+ mTempValue = new TypedValue();
+ }
+ if (layout != 0 && context.getTheme().resolveAttribute(layout, mTempValue, true)) {
+ layout = mTempValue.resourceId;
+ }
if (layout == 0) {
- final String value = attrs.getAttributeValue(null, "layout");
- if (value == null) {
- throw new InflateException("You must specifiy a layout in the"
- + " include tag: <include layout=\"@layout/layoutID\" />");
- } else {
- throw new InflateException("You must specifiy a valid layout "
- + "reference. The layout ID " + value + " is not valid.");
- }
+ final String value = attrs.getAttributeValue(null, ATTR_LAYOUT);
+ throw new InflateException("You must specify a valid layout "
+ + "reference. The layout ID " + value + " is not valid.");
} else {
final XmlResourceParser childParser =
getContext().getResources().getLayout(layout);
@@ -934,6 +946,14 @@
// Inflate all children.
rInflate(childParser, view, childAttrs, true, true);
+ final TypedArray a = context.obtainStyledAttributes(
+ attrs, com.android.internal.R.styleable.Include);
+ final int id = a.getResourceId(
+ com.android.internal.R.styleable.Include_id, View.NO_ID);
+ final int visibility = a.getInt(
+ com.android.internal.R.styleable.Include_visibility, -1);
+ a.recycle();
+
if (id != View.NO_ID) {
view.setId(id);
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 42772d8..bc6ca8f 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -5942,8 +5942,7 @@
* @hide
*/
public void addClickableRectsForAccessibility(List<RectF> outRects) {
- if (isClickable() || isLongClickable()
- || (mListenerInfo != null && mListenerInfo.mOnTouchListener != null)) {
+ if (isClickable() || isLongClickable()) {
RectF bounds = new RectF();
bounds.set(0, 0, getWidth(), getHeight());
outRects.add(bounds);
diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java
index e980acb..c03938a 100644
--- a/core/java/com/android/internal/os/ZygoteConnection.java
+++ b/core/java/com/android/internal/os/ZygoteConnection.java
@@ -993,8 +993,8 @@
private void setChildPgid(int pid) {
// Try to move the new child into the peer's process group.
try {
- ZygoteInit.setpgid(pid, ZygoteInit.getpgid(peer.getPid()));
- } catch (IOException ex) {
+ Os.setpgid(pid, Os.getpgid(peer.getPid()));
+ } catch (ErrnoException ex) {
// This exception is expected in the case where
// the peer is not in our session
// TODO get rid of this log message in the case where
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 55e3f4a..0fa9a97 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -16,6 +16,8 @@
package com.android.internal.os;
+import static android.system.OsConstants.POLLIN;
+import static android.system.OsConstants.POLLOUT;
import static android.system.OsConstants.S_IRWXG;
import static android.system.OsConstants.S_IRWXO;
@@ -32,6 +34,7 @@
import android.system.ErrnoException;
import android.system.Os;
import android.system.OsConstants;
+import android.system.StructPollfd;
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
@@ -226,26 +229,6 @@
private static final int ROOT_UID = 0;
private static final int ROOT_GID = 0;
- /**
- * Sets effective user ID.
- */
- private static void setEffectiveUser(int uid) {
- int errno = setreuid(ROOT_UID, uid);
- if (errno != 0) {
- Log.e(TAG, "setreuid() failed. errno: " + errno);
- }
- }
-
- /**
- * Sets effective group ID.
- */
- private static void setEffectiveGroup(int gid) {
- int errno = setregid(ROOT_GID, gid);
- if (errno != 0) {
- Log.e(TAG, "setregid() failed. errno: " + errno);
- }
- }
-
static void preload() {
Log.d(TAG, "begin preload");
preloadClasses();
@@ -293,8 +276,12 @@
long startTime = SystemClock.uptimeMillis();
// Drop root perms while running static initializers.
- setEffectiveGroup(UNPRIVILEGED_GID);
- setEffectiveUser(UNPRIVILEGED_UID);
+ try {
+ Os.setregid(ROOT_GID, UNPRIVILEGED_GID);
+ Os.setreuid(ROOT_UID, UNPRIVILEGED_UID);
+ } catch (ErrnoException ex) {
+ throw new RuntimeException("Failed to drop root", ex);
+ }
// Alter the target heap utilization. With explicit GCs this
// is not likely to have any effect.
@@ -349,8 +336,12 @@
runtime.preloadDexCaches();
// Bring back root. We'll need it later.
- setEffectiveUser(ROOT_UID);
- setEffectiveGroup(ROOT_GID);
+ try {
+ Os.setreuid(ROOT_UID, ROOT_UID);
+ Os.setregid(ROOT_GID, ROOT_GID);
+ } catch (ErrnoException ex) {
+ throw new RuntimeException("Failed to restore root", ex);
+ }
}
}
@@ -699,84 +690,42 @@
private static void runSelectLoop(String abiList) throws MethodAndArgsCaller {
ArrayList<FileDescriptor> fds = new ArrayList<FileDescriptor>();
ArrayList<ZygoteConnection> peers = new ArrayList<ZygoteConnection>();
- FileDescriptor[] fdArray = new FileDescriptor[4];
fds.add(sServerSocket.getFileDescriptor());
peers.add(null);
while (true) {
- int index;
-
- try {
- fdArray = fds.toArray(fdArray);
- index = selectReadable(fdArray);
- } catch (IOException ex) {
- throw new RuntimeException("Error in select()", ex);
+ StructPollfd[] pollFds = new StructPollfd[fds.size()];
+ for (int i = 0; i < pollFds.length; ++i) {
+ pollFds[i] = new StructPollfd();
+ pollFds[i].fd = fds.get(i);
+ pollFds[i].events = (short) POLLIN;
}
-
- if (index < 0) {
- throw new RuntimeException("Error in select()");
- } else if (index == 0) {
- ZygoteConnection newPeer = acceptCommandPeer(abiList);
- peers.add(newPeer);
- fds.add(newPeer.getFileDesciptor());
- } else {
- boolean done;
- done = peers.get(index).runOnce();
-
- if (done) {
- peers.remove(index);
- fds.remove(index);
+ try {
+ Os.poll(pollFds, -1);
+ } catch (ErrnoException ex) {
+ throw new RuntimeException("poll failed", ex);
+ }
+ for (int i = pollFds.length - 1; i >= 0; --i) {
+ if ((pollFds[i].revents & POLLIN) == 0) {
+ continue;
+ }
+ if (i == 0) {
+ ZygoteConnection newPeer = acceptCommandPeer(abiList);
+ peers.add(newPeer);
+ fds.add(newPeer.getFileDesciptor());
+ } else {
+ boolean done = peers.get(i).runOnce();
+ if (done) {
+ peers.remove(i);
+ fds.remove(i);
+ }
}
}
}
}
/**
- * The Linux syscall "setreuid()"
- * @param ruid real uid
- * @param euid effective uid
- * @return 0 on success, non-zero errno on fail
- */
- static native int setreuid(int ruid, int euid);
-
- /**
- * The Linux syscall "setregid()"
- * @param rgid real gid
- * @param egid effective gid
- * @return 0 on success, non-zero errno on fail
- */
- static native int setregid(int rgid, int egid);
-
- /**
- * Invokes the linux syscall "setpgid"
- *
- * @param pid pid to change
- * @param pgid new process group of pid
- * @return 0 on success or non-zero errno on fail
- */
- static native int setpgid(int pid, int pgid);
-
- /**
- * Invokes the linux syscall "getpgid"
- *
- * @param pid pid to query
- * @return pgid of pid in question
- * @throws IOException on error
- */
- static native int getpgid(int pid) throws IOException;
-
- /**
- * Invokes select() on the provider array of file descriptors (selecting
- * for readability only). Array elements of null are ignored.
- *
- * @param fds non-null; array of readable file descriptors
- * @return index of descriptor that is now readable or -1 for empty array.
- * @throws IOException if an error occurs
- */
- static native int selectReadable(FileDescriptor[] fds) throws IOException;
-
- /**
* Class not instantiable.
*/
private ZygoteInit() {
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index f6c42af..0afc651f 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -48,6 +48,9 @@
import com.android.internal.R;
import com.google.android.collect.Lists;
+import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
+import libcore.util.HexEncoding;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -357,7 +360,7 @@
*/
public boolean checkPasswordHistory(String password) {
String passwordHashString = new String(
- passwordToHash(password, getCurrentOrCallingUserId()));
+ passwordToHash(password, getCurrentOrCallingUserId()), StandardCharsets.UTF_8);
String passwordHistory = getString(PASSWORD_HISTORY_KEY);
if (passwordHistory == null) {
return false;
@@ -889,7 +892,7 @@
passwordHistory = "";
} else {
byte[] hash = passwordToHash(password, userHandle);
- passwordHistory = new String(hash) + "," + passwordHistory;
+ passwordHistory = new String(hash, StandardCharsets.UTF_8) + "," + passwordHistory;
// Cut it to contain passwordHistoryLength hashes
// and passwordHistoryLength -1 commas.
passwordHistory = passwordHistory.substring(0, Math.min(hash.length
@@ -1076,34 +1079,30 @@
* Generate a hash for the given password. To avoid brute force attacks, we use a salted hash.
* Not the most secure, but it is at least a second level of protection. First level is that
* the file is in a location only readable by the system process.
+ *
* @param password the gesture pattern.
+ *
* @return the hash of the pattern in a byte array.
*/
public byte[] passwordToHash(String password, int userId) {
if (password == null) {
return null;
}
- String algo = null;
- byte[] hashed = null;
+
try {
byte[] saltedPassword = (password + getSalt(userId)).getBytes();
- byte[] sha1 = MessageDigest.getInstance(algo = "SHA-1").digest(saltedPassword);
- byte[] md5 = MessageDigest.getInstance(algo = "MD5").digest(saltedPassword);
- hashed = (toHex(sha1) + toHex(md5)).getBytes();
- } catch (NoSuchAlgorithmException e) {
- Log.w(TAG, "Failed to encode string because of missing algorithm: " + algo);
- }
- return hashed;
- }
+ byte[] sha1 = MessageDigest.getInstance("SHA-1").digest(saltedPassword);
+ byte[] md5 = MessageDigest.getInstance("MD5").digest(saltedPassword);
- private static String toHex(byte[] ary) {
- final String hex = "0123456789ABCDEF";
- String ret = "";
- for (int i = 0; i < ary.length; i++) {
- ret += hex.charAt((ary[i] >> 4) & 0xf);
- ret += hex.charAt(ary[i] & 0xf);
+ byte[] combined = new byte[sha1.length + md5.length];
+ System.arraycopy(sha1, 0, combined, 0, sha1.length);
+ System.arraycopy(md5, 0, combined, sha1.length, md5.length);
+
+ final char[] hexEncoded = HexEncoding.encode(combined);
+ return new String(hexEncoded).getBytes(StandardCharsets.UTF_8);
+ } catch (NoSuchAlgorithmException e) {
+ throw new AssertionError("Missing digest algorithm: ", e);
}
- return ret;
}
/**
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 97e0fd3..1e816ae 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -16,10 +16,6 @@
LOCAL_CFLAGS += -DPACKED=""
endif
-ifeq ($(USE_OPENGL_RENDERER),true)
- LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER
-endif
-
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
LOCAL_SRC_FILES:= \
@@ -156,7 +152,6 @@
android_server_NetworkManagementSocketTagger.cpp \
android_server_Watchdog.cpp \
android_ddm_DdmHandleNativeHeap.cpp \
- com_android_internal_os_ZygoteInit.cpp \
android_backup_BackupDataInput.cpp \
android_backup_BackupDataOutput.cpp \
android_backup_FileBackupHelperBase.cpp \
@@ -248,11 +243,8 @@
libprocessgroup \
libnativebridge
-ifeq ($(USE_OPENGL_RENDERER),true)
- LOCAL_SHARED_LIBRARIES += libhwui
-endif
-
LOCAL_SHARED_LIBRARIES += \
+ libhwui \
libdl
# we need to access the private Bionic header
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 5352135..33d1640 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -162,7 +162,6 @@
extern int register_android_opengl_classes(JNIEnv *env);
extern int register_android_ddm_DdmHandleNativeHeap(JNIEnv *env);
extern int register_android_server_NetworkManagementSocketTagger(JNIEnv* env);
-extern int register_com_android_internal_os_ZygoteInit(JNIEnv* env);
extern int register_android_backup_BackupDataInput(JNIEnv *env);
extern int register_android_backup_BackupDataOutput(JNIEnv *env);
extern int register_android_backup_FileBackupHelperBase(JNIEnv *env);
@@ -1321,7 +1320,6 @@
REG_JNI(register_android_net_NetworkUtils),
REG_JNI(register_android_net_TrafficStats),
REG_JNI(register_android_os_MemoryFile),
- REG_JNI(register_com_android_internal_os_ZygoteInit),
REG_JNI(register_com_android_internal_os_Zygote),
REG_JNI(register_com_android_internal_util_VirtualRefBasePtr),
REG_JNI(register_android_hardware_Camera),
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index ceec0e3..f506569 100755
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -363,24 +363,20 @@
static void Bitmap_destructor(JNIEnv* env, jobject, jlong bitmapHandle) {
SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
-#ifdef USE_OPENGL_RENDERER
if (android::uirenderer::ResourceCache::hasInstance()) {
android::uirenderer::ResourceCache::getInstance().destructor(bitmap);
- return;
+ } else {
+ delete bitmap;
}
-#endif // USE_OPENGL_RENDERER
- delete bitmap;
}
static jboolean Bitmap_recycle(JNIEnv* env, jobject, jlong bitmapHandle) {
SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
-#ifdef USE_OPENGL_RENDERER
if (android::uirenderer::ResourceCache::hasInstance()) {
bool result;
result = android::uirenderer::ResourceCache::getInstance().recycle(bitmap);
return result ? JNI_TRUE : JNI_FALSE;
}
-#endif // USE_OPENGL_RENDERER
bitmap->setPixels(NULL, NULL);
return JNI_TRUE;
}
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index 099f1b0..eded678 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -386,7 +386,7 @@
// to/from unpremultiplied bitmaps.
outputBitmap->setInfo(SkImageInfo::Make(scaledWidth, scaledHeight,
colorType, decodingBitmap.alphaType()));
- if (!outputBitmap->allocPixels(outputAllocator, NULL)) {
+ if (!outputBitmap->tryAllocPixels(outputAllocator, NULL)) {
return nullObjectReturn("allocation failed for scaled bitmap");
}
diff --git a/core/jni/android/graphics/CanvasProperty.cpp b/core/jni/android/graphics/CanvasProperty.cpp
index a69a457..deb4971 100644
--- a/core/jni/android/graphics/CanvasProperty.cpp
+++ b/core/jni/android/graphics/CanvasProperty.cpp
@@ -24,12 +24,6 @@
namespace android {
-#ifdef USE_OPENGL_RENDERER
-static const bool kUseOpenGLRenderer = true;
-#else
-static const bool kUseOpenGLRenderer = false;
-#endif
-
using namespace uirenderer;
static jlong createFloat(JNIEnv* env, jobject clazz, jfloat initialValue) {
@@ -51,11 +45,8 @@
};
int register_android_graphics_CanvasProperty(JNIEnv* env) {
- if (kUseOpenGLRenderer) {
- return RegisterMethodsOrDie(env, "android/graphics/CanvasProperty", gMethods,
- NELEM(gMethods));
- }
- return 0;
+ return RegisterMethodsOrDie(env, "android/graphics/CanvasProperty", gMethods,
+ NELEM(gMethods));
}
}; // namespace android
diff --git a/core/jni/android/graphics/NinePatch.cpp b/core/jni/android/graphics/NinePatch.cpp
index d868f28..543323c 100644
--- a/core/jni/android/graphics/NinePatch.cpp
+++ b/core/jni/android/graphics/NinePatch.cpp
@@ -80,14 +80,12 @@
static void finalize(JNIEnv* env, jobject, jlong patchHandle) {
int8_t* patch = reinterpret_cast<int8_t*>(patchHandle);
-#ifdef USE_OPENGL_RENDERER
if (android::uirenderer::ResourceCache::hasInstance()) {
Res_png_9patch* p = (Res_png_9patch*) patch;
android::uirenderer::ResourceCache::getInstance().destructor(p);
- return;
+ } else {
+ delete[] patch;
}
-#endif // USE_OPENGL_RENDERER
- delete[] patch;
}
static void draw(JNIEnv* env, SkCanvas* canvas, SkRect& bounds, const SkBitmap* bitmap,
diff --git a/core/jni/android/graphics/Path.cpp b/core/jni/android/graphics/Path.cpp
index 1e4eb75..831ce09 100644
--- a/core/jni/android/graphics/Path.cpp
+++ b/core/jni/android/graphics/Path.cpp
@@ -38,13 +38,11 @@
static void finalizer(JNIEnv* env, jobject clazz, jlong objHandle) {
SkPath* obj = reinterpret_cast<SkPath*>(objHandle);
-#ifdef USE_OPENGL_RENDERER
if (android::uirenderer::ResourceCache::hasInstance()) {
android::uirenderer::ResourceCache::getInstance().destructor(obj);
- return;
+ } else {
+ delete obj;
}
-#endif
- delete obj;
}
static jlong init1(JNIEnv* env, jobject clazz) {
diff --git a/core/jni/android/graphics/Picture.cpp b/core/jni/android/graphics/Picture.cpp
index d048a29..33d43083 100644
--- a/core/jni/android/graphics/Picture.cpp
+++ b/core/jni/android/graphics/Picture.cpp
@@ -42,10 +42,6 @@
mWidth = width;
mHeight = height;
SkCanvas* canvas = mRecorder->beginRecording(width, height, NULL, 0);
- // the java side will wrap this guy in a Canvas.java, which will call
- // unref in its finalizer, so we have to ref it here, so that both that
- // Canvas.java and our picture can both be owners
- canvas->ref();
return Canvas::create_canvas(canvas);
}
@@ -106,8 +102,7 @@
SkASSERT(NULL != mPicture.get());
}
if (NULL != mPicture.get()) {
- // TODO: remove this const_cast once pictures are immutable
- const_cast<SkPicture*>(mPicture.get())->draw(canvas->getSkCanvas());
+ mPicture.get()->playback(canvas->getSkCanvas());
}
}
diff --git a/core/jni/android/graphics/SkiaCanvas.cpp b/core/jni/android/graphics/SkiaCanvas.cpp
index 793d177..7de54c4 100644
--- a/core/jni/android/graphics/SkiaCanvas.cpp
+++ b/core/jni/android/graphics/SkiaCanvas.cpp
@@ -44,10 +44,18 @@
// Holds an SkCanvas reference plus additional native data.
class SkiaCanvas : public Canvas {
public:
- SkiaCanvas(SkBitmap* bitmap);
+ explicit SkiaCanvas(SkBitmap* bitmap);
- SkiaCanvas(SkCanvas* canvas) : mCanvas(canvas) {
+ /**
+ * Create a new SkiaCanvas.
+ *
+ * @param canvas SkCanvas to handle calls made to this SkiaCanvas. Must
+ * not be NULL. This constructor will ref() the SkCanvas, and unref()
+ * it in its destructor.
+ */
+ explicit SkiaCanvas(SkCanvas* canvas) : mCanvas(canvas) {
SkASSERT(canvas);
+ canvas->ref();
}
virtual SkCanvas* getSkCanvas() {
diff --git a/core/jni/android/graphics/pdf/PdfDocument.cpp b/core/jni/android/graphics/pdf/PdfDocument.cpp
index be90612..8ba164f 100644
--- a/core/jni/android/graphics/pdf/PdfDocument.cpp
+++ b/core/jni/android/graphics/pdf/PdfDocument.cpp
@@ -73,11 +73,6 @@
SkCanvas* canvas = page->mPictureRecorder->beginRecording(
contentRect.width(), contentRect.height(), NULL, 0);
- // We pass this canvas to Java where it is used to construct
- // a Java Canvas object which dereferences the pointer when it
- // is destroyed, so we have to bump up the reference count.
- canvas->ref();
-
return canvas;
}
diff --git a/core/jni/android_graphics_Canvas.cpp b/core/jni/android_graphics_Canvas.cpp
index 19aad61..265300ed 100644
--- a/core/jni/android_graphics_Canvas.cpp
+++ b/core/jni/android_graphics_Canvas.cpp
@@ -383,7 +383,7 @@
hasAlpha ? kN32_SkColorType : kRGB_565_SkColorType,
kPremul_SkAlphaType);
SkBitmap bitmap;
- if (!bitmap.allocPixels(info)) {
+ if (!bitmap.tryAllocPixels(info)) {
return;
}
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 652492c..084117c 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -57,13 +57,6 @@
jmethodID set;
} gRectClassInfo;
-/**
- * Note: DisplayListRenderer JNI layer is generated and compiled only on supported
- * devices. This means all the logic must be compiled only when the
- * preprocessor variable USE_OPENGL_RENDERER is defined.
- */
-#ifdef USE_OPENGL_RENDERER
-
// ----------------------------------------------------------------------------
// Defines
// ----------------------------------------------------------------------------
@@ -390,7 +383,7 @@
hasAlpha ? kN32_SkColorType : kRGB_565_SkColorType,
kPremul_SkAlphaType);
SkBitmap* bitmap = new SkBitmap;
- if (!bitmap->allocPixels(info)) {
+ if (!bitmap->tryAllocPixels(info)) {
delete bitmap;
return;
}
@@ -803,32 +796,20 @@
renderer->drawLayer(layer, x, y);
}
-#endif // USE_OPENGL_RENDERER
-
-#ifdef USE_OPENGL_RENDERER
-static const bool kUseOpenGLRenderer = true;
-#else
-static const bool kUseOpenGLRenderer = false;
-#endif
-
// ----------------------------------------------------------------------------
// Common
// ----------------------------------------------------------------------------
static jboolean android_view_GLES20Canvas_isAvailable(JNIEnv* env, jobject clazz) {
- if (kUseOpenGLRenderer) {
- char prop[PROPERTY_VALUE_MAX];
- if (property_get("ro.kernel.qemu", prop, NULL) == 0) {
- // not in the emulator
- return JNI_TRUE;
- }
- // In the emulator this property will be set to 1 when hardware GLES is
- // enabled, 0 otherwise. On old emulator versions it will be undefined.
- property_get("ro.kernel.qemu.gles", prop, "0");
- return atoi(prop) == 1 ? JNI_TRUE : JNI_FALSE;
- } else {
- return JNI_FALSE;
+ char prop[PROPERTY_VALUE_MAX];
+ if (property_get("ro.kernel.qemu", prop, NULL) == 0) {
+ // not in the emulator
+ return JNI_TRUE;
}
+ // In the emulator this property will be set to 1 when hardware GLES is
+ // enabled, 0 otherwise. On old emulator versions it will be undefined.
+ property_get("ro.kernel.qemu.gles", prop, "0");
+ return atoi(prop) == 1 ? JNI_TRUE : JNI_FALSE;
}
// ----------------------------------------------------------------------------
@@ -837,10 +818,8 @@
static void
android_app_ActivityThread_dumpGraphics(JNIEnv* env, jobject clazz, jobject javaFileDescriptor) {
- if (kUseOpenGLRenderer) {
- int fd = jniGetFDFromFileDescriptor(env, javaFileDescriptor);
- android::uirenderer::renderthread::RenderProxy::outputLogBuffer(fd);
- }
+ int fd = jniGetFDFromFileDescriptor(env, javaFileDescriptor);
+ android::uirenderer::renderthread::RenderProxy::outputLogBuffer(fd);
}
// ----------------------------------------------------------------------------
@@ -851,9 +830,6 @@
static JNINativeMethod gMethods[] = {
{ "nIsAvailable", "()Z", (void*) android_view_GLES20Canvas_isAvailable },
-
-#ifdef USE_OPENGL_RENDERER
-
{ "nDestroyRenderer", "(J)V", (void*) android_view_GLES20Canvas_destroyRenderer },
{ "nSetViewport", "(JII)V", (void*) android_view_GLES20Canvas_setViewport },
{ "nSetHighContrastText","(JZ)V", (void*) android_view_GLES20Canvas_setHighContrastText },
@@ -939,8 +915,6 @@
{ "nGetMaximumTextureWidth", "()I", (void*) android_view_GLES20Canvas_getMaxTextureWidth },
{ "nGetMaximumTextureHeight", "()I", (void*) android_view_GLES20Canvas_getMaxTextureHeight },
-
-#endif
};
static JNINativeMethod gActivityThreadMethods[] = {
@@ -949,10 +923,8 @@
};
int register_android_view_GLES20Canvas(JNIEnv* env) {
- if (kUseOpenGLRenderer) {
- jclass clazz = FindClassOrDie(env, "android/graphics/Rect");
- gRectClassInfo.set = GetMethodIDOrDie(env, clazz, "set", "(IIII)V");
- }
+ jclass clazz = FindClassOrDie(env, "android/graphics/Rect");
+ gRectClassInfo.set = GetMethodIDOrDie(env, clazz, "set", "(IIII)V");
return RegisterMethodsOrDie(env, kClassPathName, gMethods, NELEM(gMethods));
}
diff --git a/core/jni/android_view_HardwareLayer.cpp b/core/jni/android_view_HardwareLayer.cpp
index cefb3da..f539127 100644
--- a/core/jni/android_view_HardwareLayer.cpp
+++ b/core/jni/android_view_HardwareLayer.cpp
@@ -41,8 +41,6 @@
using namespace uirenderer;
-#ifdef USE_OPENGL_RENDERER
-
static jboolean android_view_HardwareLayer_prepare(JNIEnv* env, jobject clazz,
jlong layerUpdaterPtr, jint width, jint height, jboolean isOpaque) {
DeferredLayerUpdater* layer = reinterpret_cast<DeferredLayerUpdater*>(layerUpdaterPtr);
@@ -87,8 +85,6 @@
return layer->backingLayer()->getTexture();
}
-#endif // USE_OPENGL_RENDERER
-
// ----------------------------------------------------------------------------
// JNI Glue
// ----------------------------------------------------------------------------
@@ -96,8 +92,6 @@
const char* const kClassPathName = "android/view/HardwareLayer";
static JNINativeMethod gMethods[] = {
-#ifdef USE_OPENGL_RENDERER
-
{ "nPrepare", "(JIIZ)Z", (void*) android_view_HardwareLayer_prepare },
{ "nSetLayerPaint", "(JJ)V", (void*) android_view_HardwareLayer_setLayerPaint },
{ "nSetTransform", "(JJ)V", (void*) android_view_HardwareLayer_setTransform },
@@ -106,7 +100,6 @@
{ "nUpdateSurfaceTexture", "(J)V", (void*) android_view_HardwareLayer_updateSurfaceTexture },
{ "nGetTexName", "(J)I", (void*) android_view_HardwareLayer_getTexName },
-#endif
};
int register_android_view_HardwareLayer(JNIEnv* env) {
diff --git a/core/jni/android_view_RenderNode.cpp b/core/jni/android_view_RenderNode.cpp
index a1d3bc6..2b5a961 100644
--- a/core/jni/android_view_RenderNode.cpp
+++ b/core/jni/android_view_RenderNode.cpp
@@ -34,13 +34,6 @@
using namespace uirenderer;
-/**
- * Note: OpenGLRenderer JNI layer is generated and compiled only on supported
- * devices. This means all the logic must be compiled only when the
- * preprocessor variable USE_OPENGL_RENDERER is defined.
- */
-#ifdef USE_OPENGL_RENDERER
-
#define SET_AND_DIRTY(prop, val, dirtyFlag) \
(reinterpret_cast<RenderNode*>(renderNodePtr)->mutateStagingProperties().prop(val) \
? (reinterpret_cast<RenderNode*>(renderNodePtr)->setPropertyFieldsDirty(dirtyFlag), true) \
@@ -469,8 +462,6 @@
renderNode->animators().endAllStagingAnimators();
}
-#endif // USE_OPENGL_RENDERER
-
// ----------------------------------------------------------------------------
// JNI Glue
// ----------------------------------------------------------------------------
@@ -478,7 +469,6 @@
const char* const kClassPathName = "android/view/RenderNode";
static JNINativeMethod gMethods[] = {
-#ifdef USE_OPENGL_RENDERER
{ "nCreate", "(Ljava/lang/String;)J", (void*) android_view_RenderNode_create },
{ "nDestroyRenderNode", "(J)V", (void*) android_view_RenderNode_destroyRenderNode },
{ "nSetDisplayListData", "(JJ)V", (void*) android_view_RenderNode_setDisplayListData },
@@ -550,7 +540,6 @@
{ "nAddAnimator", "(JJ)V", (void*) android_view_RenderNode_addAnimator },
{ "nEndAllAnimators", "(J)V", (void*) android_view_RenderNode_endAllAnimators },
-#endif
};
int register_android_view_RenderNode(JNIEnv* env) {
diff --git a/core/jni/android_view_RenderNodeAnimator.cpp b/core/jni/android_view_RenderNodeAnimator.cpp
index 0978ebb..4177ee2 100644
--- a/core/jni/android_view_RenderNodeAnimator.cpp
+++ b/core/jni/android_view_RenderNodeAnimator.cpp
@@ -37,8 +37,6 @@
jmethodID callOnFinished;
} gRenderNodeAnimatorClassInfo;
-#ifdef USE_OPENGL_RENDERER
-
static JNIEnv* getEnv(JavaVM* vm) {
JNIEnv* env;
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
@@ -189,8 +187,6 @@
animator->end();
}
-#endif
-
// ----------------------------------------------------------------------------
// JNI Glue
// ----------------------------------------------------------------------------
@@ -198,7 +194,6 @@
const char* const kClassPathName = "android/view/RenderNodeAnimator";
static JNINativeMethod gMethods[] = {
-#ifdef USE_OPENGL_RENDERER
{ "nCreateAnimator", "(IF)J", (void*) createAnimator },
{ "nCreateCanvasPropertyFloatAnimator", "(JF)J", (void*) createCanvasPropertyFloatAnimator },
{ "nCreateCanvasPropertyPaintAnimator", "(JIF)J", (void*) createCanvasPropertyPaintAnimator },
@@ -212,13 +207,10 @@
{ "nSetListener", "(JLandroid/view/RenderNodeAnimator;)V", (void*) setListener},
{ "nStart", "(J)V", (void*) start},
{ "nEnd", "(J)V", (void*) end },
-#endif
};
int register_android_view_RenderNodeAnimator(JNIEnv* env) {
-#ifdef USE_OPENGL_RENDERER
sLifecycleChecker.incStrong(0);
-#endif
gRenderNodeAnimatorClassInfo.clazz = FindClassOrDie(env, kClassPathName);
gRenderNodeAnimatorClassInfo.clazz = MakeGlobalRefOrDie(env,
gRenderNodeAnimatorClassInfo.clazz);
diff --git a/core/jni/android_view_ThreadedRenderer.cpp b/core/jni/android_view_ThreadedRenderer.cpp
index 9b06293..068b24e 100644
--- a/core/jni/android_view_ThreadedRenderer.cpp
+++ b/core/jni/android_view_ThreadedRenderer.cpp
@@ -44,8 +44,6 @@
namespace android {
-#ifdef USE_OPENGL_RENDERER
-
using namespace android::uirenderer;
using namespace android::uirenderer::renderthread;
@@ -399,8 +397,6 @@
proxy->dumpProfileInfo(fd);
}
-#endif
-
// ----------------------------------------------------------------------------
// Shaders
// ----------------------------------------------------------------------------
@@ -420,7 +416,6 @@
const char* const kClassPathName = "android/view/ThreadedRenderer";
static JNINativeMethod gMethods[] = {
-#ifdef USE_OPENGL_RENDERER
{ "nSetAtlas", "(JLandroid/view/GraphicBuffer;[J)V", (void*) android_view_ThreadedRenderer_setAtlas },
{ "nCreateRootRenderNode", "()J", (void*) android_view_ThreadedRenderer_createRootRenderNode },
{ "nCreateProxy", "(ZJ)J", (void*) android_view_ThreadedRenderer_createProxy },
@@ -448,7 +443,6 @@
{ "nStopDrawing", "(J)V", (void*) android_view_ThreadedRenderer_stopDrawing },
{ "nNotifyFramePending", "(J)V", (void*) android_view_ThreadedRenderer_notifyFramePending },
{ "nDumpProfileInfo", "(JLjava/io/FileDescriptor;)V", (void*) android_view_ThreadedRenderer_dumpProfileInfo },
-#endif
{ "setupShadersDiskCache", "(Ljava/lang/String;)V",
(void*) android_view_ThreadedRenderer_setupShadersDiskCache },
};
diff --git a/core/jni/com_android_internal_os_ZygoteInit.cpp b/core/jni/com_android_internal_os_ZygoteInit.cpp
deleted file mode 100644
index 2b6fd11..0000000
--- a/core/jni/com_android_internal_os_ZygoteInit.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- */
-
-#define LOG_TAG "Zygote"
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <utils/misc.h>
-#include <errno.h>
-#include <sys/select.h>
-
-#include "jni.h"
-#include <JNIHelp.h>
-#include "core_jni_helpers.h"
-
-#include <sys/capability.h>
-#include <sys/prctl.h>
-
-namespace android {
-
-/*
- * In class com.android.internal.os.ZygoteInit:
- * private static native boolean setreuid(int ruid, int euid)
- */
-static jint com_android_internal_os_ZygoteInit_setreuid(
- JNIEnv* env, jobject clazz, jint ruid, jint euid)
-{
- if (setreuid(ruid, euid) < 0) {
- return errno;
- }
- return 0;
-}
-
-/*
- * In class com.android.internal.os.ZygoteInit:
- * private static native int setregid(int rgid, int egid)
- */
-static jint com_android_internal_os_ZygoteInit_setregid(
- JNIEnv* env, jobject clazz, jint rgid, jint egid)
-{
- if (setregid(rgid, egid) < 0) {
- return errno;
- }
- return 0;
-}
-
-/*
- * In class com.android.internal.os.ZygoteInit:
- * private static native int setpgid(int rgid, int egid)
- */
-static jint com_android_internal_os_ZygoteInit_setpgid(
- JNIEnv* env, jobject clazz, jint pid, jint pgid)
-{
- if (setpgid(pid, pgid) < 0) {
- return errno;
- }
- return 0;
-}
-
-/*
- * In class com.android.internal.os.ZygoteInit:
- * private static native int getpgid(int pid)
- */
-static jint com_android_internal_os_ZygoteInit_getpgid(
- JNIEnv* env, jobject clazz, jint pid)
-{
- pid_t ret;
- ret = getpgid(pid);
-
- if (ret < 0) {
- jniThrowIOException(env, errno);
- }
-
- return ret;
-}
-
-static jint com_android_internal_os_ZygoteInit_selectReadable (
- JNIEnv *env, jobject clazz, jobjectArray fds)
-{
- if (fds == NULL) {
- jniThrowNullPointerException(env, "fds == null");
- return -1;
- }
-
- jsize length = env->GetArrayLength(fds);
- fd_set fdset;
-
- if (env->ExceptionCheck()) {
- return -1;
- }
-
- FD_ZERO(&fdset);
-
- int nfds = 0;
- for (jsize i = 0; i < length; i++) {
- jobject fdObj = env->GetObjectArrayElement(fds, i);
- if (env->ExceptionCheck()) {
- return -1;
- }
- if (fdObj == NULL) {
- continue;
- }
- int fd = jniGetFDFromFileDescriptor(env, fdObj);
- if (env->ExceptionCheck()) {
- return -1;
- }
-
- FD_SET(fd, &fdset);
-
- if (fd >= nfds) {
- nfds = fd + 1;
- }
- }
-
- int err;
- do {
- err = select (nfds, &fdset, NULL, NULL, NULL);
- } while (err < 0 && errno == EINTR);
-
- if (err < 0) {
- jniThrowIOException(env, errno);
- return -1;
- }
-
- for (jsize i = 0; i < length; i++) {
- jobject fdObj = env->GetObjectArrayElement(fds, i);
- if (env->ExceptionCheck()) {
- return -1;
- }
- if (fdObj == NULL) {
- continue;
- }
- int fd = jniGetFDFromFileDescriptor(env, fdObj);
- if (env->ExceptionCheck()) {
- return -1;
- }
- if (FD_ISSET(fd, &fdset)) {
- return (jint)i;
- }
- }
- return -1;
-}
-
-/*
- * JNI registration.
- */
-static JNINativeMethod gMethods[] = {
- /* name, signature, funcPtr */
- { "setreuid", "(II)I",
- (void*) com_android_internal_os_ZygoteInit_setreuid },
- { "setregid", "(II)I",
- (void*) com_android_internal_os_ZygoteInit_setregid },
- { "setpgid", "(II)I",
- (void *) com_android_internal_os_ZygoteInit_setpgid },
- { "getpgid", "(I)I",
- (void *) com_android_internal_os_ZygoteInit_getpgid },
- { "selectReadable", "([Ljava/io/FileDescriptor;)I",
- (void *) com_android_internal_os_ZygoteInit_selectReadable },
-};
-int register_com_android_internal_os_ZygoteInit(JNIEnv* env)
-{
- return RegisterMethodsOrDie(env,
- "com/android/internal/os/ZygoteInit", gMethods, NELEM(gMethods));
-}
-
-}; // namespace android
diff --git a/core/jni/com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp b/core/jni/com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp
index c5c2e9d..2c65d62 100644
--- a/core/jni/com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp
+++ b/core/jni/com_android_internal_view_animation_NativeInterpolatorFactoryHelper.cpp
@@ -26,8 +26,6 @@
using namespace uirenderer;
-#ifdef USE_OPENGL_RENDERER
-
static jlong createAccelerateDecelerateInterpolator(JNIEnv* env, jobject clazz) {
return reinterpret_cast<jlong>(new AccelerateDecelerateInterpolator());
}
@@ -74,8 +72,6 @@
return reinterpret_cast<jlong>(new LUTInterpolator(lut, len));
}
-#endif
-
// ----------------------------------------------------------------------------
// JNI Glue
// ----------------------------------------------------------------------------
@@ -83,7 +79,6 @@
const char* const kClassPathName = "com/android/internal/view/animation/NativeInterpolatorFactoryHelper";
static JNINativeMethod gMethods[] = {
-#ifdef USE_OPENGL_RENDERER
{ "createAccelerateDecelerateInterpolator", "()J", (void*) createAccelerateDecelerateInterpolator },
{ "createAccelerateInterpolator", "(F)J", (void*) createAccelerateInterpolator },
{ "createAnticipateInterpolator", "(F)J", (void*) createAnticipateInterpolator },
@@ -94,7 +89,6 @@
{ "createLinearInterpolator", "()J", (void*) createLinearInterpolator },
{ "createOvershootInterpolator", "(F)J", (void*) createOvershootInterpolator },
{ "createLutInterpolator", "([F)J", (void*) createLutInterpolator },
-#endif
};
int register_com_android_internal_view_animation_NativeInterpolatorFactoryHelper(JNIEnv* env) {
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 2a623d7..b2c99fd 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -45,7 +45,7 @@
<string name="defaultVoiceMailAlphaTag" msgid="2660020990097733077">"Telefonsvarer"</string>
<string name="defaultMsisdnAlphaTag" msgid="2850889754919584674">"MSISDN1"</string>
<string name="mmiError" msgid="5154499457739052907">"Forbindelsesproblemer eller ugyldigt MMI-nummer."</string>
- <string name="mmiFdnError" msgid="5224398216385316471">"Du kan kun foretage handlinger med faste opkaldsnumre."</string>
+ <string name="mmiFdnError" msgid="5224398216385316471">"Du kan kun foretage handlinger med dine numre til begrænset opkald."</string>
<string name="serviceEnabled" msgid="8147278346414714315">"Tjenesten blev aktiveret."</string>
<string name="serviceEnabledFor" msgid="6856228140453471041">"Tjenesten blev aktiveret for:"</string>
<string name="serviceDisabled" msgid="1937553226592516411">"Tjenesten er deaktiveret."</string>
diff --git a/core/res/res/values-mcc204-mnc04/config.xml b/core/res/res/values-mcc204-mnc04/config.xml
index dbda6af..fb639ca 100755
--- a/core/res/res/values-mcc204-mnc04/config.xml
+++ b/core/res/res/values-mcc204-mnc04/config.xml
@@ -44,23 +44,12 @@
<item>false</item>
</string-array>
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
-
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
"name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type",
Or string format of ApnSettingV3.
note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" -->
<string-array translatable="false" name="config_tether_apndata">
- <item>Vodafone NL,live.vodafone.com,,,vodafone,vodafone,,,,,204,04,,DUN</item>
<item>[ApnSettingV3]SaskTel Tethering,inet.stm.sk.ca,,,,,,,,,204,04,,DUN,,,true,0,,,,,,,gid,5A</item>
</string-array>
diff --git a/core/res/res/values-mcc208-mnc01/config.xml b/core/res/res/values-mcc208-mnc01/config.xml
index 7e44624..c56da24 100644
--- a/core/res/res/values-mcc208-mnc01/config.xml
+++ b/core/res/res/values-mcc208-mnc01/config.xml
@@ -20,15 +20,6 @@
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. Do not translate. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
diff --git a/core/res/res/values-mcc208-mnc10/config.xml b/core/res/res/values-mcc208-mnc10/config.xml
index 10e8dcc..a32f266 100644
--- a/core/res/res/values-mcc208-mnc10/config.xml
+++ b/core/res/res/values-mcc208-mnc10/config.xml
@@ -21,14 +21,6 @@
for different hardware and product builds. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- </integer-array>
-
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
"name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type",
diff --git a/core/res/res/values-mcc214-mnc03/config.xml b/core/res/res/values-mcc214-mnc03/config.xml
index 2599707..aa16468 100644
--- a/core/res/res/values-mcc214-mnc03/config.xml
+++ b/core/res/res/values-mcc214-mnc03/config.xml
@@ -20,15 +20,6 @@
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. Do not translate. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
diff --git a/core/res/res/values-mcc214-mnc07/config.xml b/core/res/res/values-mcc214-mnc07/config.xml
index b8328df..91571a5 100644
--- a/core/res/res/values-mcc214-mnc07/config.xml
+++ b/core/res/res/values-mcc214-mnc07/config.xml
@@ -21,16 +21,6 @@
for different hardware and product builds. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
-
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
"name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type",
diff --git a/core/res/res/values-mcc222-mnc01/config.xml b/core/res/res/values-mcc222-mnc01/config.xml
index 0d61c6e..4b1981f 100644
--- a/core/res/res/values-mcc222-mnc01/config.xml
+++ b/core/res/res/values-mcc222-mnc01/config.xml
@@ -20,15 +20,6 @@
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. Do not translate. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
diff --git a/core/res/res/values-mcc234-mnc33/config.xml b/core/res/res/values-mcc234-mnc33/config.xml
index e9d3bdb..4637519 100644
--- a/core/res/res/values-mcc234-mnc33/config.xml
+++ b/core/res/res/values-mcc234-mnc33/config.xml
@@ -30,16 +30,6 @@
<item>23486</item>
</string-array>
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
-
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
"name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type",
diff --git a/core/res/res/values-mcc302-mnc220/config.xml b/core/res/res/values-mcc302-mnc220/config.xml
index 3872922..b70e1b4 100644
--- a/core/res/res/values-mcc302-mnc220/config.xml
+++ b/core/res/res/values-mcc302-mnc220/config.xml
@@ -31,16 +31,6 @@
<integer name="config_mobile_mtu">1410</integer>
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
-
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
"name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type",
diff --git a/core/res/res/values-mcc302-mnc221/config.xml b/core/res/res/values-mcc302-mnc221/config.xml
index 3a453b7..ffc9d6c 100644
--- a/core/res/res/values-mcc302-mnc221/config.xml
+++ b/core/res/res/values-mcc302-mnc221/config.xml
@@ -21,16 +21,6 @@
for different hardware and product builds. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
-
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
"name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type",
diff --git a/core/res/res/values-mcc302-mnc370/config.xml b/core/res/res/values-mcc302-mnc370/config.xml
index 13f19f7..5e7e8bc 100644
--- a/core/res/res/values-mcc302-mnc370/config.xml
+++ b/core/res/res/values-mcc302-mnc370/config.xml
@@ -20,15 +20,6 @@
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. Do not translate. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
diff --git a/core/res/res/values-mcc302-mnc720/config.xml b/core/res/res/values-mcc302-mnc720/config.xml
index c20ca12..a83107a 100644
--- a/core/res/res/values-mcc302-mnc720/config.xml
+++ b/core/res/res/values-mcc302-mnc720/config.xml
@@ -20,15 +20,6 @@
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. Do not translate. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
diff --git a/core/res/res/values-mcc454-mnc10/config.xml b/core/res/res/values-mcc454-mnc10/config.xml
index e7622a0..79a9a7e 100644
--- a/core/res/res/values-mcc454-mnc10/config.xml
+++ b/core/res/res/values-mcc454-mnc10/config.xml
@@ -21,16 +21,6 @@
for different hardware and product builds. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>1</item>
- <item>4</item>
- <item>7</item>
- <item>9</item>
- </integer-array>
-
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
"name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type",
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 94d04be..e6e76b8 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2627,7 +2627,6 @@
<!-- Attributes that can be assigned to an <include> tag. -->
<declare-styleable name="Include">
<attr name="id" />
- <attr name="layout" />
<attr name="visibility" />
</declare-styleable>
diff --git a/core/tests/coretests/src/android/os/SELinuxTest.java b/core/tests/coretests/src/android/os/SELinuxTest.java
deleted file mode 100644
index 9b63a6b..0000000
--- a/core/tests/coretests/src/android/os/SELinuxTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package android.os;
-
-import android.os.Process;
-import android.os.SELinux;
-import android.test.AndroidTestCase;
-import static junit.framework.Assert.assertEquals;
-
-public class SELinuxTest extends AndroidTestCase {
-
- public void testgetFileCon() {
- if(SELinux.isSELinuxEnabled() == false)
- return;
-
- String ctx = SELinux.getFileContext("/system/bin/toolbox");
- assertEquals(ctx, "u:object_r:system_file:s0");
- }
-
- public void testgetCon() {
- if(SELinux.isSELinuxEnabled() == false)
- return;
-
- String mycon = SELinux.getContext();
- assertEquals(mycon, "u:r:untrusted_app:s0:c33");
- }
-
- public void testgetPidCon() {
- if(SELinux.isSELinuxEnabled() == false)
- return;
-
- String mycon = SELinux.getPidContext(Process.myPid());
- assertEquals(mycon, "u:r:untrusted_app:s0:c33");
- }
-
- public void testcheckSELinuxAccess() {
- if(SELinux.isSELinuxEnabled() == false)
- return;
-
- String mycon = SELinux.getContext();
- boolean ret;
- ret = SELinux.checkSELinuxAccess(mycon, mycon, "process", "fork");
- assertEquals(ret,"true");
- ret = SELinux.checkSELinuxAccess(mycon, mycon, "memprotect", "mmap_zero");
- assertEquals(ret,"true");
- }
-}
diff --git a/docs/html/design/patterns/notifications.jd b/docs/html/design/patterns/notifications.jd
index f5cd2a7..fdd435c 100644
--- a/docs/html/design/patterns/notifications.jd
+++ b/docs/html/design/patterns/notifications.jd
@@ -15,6 +15,14 @@
</div>
</a>
+<!-- video box -->
+<a class="notice-developers-video" href="https://www.youtube.com/watch?v=Uiq2kZ2JHVY">
+<div>
+ <h3>Video</h3>
+ <p>DevBytes: Notifications in the Android L Developer Preview</p>
+</div>
+</a>
+
<style>
.col-5, .col-6, .col-7 {
margin-left:0px;
diff --git a/docs/html/sdk/exploring.jd b/docs/html/sdk/exploring.jd
deleted file mode 100644
index b34c1cf..0000000
--- a/docs/html/sdk/exploring.jd
+++ /dev/null
@@ -1,10 +0,0 @@
-page.title=Exploring the SDK
-excludeFromSuggestions=true
-walkthru=1
-
-@jd:body
-
-
-
-
-
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index efb26ff..e6ea11b 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -28,22 +28,22 @@
+sdk.linux_download=android-sdk_r24.0.2-linux.tgz
+sdk.linux_bytes=140097024
+sdk.linux_checksum=b6fd75e8b06b0028c2427e6da7d8a09d8f956a86
-sdk.linux_download=android-sdk_r24.0.1-linux.tgz
-sdk.linux_bytes=141304203
-sdk.linux_checksum=fb46b9afa04e09d3c33fa9bfee5c99e9ec6a9523
+sdk.mac_download=android-sdk_r24.0.2-macosx.zip
+sdk.mac_bytes=87262823
+sdk.mac_checksum=3ab5e0ab0db5e7c45de9da7ff525dee6cfa97455
-sdk.mac_download=android-sdk_r24.0.1-macosx.zip
-sdk.mac_bytes=88535741
-sdk.mac_checksum=7097c09c72645d7ad33c81a37b1a1363a9df2a54
+sdk.win_download=android-sdk_r24.0.2-windows.zip
+sdk.win_bytes=139473113
+sdk.win_checksum=51269c8336f936fc9b9538f9b9ca236b78fb4e4b
-sdk.win_download=android-sdk_r24.0.1-windows.zip
-sdk.win_bytes=140743633
-sdk.win_checksum=cc49974e8bfcc865ffe0d887e9a74cf52085c632
+sdk.win_installer=installer_r24.0.2-windows.exe
+sdk.win_installer_bytes=91428280
+sdk.win_installer_checksum=edac14e1541e97d68821fa3a709b4ea8c659e676
-sdk.win_installer=installer_r24.0.1-windows.exe
-sdk.win_installer_bytes=92180986
-sdk.win_installer_checksum=505d7a95647bccc194b7aa707854422d9c7288d5
@@ -90,7 +90,7 @@
display:block;
padding:0;
white-space: nowrap;
- text-indent: 10000px;
+ text-indent: -10000px;
font-size:0px;
background: url(../images/tools/studio-logo.png);
background-image: -webkit-image-set(url(../images/tools/studio-logo.png) 1x, url(../images/tools/studio-logo_2x.png) 2x);
diff --git a/docs/html/tools/help/adt.jd b/docs/html/tools/help/adt.jd
index 0130524..8abe1b4 100644
--- a/docs/html/tools/help/adt.jd
+++ b/docs/html/tools/help/adt.jd
@@ -509,10 +509,10 @@
revision of the Android SDK Tools. If such dependencies exist, you will need to
update the SDK Tools package of the SDK after installing the new revision of
ADT. To update the SDK Tools package, use the Android SDK Manager, as
-described in <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</p>
+described in <a href="{@docRoot}sdk/installing/adding-packages.html">Adding SDK Packages</a>.</p>
<p>To learn about new features of each ADT revision and also any dependencies on
-the SDK Tools, see the listings in the <a href="#notes">Revisions</a>
+the SDK Tools, see the listings in the <a href="{@docRoot}tools/revisions/index.html">Revisions</a>
section. To determine the version currently installed, open the
Eclipse Installed Software window using <strong>Help</strong>
> <strong>Software Updates</strong> and refer to the version listed for
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
index ed48887..e50b7ac 100644
--- a/docs/html/tools/sdk/tools-notes.jd
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -25,6 +25,33 @@
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 24.0.2</a> <em>(December 2014)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Android SDK Platform-tools revision 19 or later.</li>
+ </ul>
+ </dd>
+
+ <dt>General Notes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed issue with creating projects and activities from templates using Eclipse ADT.</li>
+ </ul>
+ </dd>
+ </div>
+</div>
+
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
alt=""/>SDK Tools, Revision 24.0.1</a> <em>(December 2014)</em>
</p>
@@ -898,7 +925,7 @@
<li>Added a flag that sets <em>jumbo mode</em> for DEX files, which allows a larger
number of strings in the DEX files. Enable this mode by adding the following line to
the {@code project.properties} file of your project:
- <pre>set dex.force.jumbo=true</pre></li>
+ <pre>dex.force.jumbo=true</pre></li>
<li>Improved the build time by pre-dexing libraries (both JAR files and library
projects).</li>
<li>Updated the build to generate {@code R} resource classes for library projects
diff --git a/docs/html/training/multiscreen/screendensities.jd b/docs/html/training/multiscreen/screendensities.jd
index 7817830..fcb65cc 100644
--- a/docs/html/training/multiscreen/screendensities.jd
+++ b/docs/html/training/multiscreen/screendensities.jd
@@ -15,8 +15,8 @@
<!-- This is the training bar -->
-<div id="tb-wrapper">
-<div id="tb">
+<div id="tb-wrapper">
+<div id="tb">
<h2>This lesson teaches you to</h2>
<ol>
@@ -33,16 +33,15 @@
</ul>
<h2>Try it out</h2>
-
-<div class="download-box">
+
+<div class="download-box">
<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Download
the sample app</a>
-<p class="filename">NewsReader.zip</p>
-</div>
-
-
-</div>
-</div>
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
<p>This lesson shows you how to support different screen densities
by providing different resources and using resolution-independent units of
@@ -54,19 +53,29 @@
absolute pixels to define distances or sizes. Defining layout dimensions with
pixels is a problem because different screens have different pixel densities,
so the same number of pixels may correspond to different physical sizes on
-different devices. Therefore, when specifying dimensions, always use either
+different devices. Therefore, when specifying dimensions, always use either
<code>dp</code> or <code>sp</code> units. A <code>dp</code> is a density-independent pixel
that corresponds to the physical size of a pixel at 160 dpi. An <code>sp</code> is the same
base unit, but is scaled by the user's preferred text size (it’s a
scale-independent pixel), so you should use this measurement unit when defining
text size (but never for layout sizes).</p>
-<p>For example, when you specify spacing between two views, use <code>dp</code>
+ <!-- video box -->
+<a class="notice-developers-video left" href="https://www.youtube.com/watch?v=zhszwkcay2A">
+<div>
+ <h3>Video</h3>
+ <p>DesignBytes: Density-independent Pixels</p>
+</div>
+</a>
+
+<br style="clear:left">
+
+<p>For example, when you specify spacing between two views, use <code>dp</code>
rather than <code>px</code>:</p>
<pre>
-<Button android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+<Button android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:text="@string/clickme"
android:layout_marginTop="20dp" />
</pre>
@@ -74,8 +83,8 @@
<p>When specifying text size, always use <code>sp</code>:</p>
<pre>
-<TextView android:layout_width="match_parent"
- android:layout_height="wrap_content"
+<TextView android:layout_width="match_parent"
+ android:layout_height="wrap_content"
android:textSize="20sp" />
</pre>
diff --git a/docs/html/training/tv/playback/index.jd b/docs/html/training/tv/playback/index.jd
index 31c7524..5427d48 100644
--- a/docs/html/training/tv/playback/index.jd
+++ b/docs/html/training/tv/playback/index.jd
@@ -17,9 +17,20 @@
<li><a href="{@docRoot}design/tv/index.html">
Design for TV</a></li>
</ul>
+
</div>
</div>
+ <!-- video box -->
+<a class="notice-developers-video" href="https://www.youtube.com/watch?v=72K1VhjoL98">
+<div>
+ <h3>Video</h3>
+ <p>DevBytes: Android TV — Using the Leanback library</p>
+</div>
+</a>
+
+
+
<p>
Browsing and playing media files is frequently part of the user experience provided by a TV app.
Building such an experience from scratch, while making sure that it is fast, fluid, and attractive
diff --git a/include/private/graphics/Canvas.h b/include/private/graphics/Canvas.h
index 3cd57f4..2eda6a4 100644
--- a/include/private/graphics/Canvas.h
+++ b/include/private/graphics/Canvas.h
@@ -28,6 +28,16 @@
virtual ~Canvas() {};
static Canvas* create_canvas(SkBitmap* bitmap);
+
+ /**
+ * Create a new Canvas object which delegates to an SkCanvas.
+ *
+ * @param skiaCanvas Must not be NULL. All drawing calls will be
+ * delegated to this object. This function will call ref() on the
+ * SkCanvas, and the returned Canvas will unref() it upon
+ * destruction.
+ * @return new Canvas object. Will not return NULL.
+ */
static Canvas* create_canvas(SkCanvas* skiaCanvas);
// TODO: enable HWUI to either create similar canvas wrapper or subclass
diff --git a/libs/hwui/Android.common.mk b/libs/hwui/Android.common.mk
new file mode 100644
index 0000000..536912a
--- /dev/null
+++ b/libs/hwui/Android.common.mk
@@ -0,0 +1,105 @@
+# getConfig in external/skia/include/core/SkBitmap.h is deprecated.
+# Allow Gnu extension: in-class initializer of static 'const float' member.
+LOCAL_CLANG_CFLAGS += \
+ -Wno-unused-parameter \
+ -Wno-deprecated-declarations \
+ -Wno-gnu-static-float-init
+
+LOCAL_SRC_FILES := \
+ utils/Blur.cpp \
+ utils/GLUtils.cpp \
+ utils/SortedListImpl.cpp \
+ thread/TaskManager.cpp \
+ font/CacheTexture.cpp \
+ font/Font.cpp \
+ AmbientShadow.cpp \
+ AnimationContext.cpp \
+ Animator.cpp \
+ AnimatorManager.cpp \
+ AssetAtlas.cpp \
+ Caches.cpp \
+ CanvasState.cpp \
+ DamageAccumulator.cpp \
+ DisplayList.cpp \
+ DeferredDisplayList.cpp \
+ DeferredLayerUpdater.cpp \
+ DisplayListLogBuffer.cpp \
+ DisplayListRenderer.cpp \
+ Dither.cpp \
+ DrawProfiler.cpp \
+ Extensions.cpp \
+ FboCache.cpp \
+ FontRenderer.cpp \
+ GammaFontRenderer.cpp \
+ GradientCache.cpp \
+ Image.cpp \
+ Interpolator.cpp \
+ Layer.cpp \
+ LayerCache.cpp \
+ LayerRenderer.cpp \
+ Matrix.cpp \
+ OpenGLRenderer.cpp \
+ Patch.cpp \
+ PatchCache.cpp \
+ PathCache.cpp \
+ PathTessellator.cpp \
+ PixelBuffer.cpp \
+ Program.cpp \
+ ProgramCache.cpp \
+ RenderBufferCache.cpp \
+ RenderNode.cpp \
+ RenderProperties.cpp \
+ RenderState.cpp \
+ ResourceCache.cpp \
+ ShadowTessellator.cpp \
+ SkiaShader.cpp \
+ Snapshot.cpp \
+ SpotShadow.cpp \
+ Stencil.cpp \
+ TessellationCache.cpp \
+ Texture.cpp \
+ TextureCache.cpp \
+ TextDropShadowCache.cpp
+
+# RenderThread stuff
+LOCAL_SRC_FILES += \
+ renderthread/CanvasContext.cpp \
+ renderthread/DrawFrameTask.cpp \
+ renderthread/EglManager.cpp \
+ renderthread/RenderProxy.cpp \
+ renderthread/RenderTask.cpp \
+ renderthread/RenderThread.cpp \
+ renderthread/TimeLord.cpp
+
+intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
+
+LOCAL_C_INCLUDES += \
+ external/skia/src/core
+
+LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
+LOCAL_CFLAGS += -Wno-unused-parameter
+LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libEGL libGLESv2 libskia libui libgui
+
+ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
+ LOCAL_CFLAGS += -DANDROID_ENABLE_RENDERSCRIPT
+ LOCAL_SHARED_LIBRARIES += libRS libRScpp
+ LOCAL_C_INCLUDES += \
+ $(intermediates) \
+ frameworks/rs/cpp \
+ frameworks/rs \
+
+endif
+
+ifndef HWUI_COMPILE_SYMBOLS
+ LOCAL_CFLAGS += -fvisibility=hidden
+endif
+
+ifdef HWUI_COMPILE_FOR_PERF
+ # TODO: Non-arm?
+ LOCAL_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
+endif
+
+# Defaults for ATRACE_TAG and LOG_TAG for libhwui
+LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\"
+
+LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
\ No newline at end of file
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk
index 8cc4d15..aa8db26 100644
--- a/libs/hwui/Android.mk
+++ b/libs/hwui/Android.mk
@@ -2,120 +2,12 @@
include $(CLEAR_VARS)
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-# Too many unused parameters in external/skia/include and this directory.
-# getConfig in external/skia/include/core/SkBitmap.h is deprecated.
-# Allow Gnu extension: in-class initializer of static 'const float' member.
-LOCAL_CLANG_CFLAGS += \
- -Wno-unused-parameter \
- -Wno-deprecated-declarations \
- -Wno-gnu-static-float-init
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE := libhwui
+LOCAL_MODULE_TAGS := optional
-# Only build libhwui when USE_OPENGL_RENDERER is
-# defined in the current device/board configuration
-ifeq ($(USE_OPENGL_RENDERER),true)
- LOCAL_SRC_FILES := \
- utils/Blur.cpp \
- utils/GLUtils.cpp \
- utils/SortedListImpl.cpp \
- thread/TaskManager.cpp \
- font/CacheTexture.cpp \
- font/Font.cpp \
- AmbientShadow.cpp \
- AnimationContext.cpp \
- Animator.cpp \
- AnimatorManager.cpp \
- AssetAtlas.cpp \
- Caches.cpp \
- CanvasState.cpp \
- DamageAccumulator.cpp \
- DisplayList.cpp \
- DeferredDisplayList.cpp \
- DeferredLayerUpdater.cpp \
- DisplayListLogBuffer.cpp \
- DisplayListRenderer.cpp \
- Dither.cpp \
- DrawProfiler.cpp \
- Extensions.cpp \
- FboCache.cpp \
- FontRenderer.cpp \
- GammaFontRenderer.cpp \
- GradientCache.cpp \
- Image.cpp \
- Interpolator.cpp \
- Layer.cpp \
- LayerCache.cpp \
- LayerRenderer.cpp \
- Matrix.cpp \
- OpenGLRenderer.cpp \
- Patch.cpp \
- PatchCache.cpp \
- PathCache.cpp \
- PathTessellator.cpp \
- PixelBuffer.cpp \
- Program.cpp \
- ProgramCache.cpp \
- RenderBufferCache.cpp \
- RenderNode.cpp \
- RenderProperties.cpp \
- RenderState.cpp \
- ResourceCache.cpp \
- ShadowTessellator.cpp \
- SkiaShader.cpp \
- Snapshot.cpp \
- SpotShadow.cpp \
- Stencil.cpp \
- TessellationCache.cpp \
- Texture.cpp \
- TextureCache.cpp \
- TextDropShadowCache.cpp
+include $(LOCAL_PATH)/Android.common.mk
-# RenderThread stuff
- LOCAL_SRC_FILES += \
- renderthread/CanvasContext.cpp \
- renderthread/DrawFrameTask.cpp \
- renderthread/EglManager.cpp \
- renderthread/RenderProxy.cpp \
- renderthread/RenderTask.cpp \
- renderthread/RenderThread.cpp \
- renderthread/TimeLord.cpp
+include $(BUILD_SHARED_LIBRARY)
- intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
-
- LOCAL_C_INCLUDES += \
- external/skia/src/core
-
- LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
- LOCAL_CFLAGS += -Wno-unused-parameter
- LOCAL_MODULE_CLASS := SHARED_LIBRARIES
- LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libEGL libGLESv2 libskia libui libgui
- LOCAL_MODULE := libhwui
- LOCAL_MODULE_TAGS := optional
-
- ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
- LOCAL_CFLAGS += -DANDROID_ENABLE_RENDERSCRIPT
- LOCAL_SHARED_LIBRARIES += libRS libRScpp
- LOCAL_C_INCLUDES += \
- $(intermediates) \
- frameworks/rs/cpp \
- frameworks/rs \
-
- endif
-
- ifndef HWUI_COMPILE_SYMBOLS
- LOCAL_CFLAGS += -fvisibility=hidden
- endif
-
- ifdef HWUI_COMPILE_FOR_PERF
- # TODO: Non-arm?
- LOCAL_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
- endif
-
- # Defaults for ATRACE_TAG and LOG_TAG for libhwui
- LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\"
-
- LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
-
- include $(BUILD_SHARED_LIBRARY)
-
- include $(call all-makefiles-under,$(LOCAL_PATH))
-endif
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 674102b..bb4ac83 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -29,10 +29,8 @@
namespace android {
-#ifdef USE_OPENGL_RENDERER
using namespace uirenderer;
ANDROID_SINGLETON_STATIC_INSTANCE(Caches);
-#endif
namespace uirenderer {
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index ea1d714..7355baa 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -499,7 +499,7 @@
deferInfo.mergeable &= !recordingComplexClip();
deferInfo.opaqueOverBounds &= !recordingComplexClip() && mSaveStack.isEmpty();
- if (mBatches.size() &&
+ if (CC_LIKELY(mAvoidOverdraw) && mBatches.size() &&
state->mClipSideFlags != kClipSide_ConservativeFull &&
deferInfo.opaqueOverBounds && state->mBounds.contains(mBounds)) {
// avoid overdraw by resetting drawing state + discarding drawing ops
@@ -647,12 +647,13 @@
DrawModifiers restoreDrawModifiers = renderer.getDrawModifiers();
renderer.save(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
- for (unsigned int i = 1; i < mBatches.size(); i++) {
- if (mBatches[i] && mBatches[i]->coversBounds(mBounds)) {
- discardDrawingBatches(i - 1);
+ if (CC_LIKELY(mAvoidOverdraw)) {
+ for (unsigned int i = 1; i < mBatches.size(); i++) {
+ if (mBatches[i] && mBatches[i]->coversBounds(mBounds)) {
+ discardDrawingBatches(i - 1);
+ }
}
}
-
// NOTE: depth of the save stack at this point, before playback, should be reflected in
// FLUSH_SAVE_STACK_DEPTH, so that save/restores match up correctly
replayBatchList(mBatches, renderer, dirty);
diff --git a/libs/hwui/DeferredDisplayList.h b/libs/hwui/DeferredDisplayList.h
index fe70ec2..b6309ff 100644
--- a/libs/hwui/DeferredDisplayList.h
+++ b/libs/hwui/DeferredDisplayList.h
@@ -81,8 +81,8 @@
class DeferredDisplayList {
friend struct DeferStateStruct; // used to give access to allocator
public:
- DeferredDisplayList(const Rect& bounds) :
- mBounds(bounds) {
+ DeferredDisplayList(const Rect& bounds, bool avoidOverdraw = true) :
+ mBounds(bounds), mAvoidOverdraw(avoidOverdraw) {
clear();
}
~DeferredDisplayList() { clear(); }
@@ -150,6 +150,7 @@
// layer space bounds of rendering
Rect mBounds;
+ const bool mAvoidOverdraw;
/**
* At defer time, stores the *defer time* savecount of save/saveLayer ops that were deferred, so
diff --git a/libs/hwui/DisplayListLogBuffer.cpp b/libs/hwui/DisplayListLogBuffer.cpp
index bc9e7bd..23b6cff 100644
--- a/libs/hwui/DisplayListLogBuffer.cpp
+++ b/libs/hwui/DisplayListLogBuffer.cpp
@@ -47,10 +47,8 @@
namespace android {
-#ifdef USE_OPENGL_RENDERER
using namespace uirenderer;
ANDROID_SINGLETON_STATIC_INSTANCE(DisplayListLogBuffer);
-#endif
namespace uirenderer {
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 0150ac0..3f67f54 100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1919,7 +1919,10 @@
return;
}
- DeferredDisplayList deferredList(*mState.currentClipRect());
+ // Don't avoid overdraw when visualizing, since that makes it harder to
+ // debug where it's coming from, and when the problem occurs.
+ bool avoidOverdraw = !mCaches.debugOverdraw;
+ DeferredDisplayList deferredList(*mState.currentClipRect(), avoidOverdraw);
DeferStateStruct deferStruct(deferredList, *this, replayFlags);
renderNode->defer(deferStruct, 0);
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp
index 31bd637..8a48a6e 100644
--- a/libs/hwui/ResourceCache.cpp
+++ b/libs/hwui/ResourceCache.cpp
@@ -22,10 +22,8 @@
namespace android {
-#ifdef USE_OPENGL_RENDERER
using namespace uirenderer;
ANDROID_SINGLETON_STATIC_INSTANCE(ResourceCache);
-#endif
namespace uirenderer {
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 38cb4cd..3e4e965 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -40,7 +40,7 @@
static const size_t EVENT_BUFFER_SIZE = 100;
// Slight delay to give the UI time to push us a new frame before we replay
-static const int DISPATCH_FRAME_CALLBACKS_DELAY = 4;
+static const nsecs_t DISPATCH_FRAME_CALLBACKS_DELAY = milliseconds_to_nanoseconds(4);
TaskQueue::TaskQueue() : mHead(0), mTail(0) {}
@@ -209,16 +209,16 @@
return latest;
}
-void RenderThread::drainDisplayEventQueue(bool skipCallbacks) {
+void RenderThread::drainDisplayEventQueue() {
ATRACE_CALL();
nsecs_t vsyncEvent = latestVsyncEvent(mDisplayEventReceiver);
if (vsyncEvent > 0) {
mVsyncRequested = false;
- mTimeLord.vsyncReceived(vsyncEvent);
- if (!skipCallbacks && !mFrameCallbackTaskPending) {
+ if (mTimeLord.vsyncReceived(vsyncEvent) && !mFrameCallbackTaskPending) {
ATRACE_NAME("queue mFrameCallbackTask");
mFrameCallbackTaskPending = true;
- queueDelayed(mFrameCallbackTask, DISPATCH_FRAME_CALLBACKS_DELAY);
+ nsecs_t runAt = (vsyncEvent + DISPATCH_FRAME_CALLBACKS_DELAY);
+ queueAt(mFrameCallbackTask, runAt);
}
}
}
@@ -230,8 +230,13 @@
std::set<IFrameCallback*> callbacks;
mFrameCallbacks.swap(callbacks);
- for (std::set<IFrameCallback*>::iterator it = callbacks.begin(); it != callbacks.end(); it++) {
- (*it)->doFrame();
+ if (callbacks.size()) {
+ // Assume one of them will probably animate again so preemptively
+ // request the next vsync in case it occurs mid-frame
+ requestVsync();
+ for (std::set<IFrameCallback*>::iterator it = callbacks.begin(); it != callbacks.end(); it++) {
+ (*it)->doFrame();
+ }
}
}
@@ -273,7 +278,7 @@
}
if (mPendingRegistrationFrameCallbacks.size() && !mFrameCallbackTaskPending) {
- drainDisplayEventQueue(true);
+ drainDisplayEventQueue();
mFrameCallbacks.insert(
mPendingRegistrationFrameCallbacks.begin(), mPendingRegistrationFrameCallbacks.end());
mPendingRegistrationFrameCallbacks.clear();
@@ -299,9 +304,8 @@
mLooper->wake();
}
-void RenderThread::queueDelayed(RenderTask* task, int delayMs) {
- nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- task->mRunAt = now + milliseconds_to_nanoseconds(delayMs);
+void RenderThread::queueAt(RenderTask* task, nsecs_t runAtNs) {
+ task->mRunAt = runAtNs;
queue(task);
}
diff --git a/libs/hwui/renderthread/RenderThread.h b/libs/hwui/renderthread/RenderThread.h
index 4126d02..99c2e15 100644
--- a/libs/hwui/renderthread/RenderThread.h
+++ b/libs/hwui/renderthread/RenderThread.h
@@ -75,7 +75,7 @@
// and will delete them after they are run
ANDROID_API void queue(RenderTask* task);
ANDROID_API void queueAtFront(RenderTask* task);
- void queueDelayed(RenderTask* task, int delayMs);
+ void queueAt(RenderTask* task, nsecs_t runAtNs);
void remove(RenderTask* task);
// Mimics android.view.Choreographer
@@ -103,7 +103,7 @@
void initThreadLocals();
void initializeDisplayEventReceiver();
static int displayEventReceiverCallback(int fd, int events, void* data);
- void drainDisplayEventQueue(bool skipCallbacks = false);
+ void drainDisplayEventQueue();
void dispatchFrameCallbacks();
void requestVsync();
diff --git a/libs/hwui/renderthread/TimeLord.cpp b/libs/hwui/renderthread/TimeLord.cpp
index 9bd4eae..f187493 100644
--- a/libs/hwui/renderthread/TimeLord.cpp
+++ b/libs/hwui/renderthread/TimeLord.cpp
@@ -24,10 +24,12 @@
, mFrameTimeNanos(0) {
}
-void TimeLord::vsyncReceived(nsecs_t vsync) {
+bool TimeLord::vsyncReceived(nsecs_t vsync) {
if (vsync > mFrameTimeNanos) {
mFrameTimeNanos = vsync;
+ return true;
}
+ return false;
}
nsecs_t TimeLord::computeFrameTimeMs() {
diff --git a/libs/hwui/renderthread/TimeLord.h b/libs/hwui/renderthread/TimeLord.h
index 8b0372c..7c155d2 100644
--- a/libs/hwui/renderthread/TimeLord.h
+++ b/libs/hwui/renderthread/TimeLord.h
@@ -29,7 +29,8 @@
class TimeLord {
public:
void setFrameInterval(nsecs_t intervalNanos) { mFrameIntervalNanos = intervalNanos; }
- void vsyncReceived(nsecs_t vsync);
+ // returns true if the vsync is newer, false if it was rejected for staleness
+ bool vsyncReceived(nsecs_t vsync);
nsecs_t computeFrameTimeMs();
private:
diff --git a/libs/hwui/tests/Android.mk b/libs/hwui/tests/Android.mk
index 14739af..2fff07d 100644
--- a/libs/hwui/tests/Android.mk
+++ b/libs/hwui/tests/Android.mk
@@ -15,35 +15,9 @@
#
local_target_dir := $(TARGET_OUT_DATA)/local/tmp
-LOCAL_PATH:= $(call my-dir)
+LOCAL_PATH:= $(call my-dir)/..
include $(CLEAR_VARS)
-LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
-LOCAL_CFLAGS += -Wno-unused-parameter
-LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\"
-LOCAL_CFLAGS += -Wno-unused-parameter
-
-LOCAL_SRC_FILES:= \
- TestContext.cpp \
- main.cpp
-
-LOCAL_C_INCLUDES += \
- $(LOCAL_PATH)/.. \
- external/skia/src/core
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libcutils \
- libutils \
- libskia \
- libgui \
- libui \
- libhwui
-
-ifeq ($(WITH_MALLOC_LEAK_CHECK),true)
- LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK
-endif
-
LOCAL_MODULE_PATH := $(local_target_dir)
LOCAL_MODULE:= hwuitest
LOCAL_MODULE_TAGS := tests
@@ -51,6 +25,10 @@
LOCAL_MODULE_STEM_32 := hwuitest
LOCAL_MODULE_STEM_64 := hwuitest64
-include $(BUILD_EXECUTABLE)
+include $(LOCAL_PATH)/Android.common.mk
-include $(call all-makefiles-under,$(LOCAL_PATH))
+LOCAL_SRC_FILES += \
+ tests/TestContext.cpp \
+ tests/main.cpp
+
+include $(BUILD_EXECUTABLE)
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 000279d..43629c0 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -1841,12 +1841,22 @@
}
public void setRingerModeExternal(int ringerMode, String caller) {
- setRingerMode(ringerMode, caller, true /*external*/);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ setRingerMode(ringerMode, caller, true /*external*/);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
public void setRingerModeInternal(int ringerMode, String caller) {
enforceSelfOrSystemUI("setRingerModeInternal");
- setRingerMode(ringerMode, caller, false /*external*/);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ setRingerMode(ringerMode, caller, false /*external*/);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
private void setRingerMode(int ringerMode, String caller, boolean external) {
@@ -1860,26 +1870,28 @@
if ((ringerMode == AudioManager.RINGER_MODE_VIBRATE) && !mHasVibrator) {
ringerMode = AudioManager.RINGER_MODE_SILENT;
}
- final int ringerModeInternal = getRingerModeInternal();
- final int ringerModeExternal = getRingerModeExternal();
- if (external) {
- setRingerModeExt(ringerMode);
- if (mRingerModeDelegate != null) {
- ringerMode = mRingerModeDelegate.onSetRingerModeExternal(ringerModeExternal,
- ringerMode, caller, ringerModeInternal);
+ synchronized (mSettingsLock) {
+ final int ringerModeInternal = getRingerModeInternal();
+ final int ringerModeExternal = getRingerModeExternal();
+ if (external) {
+ setRingerModeExt(ringerMode);
+ if (mRingerModeDelegate != null) {
+ ringerMode = mRingerModeDelegate.onSetRingerModeExternal(ringerModeExternal,
+ ringerMode, caller, ringerModeInternal);
+ }
+ if (ringerMode != ringerModeInternal) {
+ setRingerModeInt(ringerMode, true /*persist*/);
+ }
+ } else /*internal*/ {
+ if (ringerMode != ringerModeInternal) {
+ setRingerModeInt(ringerMode, true /*persist*/);
+ }
+ if (mRingerModeDelegate != null) {
+ ringerMode = mRingerModeDelegate.onSetRingerModeInternal(ringerModeInternal,
+ ringerMode, caller, ringerModeExternal);
+ }
+ setRingerModeExt(ringerMode);
}
- if (ringerMode != ringerModeInternal) {
- setRingerModeInt(ringerMode, true /*persist*/);
- }
- } else /*internal*/ {
- if (ringerMode != ringerModeInternal) {
- setRingerModeInt(ringerMode, true /*persist*/);
- }
- if (mRingerModeDelegate != null) {
- ringerMode = mRingerModeDelegate.onSetRingerModeInternal(ringerModeInternal,
- ringerMode, caller, ringerModeExternal);
- }
- setRingerModeExt(ringerMode);
}
}
@@ -1968,10 +1980,10 @@
switch (getVibrateSetting(vibrateType)) {
case AudioManager.VIBRATE_SETTING_ON:
- return getRingerModeInternal() != AudioManager.RINGER_MODE_SILENT;
+ return getRingerModeExternal() != AudioManager.RINGER_MODE_SILENT;
case AudioManager.VIBRATE_SETTING_ONLY_SILENT:
- return getRingerModeInternal() == AudioManager.RINGER_MODE_VIBRATE;
+ return getRingerModeExternal() == AudioManager.RINGER_MODE_VIBRATE;
case AudioManager.VIBRATE_SETTING_OFF:
// return false, even for incoming calls
@@ -3236,7 +3248,10 @@
TelecomManager telecomManager =
(TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE);
+
+ final long ident = Binder.clearCallingIdentity();
IsInCall = telecomManager.isInCall();
+ Binder.restoreCallingIdentity(ident);
return (IsInCall || getMode() == AudioManager.MODE_IN_COMMUNICATION);
}
diff --git a/media/java/android/media/session/MediaSessionLegacyHelper.java b/media/java/android/media/session/MediaSessionLegacyHelper.java
index 4b9a929..7ea269b 100644
--- a/media/java/android/media/session/MediaSessionLegacyHelper.java
+++ b/media/java/android/media/session/MediaSessionLegacyHelper.java
@@ -69,12 +69,9 @@
}
public static MediaSessionLegacyHelper getHelper(Context context) {
- if (DEBUG) {
- Log.d(TAG, "Attempting to get helper with context " + context);
- }
synchronized (sLock) {
if (sInstance == null) {
- sInstance = new MediaSessionLegacyHelper(context);
+ sInstance = new MediaSessionLegacyHelper(context.getApplicationContext());
}
}
return sInstance;
diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java
index b19a1fb..8c478ed 100644
--- a/media/java/android/media/tv/TvInputService.java
+++ b/media/java/android/media/tv/TvInputService.java
@@ -597,13 +597,16 @@
public void onSetMain(boolean isMain) {
}
- /**
- * Sets the {@link Surface} for the current input session on which the TV input renders
- * video.
- *
- * @param surface {@link Surface} an application passes to this TV input session.
- * @return {@code true} if the surface was set, {@code false} otherwise.
- */
+ /**
+ * Sets the {@link Surface} for the current input session on which the TV input renders video.
+ * <p>
+ * When {@code setSurface(null)} is called, the implementation should stop using the Surface
+ * object previously given and release any references to it.
+ *
+ * @param surface possibly {@code null} {@link Surface} an application passes to this TV input
+ * session.
+ * @return {@code true} if the surface was set, {@code false} otherwise.
+ */
public abstract boolean onSetSurface(Surface surface);
/**
diff --git a/packages/CaptivePortalLogin/assets/locked_page.png b/packages/CaptivePortalLogin/assets/locked_page.png
new file mode 100644
index 0000000..91e1291
--- /dev/null
+++ b/packages/CaptivePortalLogin/assets/locked_page.png
Binary files differ
diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
index 7253579..06e8574 100644
--- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -28,6 +28,7 @@
import android.net.NetworkRequest;
import android.net.Proxy;
import android.net.Uri;
+import android.net.http.SslError;
import android.os.Bundle;
import android.provider.Settings;
import android.provider.Settings.Global;
@@ -37,6 +38,7 @@
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
+import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
@@ -251,6 +253,19 @@
}
testForCaptivePortal();
}
+
+ // A web page consisting of a large broken lock icon to indicate SSL failure.
+ final static String SSL_ERROR_HTML = "<!DOCTYPE html><html><head><style>" +
+ "html { width:100%; height:100%; " +
+ " background:url(locked_page.png) center center no-repeat; }" +
+ "</style></head><body></body></html>";
+
+ @Override
+ public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
+ Log.w(TAG, "SSL error; displaying broken lock icon.");
+ view.loadDataWithBaseURL("file:///android_asset/", SSL_ERROR_HTML, "text/HTML",
+ "UTF-8", null);
+ }
}
private class MyWebChromeClient extends WebChromeClient {
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
index 78af785..d1b4812 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
@@ -580,7 +580,7 @@
private void writeNewChecksums(long[] checksums, ParcelFileDescriptor newState)
throws IOException {
DataOutputStream dataOutput = new DataOutputStream(
- new FileOutputStream(newState.getFileDescriptor()));
+ new BufferedOutputStream(new FileOutputStream(newState.getFileDescriptor())));
dataOutput.writeInt(STATE_VERSION);
for (int i = 0; i < STATE_SIZE; i++) {
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index e1cd73a0..f61724d 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -266,7 +266,7 @@
<string name="quick_settings_tethering_label" msgid="7153452060448575549">"Tethering"</string>
<string name="quick_settings_hotspot_label" msgid="6046917934974004879">"Hotspot"</string>
<string name="quick_settings_notifications_label" msgid="4818156442169154523">"Notifications"</string>
- <string name="quick_settings_flashlight_label" msgid="2133093497691661546">"Flashlight"</string>
+ <string name="quick_settings_flashlight_label" msgid="2133093497691661546">"Torch"</string>
<string name="quick_settings_cellular_detail_title" msgid="8575062783675171695">"Mobile data"</string>
<string name="quick_settings_cellular_detail_data_usage" msgid="1964260360259312002">"Data usage"</string>
<string name="quick_settings_cellular_detail_remaining_data" msgid="722715415543541249">"Remaining data"</string>
diff --git a/packages/SystemUI/res/values-en-rIN/strings.xml b/packages/SystemUI/res/values-en-rIN/strings.xml
index e1cd73a0..f61724d 100644
--- a/packages/SystemUI/res/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res/values-en-rIN/strings.xml
@@ -266,7 +266,7 @@
<string name="quick_settings_tethering_label" msgid="7153452060448575549">"Tethering"</string>
<string name="quick_settings_hotspot_label" msgid="6046917934974004879">"Hotspot"</string>
<string name="quick_settings_notifications_label" msgid="4818156442169154523">"Notifications"</string>
- <string name="quick_settings_flashlight_label" msgid="2133093497691661546">"Flashlight"</string>
+ <string name="quick_settings_flashlight_label" msgid="2133093497691661546">"Torch"</string>
<string name="quick_settings_cellular_detail_title" msgid="8575062783675171695">"Mobile data"</string>
<string name="quick_settings_cellular_detail_data_usage" msgid="1964260360259312002">"Data usage"</string>
<string name="quick_settings_cellular_detail_remaining_data" msgid="722715415543541249">"Remaining data"</string>
diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
index 3e6611a..10618e0 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
@@ -603,7 +603,7 @@
mStartAnimationTriggered = false;
return ActivityOptions.makeThumbnailAspectScaleDownAnimation(mDummyStackView,
thumbnail, toTaskRect.left, toTaskRect.top, toTaskRect.width(),
- toTaskRect.height(), this);
+ toTaskRect.height(), mHandler, this);
}
// If both the screenshot and thumbnail fails, then just fall back to the default transition
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 746a7df..ee79242a 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -477,7 +477,7 @@
}
opts = ActivityOptions.makeThumbnailAspectScaleUpAnimation(sourceView,
b, offsetX, offsetY, transform.rect.width(), transform.rect.height(),
- animStartedListener);
+ sourceView.getHandler(), animStartedListener);
}
final ActivityOptions launchOpts = opts;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationTemplateViewWrapper.java
index fbcba0b..59b62e5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationTemplateViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationTemplateViewWrapper.java
@@ -53,6 +53,9 @@
private ImageView mIcon;
protected ImageView mPicture;
+ /** Whether the icon needs to be forced grayscale when in dark mode. */
+ private boolean mIconForceGraysaleWhenDark;
+
protected NotificationTemplateViewWrapper(Context ctx, View view) {
super(view);
mIconDarkAlpha = ctx.getResources().getInteger(R.integer.doze_small_icon_alpha);
@@ -73,11 +76,15 @@
mIcon = resolveIcon(largeIcon, rightIcon);
mPicture = resolvePicture(largeIcon);
mIconBackgroundColor = resolveBackgroundColor(mIcon);
+
+ // If the icon already has a color filter, we assume that we already forced the icon to be
+ // white when we created the notification.
+ mIconForceGraysaleWhenDark = mIcon != null && mIcon.getDrawable().getColorFilter() != null;
}
private ImageView resolveIcon(ImageView largeIcon, ImageView rightIcon) {
return largeIcon != null && largeIcon.getBackground() != null ? largeIcon
- : rightIcon != null && rightIcon.getBackground() != null ? rightIcon
+ : rightIcon != null && rightIcon.getVisibility() == View.VISIBLE ? rightIcon
: null;
}
@@ -118,9 +125,15 @@
if (fade) {
fadeIconColorFilter(mIcon, dark, delay);
fadeIconAlpha(mIcon, dark, delay);
+ if (!mIconForceGraysaleWhenDark) {
+ fadeGrayscale(mIcon, dark, delay);
+ }
} else {
updateIconColorFilter(mIcon, dark);
updateIconAlpha(mIcon, dark);
+ if (!mIconForceGraysaleWhenDark) {
+ updateGrayscale(mIcon, dark);
+ }
}
}
setPictureGrayscale(dark, fade, delay);
@@ -196,8 +209,8 @@
mIconColorFilter.setColor(color);
Drawable background = target.getBackground();
- // The notification might have been modified during the animation, so background might be
- // null here.
+ // The background might be null for legacy notifications. Also, the notification might have
+ // been modified during the animation, so background might be null here.
if (background != null) {
background.mutate().setColorFilter(mIconColorFilter);
}
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 90bfe0d..0425b4c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -426,6 +426,9 @@
return;
}
List<SubscriptionInfo> subscriptions = mSubscriptionManager.getActiveSubscriptionInfoList();
+ if (subscriptions == null) {
+ subscriptions = Collections.emptyList();
+ }
// If there have been no relevant changes to any of the subscriptions, we can leave as is.
if (hasCorrectMobileControllers(subscriptions)) {
// Even if the controllers are correct, make sure we have the right no sims state.
@@ -500,10 +503,8 @@
}
private boolean hasCorrectMobileControllers(List<SubscriptionInfo> allSubscriptions) {
- if (allSubscriptions == null) {
- // If null then the system doesn't know the subscriptions yet, instead just wait
- // to update the MobileControllers until it knows the state.
- return true;
+ if (allSubscriptions.size() != mMobileSignalControllers.size()) {
+ return false;
}
for (SubscriptionInfo info : allSubscriptions) {
if (!mMobileSignalControllers.containsKey(info.getSubscriptionId())) {
@@ -812,7 +813,8 @@
private final OnSubscriptionsChangedListener mSubscriptionListener =
new OnSubscriptionsChangedListener() {
- public void onSubscriptionInfoChanged() {
+ @Override
+ public void onSubscriptionsChanged() {
updateMobileControllers();
};
};
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 85c80ee..c37cf75 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -2452,6 +2452,15 @@
return -1;
}
+ // If an incoming call is ringing, HOME is totally disabled.
+ // (The user is already on the InCallUI at this point,
+ // and his ONLY options are to answer or reject the call.)
+ TelecomManager telecomManager = getTelecommService();
+ if (telecomManager != null && telecomManager.isRinging()) {
+ Log.i(TAG, "Ignoring HOME; there's a ringing incoming call.");
+ return -1;
+ }
+
// Delay handling home if a double-tap is possible.
if (mDoubleTapOnHomeBehavior != DOUBLE_TAP_HOME_NOTHING) {
mHandler.removeCallbacks(mHomeDoubleTapTimeoutRunnable); // just in case
@@ -6081,6 +6090,7 @@
if (denyTransientStatus || denyTransientNav) {
// clear the clearable flags instead
clearClearableFlagsLw();
+ vis &= ~View.SYSTEM_UI_CLEARABLE_FLAGS;
}
vis = mStatusBarController.updateVisibilityLw(transientStatusBarAllowed, oldVis, vis);
diff --git a/preloaded-classes b/preloaded-classes
index 7686431..dee84f0 100644
--- a/preloaded-classes
+++ b/preloaded-classes
@@ -2631,7 +2631,6 @@
javax.microedition.khronos.opengles.GL11ExtensionPack
javax.net.DefaultSocketFactory
javax.net.SocketFactory
-javax.net.ssl.DefaultHostnameVerifier
javax.net.ssl.DistinguishedNameParser
javax.net.ssl.HostnameVerifier
javax.net.ssl.HttpsURLConnection
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index ca376fd..32a6a2f 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -1521,6 +1521,8 @@
@Override
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
+ mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
+
writer.println("enabled: " + mEnable);
writer.println("state: " + mState);
writer.println("address: " + mAddress);
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 499cff3..b1f14a9 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -1048,7 +1048,7 @@
synchronized (nai) {
if (nai.created) {
NetworkCapabilities nc = new NetworkCapabilities(nai.networkCapabilities);
- if (nai.validated) {
+ if (nai.lastValidated) {
nc.addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
} else {
nc.removeCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
@@ -1954,17 +1954,18 @@
NetworkAgentInfo nai = (NetworkAgentInfo)msg.obj;
if (isLiveNetworkAgent(nai, "EVENT_NETWORK_VALIDATED")) {
boolean valid = (msg.arg1 == NetworkMonitor.NETWORK_TEST_RESULT_VALID);
+ nai.lastValidated = valid;
if (valid) {
if (DBG) log("Validated " + nai.name());
- if (!nai.validated) {
- nai.validated = true;
+ if (!nai.everValidated) {
+ nai.everValidated = true;
rematchNetworkAndRequests(nai, NascentState.JUST_VALIDATED,
ReapUnvalidatedNetworks.REAP);
// If score has changed, rebroadcast to NetworkFactories. b/17726566
sendUpdatedScoreToFactories(nai);
}
}
- updateInetCondition(nai, valid);
+ updateInetCondition(nai);
// Let the NetworkAgent know the state of its network
nai.asyncChannel.sendMessage(
android.net.NetworkAgent.CMD_REPORT_NETWORK_STATUS,
@@ -3949,6 +3950,7 @@
notifyLockdownVpn(newNetwork);
handleApplyDefaultProxy(newNetwork.linkProperties.getHttpProxy());
updateTcpBufferSizes(newNetwork);
+ setDefaultDnsSystemProperties(newNetwork.linkProperties.getDnsServers());
}
// Handles a network appearing or improving its score.
@@ -3983,11 +3985,12 @@
private void rematchNetworkAndRequests(NetworkAgentInfo newNetwork, NascentState nascent,
ReapUnvalidatedNetworks reapUnvalidatedNetworks) {
if (!newNetwork.created) return;
- if (nascent == NascentState.JUST_VALIDATED && !newNetwork.validated) {
+ if (nascent == NascentState.JUST_VALIDATED && !newNetwork.everValidated) {
loge("ERROR: nascent network not validated.");
}
boolean keep = newNetwork.isVPN();
boolean isNewDefault = false;
+ NetworkAgentInfo oldDefaultNetwork = null;
if (DBG) log("rematching " + newNetwork.name());
// Find and migrate to this Network any NetworkRequests for
// which this network is now the best.
@@ -4045,32 +4048,14 @@
sendUpdatedScoreToFactories(nri.request, newNetwork.getCurrentScore());
if (mDefaultRequest.requestId == nri.request.requestId) {
isNewDefault = true;
- // TODO: Remove following line. It's redundant with makeDefault call.
- if (newNetwork.linkProperties != null) {
- updateTcpBufferSizes(newNetwork);
- setDefaultDnsSystemProperties(
- newNetwork.linkProperties.getDnsServers());
- } else {
- setDefaultDnsSystemProperties(new ArrayList<InetAddress>());
- }
- // Maintain the illusion: since the legacy API only
- // understands one network at a time, we must pretend
- // that the current default network disconnected before
- // the new one connected.
- if (currentNetwork != null) {
- mLegacyTypeTracker.remove(currentNetwork.networkInfo.getType(),
- currentNetwork);
- }
- mDefaultInetConditionPublished = newNetwork.validated ? 100 : 0;
- mLegacyTypeTracker.add(newNetwork.networkInfo.getType(), newNetwork);
- notifyLockdownVpn(newNetwork);
+ oldDefaultNetwork = currentNetwork;
}
}
}
}
// Linger any networks that are no longer needed.
for (NetworkAgentInfo nai : affectedNetworks) {
- boolean teardown = !nai.isVPN() && nai.validated;
+ boolean teardown = !nai.isVPN() && nai.everValidated;
for (int i = 0; i < nai.networkRequests.size() && teardown; i++) {
NetworkRequest nr = nai.networkRequests.valueAt(i);
try {
@@ -4104,6 +4089,17 @@
1000);
}
}
+ // Maintain the illusion: since the legacy API only
+ // understands one network at a time, we must pretend
+ // that the current default network disconnected before
+ // the new one connected.
+ if (oldDefaultNetwork != null) {
+ mLegacyTypeTracker.remove(oldDefaultNetwork.networkInfo.getType(),
+ oldDefaultNetwork);
+ }
+ mDefaultInetConditionPublished = newNetwork.everValidated ? 100 : 0;
+ mLegacyTypeTracker.add(newNetwork.networkInfo.getType(), newNetwork);
+ notifyLockdownVpn(newNetwork);
}
// Notify battery stats service about this network, both the normal
@@ -4144,7 +4140,7 @@
}
if (reapUnvalidatedNetworks == ReapUnvalidatedNetworks.REAP) {
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
- if (!nai.created || nai.validated || nai.isVPN()) continue;
+ if (!nai.created || nai.everValidated || nai.isVPN()) continue;
boolean reap = true;
for (NetworkRequestInfo nri : mNetworkRequests.values()) {
// If this Network is already the highest scoring Network for a request, or if
@@ -4205,14 +4201,14 @@
}
}
- private void updateInetCondition(NetworkAgentInfo nai, boolean valid) {
+ private void updateInetCondition(NetworkAgentInfo nai) {
// Don't bother updating until we've graduated to validated at least once.
- if (!nai.validated) return;
+ if (!nai.everValidated) return;
// For now only update icons for default connection.
// TODO: Update WiFi and cellular icons separately. b/17237507
if (!isDefaultNetwork(nai)) return;
- int newInetCondition = valid ? 100 : 0;
+ int newInetCondition = nai.lastValidated ? 100 : 0;
// Don't repeat publish.
if (newInetCondition == mDefaultInetConditionPublished) return;
diff --git a/services/core/java/com/android/server/MmsServiceBroker.java b/services/core/java/com/android/server/MmsServiceBroker.java
index 83b1919..0de6a03 100644
--- a/services/core/java/com/android/server/MmsServiceBroker.java
+++ b/services/core/java/com/android/server/MmsServiceBroker.java
@@ -35,7 +35,7 @@
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.UserHandle;
-import android.provider.Telephony;
+import android.service.carrier.CarrierMessagingService;
import android.telephony.TelephonyManager;
import android.util.Slog;
@@ -230,7 +230,7 @@
return;
}
contentUri = adjustUriForUserAndGrantPermission(contentUri,
- Telephony.Mms.Intents.MMS_SEND_ACTION,
+ CarrierMessagingService.SERVICE_INTERFACE,
Intent.FLAG_GRANT_READ_URI_PERMISSION);
getServiceGuarded().sendMessage(subId, callingPkg, contentUri, locationUrl,
configOverrides, sentIntent);
@@ -248,7 +248,7 @@
return;
}
contentUri = adjustUriForUserAndGrantPermission(contentUri,
- Telephony.Mms.Intents.MMS_DOWNLOAD_ACTION,
+ CarrierMessagingService.SERVICE_INTERFACE,
Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
getServiceGuarded().downloadMessage(subId, callingPkg, locationUrl, contentUri,
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index 6c981c0..97879ed7 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -76,9 +76,8 @@
import com.android.server.pm.UserManagerService;
import com.google.android.collect.Lists;
import com.google.android.collect.Maps;
+import libcore.util.HexEncoding;
-import org.apache.commons.codec.binary.Hex;
-import org.apache.commons.codec.DecoderException;
import org.xmlpull.v1.XmlPullParserException;
import java.io.File;
@@ -2206,10 +2205,10 @@
private String toHex(String password) {
if (password == null) {
- return new String();
+ return "";
}
byte[] bytes = password.getBytes(StandardCharsets.UTF_8);
- return new String(Hex.encodeHex(bytes));
+ return new String(HexEncoding.encode(bytes));
}
private String fromHex(String hexPassword) {
@@ -2217,12 +2216,14 @@
return null;
}
+ final byte[] bytes;
try {
- byte[] bytes = Hex.decodeHex(hexPassword.toCharArray());
- return new String(bytes, StandardCharsets.UTF_8);
- } catch (DecoderException e) {
+ bytes = HexEncoding.decode(hexPassword.toCharArray(), false);
+ } catch (IllegalArgumentException e) {
return null;
}
+
+ return new String(bytes, StandardCharsets.UTF_8);
}
@Override
diff --git a/services/core/java/com/android/server/SystemConfig.java b/services/core/java/com/android/server/SystemConfig.java
index 92fbc1e..eb89f21 100644
--- a/services/core/java/com/android/server/SystemConfig.java
+++ b/services/core/java/com/android/server/SystemConfig.java
@@ -25,7 +25,11 @@
import android.util.Slog;
import android.util.SparseArray;
import android.util.Xml;
+
+import libcore.io.IoUtils;
+
import com.android.internal.util.XmlUtils;
+
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -60,6 +64,10 @@
// system configuration files.
final ArrayMap<String, FeatureInfo> mAvailableFeatures = new ArrayMap<>();
+ // These are the features which this device doesn't support; the OEM
+ // partition uses these to opt-out of features from the system image.
+ final ArraySet<String> mUnavailableFeatures = new ArraySet<>();
+
public static final class PermissionEntry {
public final String name;
public int[] gids;
@@ -145,9 +153,11 @@
}
// Iterate over the files in the directory and scan .xml files
+ File platformFile = null;
for (File f : libraryDir.listFiles()) {
// We'll read platform.xml last
if (f.getPath().endsWith("etc/permissions/platform.xml")) {
+ platformFile = f;
continue;
}
@@ -163,10 +173,10 @@
readPermissionsFromXml(f, onlyFeatures);
}
- // Read permissions from .../etc/permissions/platform.xml last so it will take precedence
- final File permFile = new File(Environment.getRootDirectory(),
- "etc/permissions/platform.xml");
- readPermissionsFromXml(permFile, onlyFeatures);
+ // Read platform permissions last so it will take precedence
+ if (platformFile != null) {
+ readPermissionsFromXml(platformFile, onlyFeatures);
+ }
}
private void readPermissionsFromXml(File permFile, boolean onlyFeatures) {
@@ -298,7 +308,18 @@
XmlUtils.skipCurrentTag(parser);
continue;
- } else if ("allow-in-power-save".equals(name)) {
+ } else if ("unavailable-feature".equals(name)) {
+ String fname = parser.getAttributeValue(null, "name");
+ if (fname == null) {
+ Slog.w(TAG, "<unavailable-feature> without name at "
+ + parser.getPositionDescription());
+ } else {
+ mUnavailableFeatures.add(fname);
+ }
+ XmlUtils.skipCurrentTag(parser);
+ continue;
+
+ } else if ("allow-in-power-save".equals(name) && !onlyFeatures) {
String pkgname = parser.getAttributeValue(null, "package");
if (pkgname == null) {
Slog.w(TAG, "<allow-in-power-save> without package at "
@@ -309,7 +330,7 @@
XmlUtils.skipCurrentTag(parser);
continue;
- } else if ("fixed-ime-app".equals(name)) {
+ } else if ("fixed-ime-app".equals(name) && !onlyFeatures) {
String pkgname = parser.getAttributeValue(null, "package");
if (pkgname == null) {
Slog.w(TAG, "<fixed-ime-app> without package at "
@@ -324,13 +345,19 @@
XmlUtils.skipCurrentTag(parser);
continue;
}
-
}
- permReader.close();
} catch (XmlPullParserException e) {
- Slog.w(TAG, "Got execption parsing permissions.", e);
+ Slog.w(TAG, "Got exception parsing permissions.", e);
} catch (IOException e) {
- Slog.w(TAG, "Got execption parsing permissions.", e);
+ Slog.w(TAG, "Got exception parsing permissions.", e);
+ } finally {
+ IoUtils.closeQuietly(permReader);
+ }
+
+ for (String fname : mUnavailableFeatures) {
+ if (mAvailableFeatures.remove(fname) != null) {
+ Slog.d(TAG, "Removed unavailable feature " + fname);
+ }
}
}
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index 776f836..72c2eaf 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -620,7 +620,11 @@
final int recordCount = mRecords.size();
for (int i = 0; i < recordCount; i++) {
if (mRecords.get(i).binder == binder) {
- if (VDBG) log("remove: binder=" + binder);
+ if (DBG) {
+ Record r = mRecords.get(i);
+ log("remove: binder=" + binder + "r.pkgForDebug" + r.pkgForDebug
+ + "r.callback" + r.callback);
+ }
mRecords.remove(i);
return;
}
@@ -954,7 +958,7 @@
+ " state=" + state + " isDataConnectivityPossible=" + isDataConnectivityPossible
+ " reason='" + reason
+ "' apn='" + apn + "' apnType=" + apnType + " networkType=" + networkType
- + " mRecords.size()=" + mRecords.size() + " mRecords=" + mRecords);
+ + " mRecords.size()=" + mRecords.size());
}
synchronized (mRecords) {
int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1558,11 +1562,12 @@
}
boolean idMatch(int rSubId, int subId, int phoneId) {
+
+ if(subId < 0) {
+ // Invalid case, we need compare phoneId with default one.
+ return (mDefaultPhoneId == phoneId);
+ }
if(rSubId == SubscriptionManager.DEFAULT_SUBSCRIPTION_ID) {
- if(subId < 0) {
- // Invalid case, we need compare phoneId with default one.
- return (mDefaultPhoneId == phoneId);
- }
return (subId == mDefaultSubId);
} else {
return (rSubId == subId);
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 363f0e3..8d75952 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -480,6 +480,10 @@
}
mStacks.remove(this);
mStacks.add(this);
+ final TaskRecord task = topTask();
+ if (task != null) {
+ mWindowManager.moveTaskToTop(task.taskId);
+ }
}
}
@@ -3480,11 +3484,10 @@
return;
}
- moveToFront();
-
// Shift all activities with this task up to the top
// of the stack, keeping them in the same internal order.
insertTaskAtTop(tr);
+ moveToFront();
if (DEBUG_TRANSITION) Slog.v(TAG, "Prepare to front transition: task=" + tr);
if (reason != null &&
@@ -3499,8 +3502,6 @@
updateTransitLocked(AppTransition.TRANSIT_TASK_TO_FRONT, options);
}
- mWindowManager.moveTaskToTop(tr.taskId);
-
mStackSupervisor.resumeTopActivitiesLocked();
EventLog.writeEvent(EventLogTags.AM_TASK_TO_FRONT, tr.userId, tr.taskId);
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 466eede..f164a7c 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2075,8 +2075,6 @@
final TaskRecord topTask = targetStack.topTask();
if (topTask != sourceTask) {
targetStack.moveTaskToFrontLocked(sourceTask, r, options);
- } else {
- mWindowManager.moveTaskToTop(topTask.taskId);
}
if (!addingToTask && (launchFlags&Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
// In this case, we are adding the activity to an existing
@@ -2131,8 +2129,6 @@
}
targetStack = inTask.stack;
targetStack.moveTaskToFrontLocked(inTask, r, options);
- targetStack.moveToFront();
- mWindowManager.moveTaskToTop(inTask.taskId);
// Check whether we should actually launch the new activity in to the task,
// or just reuse the current activity on top.
diff --git a/services/core/java/com/android/server/am/ProcessStatsService.java b/services/core/java/com/android/server/am/ProcessStatsService.java
index 55aec65..9634dff 100644
--- a/services/core/java/com/android/server/am/ProcessStatsService.java
+++ b/services/core/java/com/android/server/am/ProcessStatsService.java
@@ -445,14 +445,14 @@
mAm.mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.PACKAGE_USAGE_STATS, null);
Parcel current = Parcel.obtain();
+ synchronized (mAm) {
+ long now = SystemClock.uptimeMillis();
+ mProcessStats.mTimePeriodEndRealtime = SystemClock.elapsedRealtime();
+ mProcessStats.mTimePeriodEndUptime = now;
+ mProcessStats.writeToParcel(current, now, 0);
+ }
mWriteLock.lock();
try {
- synchronized (mAm) {
- long now = SystemClock.uptimeMillis();
- mProcessStats.mTimePeriodEndRealtime = SystemClock.elapsedRealtime();
- mProcessStats.mTimePeriodEndUptime = now;
- mProcessStats.writeToParcel(current, now, 0);
- }
if (historic != null) {
ArrayList<String> files = getCommittedFiles(0, false, true);
if (files != null) {
@@ -476,18 +476,18 @@
public ParcelFileDescriptor getStatsOverTime(long minTime) {
mAm.mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.PACKAGE_USAGE_STATS, null);
+ Parcel current = Parcel.obtain();
+ long curTime;
+ synchronized (mAm) {
+ long now = SystemClock.uptimeMillis();
+ mProcessStats.mTimePeriodEndRealtime = SystemClock.elapsedRealtime();
+ mProcessStats.mTimePeriodEndUptime = now;
+ mProcessStats.writeToParcel(current, now, 0);
+ curTime = mProcessStats.mTimePeriodEndRealtime
+ - mProcessStats.mTimePeriodStartRealtime;
+ }
mWriteLock.lock();
try {
- Parcel current = Parcel.obtain();
- long curTime;
- synchronized (mAm) {
- long now = SystemClock.uptimeMillis();
- mProcessStats.mTimePeriodEndRealtime = SystemClock.elapsedRealtime();
- mProcessStats.mTimePeriodEndUptime = now;
- mProcessStats.writeToParcel(current, now, 0);
- curTime = mProcessStats.mTimePeriodEndRealtime
- - mProcessStats.mTimePeriodStartRealtime;
- }
if (curTime < minTime) {
// Need to add in older stats to reach desired time.
ArrayList<String> files = getCommittedFiles(0, false, true);
diff --git a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
index 779a834..f3e0bbc 100644
--- a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
+++ b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
@@ -53,7 +53,14 @@
// default NetworkRequest in which case validation will not be attempted.
// NOTE: This is a sticky bit; once set it is never cleared even if future validation attempts
// fail.
- public boolean validated;
+ public boolean everValidated;
+
+ // The result of the last validation attempt on this network (true if validated, false if not).
+ // This bit exists only because we never unvalidate a network once it's been validated, and that
+ // is because the network scoring and revalidation code does not (may not?) deal properly with
+ // networks becoming unvalidated.
+ // TODO: Fix the network scoring code, remove this, and rename everValidated to validated.
+ public boolean lastValidated;
// This represents the last score received from the NetworkAgent.
private int currentScore;
@@ -89,7 +96,8 @@
networkMonitor = new NetworkMonitor(context, handler, this, defaultRequest);
networkMisc = misc;
created = false;
- validated = false;
+ everValidated = false;
+ lastValidated = false;
}
public void addRequest(NetworkRequest networkRequest) {
@@ -114,7 +122,7 @@
int score = currentScore;
- if (!validated && !pretendValidated) score -= UNVALIDATED_SCORE_PENALTY;
+ if (!everValidated && !pretendValidated) score -= UNVALIDATED_SCORE_PENALTY;
if (score < 0) score = 0;
if (networkMisc.explicitlySelected) score = EXPLICITLY_SELECTED_NETWORK_SCORE;
@@ -142,8 +150,9 @@
return "NetworkAgentInfo{ ni{" + networkInfo + "} network{" +
network + "} lp{" +
linkProperties + "} nc{" +
- networkCapabilities + "} Score{" + getCurrentScore() + "} " +
- "validated{" + validated + "} created{" + created + "} " +
+ networkCapabilities + "} Score{" + getCurrentScore() + "} " +
+ "everValidated{" + everValidated + "} lastValidated{" + lastValidated + "} " +
+ "created{" + created + "} " +
"explicitlySelected{" + networkMisc.explicitlySelected + "} }";
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecController.java b/services/core/java/com/android/server/hdmi/HdmiCecController.java
index 1486fee..55917fc 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecController.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecController.java
@@ -331,12 +331,13 @@
/**
* Configure ARC circuit in the hardware logic to start or stop the feature.
*
+ * @param port ID of HDMI port to which AVR is connected
* @param enabled whether to enable/disable ARC
*/
@ServiceThreadOnly
- void setAudioReturnChannel(boolean enabled) {
+ void setAudioReturnChannel(int port, boolean enabled) {
assertRunOnServiceThread();
- nativeSetAudioReturnChannel(mNativePtr, enabled);
+ nativeSetAudioReturnChannel(mNativePtr, port, enabled);
}
/**
@@ -633,6 +634,6 @@
private static native int nativeGetVendorId(long controllerPtr);
private static native HdmiPortInfo[] nativeGetPortInfos(long controllerPtr);
private static native void nativeSetOption(long controllerPtr, int flag, int value);
- private static native void nativeSetAudioReturnChannel(long controllerPtr, boolean flag);
+ private static native void nativeSetAudioReturnChannel(long controllerPtr, int port, boolean flag);
private static native boolean nativeIsConnected(long controllerPtr, int port);
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
index 62de534..e6990c6 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
@@ -827,7 +827,7 @@
HdmiLogger.debug("Set Arc Status[old:%b new:%b]", mArcEstablished, enabled);
boolean oldStatus = mArcEstablished;
// 1. Enable/disable ARC circuit.
- mService.setAudioReturnChannel(enabled);
+ mService.setAudioReturnChannel(getAvrDeviceInfo().getPortId(), enabled);
// 2. Notify arc status to audio service.
notifyArcStatusToAudioService(enabled);
// 3. Update arc status;
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 0322ae6..8ce6caf 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -756,8 +756,8 @@
return dispatchMessageToLocalDevice(message);
}
- void setAudioReturnChannel(boolean enabled) {
- mCecController.setAudioReturnChannel(enabled);
+ void setAudioReturnChannel(int portId, boolean enabled) {
+ mCecController.setAudioReturnChannel(portId, enabled);
}
@ServiceThreadOnly
diff --git a/services/core/java/com/android/server/media/MediaSessionRecord.java b/services/core/java/com/android/server/media/MediaSessionRecord.java
index 7147036..b5deda2 100644
--- a/services/core/java/com/android/server/media/MediaSessionRecord.java
+++ b/services/core/java/com/android/server/media/MediaSessionRecord.java
@@ -261,41 +261,59 @@
if (mUseMasterVolume) {
// If this device only uses master volume and playback is local
// just adjust the master volume and return.
+ boolean isMasterMute = mAudioManager.isMasterMute();
if (isMute) {
- mAudioManagerInternal.setMasterMuteForUid(!mAudioManager.isMasterMute(),
+ mAudioManagerInternal.setMasterMuteForUid(!isMasterMute,
flags, packageName, mICallback, uid);
} else {
mAudioManagerInternal.adjustMasterVolumeForUid(direction, flags, packageName,
uid);
+ if (isMasterMute) {
+ mAudioManagerInternal.setMasterMuteForUid(false,
+ flags, packageName, mICallback, uid);
+ }
}
return;
}
int stream = AudioAttributes.toLegacyStreamType(mAudioAttrs);
+ boolean isStreamMute = mAudioManager.isStreamMute(stream);
if (useSuggested) {
if (AudioSystem.isStreamActive(stream, 0)) {
if (isMute) {
- mAudioManager.setStreamMute(stream, !mAudioManager.isStreamMute(stream));
+ mAudioManager.setStreamMute(stream, !isStreamMute);
} else {
mAudioManagerInternal.adjustSuggestedStreamVolumeForUid(stream, direction,
flags, packageName, uid);
+ if (isStreamMute) {
+ mAudioManager.setStreamMute(stream, false);
+ }
}
} else {
flags |= previousFlagPlaySound;
+ isStreamMute =
+ mAudioManager.isStreamMute(AudioManager.USE_DEFAULT_STREAM_TYPE);
if (isMute) {
mAudioManager.setStreamMute(AudioManager.USE_DEFAULT_STREAM_TYPE,
- !mAudioManager.isStreamMute(AudioManager.USE_DEFAULT_STREAM_TYPE));
+ !isStreamMute);
} else {
mAudioManagerInternal.adjustSuggestedStreamVolumeForUid(
AudioManager.USE_DEFAULT_STREAM_TYPE, direction, flags, packageName,
uid);
+ if (isStreamMute) {
+ mAudioManager.setStreamMute(AudioManager.USE_DEFAULT_STREAM_TYPE,
+ false);
+ }
}
}
} else {
if (isMute) {
- mAudioManager.setStreamMute(stream, !mAudioManager.isStreamMute(stream));
+ mAudioManager.setStreamMute(stream, !isStreamMute);
} else {
mAudioManagerInternal.adjustStreamVolumeForUid(stream, direction, flags,
packageName, uid);
+ if (isStreamMute) {
+ mAudioManager.setStreamMute(stream, false);
+ }
}
}
} else {
diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java
index b4ec607..82be1bb 100644
--- a/services/core/java/com/android/server/media/MediaSessionService.java
+++ b/services/core/java/com/android/server/media/MediaSessionService.java
@@ -829,21 +829,27 @@
return;
}
try {
+ String packageName = getContext().getOpPackageName();
if (mUseMasterVolume) {
+ boolean isMasterMute = mAudioService.isMasterMute();
if (direction == MediaSessionManager.DIRECTION_MUTE) {
- mAudioService.setMasterMute(!mAudioService.isMasterMute(), flags,
- getContext().getOpPackageName(), mICallback);
+ mAudioService.setMasterMute(!isMasterMute, flags, packageName, mICallback);
} else {
- mAudioService.adjustMasterVolume(direction, flags,
- getContext().getOpPackageName());
+ mAudioService.adjustMasterVolume(direction, flags, packageName);
+ if (isMasterMute) {
+ mAudioService.setMasterMute(false, flags, packageName, mICallback);
+ }
}
} else {
+ boolean isStreamMute = mAudioService.isStreamMute(suggestedStream);
if (direction == MediaSessionManager.DIRECTION_MUTE) {
- mAudioService.setStreamMute(suggestedStream,
- !mAudioService.isStreamMute(suggestedStream), mICallback);
+ mAudioService.setStreamMute(suggestedStream, !isStreamMute, mICallback);
} else {
mAudioService.adjustSuggestedStreamVolume(direction, suggestedStream,
- flags, getContext().getOpPackageName());
+ flags, packageName);
+ if (isStreamMute) {
+ mAudioService.setStreamMute(suggestedStream, false, mICallback);
+ }
}
}
} catch (RemoteException e) {
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 650f0e2..825627f 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -927,7 +927,7 @@
Settings.Global.DEVICE_PROVISIONED, 0)) {
mDisableNotificationEffects = true;
}
- mZenModeHelper.updateZenMode();
+ mZenModeHelper.readZenModeFromSetting();
mUserProfiles.updateCache(getContext());
listenForCallState();
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index 0f9a59b..841fc21 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -221,21 +221,26 @@
}
public void setZenMode(int zenMode, String reason) {
- ZenLog.traceSetZenMode(zenMode, reason);
- Global.putInt(mContext.getContentResolver(), Global.ZEN_MODE, zenMode);
+ setZenMode(zenMode, reason, true);
}
- public void updateZenMode() {
- final int oldMode = mZenMode;
+ private void setZenMode(int zenMode, String reason, boolean setRingerMode) {
+ ZenLog.traceSetZenMode(zenMode, reason);
+ if (mZenMode == zenMode) return;
+ ZenLog.traceUpdateZenMode(mZenMode, zenMode);
+ mZenMode = zenMode;
+ Global.putInt(mContext.getContentResolver(), Global.ZEN_MODE, mZenMode);
+ if (setRingerMode) {
+ applyZenToRingerMode();
+ }
+ applyRestrictions();
+ mHandler.postDispatchOnZenModeChanged();
+ }
+
+ public void readZenModeFromSetting() {
final int newMode = Global.getInt(mContext.getContentResolver(),
Global.ZEN_MODE, Global.ZEN_MODE_OFF);
- if (oldMode != newMode) {
- ZenLog.traceUpdateZenMode(oldMode, newMode);
- }
- mZenMode = newMode;
- applyRestrictions();
- onZenUpdated(oldMode, newMode);
- dispatchOnZenModeChanged();
+ setZenMode(newMode, "setting");
}
private void applyRestrictions() {
@@ -297,18 +302,16 @@
dispatchOnConfigChanged();
final String val = Integer.toString(mConfig.hashCode());
Global.putString(mContext.getContentResolver(), Global.ZEN_MODE_CONFIG_ETAG, val);
- updateZenMode();
+ applyRestrictions();
return true;
}
- private void onZenUpdated(int oldZen, int newZen) {
+ private void applyZenToRingerMode() {
if (mAudioManager == null) return;
- if (oldZen == newZen) return;
-
// force the ringer mode into compliance
final int ringerModeInternal = mAudioManager.getRingerModeInternal();
int newRingerModeInternal = ringerModeInternal;
- switch (newZen) {
+ switch (mZenMode) {
case Global.ZEN_MODE_NO_INTERRUPTIONS:
if (ringerModeInternal != AudioManager.RINGER_MODE_SILENT) {
mPreviousRingerMode = ringerModeInternal;
@@ -337,7 +340,7 @@
int ringerModeExternalOut = ringerModeNew;
int newZen = -1;
- switch(ringerModeNew) {
+ switch (ringerModeNew) {
case AudioManager.RINGER_MODE_SILENT:
if (isChange) {
if (mZenMode != Global.ZEN_MODE_NO_INTERRUPTIONS) {
@@ -356,7 +359,7 @@
break;
}
if (newZen != -1) {
- mHandler.postSetZenMode(newZen, "ringerModeInternal");
+ setZenMode(newZen, "ringerModeInternal", false /*setRingerMode*/);
}
if (isChange || newZen != -1 || ringerModeExternal != ringerModeExternalOut) {
@@ -374,7 +377,7 @@
final boolean isVibrate = ringerModeInternal == AudioManager.RINGER_MODE_VIBRATE;
int newZen = -1;
- switch(ringerModeNew) {
+ switch (ringerModeNew) {
case AudioManager.RINGER_MODE_SILENT:
if (isChange) {
if (mZenMode == Global.ZEN_MODE_OFF) {
@@ -394,7 +397,7 @@
break;
}
if (newZen != -1) {
- mHandler.postSetZenMode(newZen, "ringerModeExternal");
+ setZenMode(newZen, "ringerModeExternal", false /*setRingerMode*/);
}
ZenLog.traceSetRingerModeExternal(ringerModeOld, ringerModeNew, caller, ringerModeInternal,
@@ -516,27 +519,28 @@
public void update(Uri uri) {
if (ZEN_MODE.equals(uri)) {
- updateZenMode();
+ readZenModeFromSetting();
}
}
}
private class H extends Handler {
- private static final int MSG_SET_ZEN = 1;
+ private static final int MSG_DISPATCH = 1;
private H(Looper looper) {
super(looper);
}
- private void postSetZenMode(int zen, String reason) {
- obtainMessage(MSG_SET_ZEN, zen, 0, reason).sendToTarget();
+ private void postDispatchOnZenModeChanged() {
+ removeMessages(MSG_DISPATCH);
+ sendEmptyMessage(MSG_DISPATCH);
}
@Override
public void handleMessage(Message msg) {
- switch(msg.what) {
- case MSG_SET_ZEN:
- setZenMode(msg.arg1, (String) msg.obj);
+ switch (msg.what) {
+ case MSG_DISPATCH:
+ dispatchOnZenModeChanged();
break;
}
}
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 4d1ab4c..9786b42 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -2375,9 +2375,9 @@
//
// This preparation can take more than 20 seconds if
// there's a very large update package, so lengthen the
- // timeout.
+ // timeout. We have seen 750MB packages take 3-4 minutes
SystemProperties.set("ctl.start", "pre-recovery");
- duration = 120 * 1000L;
+ duration = 300 * 1000L;
} else {
SystemProperties.set("sys.powerctl", "reboot," + reason);
duration = 20 * 1000L;
diff --git a/services/core/java/com/android/server/tv/TvInputHal.java b/services/core/java/com/android/server/tv/TvInputHal.java
index c12dd63..de271b8 100644
--- a/services/core/java/com/android/server/tv/TvInputHal.java
+++ b/services/core/java/com/android/server/tv/TvInputHal.java
@@ -20,6 +20,7 @@
import android.media.tv.TvStreamConfig;
import android.os.Handler;
import android.os.Message;
+import android.os.MessageQueue;
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseIntArray;
@@ -53,7 +54,7 @@
public void onFirstFrameCaptured(int deviceId, int streamId);
}
- private native long nativeOpen();
+ private native long nativeOpen(MessageQueue queue);
private static native int nativeAddOrUpdateStream(long ptr, int deviceId, int streamId,
Surface surface);
@@ -76,7 +77,7 @@
public void init() {
synchronized (mLock) {
- mPtr = nativeOpen();
+ mPtr = nativeOpen(mHandler.getLooper().getQueue());
}
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index b0feca8..b8078fb 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -241,6 +241,7 @@
mTouchExcludeRegion.op(mTmpRect, Region.Op.DIFFERENCE);
}
}
+ mTapDetector.setTouchExcludeRegion(mTouchExcludeRegion);
}
void switchUserStacks(int newUserId) {
diff --git a/services/core/java/com/android/server/wm/StackTapPointerEventListener.java b/services/core/java/com/android/server/wm/StackTapPointerEventListener.java
index 80eb453..1a85993 100644
--- a/services/core/java/com/android/server/wm/StackTapPointerEventListener.java
+++ b/services/core/java/com/android/server/wm/StackTapPointerEventListener.java
@@ -31,7 +31,7 @@
private float mDownX;
private float mDownY;
private int mPointerId;
- final private Region mTouchExcludeRegion;
+ final private Region mTouchExcludeRegion = new Region();
private final WindowManagerService mService;
private final DisplayContent mDisplayContent;
@@ -39,7 +39,6 @@
DisplayContent displayContent) {
mService = service;
mDisplayContent = displayContent;
- mTouchExcludeRegion = displayContent.mTouchExcludeRegion;
DisplayInfo info = displayContent.getDisplayInfo();
mMotionSlop = (int)(info.logicalDensityDpi * TAP_MOTION_SLOP_INCHES);
}
@@ -72,13 +71,15 @@
if (mPointerId == motionEvent.getPointerId(index)) {
final int x = (int)motionEvent.getX(index);
final int y = (int)motionEvent.getY(index);
- if ((motionEvent.getEventTime() - motionEvent.getDownTime())
- < TAP_TIMEOUT_MSEC
- && Math.abs(x - mDownX) < mMotionSlop
- && Math.abs(y - mDownY) < mMotionSlop
- && !mTouchExcludeRegion.contains(x, y)) {
- mService.mH.obtainMessage(H.TAP_OUTSIDE_STACK, x, y,
- mDisplayContent).sendToTarget();
+ synchronized(this) {
+ if ((motionEvent.getEventTime() - motionEvent.getDownTime())
+ < TAP_TIMEOUT_MSEC
+ && Math.abs(x - mDownX) < mMotionSlop
+ && Math.abs(y - mDownY) < mMotionSlop
+ && !mTouchExcludeRegion.contains(x, y)) {
+ mService.mH.obtainMessage(H.TAP_OUTSIDE_STACK, x, y,
+ mDisplayContent).sendToTarget();
+ }
}
mPointerId = -1;
}
@@ -86,4 +87,10 @@
}
}
}
+
+ void setTouchExcludeRegion(Region newRegion) {
+ synchronized (this) {
+ mTouchExcludeRegion.set(newRegion);
+ }
+ }
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 1970e11..8ed6a31 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -8898,7 +8898,8 @@
if (!gone || !win.mHaveFrame || win.mLayoutNeeded
|| ((win.isConfigChanged() || win.setInsetsChanged()) &&
((win.mAttrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0 ||
- win.mAppToken != null && win.mAppToken.layoutConfigChanges))
+ (win.mHasSurface && win.mAppToken != null &&
+ win.mAppToken.layoutConfigChanges)))
|| win.mAttrs.type == TYPE_UNIVERSE_BACKGROUND) {
if (!win.mLayoutAttached) {
if (initial) {
diff --git a/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp b/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp
index 4a08b2d..f2d0f06 100644
--- a/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp
+++ b/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp
@@ -62,7 +62,7 @@
// Set a flag and its value.
void setOption(int flag, int value);
// Set audio return channel status.
- void setAudioReturnChannel(bool flag);
+ void setAudioReturnChannel(int port, bool flag);
// Whether to hdmi device is connected to the given port.
bool isConnected(int port);
@@ -260,8 +260,8 @@
}
// Set audio return channel status.
-void HdmiCecController::setAudioReturnChannel(bool enabled) {
- mDevice->set_audio_return_channel(mDevice, enabled ? 1 : 0);
+ void HdmiCecController::setAudioReturnChannel(int port, bool enabled) {
+ mDevice->set_audio_return_channel(mDevice, port, enabled ? 1 : 0);
}
// Whether to hdmi device is connected to the given port.
@@ -374,9 +374,9 @@
}
static void nativeSetAudioReturnChannel(JNIEnv* env, jclass clazz, jlong controllerPtr,
- jboolean enabled) {
+ jint port, jboolean enabled) {
HdmiCecController* controller = reinterpret_cast<HdmiCecController*>(controllerPtr);
- controller->setAudioReturnChannel(enabled == JNI_TRUE);
+ controller->setAudioReturnChannel(port, enabled == JNI_TRUE);
}
static jboolean nativeIsConnected(JNIEnv* env, jclass clazz, jlong controllerPtr, jint port) {
@@ -399,7 +399,7 @@
"(J)[Landroid/hardware/hdmi/HdmiPortInfo;",
(void *) nativeGetPortInfos },
{ "nativeSetOption", "(JII)V", (void *) nativeSetOption },
- { "nativeSetAudioReturnChannel", "(JZ)V", (void *) nativeSetAudioReturnChannel },
+ { "nativeSetAudioReturnChannel", "(JIZ)V", (void *) nativeSetAudioReturnChannel },
{ "nativeIsConnected", "(JI)Z", (void *) nativeIsConnected },
};
diff --git a/services/core/jni/com_android_server_tv_TvInputHal.cpp b/services/core/jni/com_android_server_tv_TvInputHal.cpp
index 8292e0d..c0e4d32 100644
--- a/services/core/jni/com_android_server_tv_TvInputHal.cpp
+++ b/services/core/jni/com_android_server_tv_TvInputHal.cpp
@@ -18,6 +18,7 @@
//#define LOG_NDEBUG 0
+#include "android_os_MessageQueue.h"
#include "android_runtime/AndroidRuntime.h"
#include "android_runtime/android_view_Surface.h"
#include "JNIHelp.h"
@@ -27,6 +28,7 @@
#include <utils/Errors.h>
#include <utils/KeyedVector.h>
#include <utils/Log.h>
+#include <utils/Looper.h>
#include <utils/NativeHandle.h>
#include <hardware/tv_input.h>
@@ -233,12 +235,17 @@
public:
~JTvInputHal();
- static JTvInputHal* createInstance(JNIEnv* env, jobject thiz);
+ static JTvInputHal* createInstance(JNIEnv* env, jobject thiz, const sp<Looper>& looper);
int addOrUpdateStream(int deviceId, int streamId, const sp<Surface>& surface);
int removeStream(int deviceId, int streamId);
const tv_stream_config_t* getStreamConfigs(int deviceId, int* numConfigs);
+ void onDeviceAvailable(const tv_input_device_info_t& info);
+ void onDeviceUnavailable(int deviceId);
+ void onStreamConfigurationsChanged(int deviceId);
+ void onCaptured(int deviceId, int streamId, uint32_t seq, bool succeeded);
+
private:
// Connection between a surface and a stream.
class Connection {
@@ -254,28 +261,37 @@
sp<BufferProducerThread> mThread;
};
- JTvInputHal(JNIEnv* env, jobject thiz, tv_input_device_t* dev);
+ class NotifyHandler : public MessageHandler {
+ public:
+ NotifyHandler(JTvInputHal* hal, const tv_input_event_t* event);
+
+ virtual void handleMessage(const Message& message);
+
+ private:
+ tv_input_event_t mEvent;
+ JTvInputHal* mHal;
+ };
+
+ JTvInputHal(JNIEnv* env, jobject thiz, tv_input_device_t* dev, const sp<Looper>& looper);
static void notify(
tv_input_device_t* dev, tv_input_event_t* event, void* data);
- void onDeviceAvailable(const tv_input_device_info_t& info);
- void onDeviceUnavailable(int deviceId);
- void onStreamConfigurationsChanged(int deviceId);
- void onCaptured(int deviceId, int streamId, uint32_t seq, bool succeeded);
-
Mutex mLock;
jweak mThiz;
tv_input_device_t* mDevice;
tv_input_callback_ops_t mCallback;
+ sp<Looper> mLooper;
KeyedVector<int, KeyedVector<int, Connection> > mConnections;
};
-JTvInputHal::JTvInputHal(JNIEnv* env, jobject thiz, tv_input_device_t* device) {
+JTvInputHal::JTvInputHal(JNIEnv* env, jobject thiz, tv_input_device_t* device,
+ const sp<Looper>& looper) {
mThiz = env->NewWeakGlobalRef(thiz);
mDevice = device;
mCallback.notify = &JTvInputHal::notify;
+ mLooper = looper;
mDevice->initialize(mDevice, &mCallback, this);
}
@@ -288,7 +304,7 @@
mThiz = NULL;
}
-JTvInputHal* JTvInputHal::createInstance(JNIEnv* env, jobject thiz) {
+JTvInputHal* JTvInputHal::createInstance(JNIEnv* env, jobject thiz, const sp<Looper>& looper) {
tv_input_module_t* module = NULL;
status_t err = hw_get_module(TV_INPUT_HARDWARE_MODULE_ID,
(hw_module_t const**)&module);
@@ -309,7 +325,7 @@
return 0;
}
- return new JTvInputHal(env, thiz, device);
+ return new JTvInputHal(env, thiz, device, looper);
}
int JTvInputHal::addOrUpdateStream(int deviceId, int streamId, const sp<Surface>& surface) {
@@ -428,31 +444,7 @@
void JTvInputHal::notify(
tv_input_device_t* dev, tv_input_event_t* event, void* data) {
JTvInputHal* thiz = (JTvInputHal*)data;
- switch (event->type) {
- case TV_INPUT_EVENT_DEVICE_AVAILABLE: {
- thiz->onDeviceAvailable(event->device_info);
- } break;
- case TV_INPUT_EVENT_DEVICE_UNAVAILABLE: {
- thiz->onDeviceUnavailable(event->device_info.device_id);
- } break;
- case TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED: {
- thiz->onStreamConfigurationsChanged(event->device_info.device_id);
- } break;
- case TV_INPUT_EVENT_CAPTURE_SUCCEEDED: {
- thiz->onCaptured(event->capture_result.device_id,
- event->capture_result.stream_id,
- event->capture_result.seq,
- true /* succeeded */);
- } break;
- case TV_INPUT_EVENT_CAPTURE_FAILED: {
- thiz->onCaptured(event->capture_result.device_id,
- event->capture_result.stream_id,
- event->capture_result.seq,
- false /* succeeded */);
- } break;
- default:
- ALOGE("Unrecognizable event");
- }
+ thiz->mLooper->sendMessage(new NotifyHandler(thiz, event), event->type);
}
void JTvInputHal::onDeviceAvailable(const tv_input_device_info_t& info) {
@@ -549,10 +541,45 @@
}
}
+JTvInputHal::NotifyHandler::NotifyHandler(JTvInputHal* hal, const tv_input_event_t* event) {
+ mHal = hal;
+ memcpy(&mEvent, event, sizeof(mEvent));
+}
+
+void JTvInputHal::NotifyHandler::handleMessage(const Message& message) {
+ switch (mEvent.type) {
+ case TV_INPUT_EVENT_DEVICE_AVAILABLE: {
+ mHal->onDeviceAvailable(mEvent.device_info);
+ } break;
+ case TV_INPUT_EVENT_DEVICE_UNAVAILABLE: {
+ mHal->onDeviceUnavailable(mEvent.device_info.device_id);
+ } break;
+ case TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED: {
+ mHal->onStreamConfigurationsChanged(mEvent.device_info.device_id);
+ } break;
+ case TV_INPUT_EVENT_CAPTURE_SUCCEEDED: {
+ mHal->onCaptured(mEvent.capture_result.device_id,
+ mEvent.capture_result.stream_id,
+ mEvent.capture_result.seq,
+ true /* succeeded */);
+ } break;
+ case TV_INPUT_EVENT_CAPTURE_FAILED: {
+ mHal->onCaptured(mEvent.capture_result.device_id,
+ mEvent.capture_result.stream_id,
+ mEvent.capture_result.seq,
+ false /* succeeded */);
+ } break;
+ default:
+ ALOGE("Unrecognizable event");
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
-static jlong nativeOpen(JNIEnv* env, jobject thiz) {
- return (jlong)JTvInputHal::createInstance(env, thiz);
+static jlong nativeOpen(JNIEnv* env, jobject thiz, jobject messageQueueObj) {
+ sp<MessageQueue> messageQueue =
+ android_os_MessageQueue_getMessageQueue(env, messageQueueObj);
+ return (jlong)JTvInputHal::createInstance(env, thiz, messageQueue->getLooper());
}
static int nativeAddOrUpdateStream(JNIEnv* env, jclass clazz,
@@ -610,7 +637,7 @@
static JNINativeMethod gTvInputHalMethods[] = {
/* name, signature, funcPtr */
- { "nativeOpen", "()J",
+ { "nativeOpen", "(Landroid/os/MessageQueue;)J",
(void*) nativeOpen },
{ "nativeAddOrUpdateStream", "(JIILandroid/view/Surface;)I",
(void*) nativeAddOrUpdateStream },
diff --git a/services/usb/java/com/android/server/usb/UsbAudioManager.java b/services/usb/java/com/android/server/usb/UsbAlsaManager.java
similarity index 98%
rename from services/usb/java/com/android/server/usb/UsbAudioManager.java
rename to services/usb/java/com/android/server/usb/UsbAlsaManager.java
index 4142032..6cc8ff5 100644
--- a/services/usb/java/com/android/server/usb/UsbAudioManager.java
+++ b/services/usb/java/com/android/server/usb/UsbAlsaManager.java
@@ -39,10 +39,10 @@
import java.util.HashMap;
/**
- * UsbAudioManager manages USB audio devices.
+ * UsbAlsaManager manages USB audio and MIDI devices.
*/
-public class UsbAudioManager {
- private static final String TAG = UsbAudioManager.class.getSimpleName();
+public class UsbAlsaManager {
+ private static final String TAG = UsbAlsaManager.class.getSimpleName();
private static final boolean DEBUG = false;
private static final String ALSA_DIRECTORY = "/dev/snd/";
@@ -132,7 +132,7 @@
}
};
- /* package */ UsbAudioManager(Context context) {
+ /* package */ UsbAlsaManager(Context context) {
mContext = context;
}
diff --git a/services/usb/java/com/android/server/usb/UsbHostManager.java b/services/usb/java/com/android/server/usb/UsbHostManager.java
index 2fc8fd3..cd0f41a 100644
--- a/services/usb/java/com/android/server/usb/UsbHostManager.java
+++ b/services/usb/java/com/android/server/usb/UsbHostManager.java
@@ -60,7 +60,7 @@
private ArrayList<UsbInterface> mNewInterfaces;
private ArrayList<UsbEndpoint> mNewEndpoints;
- private UsbAudioManager mUsbAudioManager;
+ private UsbAlsaManager mUsbAlsaManager;
@GuardedBy("mLock")
private UsbSettingsManager mCurrentSettings;
@@ -69,7 +69,7 @@
mContext = context;
mHostBlacklist = context.getResources().getStringArray(
com.android.internal.R.array.config_usbHostBlacklist);
- mUsbAudioManager = new UsbAudioManager(context);
+ mUsbAlsaManager = new UsbAlsaManager(context);
}
public void setCurrentSettings(UsbSettingsManager settings) {
@@ -222,7 +222,7 @@
mDevices.put(mNewDevice.getDeviceName(), mNewDevice);
Slog.d(TAG, "Added device " + mNewDevice);
getCurrentSettings().deviceAttached(mNewDevice);
- mUsbAudioManager.deviceAdded(mNewDevice);
+ mUsbAlsaManager.deviceAdded(mNewDevice);
} else {
Slog.e(TAG, "mNewDevice is null in endUsbDeviceAdded");
}
@@ -238,14 +238,14 @@
synchronized (mLock) {
UsbDevice device = mDevices.remove(deviceName);
if (device != null) {
- mUsbAudioManager.deviceRemoved(device);
+ mUsbAlsaManager.deviceRemoved(device);
getCurrentSettings().deviceDetached(device);
}
}
}
public void systemReady() {
- mUsbAudioManager.systemReady();
+ mUsbAlsaManager.systemReady();
synchronized (mLock) {
// Create a thread to call into native code to wait for USB host events.
@@ -292,7 +292,7 @@
pw.println(" " + name + ": " + mDevices.get(name));
}
}
- mUsbAudioManager.dump(fd, pw);
+ mUsbAlsaManager.dump(fd, pw);
}
private native void monitorUsbHostBus();
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index 5371481..e764cd5 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -53,7 +53,7 @@
private final List<Connection> mUnmodifiableConferenceableConnections =
Collections.unmodifiableList(mConferenceableConnections);
- private PhoneAccountHandle mPhoneAccount;
+ protected PhoneAccountHandle mPhoneAccount;
private AudioState mAudioState;
private int mState = Connection.STATE_NEW;
private DisconnectCause mDisconnectCause;
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index f3b0586..a180f44 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -246,6 +246,7 @@
public void onVideoStateChanged(Connection c, int videoState) {}
public void onDisconnected(Connection c, DisconnectCause disconnectCause) {}
public void onPostDialWait(Connection c, String remaining) {}
+ public void onPostDialChar(Connection c, char nextChar) {}
public void onRingbackRequested(Connection c, boolean ringback) {}
public void onDestroyed(Connection c) {}
public void onConnectionCapabilitiesChanged(Connection c, int capabilities) {}
@@ -998,6 +999,23 @@
}
/**
+ * Informs listeners that this {@code Connection} has processed a character in the post-dial
+ * started state. This is done when (a) the {@code Connection} is issuing a DTMF sequence;
+ * (b) it has encountered a "wait" character; and (c) it wishes to signal Telecom to play
+ * the corresponding DTMF tone locally.
+ *
+ * @param nextChar The DTMF character that was just processed by the {@code Connection}.
+ *
+ * @hide
+ */
+ public final void setNextPostDialWaitChar(char nextChar) {
+ checkImmutable();
+ for (Listener l : mListeners) {
+ l.onPostDialChar(this, nextChar);
+ }
+ }
+
+ /**
* Requests that the framework play a ringback tone. This is to be invoked by implementations
* that do not play a ringback tone themselves in the connection's audio stream.
*
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index d0a8aee..df16375 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -484,6 +484,13 @@
}
@Override
+ public void onPostDialChar(Connection c, char nextChar) {
+ String id = mIdByConnection.get(c);
+ Log.d(this, "Adapter onPostDialChar %s, %s", c, nextChar);
+ mAdapter.onPostDialChar(id, nextChar);
+ }
+
+ @Override
public void onRingbackRequested(Connection c, boolean ringback) {
String id = mIdByConnection.get(c);
Log.d(this, "Adapter onRingback %b", ringback);
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
index aee9675..d026a28 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
@@ -226,6 +226,15 @@
}
}
+ void onPostDialChar(String callId, char nextChar) {
+ for (IConnectionServiceAdapter adapter : mAdapters) {
+ try {
+ adapter.onPostDialChar(callId, nextChar);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
/**
* Indicates that a new conference call has been created.
*
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
index 7619da5..429f296 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -58,6 +58,7 @@
private static final int MSG_SET_CALLER_DISPLAY_NAME = 19;
private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20;
private static final int MSG_ADD_EXISTING_CONNECTION = 21;
+ private static final int MSG_ON_POST_DIAL_CHAR = 22;
private final IConnectionServiceAdapter mDelegate;
@@ -143,6 +144,15 @@
}
break;
}
+ case MSG_ON_POST_DIAL_CHAR: {
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ mDelegate.onPostDialChar((String) args.arg1, (char) args.argi1);
+ } finally {
+ args.recycle();
+ }
+ break;
+ }
case MSG_QUERY_REMOTE_CALL_SERVICES:
mDelegate.queryRemoteConnectionServices((RemoteServiceCallback) msg.obj);
break;
@@ -299,6 +309,14 @@
}
@Override
+ public void onPostDialChar(String connectionId, char nextChar) {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = connectionId;
+ args.argi1 = nextChar;
+ mHandler.obtainMessage(MSG_ON_POST_DIAL_CHAR, args).sendToTarget();
+ }
+
+ @Override
public void queryRemoteConnectionServices(RemoteServiceCallback callback) {
mHandler.obtainMessage(MSG_QUERY_REMOTE_CALL_SERVICES, callback).sendToTarget();
}
diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java
index 95cc387..486691f 100644
--- a/telecomm/java/android/telecom/RemoteConnection.java
+++ b/telecomm/java/android/telecom/RemoteConnection.java
@@ -101,6 +101,15 @@
public void onPostDialWait(RemoteConnection connection, String remainingPostDialSequence) {}
/**
+ * Invoked when the post-dial sequence in the outgoing {@code Connection} has processed
+ * a character.
+ *
+ * @param connection The {@code RemoteConnection} invoking this method.
+ * @param nextChar The character being processed.
+ */
+ public void onPostDialChar(RemoteConnection connection, char nextChar) {}
+
+ /**
* Indicates that the VOIP audio status of this {@code RemoteConnection} has changed.
* See {@link #isVoipAudioMode()}.
*
@@ -726,7 +735,7 @@
* of time.
*
* If the DTMF string contains a {@link TelecomManager#DTMF_CHARACTER_WAIT} symbol, this
- * {@code RemoteConnection} will pause playing the tones and notify callbackss via
+ * {@code RemoteConnection} will pause playing the tones and notify callbacks via
* {@link Callback#onPostDialWait(RemoteConnection, String)}. At this point, the in-call app
* should display to the user an indication of this state and an affordance to continue
* the postdial sequence. When the user decides to continue the postdial sequence, the in-call
@@ -869,6 +878,15 @@
/**
* @hide
*/
+ void onPostDialChar(char nextChar) {
+ for (Callback c : mCallbacks) {
+ c.onPostDialChar(this, nextChar);
+ }
+ }
+
+ /**
+ * @hide
+ */
void setVideoState(int videoState) {
mVideoState = videoState;
for (Callback c : mCallbacks) {
diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java
index 906ecaa..073dcd5f 100644
--- a/telecomm/java/android/telecom/RemoteConnectionService.java
+++ b/telecomm/java/android/telecom/RemoteConnectionService.java
@@ -223,6 +223,12 @@
}
@Override
+ public void onPostDialChar(String callId, char nextChar) {
+ findConnectionForAction(callId, "onPostDialChar")
+ .onPostDialChar(nextChar);
+ }
+
+ @Override
public void queryRemoteConnectionServices(RemoteServiceCallback callback) {
// Not supported from remote connection service.
}
diff --git a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
index 4517a96..7e7e9cc 100644
--- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
@@ -62,6 +62,8 @@
void onPostDialWait(String callId, String remaining);
+ void onPostDialChar(String callId, char nextChar);
+
void queryRemoteConnectionServices(RemoteServiceCallback callback);
void setVideoProvider(String callId, IVideoProvider videoProvider);
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index 4ff6389..ba07a95 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -1503,7 +1503,7 @@
int digit = Character.digit(c, 10);
if (digit != -1) {
sb.append(digit);
- } else if (i == 0 && c == '+') {
+ } else if (sb.length() == 0 && c == '+') {
sb.append(c);
} else if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
return normalizeNumber(PhoneNumberUtils.convertKeypadLettersToDigits(phoneNumber));
diff --git a/telephony/java/android/telephony/RadioAccessFamily.java b/telephony/java/android/telephony/RadioAccessFamily.java
index 734fc68..d10a7ea 100644
--- a/telephony/java/android/telephony/RadioAccessFamily.java
+++ b/telephony/java/android/telephony/RadioAccessFamily.java
@@ -136,16 +136,59 @@
};
public static int getRafFromNetworkType(int type) {
- // TODO map from RILConstants.NETWORK_TYPE_* to RAF_*
+ final int GSM = RAF_GSM | RAF_GPRS | RAF_EDGE;
+ final int HS = RAF_HSUPA | RAF_HSDPA | RAF_HSPA | RAF_HSPAP;
+ final int CDMA = RAF_IS95A | RAF_IS95B | RAF_1xRTT;
+ final int EVDO = RAF_EVDO_0 | RAF_EVDO_A | RAF_EVDO_B;
+ final int WCDMA = HS | RAF_UMTS;
+
+ int raf;
+
switch (type) {
case RILConstants.NETWORK_MODE_WCDMA_PREF:
- case RILConstants.NETWORK_MODE_GSM_UMTS:
- return RAF_UMTS | RAF_GSM;
+ raf = GSM | WCDMA;
+ break;
case RILConstants.NETWORK_MODE_GSM_ONLY:
- return RAF_GSM;
+ raf = GSM;
+ break;
+ case RILConstants.NETWORK_MODE_WCDMA_ONLY:
+ raf = WCDMA;
+ break;
+ case RILConstants.NETWORK_MODE_GSM_UMTS:
+ raf = GSM | WCDMA;
+ break;
+ case RILConstants.NETWORK_MODE_CDMA:
+ raf = CDMA;
+ break;
+ case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO:
+ raf = RAF_LTE | CDMA | EVDO;
+ break;
+ case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA:
+ raf = RAF_LTE | GSM | WCDMA;
+ break;
+ case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
+ raf = RAF_LTE | CDMA | EVDO | GSM | WCDMA;
+ break;
+ case RILConstants.NETWORK_MODE_LTE_ONLY:
+ raf = RAF_LTE;
+ break;
+ case RILConstants.NETWORK_MODE_LTE_WCDMA:
+ raf = RAF_LTE | WCDMA;
+ break;
+ case RILConstants.NETWORK_MODE_CDMA_NO_EVDO:
+ raf = CDMA;
+ break;
+ case RILConstants.NETWORK_MODE_EVDO_NO_CDMA:
+ raf = EVDO;
+ break;
+ case RILConstants.NETWORK_MODE_GLOBAL:
+ raf = GSM | WCDMA | CDMA | EVDO;
+ break;
default:
- return RAF_UNKNOWN;
+ raf = RAF_UNKNOWN;
+ break;
}
+ return raf;
}
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index ccd0db6..d19a702 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -3635,6 +3635,8 @@
} catch (SettingNotFoundException e) {
try {
int val = Settings.Global.getInt(cr, name);
+ Settings.Global.putInt(cr, name + subId, val);
+
/* We are now moving from 'setting' to 'setting+subId', and using the value stored
* for 'setting' as default. Reset the default (since it may have a user set
* value). */
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index e90e6ed..5202cc3 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -510,6 +510,11 @@
public long age24; // timestamp of the strongest 2.4GHz BSSID (last time it was seen)
public String BSSID24;
public String BSSID5;
+ public int score; // Debug only, indicate last score used for autojoin/cell-handover
+ public int currentNetworkBoost; // Debug only, indicate boost applied to RSSI if current
+ public int bandPreferenceBoost; // Debug only, indicate boost applied to RSSI if current
+ public int lastChoiceBoost; // Debug only, indicate last choice applied to this configuration
+ public String lastChoiceConfig; // Debug only, indicate last choice applied to this configuration
public Visibility() {
rssi5 = INVALID_RSSI;
@@ -536,16 +541,23 @@
sbuf.append(",");
sbuf.append(Integer.toString(num24));
if (BSSID24 != null) sbuf.append(",").append(BSSID24);
- } else {
- sbuf.append("*");
}
- sbuf.append(" - ");
+ sbuf.append("; ");
if (rssi5 > INVALID_RSSI) {
sbuf.append(Integer.toString(rssi5));
sbuf.append(",");
sbuf.append(Integer.toString(num5));
if (BSSID5 != null) sbuf.append(",").append(BSSID5);
}
+ if (score != 0) {
+ sbuf.append("; ").append(score);
+ sbuf.append(", ").append(currentNetworkBoost);
+ sbuf.append(", ").append(bandPreferenceBoost);
+ if (lastChoiceConfig != null) {
+ sbuf.append(", ").append(lastChoiceBoost);
+ sbuf.append(", ").append(lastChoiceConfig);
+ }
+ }
sbuf.append("]");
return sbuf.toString();
}