diff options
-rw-r--r-- | api/current.xml | 11 | ||||
-rw-r--r-- | core/java/android/accounts/AccountManagerService.java | 7 | ||||
-rw-r--r-- | core/java/android/app/ActivityManager.java | 7 | ||||
-rw-r--r-- | core/java/android/view/WindowManager.java | 29 | ||||
-rw-r--r-- | core/java/com/android/internal/widget/DigitalClock.java | 2 | ||||
-rw-r--r-- | core/res/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | core/res/res/layout/volume_adjust.xml | 2 | ||||
-rw-r--r-- | core/res/res/values/attrs_manifest.xml | 16 | ||||
-rw-r--r-- | libs/rs/rsContext.cpp | 4 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/LockScreen.java | 5 | ||||
-rw-r--r-- | services/audioflinger/AudioPolicyManagerBase.cpp | 8 |
11 files changed, 79 insertions, 14 deletions
diff --git a/api/current.xml b/api/current.xml index 4f0898e..4ca0b39 100644 --- a/api/current.xml +++ b/api/current.xml @@ -24982,6 +24982,17 @@ <exception name="SecurityException" type="java.lang.SecurityException"> </exception> </method> +<method name="isRunningInTestHarness" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="isUserAMonkey" return="boolean" abstract="false" diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java index 72da2ce..6e04587 100644 --- a/core/java/android/accounts/AccountManagerService.java +++ b/core/java/android/accounts/AccountManagerService.java @@ -21,6 +21,7 @@ import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.TelephonyIntents; import android.Manifest; +import android.app.ActivityManager; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; @@ -162,8 +163,6 @@ public class AccountManagerService private static AtomicReference<AccountManagerService> sThis = new AtomicReference<AccountManagerService>(); - private static final boolean isDebuggableMonkeyBuild = - SystemProperties.getBoolean("ro.monkey", false); private static final Account[] EMPTY_ACCOUNT_ARRAY = new Account[]{}; static { @@ -1992,12 +1991,12 @@ public class AccountManagerService account.name, account.type}; final boolean permissionGranted = DatabaseUtils.longForQuery(db, COUNT_OF_MATCHING_GRANTS, args) != 0; - if (!permissionGranted && isDebuggableMonkeyBuild) { + if (!permissionGranted && ActivityManager.isRunningInTestHarness()) { // TODO: Skip this check when running automated tests. Replace this // with a more general solution. Log.d(TAG, "no credentials permission for usage of " + account + ", " + authTokenType + " by uid " + Binder.getCallingUid() - + " but ignoring since this is a monkey build"); + + " but ignoring since device is in test harness."); return true; } return permissionGranted; diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index 096a6eb..44db50f 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -1149,4 +1149,11 @@ public class ActivityManager { } return false; } + + /** + * Returns "true" if device is running in a test harness. + */ + public static boolean isRunningInTestHarness() { + return SystemProperties.getBoolean("ro.test_harness", false); + } } diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index c435c43..c54a3cf 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -636,8 +636,33 @@ public interface WindowManager extends ViewManager { public static final int FLAG_SPLIT_TOUCH = 0x00800000; /** - * Indicates whether this window should be hardware accelerated. - * Requesting hardware acceleration does not guarantee it will happen. + * <p>Indicates whether this window should be hardware accelerated. + * Requesting hardware acceleration does not guarantee it will happen.</p> + * + * <p>This flag can be controlled programmatically <em>only</em> to enable + * hardware acceleration. To enable hardware acceleration for a given + * window programmatically, do the following:</p> + * + * <pre> + * Window w = activity.getWindow(); // in Activity's onCreate() for instance + * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, + * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + * </pre> + * + * <p>It is important to remember that this flag <strong>must</strong> + * be set before setting the content view of your activity or dialog.</p> + * + * <p>This flag cannot be used to disable hardware acceleration after it + * was enabled in your manifest using + * {@link android.R.attr#hardwareAccelerated}. If you need to selectively + * and programmatically disable hardware acceleration (for automated testing + * for instance), make sure it is turned off in your manifest and enable it + * on your activity or dialog when you need it instead, using the method + * described above.</p> + * + * <p>This flag is automatically set by the system if the + * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated} + * XML attribute is set to true on an activity or on the application.</p> */ public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000; diff --git a/core/java/com/android/internal/widget/DigitalClock.java b/core/java/com/android/internal/widget/DigitalClock.java index ebfe9a9..bc749d8 100644 --- a/core/java/com/android/internal/widget/DigitalClock.java +++ b/core/java/com/android/internal/widget/DigitalClock.java @@ -129,7 +129,7 @@ public class DigitalClock extends RelativeLayout { mTimeDisplayBackground.setTypeface(Typeface.createFromFile(SYSTEM_FONT_TIME_BACKGROUND)); mTimeDisplayForeground = (TextView) findViewById(R.id.timeDisplayForeground); mTimeDisplayForeground.setTypeface(Typeface.createFromFile(SYSTEM_FONT_TIME_FOREGROUND)); - mAmPm = new AmPm(this, Typeface.createFromFile(SYSTEM_FONT_TIME_BACKGROUND)); + mAmPm = new AmPm(this, null); mCalendar = Calendar.getInstance(); setDateFormat(); diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 981661a..aa5be76 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -85,8 +85,6 @@ <protected-broadcast android:name="android.hardware.action.USB_CONNECTED" /> <protected-broadcast android:name="android.hardware.action.USB_DISCONNECTED" /> <protected-broadcast android:name="android.hardware.action.USB_STATE" /> - <protected-broadcast android:name="android.hardware.action.USB_CAMERA_ATTACHED" /> - <protected-broadcast android:name="android.hardware.action.USB_CAMERA_DETACHED" /> <protected-broadcast android:name="android.nfc.action.LLCP_LINK_STATE_CHANGED" /> <protected-broadcast android:name="android.nfc.action.TRANSACTION_DETECTED" /> diff --git a/core/res/res/layout/volume_adjust.xml b/core/res/res/layout/volume_adjust.xml index 946ca7e..c44ed0b 100644 --- a/core/res/res/layout/volume_adjust.xml +++ b/core/res/res/layout/volume_adjust.xml @@ -17,7 +17,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@android:drawable/panel_background" + android:background="@android:drawable/toast_frame" android:orientation="vertical" android:gravity="center_horizontal"> diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index fe6176d..5ff6212 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -234,8 +234,20 @@ the safe mode. --> <attr name="vmSafeMode" format="boolean" /> - <!-- Flag indicating whether the application's rendering should be hardware - accelerated if possible. --> + <!-- <p>Flag indicating whether the application's rendering should be hardware + accelerated if possible. This flag is turned off by default, both for + applications and activities.</p> + <p>This flag can be set on the application and any activity declared + in the manifest. When enabled for the application, each activity is + automatically assumed to be hardware accelerated. This flag can be + overriden in the activity tags, either turning it off (if on for the + application) or on (if off for the application.)</p> + <p>When this flag is turned on for an activity (either directly or via + the application tag), every window created from the activity, including + the activity's own window, will be hardware accelerated, if possible.</p> + <p>Please refer to the documentation of + {@link android.view.WindowManager.LayoutParams#FLAG_HARDWARE_ACCELERATED} + for more information on how to control this flag programmatically.</p> --> <attr name="hardwareAccelerated" format="boolean" /> <!-- Flag indicating whether the given application component is available diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index c437d72..6a065b2 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -539,6 +539,7 @@ void Context::destroyWorkerThreadResources() { } ObjectBase::zeroAllUserRef(this); LOGV("destroyWorkerThreadResources 2"); + mExit = true; } void * Context::helperThreadProc(void *vrsc) { @@ -713,6 +714,9 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { Context::~Context() { LOGV("Context::~Context"); + + mIO.mToCore.flush(); + rsAssert(mExit); mExit = true; mPaused = false; void *res; diff --git a/policy/src/com/android/internal/policy/impl/LockScreen.java b/policy/src/com/android/internal/policy/impl/LockScreen.java index 4daf84f..79fbe0e 100644 --- a/policy/src/com/android/internal/policy/impl/LockScreen.java +++ b/policy/src/com/android/internal/policy/impl/LockScreen.java @@ -23,6 +23,7 @@ import com.android.internal.widget.SlidingTab; import com.android.internal.widget.WaveView; import com.android.internal.widget.WaveView.OnTriggerListener; +import android.app.ActivityManager; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; @@ -250,9 +251,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen, private boolean shouldEnableMenuKey() { final Resources res = getResources(); final boolean configDisabled = res.getBoolean(R.bool.config_disableMenuKeyInLockScreen); - final boolean isMonkey = SystemProperties.getBoolean("ro.monkey", false); + final boolean isTestHarness = ActivityManager.isRunningInTestHarness(); final boolean fileOverride = (new File(ENABLE_MENU_KEY_FILE)).exists(); - return !configDisabled || isMonkey || fileOverride; + return !configDisabled || isTestHarness || fileOverride; } /** diff --git a/services/audioflinger/AudioPolicyManagerBase.cpp b/services/audioflinger/AudioPolicyManagerBase.cpp index 855af9f..eeca7ab 100644 --- a/services/audioflinger/AudioPolicyManagerBase.cpp +++ b/services/audioflinger/AudioPolicyManagerBase.cpp @@ -1587,6 +1587,10 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, if (device) break; device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET; if (device) break; + device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL; + if (device) break; + device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_DGTL_DOCK_HEADSET; + if (device) break; device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET; if (device) break; #ifdef WITH_A2DP @@ -1605,6 +1609,10 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, break; case AudioSystem::FORCE_SPEAKER: + device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL; + if (device) break; + device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_DGTL_DOCK_HEADSET; + if (device) break; device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET; if (device) break; #ifdef WITH_A2DP |