summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Shvadskiy <ashvadskiy@cyngn.com>2016-05-02 19:45:46 (GMT)
committerArtem Shvadskiy <ashvadskiy@cyngn.com>2016-05-02 20:07:02 (GMT)
commit7657eae25cac0aef261c436a102a18913f16f46a (patch)
tree1bdd7e0b0e2c2e5fb277fa2331734ddd1cfe805e
parentd42fae494742b0e6e428d84dc4ed61adddb8e6f6 (diff)
downloadandroid_packages_apps_Trebuchet-7657eae25cac0aef261c436a102a18913f16f46a.zip
android_packages_apps_Trebuchet-7657eae25cac0aef261c436a102a18913f16f46a.tar.gz
android_packages_apps_Trebuchet-7657eae25cac0aef261c436a102a18913f16f46a.tar.bz2
Prevent crash when exiting grid size fragment
Change-Id: Iea39713b71a8c54bf4bf79f0b1b0c865a7950fa4 issue-id: FEIJ-197 (cherry picked from commit a56a75dbeb84341ba1450fa58bad63301201aae9)
-rw-r--r--src/com/android/launcher3/Launcher.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index bcff560..8161d38 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1215,7 +1215,7 @@ public class Launcher extends Activity
Fragment gridFragment = getFragmentManager().findFragmentByTag(
DynamicGridSizeFragment.DYNAMIC_GRID_SIZE_FRAGMENT);
if (gridFragment != null) {
- mDynamicGridSizeFragment.setSize();
+ ((DynamicGridSizeFragment) gridFragment).setSize();
unlockScreenOrientation(true);
}
}
@@ -1928,6 +1928,8 @@ public class Launcher extends Activity
* @param size The new grid size to set the workspace to.
*/
public void setDynamicGridSize(InvariantDeviceProfile.GridSize size) {
+ if (size == null) return;
+
int gridSize = SettingsProvider.getIntCustomDefault(this,
SettingsProvider.SETTINGS_UI_DYNAMIC_GRID_SIZE, 0);
boolean customValuesChanged = false;
@@ -2815,7 +2817,7 @@ public class Launcher extends Activity
Fragment gridFragment = getFragmentManager().findFragmentByTag(
DynamicGridSizeFragment.DYNAMIC_GRID_SIZE_FRAGMENT);
if (gridFragment != null) {
- mDynamicGridSizeFragment.setSize();
+ ((DynamicGridSizeFragment) gridFragment).setSize();
unlockScreenOrientation(true);
}
else {