diff options
34 files changed, 282 insertions, 193 deletions
diff --git a/api/current.txt b/api/current.txt index 1d30f51..d1be295 100644 --- a/api/current.txt +++ b/api/current.txt @@ -852,6 +852,7 @@ package android { field public static final int reqNavigation = 16843306; // 0x101022a field public static final int reqTouchScreen = 16843303; // 0x1010227 field public static final int required = 16843406; // 0x101028e + field public static final int requiredAccountType = 16843734; // 0x10103d6 field public static final int requiredForAllUsers = 16843728; // 0x10103d0 field public static final int requiresFadingEdge = 16843685; // 0x10103a5 field public static final int requiresSmallestWidthDp = 16843620; // 0x1010364 @@ -4195,6 +4196,7 @@ package android.app { method public final boolean performGlobalAction(int); method public void setOnAccessibilityEventListener(android.app.UiAutomation.OnAccessibilityEventListener); method public boolean setRotation(int); + method public void setRunAsMonkey(boolean); method public final void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo); method public android.graphics.Bitmap takeScreenshot(); method public void waitForIdle(long, long) throws java.util.concurrent.TimeoutException; @@ -11815,10 +11817,10 @@ package android.media { method public void seekTo(long, int); method public void selectTrack(int); method public final void setDataSource(android.content.Context, android.net.Uri, java.util.Map<java.lang.String, java.lang.String>) throws java.io.IOException; - method public final void setDataSource(java.lang.String, java.util.Map<java.lang.String, java.lang.String>); - method public final void setDataSource(java.lang.String); - method public final void setDataSource(java.io.FileDescriptor); - method public final void setDataSource(java.io.FileDescriptor, long, long); + method public final void setDataSource(java.lang.String, java.util.Map<java.lang.String, java.lang.String>) throws java.io.IOException; + method public final void setDataSource(java.lang.String) throws java.io.IOException; + method public final void setDataSource(java.io.FileDescriptor) throws java.io.IOException; + method public final void setDataSource(java.io.FileDescriptor, long, long) throws java.io.IOException; method public void unselectTrack(int); field public static final int SAMPLE_FLAG_ENCRYPTED = 2; // 0x2 field public static final int SAMPLE_FLAG_SYNC = 1; // 0x1 @@ -12265,13 +12267,17 @@ package android.media { ctor public RemoteControlClient(android.app.PendingIntent); ctor public RemoteControlClient(android.app.PendingIntent, android.os.Looper); method public android.media.RemoteControlClient.MetadataEditor editMetadata(boolean); + method public void setOnGetPlaybackPositionListener(android.media.RemoteControlClient.OnGetPlaybackPositionListener); + method public void setPlaybackPositionUpdateListener(android.media.RemoteControlClient.OnPlaybackPositionUpdateListener); method public void setPlaybackState(int); + method public void setPlaybackState(int, long, float); method public void setTransportControlFlags(int); field public static final int FLAG_KEY_MEDIA_FAST_FORWARD = 64; // 0x40 field public static final int FLAG_KEY_MEDIA_NEXT = 128; // 0x80 field public static final int FLAG_KEY_MEDIA_PAUSE = 16; // 0x10 field public static final int FLAG_KEY_MEDIA_PLAY = 4; // 0x4 field public static final int FLAG_KEY_MEDIA_PLAY_PAUSE = 8; // 0x8 + field public static final int FLAG_KEY_MEDIA_POSITION_UPDATE = 256; // 0x100 field public static final int FLAG_KEY_MEDIA_PREVIOUS = 1; // 0x1 field public static final int FLAG_KEY_MEDIA_REWIND = 2; // 0x2 field public static final int FLAG_KEY_MEDIA_STOP = 32; // 0x20 @@ -12295,6 +12301,14 @@ package android.media { field public static final int BITMAP_KEY_ARTWORK = 100; // 0x64 } + public static abstract interface RemoteControlClient.OnGetPlaybackPositionListener { + method public abstract long onGetPlaybackPosition(); + } + + public static abstract interface RemoteControlClient.OnPlaybackPositionUpdateListener { + method public abstract void onPlaybackPositionUpdate(long); + } + public class Ringtone { method public int getStreamType(); method public java.lang.String getTitle(android.content.Context); @@ -17079,8 +17093,8 @@ package android.os { method public java.lang.String getUserName(); method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); + method public boolean isLinkedUser(); method public boolean isUserAGoat(); - method public boolean isUserLimited(); method public boolean isUserRunning(android.os.UserHandle); method public boolean isUserRunningOrStopping(android.os.UserHandle); method public void setUserRestriction(java.lang.String, boolean); @@ -20196,11 +20210,13 @@ package android.renderscript { public class RenderScript { method public void contextDump(); method public static android.renderscript.RenderScript create(android.content.Context); + method public static android.renderscript.RenderScript create(android.content.Context, android.renderscript.RenderScript.ContextType); method public void destroy(); method public void finish(); method public final android.content.Context getApplicationContext(); method public android.renderscript.RenderScript.RSErrorHandler getErrorHandler(); method public android.renderscript.RenderScript.RSMessageHandler getMessageHandler(); + method public void sendMessage(int, int[]); method public void setErrorHandler(android.renderscript.RenderScript.RSErrorHandler); method public void setMessageHandler(android.renderscript.RenderScript.RSMessageHandler); method public void setPriority(android.renderscript.RenderScript.Priority); @@ -20363,6 +20379,13 @@ package android.renderscript { public abstract class ScriptIntrinsic extends android.renderscript.Script { } + public final class ScriptIntrinsic3DLUT extends android.renderscript.ScriptIntrinsic { + method public static android.renderscript.ScriptIntrinsic3DLUT create(android.renderscript.RenderScript, android.renderscript.Element); + method public void forEach(android.renderscript.Allocation, android.renderscript.Allocation); + method public android.renderscript.Script.KernelID getKernelID(); + method public void setLUT(android.renderscript.Allocation); + } + public class ScriptIntrinsicBlend extends android.renderscript.ScriptIntrinsic { method public static android.renderscript.ScriptIntrinsicBlend create(android.renderscript.RenderScript, android.renderscript.Element); method public void forEachAdd(android.renderscript.Allocation, android.renderscript.Allocation); @@ -20482,6 +20505,7 @@ package android.renderscript { method public android.renderscript.Element getElement(); method public int getX(); method public int getY(); + method public int getYuv(); method public int getZ(); method public boolean hasFaces(); method public boolean hasMipmaps(); @@ -20494,6 +20518,7 @@ package android.renderscript { method public android.renderscript.Type.Builder setMipmaps(boolean); method public android.renderscript.Type.Builder setX(int); method public android.renderscript.Type.Builder setY(int); + method public android.renderscript.Type.Builder setYuvFormat(int); method public android.renderscript.Type.Builder setZ(int); } @@ -28030,11 +28055,11 @@ package android.webkit { public class WebViewDatabase { method public void clearFormData(); method public void clearHttpAuthUsernamePassword(); - method public void clearUsernamePassword(); + method public deprecated void clearUsernamePassword(); method public static android.webkit.WebViewDatabase getInstance(android.content.Context); method public boolean hasFormData(); method public boolean hasHttpAuthUsernamePassword(); - method public boolean hasUsernamePassword(); + method public deprecated boolean hasUsernamePassword(); } public class WebViewFragment extends android.app.Fragment { diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index c99051b..98baa0e 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -1413,6 +1413,14 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } + case SET_USER_IS_MONKEY_TRANSACTION: { + data.enforceInterface(IActivityManager.descriptor); + final boolean monkey = (data.readInt() == 1); + setUserIsMonkey(monkey); + reply.writeNoException(); + return true; + } + case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); finishHeavyWeightApp(); @@ -3633,7 +3641,18 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); return res; } - + + public void setUserIsMonkey(boolean monkey) throws RemoteException { + Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); + data.writeInterfaceToken(IActivityManager.descriptor); + data.writeInt(monkey ? 1 : 0); + mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); + reply.readException(); + data.recycle(); + reply.recycle(); + } + public void finishHeavyWeightApp() throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index fa8839a..33a2770 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -285,7 +285,9 @@ public interface IActivityManager extends IInterface { int enterAnim, int exitAnim) throws RemoteException; public boolean isUserAMonkey() throws RemoteException; - + + public void setUserIsMonkey(boolean monkey) throws RemoteException; + public void finishHeavyWeightApp() throws RemoteException; public void setImmersive(IBinder token, boolean immersive) throws RemoteException; @@ -635,4 +637,5 @@ public interface IActivityManager extends IInterface { int REPORT_TOP_ACTIVITY_EXTRAS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+162; int GET_LAUNCHED_FROM_PACKAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+163; int KILL_UID_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+164; + int SET_USER_IS_MONKEY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+165; } diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java index e0dfb25..a307a73 100644 --- a/core/java/android/app/Instrumentation.java +++ b/core/java/android/app/Instrumentation.java @@ -189,6 +189,10 @@ public class Instrumentation { if (mPerfMetrics != null) { results.putAll(mPerfMetrics); } + if (mUiAutomation != null) { + mUiAutomation.disconnect(); + mUiAutomation = null; + } mThread.finishInstrumentation(resultCode, results); } @@ -1695,10 +1699,6 @@ public class Instrumentation { startPerformanceSnapshot(); } onStart(); - if (mUiAutomation != null) { - mUiAutomation.disconnect(); - mUiAutomation = null; - } } } diff --git a/core/java/android/app/UiAutomation.java b/core/java/android/app/UiAutomation.java index d9799b6..05b79c1 100644 --- a/core/java/android/app/UiAutomation.java +++ b/core/java/android/app/UiAutomation.java @@ -619,6 +619,25 @@ public final class UiAutomation { return screenShot; } + /** + * Sets whether this UiAutomation to run in a "monkey" mode. Applications can query whether + * they are executed in a "monkey" mode, i.e. run by a test framework, and avoid doing + * potentially undesirable actions such as calling 911 or posting on public forums etc. + * + * @param enable whether to run in a "monkey" mode or not. Default is not. + * @see {@link ActivityManager#isUserAMonkey()} + */ + public void setRunAsMonkey(boolean enable) { + synchronized (mLock) { + throwIfNotConnectedLocked(); + } + try { + ActivityManagerNative.getDefault().setUserIsMonkey(enable); + } catch (RemoteException re) { + Log.e(LOG_TAG, "Error while setting run as monkey!", re); + } + } + private static float getDegreesForRotation(int value) { switch (value) { case Surface.ROTATION_90: { diff --git a/core/java/android/content/pm/PackageInfo.java b/core/java/android/content/pm/PackageInfo.java index 33a6757..af1a6d5 100644 --- a/core/java/android/content/pm/PackageInfo.java +++ b/core/java/android/content/pm/PackageInfo.java @@ -224,6 +224,9 @@ public class PackageInfo implements Parcelable { /** @hide */ public String restrictedAccountType; + /** @hide */ + public String requiredAccountType; + public PackageInfo() { } @@ -266,6 +269,7 @@ public class PackageInfo implements Parcelable { dest.writeInt(installLocation); dest.writeInt(requiredForAllUsers ? 1 : 0); dest.writeString(restrictedAccountType); + dest.writeString(requiredAccountType); } public static final Parcelable.Creator<PackageInfo> CREATOR @@ -306,5 +310,6 @@ public class PackageInfo implements Parcelable { installLocation = source.readInt(); requiredForAllUsers = source.readInt() != 0; restrictedAccountType = source.readString(); + requiredAccountType = source.readString(); } } diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 5a50ec2..3586573 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -289,6 +289,7 @@ public class PackageParser { pi.installLocation = p.installLocation; pi.requiredForAllUsers = p.mRequiredForAllUsers; pi.restrictedAccountType = p.mRestrictedAccountType; + pi.requiredAccountType = p.mRequiredAccountType; pi.firstInstallTime = firstInstallTime; pi.lastUpdateTime = lastUpdateTime; if ((flags&PackageManager.GET_GIDS) != 0) { @@ -1816,13 +1817,19 @@ public class PackageParser { false)) { owner.mRequiredForAllUsers = true; } - String accountType = sa.getString(com.android.internal.R.styleable + String restrictedAccountType = sa.getString(com.android.internal.R.styleable .AndroidManifestApplication_restrictedAccountType); - if (accountType != null && accountType.length() > 0) { - owner.mRestrictedAccountType = accountType; + if (restrictedAccountType != null && restrictedAccountType.length() > 0) { + owner.mRestrictedAccountType = restrictedAccountType; } } + String requiredAccountType = sa.getString(com.android.internal.R.styleable + .AndroidManifestApplication_requiredAccountType); + if (requiredAccountType != null && requiredAccountType.length() > 0) { + owner.mRequiredAccountType = requiredAccountType; + } + if (sa.getBoolean( com.android.internal.R.styleable.AndroidManifestApplication_debuggable, false)) { @@ -3339,6 +3346,9 @@ public class PackageParser { /* The restricted account authenticator type that is used by this application */ public String mRestrictedAccountType; + /* The required account type without which this application will not function */ + public String mRequiredAccountType; + /** * Digest suitable for comparing whether this package's manifest is the * same as another. diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 9338f3d..d64bff9 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -16,6 +16,7 @@ package android.content.res; +import android.os.Trace; import com.android.internal.util.XmlUtils; import org.xmlpull.v1.XmlPullParser; @@ -2055,20 +2056,24 @@ public class Resources { + value.assetCookie + ": " + file); if (file.endsWith(".xml")) { + Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, file); try { XmlResourceParser rp = loadXmlResourceParser( file, id, value.assetCookie, "drawable"); dr = Drawable.createFromXml(this, rp); rp.close(); } catch (Exception e) { + Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); NotFoundException rnf = new NotFoundException( "File " + file + " from drawable resource ID #0x" + Integer.toHexString(id)); rnf.initCause(e); throw rnf; } + Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); } else { + Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, file); try { InputStream is = mAssets.openNonAsset( value.assetCookie, file, AssetManager.ACCESS_STREAMING); @@ -2078,12 +2083,14 @@ public class Resources { is.close(); // System.out.println("Created stream: " + dr); } catch (Exception e) { + Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); NotFoundException rnf = new NotFoundException( "File " + file + " from drawable resource ID #0x" + Integer.toHexString(id)); rnf.initCause(e); throw rnf; } + Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); } } } @@ -2189,18 +2196,21 @@ public class Resources { String file = value.string.toString(); if (file.endsWith(".xml")) { + Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, file); try { XmlResourceParser rp = loadXmlResourceParser( file, id, value.assetCookie, "colorstatelist"); csl = ColorStateList.createFromXml(this, rp); rp.close(); } catch (Exception e) { + Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); NotFoundException rnf = new NotFoundException( "File " + file + " from color state list resource ID #0x" + Integer.toHexString(id)); rnf.initCause(e); throw rnf; } + Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); } else { throw new NotFoundException( "File " + file + " from drawable resource ID #0x" diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java index 37cbe04..30118f9 100644 --- a/core/java/android/hardware/SensorManager.java +++ b/core/java/android/hardware/SensorManager.java @@ -1387,14 +1387,14 @@ public abstract class SensorManager { * @throws IllegalArgumentException when sensor is a trigger sensor. */ public boolean cancelTriggerSensor(TriggerEventListener listener, Sensor sensor) { - return cancelTriggerSensorImpl(listener, sensor); + return cancelTriggerSensorImpl(listener, sensor, true); } /** * @hide */ protected abstract boolean cancelTriggerSensorImpl(TriggerEventListener listener, - Sensor sensor); + Sensor sensor, boolean disable); private LegacySensorManager getLegacySensorManager() { diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java index c6c999b..852cf4a 100644 --- a/core/java/android/hardware/SystemSensorManager.java +++ b/core/java/android/hardware/SystemSensorManager.java @@ -20,6 +20,7 @@ import android.content.Context; import android.os.Handler; import android.os.Looper; import android.os.MessageQueue; +import android.util.Log; import android.util.SparseArray; import android.util.SparseBooleanArray; import android.util.SparseIntArray; @@ -135,7 +136,7 @@ public class SystemSensorManager extends SensorManager { if (sensor == null) { result = queue.removeAllSensors(); } else { - result = queue.removeSensor(sensor); + result = queue.removeSensor(sensor, true); } if (result && !queue.hasSensors()) { mSensorListeners.remove(listener); @@ -170,7 +171,8 @@ public class SystemSensorManager extends SensorManager { /** @hide */ @Override - protected boolean cancelTriggerSensorImpl(TriggerEventListener listener, Sensor sensor) { + protected boolean cancelTriggerSensorImpl(TriggerEventListener listener, Sensor sensor, + boolean disable) { if (sensor != null && Sensor.getReportingMode(sensor) != Sensor.REPORTING_MODE_ONE_SHOT) { return false; } @@ -181,7 +183,7 @@ public class SystemSensorManager extends SensorManager { if (sensor == null) { result = queue.removeAllSensors(); } else { - result = queue.removeSensor(sensor); + result = queue.removeSensor(sensor, disable); } if (result && !queue.hasSensors()) { mTriggerListeners.remove(listener); @@ -225,14 +227,17 @@ public class SystemSensorManager extends SensorManager { public boolean addSensor(Sensor sensor, int delay) { // Check if already present. - if (mActiveSensors.get(sensor.getHandle())) return false; - - if (enableSensor(sensor, delay) == 0) { - mActiveSensors.put(sensor.getHandle(), true); - addSensorEvent(sensor); - return true; + int handle = sensor.getHandle(); + if (mActiveSensors.get(handle)) return false; + + // Get ready to receive events before calling enable. + mActiveSensors.put(handle, true); + addSensorEvent(sensor); + if (enableSensor(sensor, delay) != 0) { + removeSensor(sensor, false); + return false; } - return false; + return true; } public boolean removeAllSensors() { @@ -252,10 +257,10 @@ public class SystemSensorManager extends SensorManager { return true; } - public boolean removeSensor(Sensor sensor) { + public boolean removeSensor(Sensor sensor, boolean disable) { final int handle = sensor.getHandle(); if (mActiveSensors.get(handle)) { - disableSensor(sensor); + if (disable) disableSensor(sensor); mActiveSensors.put(sensor.getHandle(), false); removeSensorEvent(sensor); return true; @@ -334,6 +339,10 @@ public class SystemSensorManager extends SensorManager { long timestamp) { final Sensor sensor = sHandleToSensor.get(handle); SensorEvent t = mSensorsEvents.get(handle); + if (t == null) { + Log.e(TAG, "Error: Sensor Event is null for Sensor: " + sensor); + return; + } // Copy from the values array. System.arraycopy(values, 0, t.values, 0, t.values.length); t.timestamp = timestamp; @@ -390,14 +399,19 @@ public class SystemSensorManager extends SensorManager { long timestamp) { final Sensor sensor = sHandleToSensor.get(handle); TriggerEvent t = mTriggerEvents.get(handle); + if (t == null) { + Log.e(TAG, "Error: Trigger Event is null for Sensor: " + sensor); + return; + } // Copy from the values array. System.arraycopy(values, 0, t.values, 0, t.values.length); t.timestamp = timestamp; t.sensor = sensor; - // A trigger sensor should be auto disabled. - mManager.cancelTriggerSensorImpl(mListener, sensor); + // A trigger sensor is auto disabled. So just clean up and don't call native + // disable. + mManager.cancelTriggerSensorImpl(mListener, sensor, false); mListener.onTrigger(t); } diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index c61bf84..e580e2b 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -198,11 +198,11 @@ public class UserManager { } /** - * Used to check if the user making this call is a limited user. Limited users may have + * Used to check if the user making this call is linked to another user. Linked users may have * a reduced number of available apps, app restrictions and account restrictions. - * @return whether the user making this call is a limited user + * @return whether the user making this call is a linked user */ - public boolean isUserLimited() { + public boolean isLinkedUser() { try { return mService.isRestricted(); } catch (RemoteException re) { diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 6da4b62..bf502dd 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -1464,10 +1464,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final float y = event.getY(); final int childrenCount = mChildrenCount; if (childrenCount != 0) { + final boolean customChildOrder = isChildrenDrawingOrderEnabled(); final View[] children = mChildren; HoverTarget lastHoverTarget = null; for (int i = childrenCount - 1; i >= 0; i--) { - final View child = children[i]; + final int childIndex = customChildOrder + ? getChildDrawingOrder(childrenCount, i) : i; + final View child = children[childIndex]; if (!canViewReceivePointerEvents(child) || !isTransformedTouchPointInView(x, y, child, null)) { continue; diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 094c901..f03c077 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1727,7 +1727,7 @@ public final class ViewRootImpl implements ViewParent, if (didLayout) { performLayout(lp, desiredWindowWidth, desiredWindowHeight); - // By this point all views have been sized and positionned + // By this point all views have been sized and positioned // We can compute the transparent area if ((host.mPrivateFlags & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) != 0) { @@ -1745,6 +1745,7 @@ public final class ViewRootImpl implements ViewParent, if (!mTransparentRegion.equals(mPreviousTransparentRegion)) { mPreviousTransparentRegion.set(mTransparentRegion); + mFullRedrawNeeded = true; // reconfigure window manager try { mWindowSession.setTransparentRegion(mWindow, mTransparentRegion); @@ -4922,7 +4923,7 @@ public final class ViewRootImpl implements ViewParent, public void handleDispatchDoneAnimating() { if (mWindowsAnimating) { mWindowsAnimating = false; - if (!mDirty.isEmpty() || mIsAnimating) { + if (!mDirty.isEmpty() || mIsAnimating || mFullRedrawNeeded) { scheduleTraversals(); } } diff --git a/core/java/android/webkit/WebViewDatabase.java b/core/java/android/webkit/WebViewDatabase.java index e08052a..99e0ffb 100644 --- a/core/java/android/webkit/WebViewDatabase.java +++ b/core/java/android/webkit/WebViewDatabase.java @@ -50,8 +50,10 @@ public class WebViewDatabase { * * @return true if there are any saved username/password pairs * @see WebView#savePassword - * @see #clearUsernamePassword + * @see #clearUsernamePassworda + * @deprecated Saving passwords in WebView will not be supported in future versions. */ + @Deprecated public boolean hasUsernamePassword() { throw new MustOverrideException(); } @@ -62,7 +64,9 @@ public class WebViewDatabase { * * @see WebView#savePassword * @see #hasUsernamePassword + * @deprecated Saving passwords in WebView will not be supported in future versions. */ + @Deprecated public void clearUsernamePassword() { throw new MustOverrideException(); } diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml index d2b11e4..0c7cf72 100644 --- a/core/res/res/values-da/strings.xml +++ b/core/res/res/values-da/strings.xml @@ -622,7 +622,7 @@ <string name="permlab_accessNotifications" msgid="7673416487873432268">"adgang til underretninger"</string> <string name="permdesc_accessNotifications" msgid="458457742683431387">"Tillader, at appen kan hente, undersøge og rydde underretninger, herunder dem, der er sendt af andre apps."</string> <string name="permlab_bindNotificationListenerService" msgid="7057764742211656654">"forpligte sig til en underretningslyttertjeneste"</string> - <string name="permdesc_bindNotificationListenerService" msgid="985697918576902986">"Tillader, at brugeren kan forpligte sig til en grænseflade for en underretningslyttertjeneste på øverste niveau. Bør aldrig være nødvendigt til almindelige apps."</string> + <string name="permdesc_bindNotificationListenerService" msgid="985697918576902986">"Tillader brugeren at forpligte sig til en underretningslyttertjenestes grænseflade på øverste niveau. Bør aldrig være nødvendigt til almindelige apps."</string> <string name="policylab_limitPassword" msgid="4497420728857585791">"Indstil regler for adgangskode"</string> <string name="policydesc_limitPassword" msgid="3252114203919510394">"Kontroller længden samt tilladte tegn i adgangskoder til oplåsning af skærmen."</string> <string name="policylab_watchLogin" msgid="914130646942199503">"Overvåg forsøg på oplåsning af skærm"</string> diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml index 09acbe1..485e1bf 100644 --- a/core/res/res/values-es/strings.xml +++ b/core/res/res/values-es/strings.xml @@ -559,8 +559,8 @@ <string name="permdesc_changeNetworkState" msgid="6789123912476416214">"Permite que la aplicación modifique el estado de la conectividad de red."</string> <string name="permlab_changeTetherState" msgid="5952584964373017960">"cambiar conectividad de anclaje a red"</string> <string name="permdesc_changeTetherState" msgid="1524441344412319780">"Permite que la aplicación cambie el estado de la conectividad de red de anclaje."</string> - <string name="permlab_changeBackgroundDataSetting" msgid="1400666012671648741">"cambiar configuración de uso de datos de referencia"</string> - <string name="permdesc_changeBackgroundDataSetting" msgid="5347729578468744379">"Permite que la aplicación cambie los ajustes de uso de datos de referencia."</string> + <string name="permlab_changeBackgroundDataSetting" msgid="1400666012671648741">"cambiar configuración de uso de conexiones automáticas"</string> + <string name="permdesc_changeBackgroundDataSetting" msgid="5347729578468744379">"Permite que la aplicación cambie los ajustes de uso de conexiones automáticas."</string> <string name="permlab_accessWifiState" msgid="5202012949247040011">"ver conexiones Wi-Fi"</string> <string name="permdesc_accessWifiState" msgid="5002798077387803726">"Permite que la aplicación vea información sobre conexión a redes Wi-Fi (por ejemplo, si está habilitada la conexión Wi-Fi y el nombre de los dispositivos Wi-Fi conectados)."</string> <string name="permlab_changeWifiState" msgid="6550641188749128035">"conectarse a redes Wi-Fi y desconectarse"</string> @@ -569,14 +569,14 @@ <string name="permdesc_changeWifiMulticastState" product="tablet" msgid="7969774021256336548">"Permite que la aplicación reciba paquetes enviados a todos los dispositivos de una red Wi-Fi que utilicen direcciones de multidifusión, no solo al tablet. Utiliza más batería que el modo de no multidifusión."</string> <string name="permdesc_changeWifiMulticastState" product="default" msgid="6851949706025349926">"Permite que la aplicación reciba paquetes enviados a todos los dispositivos de una red Wi-Fi que utilicen direcciones de multidifusión, no solo al teléfono. Utiliza más batería que el modo de no multidifusión."</string> <string name="permlab_bluetoothAdmin" msgid="6006967373935926659">"acceder a los ajustes de Bluetooth"</string> - <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"Permite que la aplicación configure el tablet Bluetooth local y que detecte dispositivos remotos y se sincronice con ellos."</string> - <string name="permdesc_bluetoothAdmin" product="default" msgid="8931682159331542137">"Permite que la aplicación configure el teléfono Bluetooth local y que detecte dispositivos remotos y se sincronice con ellos."</string> + <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"Permite que la aplicación configure el tablet Bluetooth local y que detecte dispositivos remotos y se vincule con ellos."</string> + <string name="permdesc_bluetoothAdmin" product="default" msgid="8931682159331542137">"Permite que la aplicación configure el teléfono Bluetooth local y que detecte dispositivos remotos y se vincule con ellos."</string> <string name="permlab_accessWimaxState" msgid="4195907010610205703">"conectarse a WiMAX y desconectarse de esta red"</string> <string name="permdesc_accessWimaxState" msgid="6360102877261978887">"Permite que la aplicación determine si está habilitada la conexión WiMAX y obtenga información sobre las redes WiMAX que están conectadas."</string> <string name="permlab_changeWimaxState" msgid="2405042267131496579">"Cambiar estado de WiMAX"</string> <string name="permdesc_changeWimaxState" product="tablet" msgid="3156456504084201805">"Permite que la aplicación conecte el tablet a redes WiMAX y lo desconecte de ellas."</string> <string name="permdesc_changeWimaxState" product="default" msgid="697025043004923798">"Permite que la aplicación conecte el teléfono a redes WiMAX y lo desconecte de ellas."</string> - <string name="permlab_bluetooth" msgid="6127769336339276828">"sincronizarse con dispositivos Bluetooth"</string> + <string name="permlab_bluetooth" msgid="6127769336339276828">"vincular con dispositivos Bluetooth"</string> <string name="permdesc_bluetooth" product="tablet" msgid="3480722181852438628">"Permite que la aplicación acceda a la configuración de Bluetooth del tablet y que establezca y acepte conexiones con los dispositivos sincronizados."</string> <string name="permdesc_bluetooth" product="default" msgid="3207106324452312739">"Permite que la aplicación acceda a la configuración de Bluetooth del teléfono y que establezca y acepte conexiones con los dispositivos sincronizados."</string> <string name="permlab_nfc" msgid="4423351274757876953">"controlar Comunicación de campo cercano (NFC)"</string> @@ -702,7 +702,7 @@ <string name="phoneTypeIsdn" msgid="8022453193171370337">"RDSI"</string> <string name="phoneTypeMain" msgid="6766137010628326916">"Principal"</string> <string name="phoneTypeOtherFax" msgid="8587657145072446565">"Otro fax"</string> - <string name="phoneTypeRadio" msgid="4093738079908667513">"Radio"</string> + <string name="phoneTypeRadio" msgid="4093738079908667513">"Señal móvil"</string> <string name="phoneTypeTelex" msgid="3367879952476250512">"Télex"</string> <string name="phoneTypeTtyTdd" msgid="8606514378585000044">"TTY TDD"</string> <string name="phoneTypeWorkMobile" msgid="1311426989184065709">"Móvil del trabajo"</string> @@ -1391,7 +1391,7 @@ <string name="data_usage_mobile_limit_snoozed_title" msgid="279240572165412168">"Límite de datos móviles superado"</string> <string name="data_usage_wifi_limit_snoozed_title" msgid="8743856006384825974">"Límite de datos Wi-Fi superado"</string> <string name="data_usage_limit_snoozed_body" msgid="7035490278298441767">"Límite superado en <xliff:g id="SIZE">%s</xliff:g>"</string> - <string name="data_usage_restricted_title" msgid="5965157361036321914">"Datos de referencia restringidos"</string> + <string name="data_usage_restricted_title" msgid="5965157361036321914">"Conexiones automáticas restringidas"</string> <string name="data_usage_restricted_body" msgid="6741521330997452990">"Toca para eliminar la restricción."</string> <string name="ssl_certificate" msgid="6510040486049237639">"Certificado de seguridad"</string> <string name="ssl_certificate_is_valid" msgid="6825263250774569373">"Este certificado es válido."</string> @@ -1420,7 +1420,7 @@ <string name="default_audio_route_name" product="tablet" msgid="4617053898167127471">"Tablet"</string> <string name="default_audio_route_name" product="default" msgid="4239291273420140123">"Teléfono"</string> <string name="default_audio_route_name_headphones" msgid="8119971843803439110">"Auriculares"</string> - <string name="default_audio_route_name_dock_speakers" msgid="6240602982276591864">"Altavoces del conector"</string> + <string name="default_audio_route_name_dock_speakers" msgid="6240602982276591864">"Altavoces de la base"</string> <string name="default_media_route_name_hdmi" msgid="2450970399023478055">"HDMI"</string> <string name="default_audio_route_category_name" msgid="3722811174003886946">"Sistema"</string> <string name="bluetooth_a2dp_audio_route_name" msgid="8575624030406771015">"Audio Bluetooth"</string> diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml index 0c11321..bdc0155 100644 --- a/core/res/res/values-sw/strings.xml +++ b/core/res/res/values-sw/strings.xml @@ -622,7 +622,7 @@ <string name="permlab_accessNotifications" msgid="7673416487873432268">"fikia arifa"</string> <string name="permdesc_accessNotifications" msgid="458457742683431387">"Huruhusu programu kurejesha, kuchunguza, na kuondoa arifa, ikiwa ni pamoja na zile zilizochapishwa na programu nyingine."</string> <string name="permlab_bindNotificationListenerService" msgid="7057764742211656654">"unganisha kwenye huduma ya kisikilizi cha arifa"</string> - <string name="permdesc_bindNotificationListenerService" msgid="985697918576902986">"Inaruhusu kishikilizi kuunganishwa kwenye kiolesura cha kiwango cha juu cha huduma ya kisikilizi cha arifa. Haipaswi kuhitajika tena kwa programu za kawaida."</string> + <string name="permdesc_bindNotificationListenerService" msgid="985697918576902986">"Inaruhusu kishikilizi kuunganishwa kwenye kusano cha kiwango cha juu cha huduma ya kisikilizi cha arifa. Haipaswi kuhitajika tena kwa programu za kawaida."</string> <string name="policylab_limitPassword" msgid="4497420728857585791">"Weka kanuni za nenosiri"</string> <string name="policydesc_limitPassword" msgid="3252114203919510394">"Dhibiti urefu na vibambo vinavyoruhusiwa katika manenosiri ya kufungua skrini."</string> <string name="policylab_watchLogin" msgid="914130646942199503">"Chunguza majaribio ya kutofun gua skrini"</string> @@ -1284,7 +1284,7 @@ <string name="submit" msgid="1602335572089911941">"Wasilisha"</string> <string name="car_mode_disable_notification_title" msgid="3164768212003864316">"Mtindo wa gari umewezeshwa"</string> <string name="car_mode_disable_notification_message" msgid="8035230537563503262">"Gusa ili kutoka katika modi ya gari."</string> - <string name="tethered_notification_title" msgid="3146694234398202601">"Amilisha uzuiaji au mahali maalum"</string> + <string name="tethered_notification_title" msgid="3146694234398202601">"Kushiriki au kusambaza intaneti kumewashwa"</string> <string name="tethered_notification_message" msgid="6857031760103062982">"Gusa ili kusanidi."</string> <string name="back_button_label" msgid="2300470004503343439">"Nyuma"</string> <string name="next_button_label" msgid="1080555104677992408">"Ifuatayo"</string> diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index 7f5a3dc..8821a01 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -909,8 +909,13 @@ <!-- Declare that this application requires access to restricted accounts of a certain type. The default value is null and restricted accounts won\'t be visible to this application. The type should correspond to the account authenticator type, such as - "com.google" --> + "com.google". Only usable by system apps. --> <attr name="restrictedAccountType" format="string"/> + <!-- Declare that this application requires an account of a certain + type. The default value is null and indicates that the application can work without + any accounts. The type should correspond to the account authenticator type, such as + "com.google". --> + <attr name="requiredAccountType" format="string"/> </declare-styleable> <!-- The <code>permission</code> tag declares a security permission that can be diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 42d692f..074d91f 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2042,6 +2042,7 @@ <public type="attr" name="childIndicatorStart" /> <public type="attr" name="childIndicatorEnd" /> <public type="attr" name="restrictedAccountType" /> + <public type="attr" name="requiredAccountType" /> <public type="style" name="Theme.NoTitleBar.Overscan" /> <public type="style" name="Theme.Light.NoTitleBar.Overscan" /> diff --git a/docs/html/tools/extras/oem-usb.jd b/docs/html/tools/extras/oem-usb.jd index 774fe87..87734a1 100644 --- a/docs/html/tools/extras/oem-usb.jd +++ b/docs/html/tools/extras/oem-usb.jd @@ -306,6 +306,10 @@ href="http://developer.motorola.com/docstools/USB_Drivers/">http://developer.mot <tr><td>MTK</td> <td><a href="http://online.mediatek.com/Public%20Documents/MTK_Android_USB_Driver.zip">http://online.mediatek.com/Public%20Documents/MTK_Android_USB_Driver.zip</a></td> </tr> +<tr><td>Oppo</td> <td><a +href="http://www.oppo.com/index.php?q=software/view&sw_id=631" +>http://www.oppo.com/index.php?q=software/view&sw_id=631</a></td> +</tr> <tr><td>Pantech</td> <td><a href="http://www.isky.co.kr/cs/software/software.sky?fromUrl=index">http://www.isky.co.kr/cs/software/software.sky?fromUrl=index</a></td> </tr><tr><td>Pegatron</td> <td><a @@ -327,6 +331,9 @@ href="http://www.teleepoch.com/android.html">http://www.teleepoch.com/android.ht href="http://www.yulong.com/product/product/product/downloadList.html#downListUL">http://www.yulong.com/product/product/product/downloadList.html#downListUL</a></td> </tr> +<tr><td>Xiaomi</td> <td><a +href="http://www.xiaomi.com/c/driver/index.html">http://www.xiaomi.com/c/driver/index.html</a></td> +</tr> <tr> <td>ZTE</td> <td><a href="http://support.zte.com.cn/support/news/NewsDetail.aspx?newsId=1000442">http://support.zte.com.cn/support/news/NewsDetail.aspx?newsId=1000442</a></td></tr> diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java index c90f400..d5183d5 100644 --- a/graphics/java/android/graphics/drawable/Drawable.java +++ b/graphics/java/android/graphics/drawable/Drawable.java @@ -17,6 +17,7 @@ package android.graphics.drawable; import android.graphics.Insets; +import android.os.Trace; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; @@ -745,7 +746,12 @@ public abstract class Drawable { * Create a drawable from an inputstream */ public static Drawable createFromStream(InputStream is, String srcName) { - return createFromResourceStream(null, null, is, srcName, null); + Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, srcName != null ? srcName : "Unknown drawable"); + try { + return createFromResourceStream(null, null, is, srcName, null); + } finally { + Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); + } } /** @@ -754,7 +760,12 @@ public abstract class Drawable { */ public static Drawable createFromResourceStream(Resources res, TypedValue value, InputStream is, String srcName) { - return createFromResourceStream(res, value, is, srcName, null); + Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, srcName != null ? srcName : "Unknown drawable"); + try { + return createFromResourceStream(res, value, is, srcName, null); + } finally { + Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); + } } /** @@ -900,9 +911,14 @@ public abstract class Drawable { return null; } - Bitmap bm = BitmapFactory.decodeFile(pathName); - if (bm != null) { - return drawableFromBitmap(null, bm, null, null, null, pathName); + Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, pathName); + try { + Bitmap bm = BitmapFactory.decodeFile(pathName); + if (bm != null) { + return drawableFromBitmap(null, bm, null, null, null, pathName); + } + } finally { + Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); } return null; diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index ea29b7d..5d1990a 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -277,21 +277,13 @@ public class Allocation extends BaseObj { throw new RSIllegalArgumentException("Invalid usage combination."); } } - if (t != null) { - // don't need to account for USAGE_SHARED Allocations - if ((usage & USAGE_SHARED) == 0) { - int numBytes = t.getCount() * t.getElement().getBytesSize(); - rs.addAllocSizeForGC(numBytes); - mGCSize = numBytes; - } - } + mType = t; mUsage = usage; if (t != null) { updateCacheInfo(t); } - } private void validateIsInt32() { @@ -355,12 +347,6 @@ public class Allocation extends BaseObj { mType.updateFromNative(); updateCacheInfo(mType); } - // don't need to account for USAGE_SHARED Allocations - if ((mUsage & USAGE_SHARED) == 0) { - int numBytes = mType.getCount() * mType.getElement().getBytesSize(); - mRS.addAllocSizeForGC(numBytes); - mGCSize = numBytes; - } } /** @@ -1264,7 +1250,6 @@ public class Allocation extends BaseObj { if (type.getID(rs) == 0) { throw new RSInvalidStateException("Bad Type"); } - int id = rs.nAllocationCreateTyped(type.getID(rs), mips.mID, usage, 0); if (id == 0) { throw new RSRuntimeException("Allocation creation failed."); @@ -1414,6 +1399,7 @@ public class Allocation extends BaseObj { return alloc; } + int id = rs.nAllocationCreateFromBitmap(t.getID(rs), mips.mID, b, usage); if (id == 0) { throw new RSRuntimeException("Load failed."); diff --git a/graphics/java/android/renderscript/BaseObj.java b/graphics/java/android/renderscript/BaseObj.java index c2ebc9f..f464f9b 100644 --- a/graphics/java/android/renderscript/BaseObj.java +++ b/graphics/java/android/renderscript/BaseObj.java @@ -71,9 +71,6 @@ public class BaseObj { private int mID; private boolean mDestroyed; private String mName; - - int mGCSize; - RenderScript mRS; /** @@ -138,9 +135,6 @@ public class BaseObj { throw new RSInvalidStateException("Object already destroyed."); } mDestroyed = true; - if (mGCSize != 0) { - mRS.removeAllocSizeForGC(mGCSize); - } mRS.nObjDestroy(mID); } diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index 7163151..6f614c3 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -18,9 +18,7 @@ package android.renderscript; import java.io.File; import java.lang.reflect.Field; -import java.util.concurrent.locks.*; -import android.app.ActivityManager; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; @@ -99,9 +97,29 @@ public class RenderScript { mCacheDir = cacheDir; } + /** + * ContextType specifies the specific type of context to be created. + * + */ public enum ContextType { + /** + * NORMAL context, this is the default and what shipping apps should + * use. + */ NORMAL (0), + + /** + * DEBUG context, perform extra runtime checks to validate the + * kernels and APIs are being used as intended. Get and SetElementAt + * will be bounds checked in this mode. + */ DEBUG (1), + + /** + * PROFILE context, Intended to be used once the first time an + * application is run on a new device. This mode allows the runtime to + * do additional testing and performance tuning. + */ PROFILE (2); int mID; @@ -784,8 +802,6 @@ public class RenderScript { int mContext; @SuppressWarnings({"FieldCanBeLocal"}) MessageThread mMessageThread; - GCThread mGCThread; - Element mElement_U8; Element mElement_I8; @@ -915,7 +931,8 @@ public class RenderScript { } /** - * @hide + * Place a message into the message queue to be sent back to the message + * handler once all previous commands have been executed. * * @param id * @param data @@ -1074,60 +1091,6 @@ public class RenderScript { } } - static class GCThread extends Thread { - RenderScript mRS; - boolean mRun = true; - - long currentSize = 0; - long targetSize; // call System.gc after 512MB of allocs - - final Lock lock = new ReentrantLock(); - final Condition cond = lock.newCondition(); - - GCThread(RenderScript rs) { - super("RSGCThread"); - mRS = rs; - - } - - public void run() { - ActivityManager am = (ActivityManager)mRS.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE); - ActivityManager.MemoryInfo meminfo = new ActivityManager.MemoryInfo(); - am.getMemoryInfo(meminfo); - targetSize = (long)(meminfo.totalMem * .5f); - - while(mRun) { - System.gc(); - lock.lock(); - try { - cond.awaitUninterruptibly(); - } finally { - lock.unlock(); - } - } - - Log.d(LOG_TAG, "GCThread exiting."); - } - - public synchronized void addAllocSize(long bytes) { - currentSize += bytes; - if (currentSize >= targetSize) { - lock.lock(); - try { - cond.signal(); - } finally { - lock.unlock(); - } - } - } - - public synchronized void removeAllocSize(long bytes) { - currentSize -= bytes; - } - - } - - RenderScript(Context ctx) { if (ctx != null) { mApplicationContext = ctx.getApplicationContext(); @@ -1150,15 +1113,6 @@ public class RenderScript { return create(ctx, sdkVersion, ContextType.NORMAL); } - void addAllocSizeForGC(int bytes) { - mGCThread.addAllocSize(bytes); - } - - void removeAllocSizeForGC(int bytes) { - mGCThread.removeAllocSize(bytes); - } - - /** * Create a basic RenderScript context. * @@ -1175,9 +1129,7 @@ public class RenderScript { throw new RSDriverException("Failed to create RS context."); } rs.mMessageThread = new MessageThread(rs); - rs.mGCThread = new GCThread(rs); rs.mMessageThread.start(); - rs.mGCThread.start(); return rs; } @@ -1194,9 +1146,9 @@ public class RenderScript { /** * Create a basic RenderScript context. * - * @hide * * @param ctx The context. + * @param ct The type of context to be created. * @return RenderScript */ public static RenderScript create(Context ctx, ContextType ct) { @@ -1232,11 +1184,8 @@ public class RenderScript { validate(); nContextDeinitToClient(mContext); mMessageThread.mRun = false; - mGCThread.mRun = false; - mGCThread.addAllocSize(0); try { mMessageThread.join(); - mGCThread.join(); } catch(InterruptedException e) { } diff --git a/graphics/java/android/renderscript/RenderScriptGL.java b/graphics/java/android/renderscript/RenderScriptGL.java index fad8838..52034b1 100644 --- a/graphics/java/android/renderscript/RenderScriptGL.java +++ b/graphics/java/android/renderscript/RenderScriptGL.java @@ -198,9 +198,6 @@ public class RenderScriptGL extends RenderScript { } mMessageThread = new MessageThread(this); mMessageThread.start(); - mGCThread = new GCThread(this); - mGCThread.start(); - } /** diff --git a/graphics/java/android/renderscript/ScriptC.java b/graphics/java/android/renderscript/ScriptC.java index 2f69775..221f760 100644 --- a/graphics/java/android/renderscript/ScriptC.java +++ b/graphics/java/android/renderscript/ScriptC.java @@ -60,8 +60,6 @@ public class ScriptC extends Script { throw new RSRuntimeException("Loading of ScriptC script failed."); } setID(id); - mGCSize = 2 * 1024 * 1024; - rs.addAllocSizeForGC(mGCSize); } /** diff --git a/graphics/java/android/renderscript/ScriptIntrinsic3DLUT.java b/graphics/java/android/renderscript/ScriptIntrinsic3DLUT.java index 3e58b87..86f37d8 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsic3DLUT.java +++ b/graphics/java/android/renderscript/ScriptIntrinsic3DLUT.java @@ -20,7 +20,11 @@ import android.util.Log; /** * - * @hide + * Intrinsic for converting RGB to RGBA by using a 3D lookup table. The + * incoming r,g,b values are use as normalized x,y,z coordinates into a 3D + * allocation. The 8 nearest values are sampled and linearly interpolated. The + * result is placed in the output. + * **/ public final class ScriptIntrinsic3DLUT extends ScriptIntrinsic { private Allocation mLUT; diff --git a/graphics/java/android/renderscript/Type.java b/graphics/java/android/renderscript/Type.java index d7c8255..a5e24ce 100644 --- a/graphics/java/android/renderscript/Type.java +++ b/graphics/java/android/renderscript/Type.java @@ -112,7 +112,7 @@ public class Type extends BaseObj { /** * Get the YUV format * - * @hide + * * @return int */ public int getYuv() { @@ -277,7 +277,9 @@ public class Type extends BaseObj { } /** - * @hide + * Set the YUV layout for a Type. This controls how the memory is + * interpreted. Generally and application should not need to call this + * function and it would be set by the Camera. * * only NV21, YV12. Enums from ImageFormat */ diff --git a/libs/hwui/Dither.cpp b/libs/hwui/Dither.cpp index 51f1e39..19b3849 100644 --- a/libs/hwui/Dither.cpp +++ b/libs/hwui/Dither.cpp @@ -75,6 +75,7 @@ void Dither::bindDitherTexture() { void Dither::clear() { if (mInitialized) { glDeleteTextures(1, &mDitherTexture); + mInitialized = false; } } diff --git a/media/java/android/media/MediaExtractor.java b/media/java/android/media/MediaExtractor.java index 286e203..cf159f0 100644 --- a/media/java/android/media/MediaExtractor.java +++ b/media/java/android/media/MediaExtractor.java @@ -67,7 +67,7 @@ final public class MediaExtractor { * Sets the DataSource object to be used as the data source for this extractor * {@hide} */ - public native final void setDataSource(DataSource source); + public native final void setDataSource(DataSource source) throws IOException; /** * Sets the data source as a content Uri. @@ -121,7 +121,8 @@ final public class MediaExtractor { * @param path the path of the file, or the http URL * @param headers the headers associated with the http request for the stream you want to play */ - public final void setDataSource(String path, Map<String, String> headers) { + public final void setDataSource(String path, Map<String, String> headers) + throws IOException { String[] keys = null; String[] values = null; @@ -140,7 +141,7 @@ final public class MediaExtractor { } private native final void setDataSource( - String path, String[] keys, String[] values); + String path, String[] keys, String[] values) throws IOException; /** * Sets the data source (file-path or http URL) to use. @@ -154,7 +155,7 @@ final public class MediaExtractor { * As an alternative, the application could first open the file for reading, * and then use the file descriptor form {@link #setDataSource(FileDescriptor)}. */ - public final void setDataSource(String path) { + public final void setDataSource(String path) throws IOException { setDataSource(path, null, null); } @@ -164,7 +165,7 @@ final public class MediaExtractor { * * @param fd the FileDescriptor for the file you want to extract from. */ - public final void setDataSource(FileDescriptor fd) { + public final void setDataSource(FileDescriptor fd) throws IOException { setDataSource(fd, 0, 0x7ffffffffffffffL); } @@ -178,7 +179,7 @@ final public class MediaExtractor { * @param length the length in bytes of the data to be extracted */ public native final void setDataSource( - FileDescriptor fd, long offset, long length); + FileDescriptor fd, long offset, long length) throws IOException; @Override protected void finalize() { diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java index 85a32ca..f745163 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -1181,7 +1181,8 @@ public class MediaPlayer /** * Gets the duration of the file. * - * @return the duration in milliseconds + * @return the duration in milliseconds, if no duration is available + * (for example, if streaming live content), -1 is returned. */ public native int getDuration(); diff --git a/media/java/android/media/RemoteControlClient.java b/media/java/android/media/RemoteControlClient.java index 93bcf03..4a5e82e 100644 --- a/media/java/android/media/RemoteControlClient.java +++ b/media/java/android/media/RemoteControlClient.java @@ -277,14 +277,12 @@ public class RemoteControlClient */ public final static int FLAG_KEY_MEDIA_NEXT = 1 << 7; /** - * @hide - * TODO un-hide and add in javadoc of setTransportControlFlags(int) * Flag indicating a RemoteControlClient can receive changes in the media playback position - * through the {@link #OnPlaybackPositionUpdateListener} interface. This flag must be set + * through the {@link OnPlaybackPositionUpdateListener} interface. This flag must be set * in order for components that display the RemoteControlClient information, to display and * let the user control media playback position. * @see #setTransportControlFlags(int) - * @see #setPlaybackPositionProvider(PlaybackPositionProvider) + * @see #setOnGetPlaybackPositionListener(OnGetPlaybackPositionListener) * @see #setPlaybackPositionUpdateListener(OnPlaybackPositionUpdateListener) */ public final static int FLAG_KEY_MEDIA_POSITION_UPDATE = 1 << 8; @@ -607,8 +605,6 @@ public class RemoteControlClient } /** - * @hide - * TODO un-hide * Sets the current playback state and the matching media position for the current playback * speed. * @param state The current playback state, one of the following values: @@ -660,7 +656,8 @@ public class RemoteControlClient * {@link #FLAG_KEY_MEDIA_PAUSE}, * {@link #FLAG_KEY_MEDIA_STOP}, * {@link #FLAG_KEY_MEDIA_FAST_FORWARD}, - * {@link #FLAG_KEY_MEDIA_NEXT} + * {@link #FLAG_KEY_MEDIA_NEXT}, + * {@link #FLAG_KEY_MEDIA_POSITION_UPDATE} */ public void setTransportControlFlags(int transportControlFlags) { synchronized(mCacheLock) { @@ -673,8 +670,6 @@ public class RemoteControlClient } /** - * @hide - * TODO un-hide * Interface definition for a callback to be invoked when the media playback position is * requested to be updated. * @see RemoteControlClient#FLAG_KEY_MEDIA_POSITION_UPDATE @@ -684,7 +679,7 @@ public class RemoteControlClient * Called on the implementer to notify it that the playback head should be set at the given * position. If the position can be changed from its current value, the implementor of * the interface must also update the playback position using - * {@link RemoteControlClient#setPlaybackState(int, long, int)} to reflect the actual new + * {@link #setPlaybackState(int, long, float)} to reflect the actual new * position being used, regardless of whether it differs from the requested position. * Failure to do so would cause the system to not know the new actual playback position, * and user interface components would fail to show the user where playback resumed after @@ -695,30 +690,26 @@ public class RemoteControlClient } /** - * @hide - * TODO un-hide * Interface definition for a callback to be invoked when the media playback position is * queried. * @see RemoteControlClient#FLAG_KEY_MEDIA_POSITION_UPDATE */ - public interface PlaybackPositionProvider { + public interface OnGetPlaybackPositionListener { /** * Called on the implementer of the interface to query the current playback position. * @return a negative value if the current playback position (or the last valid playback * position) is not known, or a zero or positive value expressed in ms indicating the * current position, or the last valid known position. */ - long getPlaybackPosition(); + long onGetPlaybackPosition(); } /** - * @hide - * TODO un-hide * Sets the listener to be called whenever the media playback position is requested * to be updated. * Notifications will be received in the same thread as the one in which RemoteControlClient * was created. - * @param l + * @param l the position update listener to be called */ public void setPlaybackPositionUpdateListener(OnPlaybackPositionUpdateListener l) { synchronized(mCacheLock) { @@ -737,14 +728,12 @@ public class RemoteControlClient } /** - * @hide - * TODO un-hide * Sets the listener to be called whenever the media current playback position is needed. * Queries will be received in the same thread as the one in which RemoteControlClient * was created. - * @param l + * @param l the listener to be called to retrieve the playback position */ - public void setPlaybackPositionProvider(PlaybackPositionProvider l) { + public void setOnGetPlaybackPositionListener(OnGetPlaybackPositionListener l) { synchronized(mCacheLock) { int oldCapa = mPlaybackPositionCapabilities; if (l != null) { @@ -942,7 +931,7 @@ public class RemoteControlClient /** * Provider registered by user of RemoteControlClient to provide the current playback position. */ - private PlaybackPositionProvider mPositionProvider; + private OnGetPlaybackPositionListener mPositionProvider; /** * The current remote control client generation ID across the system, as known by this object */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index c2dc159..d98f08e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -105,7 +105,7 @@ public class PhoneStatusBar extends BaseStatusBar { public static final boolean DEBUG = BaseStatusBar.DEBUG; public static final boolean SPEW = DEBUG; public static final boolean DUMPTRUCK = true; // extra dumpsys info - public static final boolean DEBUG_GESTURES = true; + public static final boolean DEBUG_GESTURES = false; public static final boolean DEBUG_CLINGS = false; diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 2417cff..bc1df85 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -936,6 +936,12 @@ public final class ActivityManagerService extends ActivityManagerNative CompatModeDialog mCompatModeDialog; long mLastMemUsageReportTime = 0; + /** + * Flag whether the current user is a "monkey", i.e. whether + * the UI is driven by a UI automation tool. + */ + private boolean mUserIsMonkey; + final Handler mHandler = new Handler() { //public Handler() { // if (localLOGV) Slog.v(TAG, "Handler started!"); @@ -7434,11 +7440,27 @@ public final class ActivityManagerService extends ActivityManagerNative } } + public void setUserIsMonkey(boolean userIsMonkey) { + synchronized (this) { + synchronized (mPidsSelfLocked) { + final int callingPid = Binder.getCallingPid(); + ProcessRecord precessRecord = mPidsSelfLocked.get(callingPid); + if (precessRecord == null) { + throw new SecurityException("Unknown process: " + callingPid); + } + if (precessRecord.instrumentationUiAutomationConnection == null) { + throw new SecurityException("Only an instrumentation process " + + "with a UiAutomation can call setUserIsMonkey"); + } + } + mUserIsMonkey = userIsMonkey; + } + } + public boolean isUserAMonkey() { - // For now the fact that there is a controller implies - // we have a monkey. synchronized (this) { - return mController != null; + // If there is a controller also implies the user is a monkey. + return (mUserIsMonkey || mController != null); } } @@ -12435,6 +12457,9 @@ public final class ActivityManagerService extends ActivityManagerNative } catch (RemoteException re) { /* ignore */ } + // Only a UiAutomation can set this flag and now that + // it is finished we make sure it is reset to its default. + mUserIsMonkey = false; } app.instrumentationWatcher = null; app.instrumentationUiAutomationConnection = null; |