diff options
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java | 13 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java | 6 |
2 files changed, 18 insertions, 1 deletions
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 83ba6fe..8dde208 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -790,6 +790,9 @@ public class KeyguardHostView extends KeyguardViewBase { // Once the screen turns off, we no longer consider this to be first boot and we want the // biometric unlock to start next time keyguard is shown. KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(true); + // We use mAppWidgetToShow to show a particular widget after you add it-- once the screen + // turns off we reset that behavior + clearAppWidgetToShow(); checkAppWidgetConsistency(); showPrimarySecurityScreen(true); getSecurityView(mCurrentSecuritySelection).onPause(); @@ -799,6 +802,10 @@ public class KeyguardHostView extends KeyguardViewBase { } } + public void clearAppWidgetToShow() { + mAppWidgetToShow = AppWidgetManager.INVALID_APPWIDGET_ID; + } + @Override public void show() { if (DEBUG) Log.d(TAG, "show()"); @@ -1176,6 +1183,7 @@ public class KeyguardHostView extends KeyguardViewBase { static class SavedState extends BaseSavedState { int transportState; + int appWidgetToShow = AppWidgetManager.INVALID_APPWIDGET_ID; SavedState(Parcelable superState) { super(superState); @@ -1184,12 +1192,14 @@ public class KeyguardHostView extends KeyguardViewBase { private SavedState(Parcel in) { super(in); this.transportState = in.readInt(); + this.appWidgetToShow = in.readInt(); } @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(this.transportState); + out.writeInt(this.appWidgetToShow); } public static final Parcelable.Creator<SavedState> CREATOR @@ -1210,6 +1220,7 @@ public class KeyguardHostView extends KeyguardViewBase { Parcelable superState = super.onSaveInstanceState(); SavedState ss = new SavedState(superState); ss.transportState = mViewStateManager.getTransportState(); + ss.appWidgetToShow = mAppWidgetToShow; return ss; } @@ -1223,6 +1234,7 @@ public class KeyguardHostView extends KeyguardViewBase { SavedState ss = (SavedState) state; super.onRestoreInstanceState(ss.getSuperState()); mViewStateManager.setTransportState(ss.transportState); + mAppWidgetToShow = ss.appWidgetToShow; post(mSwitchPageRunnable); } @@ -1275,7 +1287,6 @@ public class KeyguardHostView extends KeyguardViewBase { for (int i = 0; i < childCount; i++) { if (mAppWidgetContainer.getWidgetPageAt(i).getContentAppWidgetId() == mAppWidgetToShow) { - mAppWidgetToShow = AppWidgetManager.INVALID_APPWIDGET_ID; return i; } } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java index 4fdf7d8..41db69a 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java @@ -15,6 +15,7 @@ */ package com.android.internal.policy.impl.keyguard; +import android.appwidget.AppWidgetManager; import android.os.Handler; import android.os.Looper; import android.view.View; @@ -115,6 +116,11 @@ public class KeyguardViewStateManager implements scl.fadeOutChallenge(); mPageIndexOnPageBeginMoving = mKeyguardWidgetPager.getCurrentPage(); } + // We use mAppWidgetToShow to show a particular widget after you add it-- + // once the user swipes a page we clear that behavior + if (mKeyguardHostView != null) { + mKeyguardHostView.clearAppWidgetToShow(); + } if (mHideHintsRunnable != null) { mMainQueue.removeCallbacks(mHideHintsRunnable); mHideHintsRunnable = null; |