summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-12-05 12:23:27 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-12-05 12:23:27 -0800
commita5c40b774cc83cdd7ad86200ada97b8648a8687e (patch)
tree32664ef92d34faf1241e9c288067a29a26b0ffab /policy
parent5fa2cad1620546cf6e7144c197c083d7e3bca7e6 (diff)
parent46a1a4b2febc504a1ceb5429ac329264b158929c (diff)
downloadframeworks_base-a5c40b774cc83cdd7ad86200ada97b8648a8687e.zip
frameworks_base-a5c40b774cc83cdd7ad86200ada97b8648a8687e.tar.gz
frameworks_base-a5c40b774cc83cdd7ad86200ada97b8648a8687e.tar.bz2
am 46a1a4b2: am 8f90249d: am ca83e1d5: Merge "Saving and restoring current page when rotating in lockscreen. (Bug 7568412)" into jb-mr1.1-dev
* commit '46a1a4b2febc504a1ceb5429ac329264b158929c': Saving and restoring current page when rotating in lockscreen. (Bug 7568412)
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java23
1 files changed, 22 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 94cd0b5..c47f89d 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
@@ -80,6 +80,7 @@ public class KeyguardHostView extends KeyguardViewBase {
private boolean mEnableFallback; // TODO: This should get the value from KeyguardPatternView
private SecurityMode mCurrentSecuritySelection = SecurityMode.Invalid;
private int mAppWidgetToShow;
+ private int mPreviousWidgetPage = -1;
private boolean mCheckAppWidgetConsistencyOnBootCompleted = false;
private boolean mCleanupAppWidgetsOnBootCompleted = false;
@@ -911,6 +912,7 @@ public class KeyguardHostView extends KeyguardViewBase {
public void clearAppWidgetToShow() {
mAppWidgetToShow = AppWidgetManager.INVALID_APPWIDGET_ID;
+ mPreviousWidgetPage = -1;
}
@Override
@@ -1298,10 +1300,22 @@ public class KeyguardHostView extends KeyguardViewBase {
showAppropriateWidgetPage();
}
};
+ Runnable mOnRestoreUpdatePageRunnable = new Runnable() {
+ @Override
+ public void run() {
+ mSwitchPageRunnable.run();
+
+ // We need to update the alpha's of the hints and content after setting the current page
+ mViewStateManager.showUsabilityHints();
+ };
+ };
+
static class SavedState extends BaseSavedState {
int transportState;
int appWidgetToShow = AppWidgetManager.INVALID_APPWIDGET_ID;
+ // Note the appWidgetContainerPage is only used if the appWidgetToShow is invalid
+ int appWidgetContainerPage = -1;
SavedState(Parcelable superState) {
super(superState);
@@ -1311,6 +1325,7 @@ public class KeyguardHostView extends KeyguardViewBase {
super(in);
this.transportState = in.readInt();
this.appWidgetToShow = in.readInt();
+ this.appWidgetContainerPage = in.readInt();
}
@Override
@@ -1318,6 +1333,7 @@ public class KeyguardHostView extends KeyguardViewBase {
super.writeToParcel(out, flags);
out.writeInt(this.transportState);
out.writeInt(this.appWidgetToShow);
+ out.writeInt(this.appWidgetContainerPage);
}
public static final Parcelable.Creator<SavedState> CREATOR
@@ -1339,6 +1355,7 @@ public class KeyguardHostView extends KeyguardViewBase {
SavedState ss = new SavedState(superState);
ss.transportState = mViewStateManager.getTransportState();
ss.appWidgetToShow = mAppWidgetToShow;
+ ss.appWidgetContainerPage = mAppWidgetContainer.getCurrentPage();
return ss;
}
@@ -1353,7 +1370,8 @@ public class KeyguardHostView extends KeyguardViewBase {
super.onRestoreInstanceState(ss.getSuperState());
mViewStateManager.setTransportState(ss.transportState);
mAppWidgetToShow = ss.appWidgetToShow;
- post(mSwitchPageRunnable);
+ mPreviousWidgetPage = ss.appWidgetContainerPage;
+ post(mOnRestoreUpdatePageRunnable);
}
@Override
@@ -1410,6 +1428,9 @@ public class KeyguardHostView extends KeyguardViewBase {
}
mAppWidgetToShow = AppWidgetManager.INVALID_APPWIDGET_ID;
}
+ if (mPreviousWidgetPage > -1) {
+ return mPreviousWidgetPage;
+ }
// if music playing, show transport
if (isMusicPlaying) {
if (DEBUG) Log.d(TAG, "Music playing, show transport");