diff options
18 files changed, 117 insertions, 55 deletions
diff --git a/api/current.txt b/api/current.txt index 5f1acbe..c796cdb 100644 --- a/api/current.txt +++ b/api/current.txt @@ -4510,8 +4510,8 @@ package android.app { } public class KeyguardManager { + method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence); method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); - method public android.content.Intent getConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence); method public boolean inKeyguardRestrictedInputMode(); method public boolean isKeyguardLocked(); method public boolean isKeyguardSecure(); @@ -5454,7 +5454,6 @@ package android.app.admin { method public boolean getScreenCaptureDisabled(android.content.ComponentName); method public boolean getStorageEncryption(android.content.ComponentName); method public int getStorageEncryptionStatus(); - method public java.util.List<java.lang.String> getTrustAgentFeaturesEnabled(android.content.ComponentName, android.content.ComponentName); method public boolean getUninstallBlocked(android.content.ComponentName, java.lang.String); method public boolean hasCaCertInstalled(byte[]); method public boolean hasGrantedPolicy(android.content.ComponentName, int); @@ -5502,7 +5501,6 @@ package android.app.admin { method public void setScreenCaptureDisabled(android.content.ComponentName, boolean); method public void setSecureSetting(android.content.ComponentName, java.lang.String, java.lang.String); method public int setStorageEncryption(android.content.ComponentName, boolean); - method public void setTrustAgentFeaturesEnabled(android.content.ComponentName, android.content.ComponentName, java.util.List<java.lang.String>); method public void setUninstallBlocked(android.content.ComponentName, java.lang.String, boolean); method public boolean switchUser(android.content.ComponentName, android.os.UserHandle); method public void uninstallAllUserCaCerts(android.content.ComponentName); diff --git a/api/removed.txt b/api/removed.txt index 1b8aef4..1fde099 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -1,3 +1,11 @@ +package android.app { + + public class KeyguardManager { + method public android.content.Intent getConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence); + } + +} + package android.media { public class AudioFormat { diff --git a/core/java/android/app/KeyguardManager.java b/core/java/android/app/KeyguardManager.java index 50e3a10..e055237 100644 --- a/core/java/android/app/KeyguardManager.java +++ b/core/java/android/app/KeyguardManager.java @@ -56,6 +56,13 @@ public class KeyguardManager { public static final String EXTRA_DESCRIPTION = "android.app.extra.DESCRIPTION"; /** + * @removed + */ + public Intent getConfirmDeviceCredentialIntent(CharSequence title, CharSequence description) { + return createConfirmDeviceCredentialIntent(title, description); + } + + /** * Get an intent to prompt the user to confirm credentials (pin, pattern or password) * for the current user of the device. The caller is expected to launch this activity using * {@link android.app.Activity#startActivityForResult(Intent, int)} and check for @@ -63,7 +70,7 @@ public class KeyguardManager { * * @return the intent for launching the activity or null if no password is required. **/ - public Intent getConfirmDeviceCredentialIntent(CharSequence title, CharSequence description) { + public Intent createConfirmDeviceCredentialIntent(CharSequence title, CharSequence description) { if (!isKeyguardSecure()) return null; Intent intent = new Intent(ACTION_CONFIRM_DEVICE_CREDENTIAL); intent.putExtra(EXTRA_TITLE, title); diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 26c72a5..3f82157 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -2562,6 +2562,7 @@ public class DevicePolicyManager { * @param agent Which component to enable features for. * @param features List of features to enable. Consult specific TrustAgent documentation for * the feature list. + * @hide */ public void setTrustAgentFeaturesEnabled(ComponentName admin, ComponentName agent, List<String> features) { @@ -2582,6 +2583,7 @@ public class DevicePolicyManager { * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param agent Which component to get enabled features for. * @return List of enabled features. + * @hide */ public List<String> getTrustAgentFeaturesEnabled(ComponentName admin, ComponentName agent) { if (mService != null) { @@ -2689,10 +2691,10 @@ public class DevicePolicyManager { * Called by a profile or device owner to set the permitted accessibility services. When * set by a device owner or profile owner the restriction applies to all profiles of the * user the device owner or profile owner is an admin for. - * + * * By default the user can use any accessiblity service. When zero or more packages have * been added, accessiblity services that are not in the list and not part of the system - * can not be enabled by the user. + * can not be enabled by the user. * * <p> Calling with a null value for the list disables the restriction so that all services * can be used, calling with an empty list only allows the builtin system's services. diff --git a/core/java/android/service/trust/TrustAgentService.java b/core/java/android/service/trust/TrustAgentService.java index 337ae60..3ef5b37 100644 --- a/core/java/android/service/trust/TrustAgentService.java +++ b/core/java/android/service/trust/TrustAgentService.java @@ -89,6 +89,7 @@ public class TrustAgentService extends Service { /** * A white list of features that the given trust agent should support when otherwise disabled * by device policy. + * @hide */ public static final String KEY_FEATURES = "trust_agent_features"; @@ -184,6 +185,7 @@ public class TrustAgentService extends Service { * * @param options Option feature bundle. * @return true if the {@link TrustAgentService} supports this feature. + * @hide */ public boolean onSetTrustAgentFeaturesEnabled(Bundle options) { return false; diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index bb469a3..2420ebc 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -333,6 +333,8 @@ public final class ViewRootImpl implements ViewParent, private boolean mRemoved; private boolean mIsEmulator; + private boolean mIsCircularEmulator; + private final boolean mWindowIsRound; /** * Consistency verifier for debugging purposes. @@ -388,6 +390,8 @@ public final class ViewRootImpl implements ViewParent, mChoreographer = Choreographer.getInstance(); mDisplayManager = (DisplayManager)context.getSystemService(Context.DISPLAY_SERVICE); loadSystemProperties(); + mWindowIsRound = context.getResources().getBoolean( + com.android.internal.R.bool.config_windowIsRound); } public static void addFirstDrawHandler(Runnable callback) { @@ -1183,14 +1187,7 @@ public final class ViewRootImpl implements ViewParent, void dispatchApplyInsets(View host) { mDispatchContentInsets.set(mAttachInfo.mContentInsets); mDispatchStableInsets.set(mAttachInfo.mStableInsets); - boolean isRound = false; - if ((mWindowAttributes.flags & WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN) != 0 - && mDisplay.getDisplayId() == 0) { - // we're fullscreen and not hosted in an ActivityView - isRound = (mIsEmulator && SystemProperties.getBoolean(PROPERTY_EMULATOR_CIRCULAR, false)) - || mContext.getResources().getBoolean( - com.android.internal.R.bool.config_windowIsRound); - } + final boolean isRound = (mIsEmulator && mIsCircularEmulator) || mWindowIsRound; host.dispatchApplyWindowInsets(new WindowInsets( mDispatchContentInsets, null /* windowDecorInsets */, mDispatchStableInsets, isRound)); @@ -5431,6 +5428,8 @@ public final class ViewRootImpl implements ViewParent, // detect emulator mIsEmulator = Build.HARDWARE.contains("goldfish"); + mIsCircularEmulator = + SystemProperties.getBoolean(PROPERTY_EMULATOR_CIRCULAR, false); } }); } diff --git a/core/res/res/drawable/progress_horizontal_material.xml b/core/res/res/drawable/progress_horizontal_material.xml index d7440a9..7a1079c 100644 --- a/core/res/res/drawable/progress_horizontal_material.xml +++ b/core/res/res/drawable/progress_horizontal_material.xml @@ -17,7 +17,8 @@ <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@id/background"> <nine-patch android:src="@drawable/progress_mtrl_alpha" - android:tint="?attr/colorControlNormal" /> + android:tint="?attr/colorControlNormal" + android:alpha="0.5" /> </item> <item android:id="@id/secondaryProgress"> <scale android:scaleWidth="100%"> diff --git a/core/res/res/values-television/dimens.xml b/core/res/res/values-television/dimens.xml index 8266642..69c3da5 100644 --- a/core/res/res/values-television/dimens.xml +++ b/core/res/res/values-television/dimens.xml @@ -16,8 +16,8 @@ <resources> <!-- Lighting and shadow properties --> - <dimen name="light_y">-300dp</dimen> - <item type="dimen" format="float" name="ambient_shadow_alpha">0.4</item> - <item type="dimen" format="float" name="spot_shadow_alpha">0.4</item> + <dimen name="light_y">-400dp</dimen> + <item type="dimen" format="float" name="ambient_shadow_alpha">0.06</item> + <item type="dimen" format="float" name="spot_shadow_alpha">0.3</item> </resources> diff --git a/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java b/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java index 0bc4fdf..4c8b4f1 100644 --- a/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java @@ -346,22 +346,24 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac private boolean mCanConstantState; private boolean mCheckedConstantState; - public AnimatedRotateState(AnimatedRotateState source, AnimatedRotateDrawable owner, + public AnimatedRotateState(AnimatedRotateState orig, AnimatedRotateDrawable owner, Resources res) { - if (source != null) { + if (orig != null) { if (res != null) { - mDrawable = source.mDrawable.getConstantState().newDrawable(res); + mDrawable = orig.mDrawable.getConstantState().newDrawable(res); } else { - mDrawable = source.mDrawable.getConstantState().newDrawable(); + mDrawable = orig.mDrawable.getConstantState().newDrawable(); } mDrawable.setCallback(owner); - mDrawable.setLayoutDirection(source.mDrawable.getLayoutDirection()); - mPivotXRel = source.mPivotXRel; - mPivotX = source.mPivotX; - mPivotYRel = source.mPivotYRel; - mPivotY = source.mPivotY; - mFramesCount = source.mFramesCount; - mFrameDuration = source.mFrameDuration; + mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection()); + mDrawable.setBounds(orig.mDrawable.getBounds()); + mDrawable.setLevel(orig.mDrawable.getLevel()); + mPivotXRel = orig.mPivotXRel; + mPivotX = orig.mPivotX; + mPivotYRel = orig.mPivotYRel; + mPivotY = orig.mPivotY; + mFramesCount = orig.mFramesCount; + mFrameDuration = orig.mFrameDuration; mCanConstantState = mCheckedConstantState = true; } } diff --git a/graphics/java/android/graphics/drawable/ClipDrawable.java b/graphics/java/android/graphics/drawable/ClipDrawable.java index f116376..61ef81b 100644 --- a/graphics/java/android/graphics/drawable/ClipDrawable.java +++ b/graphics/java/android/graphics/drawable/ClipDrawable.java @@ -285,6 +285,8 @@ public class ClipDrawable extends Drawable implements Drawable.Callback { } mDrawable.setCallback(owner); mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection()); + mDrawable.setBounds(orig.mDrawable.getBounds()); + mDrawable.setLevel(orig.mDrawable.getLevel()); mOrientation = orig.mOrientation; mGravity = orig.mGravity; mCheckedConstantState = mCanConstantState = true; diff --git a/graphics/java/android/graphics/drawable/InsetDrawable.java b/graphics/java/android/graphics/drawable/InsetDrawable.java index dd0f06f..a20b6d8 100644 --- a/graphics/java/android/graphics/drawable/InsetDrawable.java +++ b/graphics/java/android/graphics/drawable/InsetDrawable.java @@ -400,6 +400,8 @@ public class InsetDrawable extends Drawable implements Drawable.Callback { } mDrawable.setCallback(owner); mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection()); + mDrawable.setBounds(orig.mDrawable.getBounds()); + mDrawable.setLevel(orig.mDrawable.getLevel()); mInsetLeft = orig.mInsetLeft; mInsetTop = orig.mInsetTop; mInsetRight = orig.mInsetRight; diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java index 43bc89a..001ed88 100644 --- a/graphics/java/android/graphics/drawable/LayerDrawable.java +++ b/graphics/java/android/graphics/drawable/LayerDrawable.java @@ -961,20 +961,22 @@ public class LayerDrawable extends Drawable implements Drawable.Callback { // Default empty constructor. } - ChildDrawable(ChildDrawable or, LayerDrawable owner, Resources res) { + ChildDrawable(ChildDrawable orig, LayerDrawable owner, Resources res) { if (res != null) { - mDrawable = or.mDrawable.getConstantState().newDrawable(res); + mDrawable = orig.mDrawable.getConstantState().newDrawable(res); } else { - mDrawable = or.mDrawable.getConstantState().newDrawable(); + mDrawable = orig.mDrawable.getConstantState().newDrawable(); } mDrawable.setCallback(owner); - mDrawable.setLayoutDirection(or.mDrawable.getLayoutDirection()); - mThemeAttrs = or.mThemeAttrs; - mInsetL = or.mInsetL; - mInsetT = or.mInsetT; - mInsetR = or.mInsetR; - mInsetB = or.mInsetB; - mId = or.mId; + mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection()); + mDrawable.setBounds(orig.mDrawable.getBounds()); + mDrawable.setLevel(orig.mDrawable.getLevel()); + mThemeAttrs = orig.mThemeAttrs; + mInsetL = orig.mInsetL; + mInsetT = orig.mInsetT; + mInsetR = orig.mInsetR; + mInsetB = orig.mInsetB; + mId = orig.mId; } } diff --git a/graphics/java/android/graphics/drawable/RotateDrawable.java b/graphics/java/android/graphics/drawable/RotateDrawable.java index 63b9e02..70482a6 100644 --- a/graphics/java/android/graphics/drawable/RotateDrawable.java +++ b/graphics/java/android/graphics/drawable/RotateDrawable.java @@ -507,21 +507,23 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { private boolean mCanConstantState; private boolean mCheckedConstantState; - public RotateState(RotateState source, RotateDrawable owner, Resources res) { - if (source != null) { + public RotateState(RotateState orig, RotateDrawable owner, Resources res) { + if (orig != null) { if (res != null) { - mDrawable = source.mDrawable.getConstantState().newDrawable(res); + mDrawable = orig.mDrawable.getConstantState().newDrawable(res); } else { - mDrawable = source.mDrawable.getConstantState().newDrawable(); + mDrawable = orig.mDrawable.getConstantState().newDrawable(); } mDrawable.setCallback(owner); - mDrawable.setLayoutDirection(source.mDrawable.getLayoutDirection()); - mPivotXRel = source.mPivotXRel; - mPivotX = source.mPivotX; - mPivotYRel = source.mPivotYRel; - mPivotY = source.mPivotY; - mFromDegrees = mCurrentDegrees = source.mFromDegrees; - mToDegrees = source.mToDegrees; + mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection()); + mDrawable.setBounds(orig.mDrawable.getBounds()); + mDrawable.setLevel(orig.mDrawable.getLevel()); + mPivotXRel = orig.mPivotXRel; + mPivotX = orig.mPivotX; + mPivotYRel = orig.mPivotYRel; + mPivotY = orig.mPivotY; + mFromDegrees = mCurrentDegrees = orig.mFromDegrees; + mToDegrees = orig.mToDegrees; mCanConstantState = mCheckedConstantState = true; } } diff --git a/graphics/java/android/graphics/drawable/ScaleDrawable.java b/graphics/java/android/graphics/drawable/ScaleDrawable.java index a954474..b40038a 100644 --- a/graphics/java/android/graphics/drawable/ScaleDrawable.java +++ b/graphics/java/android/graphics/drawable/ScaleDrawable.java @@ -295,6 +295,8 @@ public class ScaleDrawable extends Drawable implements Drawable.Callback { } mDrawable.setCallback(owner); mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection()); + mDrawable.setBounds(orig.mDrawable.getBounds()); + mDrawable.setLevel(orig.mDrawable.getLevel()); mScaleWidth = orig.mScaleWidth; mScaleHeight = orig.mScaleHeight; mGravity = orig.mGravity; diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index dae539b..bce4074 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -4290,7 +4290,8 @@ public class AudioService extends IAudioService.Stub { if ((state == 0) && ((device & mBecomingNoisyIntentDevices) != 0)) { int devices = 0; for (int dev : mConnectedDevices.keySet()) { - if ((dev & mBecomingNoisyIntentDevices) != 0) { + if (((dev & AudioSystem.DEVICE_BIT_IN) == 0) && + ((dev & mBecomingNoisyIntentDevices) != 0)) { devices |= dev; } } diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index e240127..a13da609 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -3206,8 +3206,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { Context.WINDOW_SERVICE); if (windowService != null) { final Display display = windowService.getDefaultDisplay(); - if (display.getDisplayId() == Display.DEFAULT_DISPLAY && - a.hasValue(R.styleable.Window_windowOutsetBottom)) { + final boolean shouldUseBottomOutset = + display.getDisplayId() == Display.DEFAULT_DISPLAY + || (getForcedWindowFlags() & FLAG_FULLSCREEN) != 0; + if (shouldUseBottomOutset && a.hasValue(R.styleable.Window_windowOutsetBottom)) { if (mOutsetBottom == null) mOutsetBottom = new TypedValue(); a.getValue(R.styleable.Window_windowOutsetBottom, mOutsetBottom); diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 5a836c8..e382a9f 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -545,6 +545,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { private static final int MSG_DISPATCH_SHOW_RECENTS = 9; private static final int MSG_DISPATCH_SHOW_GLOBAL_ACTIONS = 10; private static final int MSG_HIDE_BOOT_MESSAGE = 11; + private static final int MSG_LAUNCH_VOICE_ASSIST_WITH_WAKE_LOCK = 12; private class PolicyHandler extends Handler { @Override @@ -590,6 +591,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { case MSG_HIDE_BOOT_MESSAGE: handleHideBootMessage(); break; + case MSG_LAUNCH_VOICE_ASSIST_WITH_WAKE_LOCK: + launchVoiceAssistWithWakeLock(msg.arg1 != 0); + break; } } } @@ -2342,11 +2346,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { } else if (keyCode == KeyEvent.KEYCODE_VOICE_ASSIST) { if (!down) { Intent voiceIntent; - if (!keyguardOn && mPowerManager.isInteractive()) { + if (!keyguardOn) { voiceIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH); } else { voiceIntent = new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE); - voiceIntent.putExtra(RecognizerIntent.EXTRA_SECURE, keyguardOn); + voiceIntent.putExtra(RecognizerIntent.EXTRA_SECURE, true); } mContext.startActivityAsUser(voiceIntent, UserHandle.CURRENT_OR_SELF); } @@ -4445,6 +4449,19 @@ public class PhoneWindowManager implements WindowManagerPolicy { } break; } + case KeyEvent.KEYCODE_VOICE_ASSIST: { + // Only do this if we would otherwise not pass it to the user. In that case, + // interceptKeyBeforeDispatching would apply a similar but different policy in + // order to invoke voice assist actions. Note that we need to make a copy of the + // key event here because the original key event will be recycled when we return. + if ((result & ACTION_PASS_TO_USER) == 0 && !down) { + mBroadcastWakeLock.acquire(); + Message msg = mHandler.obtainMessage(MSG_LAUNCH_VOICE_ASSIST_WITH_WAKE_LOCK, + keyguardActive ? 1 : 0, 0); + msg.setAsynchronous(true); + msg.sendToTarget(); + } + } } if (useHapticFeedback) { @@ -4551,6 +4568,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } + void launchVoiceAssistWithWakeLock(boolean keyguardActive) { + Intent voiceIntent = + new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE); + voiceIntent.putExtra(RecognizerIntent.EXTRA_SECURE, keyguardActive); + mContext.startActivityAsUser(voiceIntent, UserHandle.CURRENT_OR_SELF); + mBroadcastWakeLock.release(); + } + BroadcastReceiver mDockReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 972a86d..6ca536c 100755 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -3816,6 +3816,11 @@ public final class ActivityManagerService extends ActivityManagerNative * of affiliations. */ void cleanupRecentTasksLocked(int userId) { + if (mRecentTasks == null) { + // Happens when called from the packagemanager broadcast before boot. + return; + } + final HashMap<ComponentName, ActivityInfo> availActCache = new HashMap<>(); final HashMap<String, ApplicationInfo> availAppCache = new HashMap<>(); final IPackageManager pm = AppGlobals.getPackageManager(); |