Merge "Update APIs to JB MR1 level 17." into jb-mr1-dev
diff --git a/api/current.txt b/api/current.txt
index 56f7b88..5406157 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -4486,9 +4486,8 @@
field public static final int RESIZE_VERTICAL = 2; // 0x2
field public static final int WIDGET_CATEGORY_HOME_SCREEN = 1; // 0x1
field public static final int WIDGET_CATEGORY_KEYGUARD = 2; // 0x2
- field public static final int WIDGET_FEATURES_CLOCK = 1; // 0x1
field public static final int WIDGET_FEATURES_NONE = 0; // 0x0
- field public static final int WIDGET_FEATURES_STATUS = 2; // 0x2
+ field public static final int WIDGET_FEATURES_STATUS = 1; // 0x1
field public int autoAdvanceViewId;
field public android.content.ComponentName configure;
field public int icon;
diff --git a/core/java/android/appwidget/AppWidgetProviderInfo.java b/core/java/android/appwidget/AppWidgetProviderInfo.java
index 5074480..8b62931 100644
--- a/core/java/android/appwidget/AppWidgetProviderInfo.java
+++ b/core/java/android/appwidget/AppWidgetProviderInfo.java
@@ -59,17 +59,11 @@
public static final int WIDGET_FEATURES_NONE = 0;
/**
- * Indicates that the widget displays the current time. The host may use this as a hint to not
- * display the time in other places.
- */
- public static final int WIDGET_FEATURES_CLOCK = 1;
-
- /**
* Indicates that the widget is output only, ie. has nothing clickable. This may be enforced by
* the host. Presently, this flag is used by the keyguard to indicate that it can be placed
* in the first position.
*/
- public static final int WIDGET_FEATURES_STATUS = 2;
+ public static final int WIDGET_FEATURES_STATUS = 1;
/**
* Identity of this AppWidget component. This component should be a {@link
@@ -215,8 +209,7 @@
/**
* A field which specifies any special features that this widget supports. See
- * {@link #WIDGET_FEATURES_NONE}, {@link #WIDGET_FEATURES_CLOCK},
- * {@link #WIDGET_FEATURES_STATUS}.
+ * {@link #WIDGET_FEATURES_NONE}, {@link #WIDGET_FEATURES_STATUS}.
*
* <p>This field corresponds to the <code>widgetFeatures</code> attribute in
* the AppWidget meta-data file.
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index 492e5e9..b316f23 100755
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -1554,8 +1554,6 @@
public static void updateSystemConfiguration(Configuration config, DisplayMetrics metrics,
CompatibilityInfo compat) {
if (mSystem != null) {
- // TODO: Remove once b/7094175 is fixed
- Slog.v(TAG, "updateSystemConfiguration: b/7094175 config=" + config);
mSystem.updateConfiguration(config, metrics, compat);
//Log.i(TAG, "Updated system resources " + mSystem
// + ": " + mSystem.getConfiguration());
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 128a190..6eca8fd 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -12811,8 +12811,8 @@
final boolean opaque = drawingCacheBackgroundColor != 0 || isOpaque();
final boolean use32BitCache = attachInfo != null && attachInfo.mUse32BitDrawingCache;
- final int projectedBitmapSize = width * height * (opaque && !use32BitCache ? 2 : 4);
- final int drawingCacheSize =
+ final long projectedBitmapSize = width * height * (opaque && !use32BitCache ? 2 : 4);
+ final long drawingCacheSize =
ViewConfiguration.get(mContext).getScaledMaximumDrawingCacheSize();
if (width <= 0 || height <= 0 || projectedBitmapSize > drawingCacheSize) {
if (width > 0 && height > 0) {
@@ -14778,6 +14778,14 @@
/**
* @hide
*/
+ public void resetPaddingToInitialValues() {
+ mPaddingLeft = mUserPaddingLeftInitial;
+ mPaddingRight = mUserPaddingRightInitial;
+ }
+
+ /**
+ * @hide
+ */
public Insets getOpticalInsets() {
if (mLayoutInsets == null) {
mLayoutInsets = (mBackground == null) ? Insets.NONE : mBackground.getLayoutInsets();
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 17c6f1d..d6fd4ff 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -46,9 +46,6 @@
private int mCheckMarkWidth;
private boolean mNeedRequestlayout;
- private int initialPaddingLeft = -1;
- private int initialPaddingRight = -1;
-
private static final int[] CHECKED_STATE_SET = {
R.attr.state_checked
};
@@ -179,8 +176,6 @@
protected void internalSetPadding(int left, int top, int right, int bottom) {
super.internalSetPadding(left, top, right, bottom);
setBasePadding(isLayoutRtl());
- initialPaddingLeft = mPaddingLeft;
- initialPaddingRight = mPaddingRight;
}
@Override
@@ -190,6 +185,7 @@
}
private void updatePadding() {
+ resetPaddingToInitialValues();
int newPadding = (mCheckMarkDrawable != null) ?
mCheckMarkWidth + mBasePadding : mBasePadding;
mNeedRequestlayout |= (mPaddingRight != newPadding);
diff --git a/core/res/res/layout-land/keyguard_host_view.xml b/core/res/res/layout-land/keyguard_host_view.xml
index 595762e..18e23f0 100644
--- a/core/res/res/layout-land/keyguard_host_view.xml
+++ b/core/res/res/layout-land/keyguard_host_view.xml
@@ -27,20 +27,10 @@
android:gravity="center_vertical"
android:orientation="horizontal">
- <com.android.internal.policy.impl.keyguard.KeyguardWidgetPager
- android:id="@+id/app_widget_container"
+ <include layout="@layout/keyguard_widget_region"
android:layout_width="0dip"
android:layout_height="230dip"
- android:gravity="center"
- android:layout_weight=".45"
- android:visibility="gone">
-
- <!-- TODO: Remove this once supported as a widget -->
- <include layout="@layout/keyguard_status_view"/>
- <include layout="@layout/keyguard_transport_control_view"/>
-
- </com.android.internal.policy.impl.keyguard.KeyguardWidgetPager>
-
+ android:layout_weight=".45"/>
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
diff --git a/core/res/res/layout-sw600dp-land/keyguard_host_view.xml b/core/res/res/layout-sw600dp-land/keyguard_host_view.xml
index ea0b3ba..595c918 100644
--- a/core/res/res/layout-sw600dp-land/keyguard_host_view.xml
+++ b/core/res/res/layout-sw600dp-land/keyguard_host_view.xml
@@ -26,18 +26,10 @@
android:layout_height="match_parent"
android:orientation="horizontal">
- <com.android.internal.policy.impl.keyguard.KeyguardWidgetPager
- android:id="@+id/app_widget_container"
+ <include layout="@layout/keyguard_widget_region"
android:layout_width="0dip"
android:layout_height="match_parent"
- android:layout_weight="1"
- android:visibility="gone">
-
- <!-- TODO: Remove this once supported as a widget -->
- <include layout="@layout/keyguard_status_view"/>
- <include layout="@layout/keyguard_transport_control_view"/>
-
- </com.android.internal.policy.impl.keyguard.KeyguardWidgetPager>
+ android:layout_weight="1"/>
<FrameLayout
android:layout_width="0dip"
diff --git a/core/res/res/layout-sw600dp-port/keyguard_host_view.xml b/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
index 84b1b03..7cde7e1 100644
--- a/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
+++ b/core/res/res/layout-sw600dp-port/keyguard_host_view.xml
@@ -27,18 +27,10 @@
android:layout_height="match_parent"
android:gravity="center_horizontal">
- <com.android.internal.policy.impl.keyguard.KeyguardWidgetPager
- android:id="@+id/app_widget_container"
+ <include layout="@layout/keyguard_widget_region"
android:layout_width="match_parent"
android:layout_height="0dip"
- android:layout_weight="0.4"
- android:visibility="gone">
-
- <!-- TODO: Remove this once supported as a widget -->
- <include layout="@layout/keyguard_status_view"/>
- <include layout="@layout/keyguard_transport_control_view"/>
-
- </com.android.internal.policy.impl.keyguard.KeyguardWidgetPager>
+ android:layout_weight="0.4"/>
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
diff --git a/core/res/res/layout/keyguard_selector_view.xml b/core/res/res/layout/keyguard_selector_view.xml
index 8b2865e..710a78e 100644
--- a/core/res/res/layout/keyguard_selector_view.xml
+++ b/core/res/res/layout/keyguard_selector_view.xml
@@ -26,19 +26,13 @@
android:layout_height="match_parent"
android:orientation="vertical">
- <com.android.internal.policy.impl.keyguard.KeyguardWidgetPager
- android:id="@+id/app_widget_container"
+ <include layout="@layout/keyguard_widget_region"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="0.45"
android:layout_marginTop="35dip"
android:layout_marginLeft="33dip"
- android:layout_marginRight="33dip"
- android:visibility="gone">
- <!-- TODO: Remove this when supported as a widget -->
- <include layout="@layout/keyguard_status_view"/>
- <include layout="@layout/keyguard_transport_control_view"/>
- </com.android.internal.policy.impl.keyguard.KeyguardWidgetPager>
+ android:layout_marginRight="33dip"/>
<RelativeLayout
android:layout_width="wrap_content"
diff --git a/core/res/res/layout/keyguard_widget_region.xml b/core/res/res/layout/keyguard_widget_region.xml
new file mode 100644
index 0000000..f759366
--- /dev/null
+++ b/core/res/res/layout/keyguard_widget_region.xml
@@ -0,0 +1,68 @@
+<?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 the selector widget that allows the user to select an action. -->
+<com.android.internal.policy.impl.keyguard.KeyguardWidgetRegion
+ xmlns:prvandroid="http://schemas.android.com/apk/prv/res/android"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/kg_widget_region"
+ android:visibility="gone"
+ android:gravity="center"
+ android:orientation="vertical">
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1" />
+ <com.android.internal.policy.impl.keyguard.KeyguardWidgetPager
+ android:id="@+id/app_widget_container"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/kg_widget_container_height">
+ <!-- TODO: Remove this when supported as a widget -->
+ <include layout="@layout/keyguard_status_view"/>
+ <include layout="@layout/keyguard_transport_control_view"/>
+ </com.android.internal.policy.impl.keyguard.KeyguardWidgetPager>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:orientation="horizontal">
+ <com.android.internal.policy.impl.keyguard.KeyguardGlowStripView
+ android:id="@+id/left_strip"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ prvandroid:numDots="5"
+ prvandroid:dotSize="7dip"
+ prvandroid:leftToRight="false"
+ prvandroid:glowDot="@*android:drawable/ic_lockscreen_glowdot" />
+ <Space
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"/>
+ <com.android.internal.policy.impl.keyguard.KeyguardGlowStripView
+ android:id="@+id/right_strip"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ prvandroid:numDots="5"
+ prvandroid:dotSize="7dip"
+ prvandroid:leftToRight="true"
+ prvandroid:glowDot="@*android:drawable/ic_lockscreen_glowdot" />
+ </LinearLayout>
+</com.android.internal.policy.impl.keyguard.KeyguardWidgetRegion>
\ No newline at end of file
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 7698624..ea89633 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -5215,8 +5215,7 @@
supports. Supports combined values using | operator. -->
<attr name="widgetFeatures" format="integer">
<flag name="none" value="0x0" />
- <flag name="clock" value="0x1" />
- <flag name="status" value="0x2" />
+ <flag name="status" value="0x1" />
</attr>
</declare-styleable>
@@ -5773,4 +5772,11 @@
<attr name="scrollIndicatorPaddingRight" format="dimension" />
</declare-styleable>
+ <declare-styleable name="KeyguardGlowStripView">
+ <attr name="dotSize" format="dimension" />
+ <attr name="numDots" format="integer" />
+ <attr name="glowDot" format="reference" />
+ <attr name="leftToRight" format="boolean" />
+ </declare-styleable>
+
</resources>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 63ed18e..01a35b0 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -285,6 +285,9 @@
<!-- Space reserved at the bottom of secure views (pin/pattern/password/SIM pin/SIM puk) -->
<dimen name="kg_secure_padding_height">46dp</dimen>
+ <!-- The height of the widget container -->
+ <dimen name="kg_widget_container_height">200dp</dimen>
+
<!-- Touch slop for the global toggle accessibility gesture -->
<dimen name="accessibility_touch_slop">80dip</dimen>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 160495c..224a059 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1075,6 +1075,7 @@
<java-symbol type="layout" name="notification_template_inbox" />
<java-symbol type="layout" name="keyguard_multi_user_avatar" />
<java-symbol type="layout" name="keyguard_multi_user_selector_widget" />
+ <java-symbol type="layout" name="keyguard_widget_region" />
<java-symbol type="layout" name="sms_short_code_confirmation_dialog" />
<java-symbol type="anim" name="slide_in_child_bottom" />
@@ -1283,6 +1284,10 @@
<java-symbol type="id" name="keyguard_users_grid" />
<java-symbol type="id" name="clock_text" />
<java-symbol type="id" name="clock_view" />
+ <java-symbol type="id" name="kg_widget_region" />
+ <java-symbol type="id" name="left_strip" />
+ <java-symbol type="id" name="right_strip" />
+
<java-symbol type="integer" name="config_carDockRotation" />
<java-symbol type="integer" name="config_defaultUiModeType" />
<java-symbol type="integer" name="config_deskDockRotation" />
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index f68f9dc..4170cfe 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -371,12 +371,30 @@
public void reset() {
native_reset(mNativePaint);
setFlags(DEFAULT_PAINT_FLAGS);
+
// TODO: Turning off hinting has undesirable side effects, we need to
// revisit hinting once we add support for subpixel positioning
// setHinting(DisplayMetrics.DENSITY_DEVICE >= DisplayMetrics.DENSITY_TV
// ? HINTING_OFF : HINTING_ON);
+
+ mColorFilter = null;
+ mMaskFilter = null;
+ mPathEffect = null;
+ mRasterizer = null;
+ mShader = null;
+ mTypeface = null;
+ mXfermode = null;
+
mHasCompatScaling = false;
- mCompatScaling = mInvCompatScaling = 1;
+ mCompatScaling = 1;
+ mInvCompatScaling = 1;
+
+ hasShadow = false;
+ shadowDx = 0;
+ shadowDy = 0;
+ shadowRadius = 0;
+ shadowColor = 0;
+
mBidiFlags = BIDI_DEFAULT_LTR;
setTextLocale(Locale.getDefault());
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/ClockView.java b/policy/src/com/android/internal/policy/impl/keyguard/ClockView.java
index cbbc92c..97a3f26 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/ClockView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/ClockView.java
@@ -33,7 +33,6 @@
import java.lang.ref.WeakReference;
import java.text.DateFormatSymbols;
import java.util.Calendar;
-
import com.android.internal.R;
/**
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardGlowStripView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardGlowStripView.java
new file mode 100644
index 0000000..e1c95f0
--- /dev/null
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardGlowStripView.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 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.
+ */
+package com.android.internal.policy.impl.keyguard;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ValueAnimator;
+import android.animation.ValueAnimator.AnimatorUpdateListener;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Canvas;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.animation.DecelerateInterpolator;
+import android.view.animation.Interpolator;
+import android.view.animation.LinearInterpolator;
+import android.widget.LinearLayout;
+
+import com.android.internal.R;
+
+/**
+ * A layout which animates a strip of horizontal, pulsing dots on request. This is used
+ * to indicate the presence of pages to the left / right.
+ */
+public class KeyguardGlowStripView extends LinearLayout {
+ private static final int DURATION = 500;
+
+ private static final float SLIDING_WINDOW_SIZE = 0.4f;
+ private int mDotStripTop;
+ private int mHorizontalDotGap;
+
+ private int mDotSize;
+ private int mNumDots;
+ private Drawable mDotDrawable;
+ private boolean mLeftToRight = true;
+
+ private float mAnimationProgress = 0f;
+ private boolean mDrawDots = false;
+ private ValueAnimator mAnimator;
+ private Interpolator mDotAlphaInterpolator = new DecelerateInterpolator(0.5f);
+
+ public KeyguardGlowStripView(Context context) {
+ this(context, null, 0);
+ }
+
+ public KeyguardGlowStripView(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public KeyguardGlowStripView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+
+ TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.KeyguardGlowStripView);
+ mDotSize = a.getDimensionPixelSize(R.styleable.KeyguardGlowStripView_dotSize, mDotSize);
+ mNumDots = a.getInt(R.styleable.KeyguardGlowStripView_numDots, mNumDots);
+ mDotDrawable = a.getDrawable(R.styleable.KeyguardGlowStripView_glowDot);
+ mLeftToRight = a.getBoolean(R.styleable.KeyguardGlowStripView_leftToRight, mLeftToRight);
+ }
+
+ protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+ int availableWidth = w - getPaddingLeft() - getPaddingRight();
+ mHorizontalDotGap = (availableWidth - mDotSize * mNumDots) / (mNumDots - 1);
+ mDotStripTop = getPaddingTop();
+ invalidate();
+ }
+
+ @Override
+ protected void dispatchDraw(Canvas canvas) {
+ super.dispatchDraw(canvas);
+
+ if (!mDrawDots) return;
+
+ int xOffset = getPaddingLeft();
+ mDotDrawable.setBounds(0, 0, mDotSize, mDotSize);
+
+ for (int i = 0; i < mNumDots; i++) {
+ // We fudge the relative position to provide a fade in of the first dot and a fade
+ // out of the final dot.
+ float relativeDotPosition = SLIDING_WINDOW_SIZE / 2 + ((1.0f * i) / (mNumDots - 1)) *
+ (1 - SLIDING_WINDOW_SIZE);
+ float distance = Math.abs(relativeDotPosition - mAnimationProgress);
+ float alpha = Math.max(0, 1 - distance / (SLIDING_WINDOW_SIZE / 2));
+
+ alpha = mDotAlphaInterpolator.getInterpolation(alpha);
+
+ canvas.save();
+ canvas.translate(xOffset, mDotStripTop);
+ mDotDrawable.setAlpha((int) (alpha * 255));
+ mDotDrawable.draw(canvas);
+ canvas.restore();
+ xOffset += mDotSize + mHorizontalDotGap;
+ }
+ }
+
+ public void makeEmGo() {
+ if (mAnimator != null) {
+ mAnimator.cancel();
+ }
+ float from = mLeftToRight ? 0f : 1f;
+ float to = mLeftToRight ? 1f : 0f;
+ mAnimator = ValueAnimator.ofFloat(from, to);
+ mAnimator.setDuration(DURATION);
+ mAnimator.setInterpolator(new LinearInterpolator());
+ mAnimator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mDrawDots = false;
+ // make sure we draw one frame at the end with everything gone.
+ invalidate();
+ }
+
+ @Override
+ public void onAnimationStart(Animator animation) {
+ mDrawDots = true;
+ }
+ });
+ mAnimator.addUpdateListener(new AnimatorUpdateListener() {
+ @Override
+ public void onAnimationUpdate(ValueAnimator animation) {
+ mAnimationProgress = (Float) animation.getAnimatedValue();
+ invalidate();
+ }
+ });
+ mAnimator.start();
+ }
+}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
index 1d1c7fc..14633c4 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
@@ -141,7 +141,8 @@
@Override
protected void onFinishInflate() {
mAppWidgetContainer = (KeyguardWidgetPager) findViewById(R.id.app_widget_container);
- mAppWidgetContainer.setVisibility(VISIBLE);
+ KeyguardWidgetRegion kgwr = (KeyguardWidgetRegion) findViewById(R.id.kg_widget_region);
+ kgwr.setVisibility(VISIBLE);
mSecurityViewContainer = (ViewFlipper) findViewById(R.id.view_flipper);
// This code manages showing/hiding the transport control. We keep it around and only
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
index f99765d..8714276 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
@@ -26,15 +26,12 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.MediaStore;
-import android.telephony.TelephonyManager;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Slog;
import android.view.View;
-import android.widget.Button;
import android.widget.LinearLayout;
-import com.android.internal.telephony.IccCardConstants;
import com.android.internal.telephony.IccCardConstants.State;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.multiwaveview.GlowPadView;
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
index fd9362a..4af7a25 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
@@ -20,6 +20,7 @@
import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
+import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
@@ -63,6 +64,12 @@
addView(frame);
}
+ protected void onUnhandledTap(MotionEvent ev) {
+ if (getParent() instanceof KeyguardWidgetRegion) {
+ ((KeyguardWidgetRegion) getParent()).showPagingFeedback();
+ }
+ }
+
/*
* This interpolator emulates the rate at which the perceived scale of an object changes
* as its distance from a camera increases. When this interpolator is applied to a scale
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetRegion.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetRegion.java
new file mode 100644
index 0000000..34754e0
--- /dev/null
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetRegion.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 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.
+ */
+package com.android.internal.policy.impl.keyguard;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.LinearLayout;
+
+import com.android.internal.R;
+
+public class KeyguardWidgetRegion extends LinearLayout {
+ KeyguardGlowStripView mLeftStrip;
+ KeyguardGlowStripView mRightStrip;
+ KeyguardWidgetPager mPager;
+
+ public KeyguardWidgetRegion(Context context) {
+ this(context, null, 0);
+ }
+
+ public KeyguardWidgetRegion(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public KeyguardWidgetRegion(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+ mLeftStrip = (KeyguardGlowStripView) findViewById(R.id.left_strip);
+ mRightStrip = (KeyguardGlowStripView) findViewById(R.id.right_strip);
+ mPager = (KeyguardWidgetPager) findViewById(R.id.app_widget_container);
+
+ setSoundEffectsEnabled(false);
+ setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ showPagingFeedback();
+ }
+ });
+ }
+
+ public void showPagingFeedback() {
+ mLeftStrip.makeEmGo();
+ mRightStrip.makeEmGo();
+ }
+}
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 23ce52e..782d417 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -2748,7 +2748,10 @@
}
}
- if (DEBUG_LAYOUT) Slog.v(TAG, "Relayout " + win + ": viewVisibility=" + viewVisibility
+ if (DEBUG_LAYOUT
+ // TODO: Remove once b/7094175 is fixed
+ || ((String)win.mAttrs.getTitle()).contains("Keyguard")
+ ) Slog.v(TAG, "Relayout " + win + ": viewVisibility=" + viewVisibility
+ " " + requestedWidth + "x" + requestedHeight + " " + win.mAttrs);
win.mEnforceSizeCompat = (win.mAttrs.flags & FLAG_COMPATIBLE_WINDOW) != 0;
@@ -9255,7 +9258,9 @@
"Reporting new frame to " + win + ": " + win.mCompatFrame);
int diff = 0;
boolean configChanged = win.isConfigChanged();
- if ((DEBUG_RESIZE || DEBUG_ORIENTATION || DEBUG_CONFIGURATION)
+ if ((DEBUG_RESIZE || DEBUG_ORIENTATION || DEBUG_CONFIGURATION
+ // TODO: Remove once b/7094175 is fixed
+ || ((String)win.mAttrs.getTitle()).contains("Keyguard"))
&& configChanged) {
Slog.i(TAG, "Sending new config to window " + win + ": "
+ winAnimator.mSurfaceW + "x" + winAnimator.mSurfaceH