Merge "Allowing rotation while adding lockscreen widgets" into jb-mr1-lockscreen-dev

This commit is contained in:
Michael Jurka
2012-11-07 01:16:11 -08:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 20 deletions

View File

@ -136,11 +136,6 @@ public class LockPatternUtils {
*/
public static final int ID_DEFAULT_STATUS_WIDGET = -2;
/**
* Intent extra that's used to tag the default widget when using the picker
*/
public static final String EXTRA_DEFAULT_WIDGET = "com.android.settings.DEFAULT_WIDGET";
protected final static String LOCKOUT_PERMANENT_KEY = "lockscreen.lockedoutpermanently";
protected final static String LOCKOUT_ATTEMPT_DEADLINE = "lockscreen.lockoutattemptdeadline";
protected final static String PATTERN_EVER_CHOSEN_KEY = "lockscreen.patterneverchosen";

View File

@ -62,6 +62,7 @@ public class KeyguardHostView extends KeyguardViewBase {
// Use this to debug all of keyguard
public static boolean DEBUG = KeyguardViewMediator.DEBUG;
// Found in KeyguardAppWidgetPickActivity.java
static final int APPWIDGET_HOST_ID = 0x4B455947;
private AppWidgetHost mAppWidgetHost;
@ -956,12 +957,8 @@ public class KeyguardHostView extends KeyguardViewBase {
addWidgetButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
if (appWidgetId != -1) {
mActivityLauncher.launchWidgetPicker(appWidgetId);
} else {
Log.e(TAG, "Unable to allocate an AppWidget id in lock screen");
}
// Pass in an invalid widget id... the picker will allocate an ID for us
mActivityLauncher.launchWidgetPicker(AppWidgetManager.INVALID_APPWIDGET_ID);
}
});
}
@ -1262,15 +1259,6 @@ public class KeyguardHostView extends KeyguardViewBase {
return null;
}
private boolean isWidgetPage(int pageIndex) {
View v = mAppWidgetContainer.getChildAt(pageIndex);
if (v != null && v instanceof KeyguardWidgetFrame) {
KeyguardWidgetFrame kwf = (KeyguardWidgetFrame) v;
return kwf.getContentAppWidgetId() != AppWidgetManager.INVALID_APPWIDGET_ID;
}
return false;
}
boolean isMusicPage(int pageIndex) {
return pageIndex >= 0 && pageIndex == getWidgetPosition(R.id.keyguard_transport_control);
}