summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Shvadskiy <ashvadskiy@cyngn.com>2016-05-02 12:45:46 -0700
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:21:10 -0700
commitb6f1500e0ce19d4a8061f0697cae3811645d9de4 (patch)
treeb122cdd58a83bd2d171a59fd5c5f0402a992735c
parent0b51ee8b61b351b484ddc925090cc9713fff7078 (diff)
downloadandroid_packages_apps_Trebuchet-b6f1500e0ce19d4a8061f0697cae3811645d9de4.zip
android_packages_apps_Trebuchet-b6f1500e0ce19d4a8061f0697cae3811645d9de4.tar.gz
android_packages_apps_Trebuchet-b6f1500e0ce19d4a8061f0697cae3811645d9de4.tar.bz2
Prevent crash when exiting grid size fragment
Change-Id: Iea39713b71a8c54bf4bf79f0b1b0c865a7950fa4 issue-id: FEIJ-197
-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 58e9365..c892f4b 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1193,7 +1193,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);
}
}
@@ -1902,6 +1902,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;
@@ -2771,7 +2773,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 {