Skip to content

Commit cabcc59

Browse files
mikejurkaAndroid (Google) Code Review
authored andcommitted
Merge "Allowing rotation while adding lockscreen widgets" into jb-mr1-lockscreen-dev
2 parents 1361758 + 192d6d4 commit cabcc59

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

core/java/com/android/internal/widget/LockPatternUtils.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,6 @@ public class LockPatternUtils {
136136
*/
137137
public static final int ID_DEFAULT_STATUS_WIDGET = -2;
138138

139-
/**
140-
* Intent extra that's used to tag the default widget when using the picker
141-
*/
142-
public static final String EXTRA_DEFAULT_WIDGET = "com.android.settings.DEFAULT_WIDGET";
143-
144139
protected final static String LOCKOUT_PERMANENT_KEY = "lockscreen.lockedoutpermanently";
145140
protected final static String LOCKOUT_ATTEMPT_DEADLINE = "lockscreen.lockoutattemptdeadline";
146141
protected final static String PATTERN_EVER_CHOSEN_KEY = "lockscreen.patterneverchosen";

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public class KeyguardHostView extends KeyguardViewBase {
6262
// Use this to debug all of keyguard
6363
public static boolean DEBUG = KeyguardViewMediator.DEBUG;
6464

65+
// Found in KeyguardAppWidgetPickActivity.java
6566
static final int APPWIDGET_HOST_ID = 0x4B455947;
6667

6768
private AppWidgetHost mAppWidgetHost;
@@ -956,12 +957,8 @@ private void addDefaultWidgets() {
956957
addWidgetButton.setOnClickListener(new OnClickListener() {
957958
@Override
958959
public void onClick(View v) {
959-
int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
960-
if (appWidgetId != -1) {
961-
mActivityLauncher.launchWidgetPicker(appWidgetId);
962-
} else {
963-
Log.e(TAG, "Unable to allocate an AppWidget id in lock screen");
964-
}
960+
// Pass in an invalid widget id... the picker will allocate an ID for us
961+
mActivityLauncher.launchWidgetPicker(AppWidgetManager.INVALID_APPWIDGET_ID);
965962
}
966963
});
967964
}
@@ -1262,15 +1259,6 @@ private CameraWidgetFrame findCameraPage() {
12621259
return null;
12631260
}
12641261

1265-
private boolean isWidgetPage(int pageIndex) {
1266-
View v = mAppWidgetContainer.getChildAt(pageIndex);
1267-
if (v != null && v instanceof KeyguardWidgetFrame) {
1268-
KeyguardWidgetFrame kwf = (KeyguardWidgetFrame) v;
1269-
return kwf.getContentAppWidgetId() != AppWidgetManager.INVALID_APPWIDGET_ID;
1270-
}
1271-
return false;
1272-
}
1273-
12741262
boolean isMusicPage(int pageIndex) {
12751263
return pageIndex >= 0 && pageIndex == getWidgetPosition(R.id.keyguard_transport_control);
12761264
}

0 commit comments

Comments
 (0)