summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/ActivityThread.java62
-rw-r--r--core/java/android/content/ContentResolver.java2
-rw-r--r--core/java/android/database/AbstractCursor.java8
-rw-r--r--core/java/android/os/IPowerManager.aidl3
-rw-r--r--core/java/android/os/PowerManager.java2
-rw-r--r--core/java/android/text/Layout.java15
-rw-r--r--core/java/android/view/GLES20RecordingCanvas.java12
-rw-r--r--core/java/android/view/HardwareRenderer.java9
-rw-r--r--core/java/android/view/View.java1
-rw-r--r--core/java/android/view/ViewDebug.java10
-rw-r--r--core/java/android/view/ViewRootImpl.java15
11 files changed, 80 insertions, 59 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index ef9f6d4..5f65f08 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -4530,6 +4530,14 @@ public final class ActivityThread {
IContentProvider provider = pr.mProvider;
IBinder jBinder = provider.asBinder();
+ if (!jBinder.isBinderAlive()) {
+ // The hosting process of the provider has died; we can't
+ // use this one.
+ Log.i(TAG, "Acquiring provider " + auth + " for user " + userId
+ + ": existing object's process dead");
+ handleUnstableProviderDiedLocked(jBinder, true);
+ return null;
+ }
// Only increment the ref count if we have one. If we don't then the
// provider is not reference counted and never needs to be released.
@@ -4670,33 +4678,37 @@ public final class ActivityThread {
}
final void handleUnstableProviderDied(IBinder provider, boolean fromClient) {
- synchronized(mProviderMap) {
- ProviderRefCount prc = mProviderRefCountMap.get(provider);
- if (prc != null) {
- if (DEBUG_PROVIDER) Slog.v(TAG, "Cleaning up dead provider "
- + provider + " " + prc.holder.info.name);
- mProviderRefCountMap.remove(provider);
- if (prc.client != null && prc.client.mNames != null) {
- for (String name : prc.client.mNames) {
- ProviderClientRecord pr = mProviderMap.get(name);
- if (pr != null && pr.mProvider.asBinder() == provider) {
- Slog.i(TAG, "Removing dead content provider: " + name);
- mProviderMap.remove(name);
- }
+ synchronized (mProviderMap) {
+ handleUnstableProviderDiedLocked(provider, fromClient);
+ }
+ }
+
+ final void handleUnstableProviderDiedLocked(IBinder provider, boolean fromClient) {
+ ProviderRefCount prc = mProviderRefCountMap.get(provider);
+ if (prc != null) {
+ if (DEBUG_PROVIDER) Slog.v(TAG, "Cleaning up dead provider "
+ + provider + " " + prc.holder.info.name);
+ mProviderRefCountMap.remove(provider);
+ if (prc.client != null && prc.client.mNames != null) {
+ for (String name : prc.client.mNames) {
+ ProviderClientRecord pr = mProviderMap.get(name);
+ if (pr != null && pr.mProvider.asBinder() == provider) {
+ Slog.i(TAG, "Removing dead content provider: " + name);
+ mProviderMap.remove(name);
}
}
- if (fromClient) {
- // We found out about this due to execution in our client
- // code. Tell the activity manager about it now, to ensure
- // that the next time we go to do anything with the provider
- // it knows it is dead (so we don't race with its death
- // notification).
- try {
- ActivityManagerNative.getDefault().unstableProviderDied(
- prc.holder.connection);
- } catch (RemoteException e) {
- //do nothing content provider object is dead any way
- }
+ }
+ if (fromClient) {
+ // We found out about this due to execution in our client
+ // code. Tell the activity manager about it now, to ensure
+ // that the next time we go to do anything with the provider
+ // it knows it is dead (so we don't race with its death
+ // notification).
+ try {
+ ActivityManagerNative.getDefault().unstableProviderDied(
+ prc.holder.connection);
+ } catch (RemoteException e) {
+ //do nothing content provider object is dead any way
}
}
}
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index 4ab8272..9e406d4 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -1219,7 +1219,7 @@ public abstract class ContentResolver {
public final void registerContentObserver(Uri uri, boolean notifyForDescendents,
ContentObserver observer)
{
- registerContentObserver(uri, notifyForDescendents, observer, UserHandle.getCallingUserId());
+ registerContentObserver(uri, notifyForDescendents, observer, UserHandle.myUserId());
}
/** @hide - designated user version */
diff --git a/core/java/android/database/AbstractCursor.java b/core/java/android/database/AbstractCursor.java
index e7ff92d..300b4d1 100644
--- a/core/java/android/database/AbstractCursor.java
+++ b/core/java/android/database/AbstractCursor.java
@@ -19,6 +19,7 @@ package android.database;
import android.content.ContentResolver;
import android.net.Uri;
import android.os.Bundle;
+import android.os.UserHandle;
import android.util.Log;
import java.lang.ref.WeakReference;
@@ -350,6 +351,11 @@ public abstract class AbstractCursor implements CrossProcessCursor {
* specific row URI, or a base URI for a whole class of content.
*/
public void setNotificationUri(ContentResolver cr, Uri notifyUri) {
+ setNotificationUri(cr, notifyUri, UserHandle.myUserId());
+ }
+
+ /** @hide - set the notification uri but with an observer for a particular user's view */
+ public void setNotificationUri(ContentResolver cr, Uri notifyUri, int userHandle) {
synchronized (mSelfObserverLock) {
mNotifyUri = notifyUri;
mContentResolver = cr;
@@ -357,7 +363,7 @@ public abstract class AbstractCursor implements CrossProcessCursor {
mContentResolver.unregisterContentObserver(mSelfObserver);
}
mSelfObserver = new SelfContentObserver(this);
- mContentResolver.registerContentObserver(mNotifyUri, true, mSelfObserver);
+ mContentResolver.registerContentObserver(mNotifyUri, true, mSelfObserver, userHandle);
mSelfObserverRegistered = true;
}
}
diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl
index 557d3f3..6d6d147 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -37,7 +37,8 @@ interface IPowerManager
void nap(long time);
boolean isScreenOn();
- void reboot(String reason);
+ void reboot(boolean confirm, String reason, boolean wait);
+ void shutdown(boolean confirm, boolean wait);
void crash(String message);
void setStayOnSetting(int val);
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index ae50ddb..fb02c0a 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -596,7 +596,7 @@ public final class PowerManager {
*/
public void reboot(String reason) {
try {
- mService.reboot(reason);
+ mService.reboot(false, reason, true);
} catch (RemoteException e) {
}
}
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java
index d2bed48..123acca 100644
--- a/core/java/android/text/Layout.java
+++ b/core/java/android/text/Layout.java
@@ -475,10 +475,14 @@ public abstract class Layout {
Alignment align = getParagraphAlignment(line);
int dir = getParagraphDirection(line);
- int x;
if (align == Alignment.ALIGN_LEFT) {
- x = left;
- } else if (align == Alignment.ALIGN_NORMAL) {
+ align = (dir == DIR_LEFT_TO_RIGHT) ? Alignment.ALIGN_NORMAL : Alignment.ALIGN_OPPOSITE;
+ } else if (align == Alignment.ALIGN_RIGHT) {
+ align = (dir == DIR_LEFT_TO_RIGHT) ? Alignment.ALIGN_OPPOSITE : Alignment.ALIGN_NORMAL;
+ }
+
+ int x;
+ if (align == Alignment.ALIGN_NORMAL) {
if (dir == DIR_LEFT_TO_RIGHT) {
x = left;
} else {
@@ -498,12 +502,11 @@ public abstract class Layout {
}
}
int max = (int)getLineExtent(line, tabStops, false);
- if (align == Alignment.ALIGN_RIGHT) {
- x = right - max;
- } else if (align == Alignment.ALIGN_OPPOSITE) {
+ if (align == Alignment.ALIGN_OPPOSITE) {
if (dir == DIR_LEFT_TO_RIGHT) {
x = right - max;
} else {
+ // max is negative here
x = left - max;
}
} else { // Alignment.ALIGN_CENTER
diff --git a/core/java/android/view/GLES20RecordingCanvas.java b/core/java/android/view/GLES20RecordingCanvas.java
index ba8be6c..d2df45a 100644
--- a/core/java/android/view/GLES20RecordingCanvas.java
+++ b/core/java/android/view/GLES20RecordingCanvas.java
@@ -236,18 +236,6 @@ class GLES20RecordingCanvas extends GLES20Canvas implements Poolable<GLES20Recor
}
@Override
- public void drawRect(Rect r, Paint paint) {
- super.drawRect(r, paint);
- recordShaderBitmap(paint);
- }
-
- @Override
- public void drawRect(RectF r, Paint paint) {
- super.drawRect(r, paint);
- recordShaderBitmap(paint);
- }
-
- @Override
public void drawRoundRect(RectF rect, float rx, float ry, Paint paint) {
super.drawRoundRect(rect, rx, ry, paint);
recordShaderBitmap(paint);
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 99987bf..37e0a36 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -507,17 +507,22 @@ public abstract class HardwareRenderer {
* @param width The width of the drawing surface.
* @param height The height of the drawing surface.
* @param surface The surface to hardware accelerate
+ *
+ * @return true if the surface was initialized, false otherwise. Returning
+ * false might mean that the surface was already initialized.
*/
- void initializeIfNeeded(int width, int height, Surface surface)
+ boolean initializeIfNeeded(int width, int height, Surface surface)
throws Surface.OutOfResourcesException {
if (isRequested()) {
// We lost the gl context, so recreate it.
if (!isEnabled()) {
if (initialize(surface)) {
setup(width, height);
+ return true;
}
}
- }
+ }
+ return false;
}
/**
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 2d083b6..ae51c1d 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -2904,6 +2904,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
int mOldHeightMeasureSpec = Integer.MIN_VALUE;
+ @ViewDebug.ExportedProperty(deepExport = true, prefix = "bg_")
private Drawable mBackground;
private int mBackgroundResource;
diff --git a/core/java/android/view/ViewDebug.java b/core/java/android/view/ViewDebug.java
index c013d85..023e58f 100644
--- a/core/java/android/view/ViewDebug.java
+++ b/core/java/android/view/ViewDebug.java
@@ -923,8 +923,12 @@ public class ViewDebug {
private static void dumpViewProperties(Context context, Object view,
BufferedWriter out, String prefix) throws IOException {
- Class<?> klass = view.getClass();
+ if (view == null) {
+ out.write(prefix + "=4,null ");
+ return;
+ }
+ Class<?> klass = view.getClass();
do {
exportFields(context, view, out, klass, prefix);
exportMethods(context, view, out, klass, prefix);
@@ -1064,8 +1068,8 @@ public class ViewDebug {
return;
} else if (!type.isPrimitive()) {
if (property.deepExport()) {
- dumpViewProperties(context, field.get(view), out, prefix
- + property.prefix());
+ dumpViewProperties(context, field.get(view), out, prefix +
+ property.prefix());
continue;
}
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 438f792..be2d5b3 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -52,7 +52,6 @@ import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
-import android.os.UserHandle;
import android.util.AndroidRuntimeException;
import android.util.DisplayMetrics;
import android.util.Log;
@@ -2817,10 +2816,10 @@ public final class ViewRootImpl implements ViewParent,
case MSG_RESIZED: {
// Recycled in the fall through...
SomeArgs args = (SomeArgs) msg.obj;
- if (mWinFrame.equals((Rect) args.arg1)
- && mPendingContentInsets.equals((Rect) args.arg2)
- && mPendingVisibleInsets.equals((Rect) args.arg3)
- && ((Configuration) args.arg4 == null)) {
+ if (mWinFrame.equals(args.arg1)
+ && mPendingContentInsets.equals(args.arg2)
+ && mPendingVisibleInsets.equals(args.arg3)
+ && args.arg4 == null) {
break;
}
} // fall through...
@@ -2882,8 +2881,10 @@ public final class ViewRootImpl implements ViewParent,
mSurface != null && mSurface.isValid()) {
mFullRedrawNeeded = true;
try {
- mAttachInfo.mHardwareRenderer.initializeIfNeeded(mWidth, mHeight,
- mHolder.getSurface());
+ if (mAttachInfo.mHardwareRenderer.initializeIfNeeded(
+ mWidth, mHeight, mHolder.getSurface())) {
+ mFullRedrawNeeded = true;
+ }
} catch (Surface.OutOfResourcesException e) {
Log.e(TAG, "OutOfResourcesException locking surface", e);
try {