diff options
13 files changed, 84 insertions, 103 deletions
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp index 62ea35194954..8ea28eca476b 100644 --- a/core/jni/android/graphics/BitmapFactory.cpp +++ b/core/jni/android/graphics/BitmapFactory.cpp @@ -367,6 +367,9 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding peeker.mOpticalInsets[0], peeker.mOpticalInsets[1], peeker.mOpticalInsets[2], peeker.mOpticalInsets[3], peeker.mOutlineInsets[0], peeker.mOutlineInsets[1], peeker.mOutlineInsets[2], peeker.mOutlineInsets[3], peeker.mOutlineRadius, peeker.mOutlineAlpha, scale); + if (ninePatchInsets == NULL) { + return nullObjectReturn("nine patch insets == null"); + } if (javaBitmap != NULL) { env->SetObjectField(javaBitmap, gBitmap_ninePatchInsetsFieldID, ninePatchInsets); } diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp index 7c41c2e428e1..d7b75dbb0324 100644 --- a/core/jni/android/graphics/Graphics.cpp +++ b/core/jni/android/graphics/Graphics.cpp @@ -419,6 +419,7 @@ jobject GraphicsJNI::createBitmap(JNIEnv* env, SkBitmap* bitmap, jbyteArray buff { SkASSERT(bitmap); SkASSERT(bitmap->pixelRef()); + SkASSERT(!env->ExceptionCheck()); bool isMutable = bitmapCreateFlags & kBitmapCreateFlag_Mutable; bool isPremultiplied = bitmapCreateFlags & kBitmapCreateFlag_Premultiplied; diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp index c802b183d41c..23fe1b990df5 100644 --- a/libs/hwui/ProgramCache.cpp +++ b/libs/hwui/ProgramCache.cpp @@ -88,7 +88,7 @@ const char* gVS_Header_Varyings_HasGradient[6] = { "varying vec2 ditherTexCoords;\n", }; const char* gVS_Header_Varyings_HasRoundRectClip = - "varying vec2 roundRectPos;\n"; + "varying highp vec2 roundRectPos;\n"; const char* gVS_Main = "\nvoid main(void) {\n"; const char* gVS_Main_OutTexCoords = diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 10fa4044b452..d15085bba088 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -1564,6 +1564,9 @@ public class AudioService extends IAudioService.Stub { callingPackage) != AppOpsManager.MODE_ALLOWED) { return; } + if (!checkAudioSettingsPermission("setMicrophoneMute()")) { + return; + } AudioSystem.muteMicrophone(on); // Post a persist microphone msg. diff --git a/packages/Keyguard/res/layout/keyguard_emergency_carrier_area_empty.xml b/packages/Keyguard/res/layout/keyguard_emergency_carrier_area_empty.xml deleted file mode 100644 index 2f4adae00cf7..000000000000 --- a/packages/Keyguard/res/layout/keyguard_emergency_carrier_area_empty.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -** -** Copyright 2012, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License") -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> - -<!-- This is a blank layout to simplify implementation on landscape on phones - it is referenced indirectly by keyguard_eca --> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="0dip" - android:layout_height="0dip" - android:orientation="vertical" - android:gravity="center" - android:layout_gravity="center_horizontal" - android:layout_alignParentBottom="true"> - -</LinearLayout> diff --git a/packages/Keyguard/res/values-land/alias.xml b/packages/Keyguard/res/values-land/alias.xml deleted file mode 100644 index 7aac5b4ab379..000000000000 --- a/packages/Keyguard/res/values-land/alias.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* //device/apps/common/assets/res/any/colors.xml -** -** Copyright 2012, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> -<resources> - <!-- Alias used to reference one of two possible layouts in keyguard. --> - <item type="layout" name="keyguard_eca">@layout/keyguard_emergency_carrier_area_empty</item> -</resources> diff --git a/packages/Keyguard/res/values-port/alias.xml b/packages/Keyguard/res/values-port/alias.xml deleted file mode 100644 index c3ecbb9e4f63..000000000000 --- a/packages/Keyguard/res/values-port/alias.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* //device/apps/common/assets/res/any/colors.xml -** -** Copyright 2012, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> -<resources> - <!-- Alias used to reference one of two possible layouts in keyguard. --> - <item type="layout" name="keyguard_eca">@layout/keyguard_emergency_carrier_area</item> -</resources> diff --git a/packages/Keyguard/res/values/alias.xml b/packages/Keyguard/res/values/alias.xml index e6657a18d76c..09e9591f37ad 100644 --- a/packages/Keyguard/res/values/alias.xml +++ b/packages/Keyguard/res/values/alias.xml @@ -49,4 +49,6 @@ <!-- Alias used to reference framework activity duration. --> <item type="integer" name="config_activityDefaultDur">@*android:integer/config_activityDefaultDur</item> + <!-- Alias used to reference one of two possible layouts in keyguard. --> + <item type="layout" name="keyguard_eca">@layout/keyguard_emergency_carrier_area</item> </resources> diff --git a/packages/SystemUI/res/drawable/notification_material_bg_dim.xml b/packages/SystemUI/res/drawable/notification_material_bg_dim.xml index b04394de7b93..65819428caf8 100644 --- a/packages/SystemUI/res/drawable/notification_material_bg_dim.xml +++ b/packages/SystemUI/res/drawable/notification_material_bg_dim.xml @@ -14,7 +14,11 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<shape xmlns:android="http://schemas.android.com/apk/res/android"> - <solid android:color="@color/notification_material_background_dimmed_color" /> - <corners android:radius="@dimen/notification_material_rounded_rect_radius" /> -</shape> +<ripple xmlns:android="http://schemas.android.com/apk/res/android"> + <item> + <shape> + <solid android:color="@color/notification_material_background_dimmed_color" /> + <corners android:radius="@dimen/notification_material_rounded_rect_radius" /> + </shape> + </item> +</ripple> diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index f3a62b85cc5f..6da811f9b8b3 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -90,7 +90,10 @@ <color name="notification_material_background_media_default_color">#ff424242</color> <!-- The color of the ripples on the untinted notifications --> - <color name="notification_ripple_untinted_color">#20000000</color> + <color name="notification_ripple_untinted_color">#28000000</color> + + <!-- The color of the ripples on the low priority notifications --> + <color name="notification_ripple_color_low_priority">#30000000</color> <!-- The color of the ripples on the tinted notifications --> <color name="notification_ripple_tinted_color">#30ffffff</color> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java index 500bf45602d6..e6984b2bd6d1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java @@ -88,6 +88,9 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView = new PathInterpolator(0.6f, 0, 0.5f, 1); private static final Interpolator ACTIVATE_INVERSE_ALPHA_INTERPOLATOR = new PathInterpolator(0, 0, 0.5f, 1); + private final int mTintedRippleColor; + private final int mLowPriorityRippleColor; + private final int mNormalRippleColor; private boolean mDimmed; private boolean mDark; @@ -153,6 +156,12 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView mNormalColor = getResources().getColor(R.color.notification_material_background_color); mLowPriorityColor = getResources().getColor( R.color.notification_material_background_low_priority_color); + mTintedRippleColor = context.getResources().getColor( + R.color.notification_ripple_tinted_color); + mLowPriorityRippleColor = context.getResources().getColor( + R.color.notification_ripple_color_low_priority); + mNormalRippleColor = context.getResources().getColor( + R.color.notification_ripple_untinted_color); } @Override @@ -191,6 +200,16 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView } } + @Override + protected void drawableStateChanged() { + super.drawableStateChanged(); + if (mDimmed) { + mBackgroundDimmed.setState(getDrawableState()); + } else { + mBackgroundNormal.setState(getDrawableState()); + } + } + private boolean handleTouchEventDimmed(MotionEvent event) { int action = event.getActionMasked(); switch (action) { @@ -372,12 +391,15 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView private void updateBackgroundTint() { int color = getBackgroundColor(); + int rippleColor = getRippleColor(); if (color == mNormalColor) { // We don't need to tint a normal notification color = 0; } mBackgroundDimmed.setTint(color); mBackgroundNormal.setTint(color); + mBackgroundDimmed.setRippleColor(rippleColor); + mBackgroundNormal.setRippleColor(rippleColor); } private void fadeBackground() { @@ -618,6 +640,18 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView } } + private int getRippleColor() { + if (mBgTint != 0) { + return mTintedRippleColor; + } else if (mShowingLegacyBackground) { + return mTintedRippleColor; + } else if (mIsBelowSpeedBump) { + return mLowPriorityRippleColor; + } else { + return mNormalRippleColor; + } + } + /** * When we draw the appear animation, we render the view in a bitmap and render this bitmap * as a shader of a rect. This call creates the Bitmap and switches the drawing mode, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java index ad274b0a70e1..5db680a1b379 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java @@ -35,15 +35,9 @@ public class NotificationBackgroundView extends View { private Drawable mBackground; private int mClipTopAmount; private int mActualHeight; - private final int mTintedRippleColor; - private final int mNormalRippleColor; public NotificationBackgroundView(Context context, AttributeSet attrs) { super(context, attrs); - mTintedRippleColor = context.getResources().getColor( - R.color.notification_ripple_tinted_color); - mNormalRippleColor = context.getResources().getColor( - R.color.notification_ripple_untinted_color); } @Override @@ -103,17 +97,10 @@ public class NotificationBackgroundView extends View { } public void setTint(int tintColor) { - int rippleColor; if (tintColor != 0) { mBackground.setColorFilter(tintColor, PorterDuff.Mode.SRC_ATOP); - rippleColor = mTintedRippleColor; } else { mBackground.clearColorFilter(); - rippleColor = mNormalRippleColor; - } - if (mBackground instanceof RippleDrawable) { - RippleDrawable ripple = (RippleDrawable) mBackground; - ripple.setColor(ColorStateList.valueOf(rippleColor)); } invalidate(); } @@ -138,4 +125,15 @@ public class NotificationBackgroundView extends View { // Prevents this view from creating a layer when alpha is animating. return false; } + + public void setState(int[] drawableState) { + mBackground.setState(drawableState); + } + + public void setRippleColor(int color) { + if (mBackground instanceof RippleDrawable) { + RippleDrawable ripple = (RippleDrawable) mBackground; + ripple.setColor(ColorStateList.valueOf(color)); + } + } } diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index 654513400e64..6bc1c9ce550e 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -1729,16 +1729,19 @@ public final class ActivityStackSupervisor implements DisplayListener { | (baseIntent.getFlags()&flagsOfInterest); intent.setFlags(launchFlags); inTask.setIntent(r); + addingToTask = true; - // If the task is not empty, then we are going to add the new activity on top - // of the task, so it can not be launching as a new task. + // If the task is not empty and the caller is asking to start it as the root + // of a new task, then we don't actually want to start this on the task. We + // will bring the task to the front, and possibly give it a new intent. } else if ((launchFlags & Intent.FLAG_ACTIVITY_NEW_TASK) != 0) { - ActivityOptions.abort(options); - throw new IllegalStateException("Caller has inTask " + inTask - + " but target is a new task"); + addingToTask = false; + + } else { + addingToTask = true; } + reuseTask = inTask; - addingToTask = true; } else { inTask = null; } @@ -1979,7 +1982,7 @@ public final class ActivityStackSupervisor implements DisplayListener { sourceRecord.task : null; // Should this be considered a new task? - if (r.resultTo == null && !addingToTask + if (r.resultTo == null && inTask == null && !addingToTask && (launchFlags & Intent.FLAG_ACTIVITY_NEW_TASK) != 0) { if (isLockTaskModeViolation(reuseTask)) { Slog.e(TAG, "Attempted Lock Task Mode violation r=" + r); @@ -2092,6 +2095,13 @@ public final class ActivityStackSupervisor implements DisplayListener { } } + if (!addingToTask) { + // We don't actually want to have this activity added to the task, so just + // stop here but still tell the caller that we consumed the intent. + ActivityOptions.abort(options); + return ActivityManager.START_TASK_TO_FRONT; + } + r.setTask(inTask, null); if (DEBUG_TASKS) Slog.v(TAG, "Starting new activity " + r + " in explicit task " + r.task); |