mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Fixes #1930069. Prevents NPE in GesturesActivity. Ensures the store is always != null.
This commit is contained in:
@@ -81,7 +81,7 @@ public class GesturesActivity extends ListActivity implements AdapterView.OnItem
|
||||
setListAdapter(new GesturesSettingsAdapter(mAdapter));
|
||||
getListView().setOnItemClickListener(this);
|
||||
|
||||
mStore = Launcher.getGestureLibrary();
|
||||
mStore = Launcher.getGestureLibrary(this);
|
||||
mTask = (GesturesLoadTask) new GesturesLoadTask().execute();
|
||||
|
||||
registerForContextMenu(getListView());
|
||||
|
||||
@@ -246,11 +246,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||
super.onCreate(savedInstanceState);
|
||||
mInflater = getLayoutInflater();
|
||||
|
||||
if (sLibrary == null) {
|
||||
// The context is not kept by the library so it's safe to do this
|
||||
sLibrary = GestureLibraries.fromPrivateFile(Launcher.this,
|
||||
GesturesConstants.STORE_NAME);
|
||||
}
|
||||
getGestureLibrary(this);
|
||||
|
||||
mAppWidgetManager = AppWidgetManager.getInstance(this);
|
||||
|
||||
@@ -1983,7 +1979,11 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||
return sModel;
|
||||
}
|
||||
|
||||
static GestureLibrary getGestureLibrary() {
|
||||
static GestureLibrary getGestureLibrary(Context context) {
|
||||
if (sLibrary == null) {
|
||||
// The context is not kept by the library so it's safe to do this
|
||||
sLibrary = GestureLibraries.fromPrivateFile(context, GesturesConstants.STORE_NAME);
|
||||
}
|
||||
return sLibrary;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user