mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-25 16:15:55 +01:00
Fix compilation
This commit is contained in:
parent
8d6e6c8675
commit
840a125c81
@ -4,10 +4,8 @@ import android.annotation.TargetApi;
|
||||
import android.app.Application;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.NotificationManager.Policy;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.database.Cursor;
|
||||
@ -43,8 +41,6 @@ import nodomain.freeyourgadget.gadgetbridge.util.GBPrefs;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.LimitedQueue;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
||||
|
||||
//import nodomain.freeyourgadget.gadgetbridge.externalevents.BluetoothConnectReceiver;
|
||||
|
||||
/**
|
||||
* Main Application class that initializes and provides access to certain things like
|
||||
* logging and DB access.
|
||||
@ -309,12 +305,12 @@ public class GBApplication extends Application {
|
||||
*
|
||||
* @return true on successful deletion
|
||||
*/
|
||||
public static synchronized boolean deleteActivityDatabase() {
|
||||
public static synchronized boolean deleteActivityDatabase(Context context) {
|
||||
// TODO: flush, close, reopen db
|
||||
if (lockHandler != null) {
|
||||
lockHandler.closeDb();
|
||||
}
|
||||
DBHelper dbHelper = new DBHelper(this);
|
||||
DBHelper dbHelper = new DBHelper(context);
|
||||
boolean result = true;
|
||||
if (dbHelper.existsDB(DBConstants.DATABASE_NAME)) {
|
||||
result = getContext().deleteDatabase(DBConstants.DATABASE_NAME);
|
||||
|
@ -371,7 +371,7 @@ public class DebugActivity extends GBActivity {
|
||||
.setPositiveButton("Delete", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (GBApplication.deleteActivityDatabase()) {
|
||||
if (GBApplication.deleteActivityDatabase(DebugActivity.this)) {
|
||||
GB.toast(DebugActivity.this, "Activity database successfully deleted.", Toast.LENGTH_SHORT, GB.INFO);
|
||||
} else {
|
||||
GB.toast(DebugActivity.this, "Activity database deletion failed.", Toast.LENGTH_SHORT, GB.INFO);
|
||||
|
Loading…
Reference in New Issue
Block a user