Merge "Add setters for mWorkspaceLoading and mWaitingForResult." into ub-now-nova

This commit is contained in:
Anjali Koppal
2014-05-05 23:28:32 +00:00
committed by Android (Google) Code Review
+27 -7
View File
@@ -762,7 +762,7 @@ public class Launcher extends Activity
protected void onActivityResult(
final int requestCode, final int resultCode, final Intent data) {
// Reset the startActivity waiting flag
mWaitingForResult = false;
setWaitingForResult(false);
int pendingAddWidgetId = mPendingAddWidgetId;
mPendingAddWidgetId = -1;
@@ -935,7 +935,7 @@ public class Launcher extends Activity
mPaused = false;
sPausedFromUserAction = false;
if (mRestoring || mOnResumeNeedsLoad) {
mWorkspaceLoading = true;
setWorkspaceLoading(true);
mModel.startLoader(true, PagedView.INVALID_RESTORE_PAGE);
mRestoring = false;
mOnResumeNeedsLoad = false;
@@ -1189,7 +1189,7 @@ public class Launcher extends Activity
mPendingAddInfo.spanY = savedState.getInt(RUNTIME_STATE_PENDING_ADD_SPAN_Y);
mPendingAddWidgetInfo = savedState.getParcelable(RUNTIME_STATE_PENDING_ADD_WIDGET_INFO);
mPendingAddWidgetId = savedState.getInt(RUNTIME_STATE_PENDING_ADD_WIDGET_ID);
mWaitingForResult = true;
setWaitingForResult(true);
mRestoring = true;
}
@@ -1769,7 +1769,7 @@ public class Launcher extends Activity
getWindow().closeAllPanels();
// Whatever we were doing is hereby canceled.
mWaitingForResult = false;
setWaitingForResult(false);
}
@Override
@@ -1947,7 +1947,9 @@ public class Launcher extends Activity
@Override
public void startActivityForResult(Intent intent, int requestCode) {
if (requestCode >= 0) mWaitingForResult = true;
if (requestCode >= 0) {
setWaitingForResult(true);
}
super.startActivityForResult(intent, requestCode);
}
@@ -2061,6 +2063,24 @@ public class Launcher extends Activity
return mWorkspaceLoading;
}
private void setWorkspaceLoading(boolean value) {
boolean isLocked = isWorkspaceLocked();
mWorkspaceLoading = value;
if (isLocked != isWorkspaceLocked()) {
onWorkspaceLockedChanged();
}
}
private void setWaitingForResult(boolean value) {
boolean isLocked = isWorkspaceLocked();
mWaitingForResult = value;
if (isLocked != isWorkspaceLocked()) {
onWorkspaceLockedChanged();
}
}
protected void onWorkspaceLockedChanged() { }
private void resetAddInfo() {
mPendingAddInfo.container = ItemInfo.NO_ID;
mPendingAddInfo.screenId = -1;
@@ -3801,7 +3821,7 @@ public class Launcher extends Activity
* Implementation of the method from LauncherModel.Callbacks.
*/
public void startBinding() {
mWorkspaceLoading = true;
setWorkspaceLoading(true);
// If we're starting binding all over again, clear any bind calls we'd postponed in
// the past (see waitUntilResume) -- we don't need them since we're starting binding
@@ -4118,7 +4138,7 @@ public class Launcher extends Activity
updateAppMarketIcon();
}
mWorkspaceLoading = false;
setWorkspaceLoading(false);
if (upgradePath) {
mWorkspace.getUniqueComponents(true, null);
mIntentsOnWorkspaceFromUpgradePath = mWorkspace.getUniqueComponents(true, null);