diff --git a/build.gradle b/build.gradle
index 49f858094..7d4be6169 100644
--- a/build.gradle
+++ b/build.gradle
@@ -50,8 +50,8 @@ ext {
compileSdkVersion = 28
targetSdkVersion = 28
buildToolsVersion = '28.0.3'
- versionCode = 35
- versionName = "1.0.0"
+ versionCode = 37
+ versionName = "1.0.1"
javaCompileVersion = JavaVersion.VERSION_1_8
diff --git a/org.envirocar.app/AndroidManifest.xml b/org.envirocar.app/AndroidManifest.xml
index cccbbe1f7..f4e3985e0 100644
--- a/org.envirocar.app/AndroidManifest.xml
+++ b/org.envirocar.app/AndroidManifest.xml
@@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="org.envirocar.app"
android:installLocation="internalOnly"
- android:versionCode="36"
- android:versionName="1.0.0">
+ android:versionCode="37"
+ android:versionName="1.0.1">
+ * * This file is part of the enviroCar app. - *
+ * * The enviroCar app is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - *
+ * * The enviroCar app is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details. - *
+ * * You should have received a copy of the GNU General Public License along * with the enviroCar app. If not, see http://www.gnu.org/licenses/. */ diff --git a/org.envirocar.app/src/org/envirocar/app/handler/preferences/UserPreferenceHandler.java b/org.envirocar.app/src/org/envirocar/app/handler/preferences/UserPreferenceHandler.java index 86a289a77..f68762e5a 100644 --- a/org.envirocar.app/src/org/envirocar/app/handler/preferences/UserPreferenceHandler.java +++ b/org.envirocar.app/src/org/envirocar/app/handler/preferences/UserPreferenceHandler.java @@ -1,18 +1,18 @@ /** * Copyright (C) 2013 - 2019 the enviroCar community - *
+ * * This file is part of the enviroCar app. - *
+ * * The enviroCar app is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - *
+ * * The enviroCar app is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details. - *
+ *
* You should have received a copy of the GNU General Public License along
* with the enviroCar app. If not, see http://www.gnu.org/licenses/.
*/
diff --git a/org.envirocar.app/src/org/envirocar/app/interactor/UploadAllTracks.java b/org.envirocar.app/src/org/envirocar/app/interactor/UploadAllTracks.java
index d3675a61d..dfbd22c22 100644
--- a/org.envirocar.app/src/org/envirocar/app/interactor/UploadAllTracks.java
+++ b/org.envirocar.app/src/org/envirocar/app/interactor/UploadAllTracks.java
@@ -1,3 +1,21 @@
+/**
+ * Copyright (C) 2013 - 2019 the enviroCar community
+ *
+ * This file is part of the enviroCar app.
+ *
+ * The enviroCar app is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The enviroCar app is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with the enviroCar app. If not, see http://www.gnu.org/licenses/.
+ */
package org.envirocar.app.interactor;
import android.app.Activity;
diff --git a/org.envirocar.app/src/org/envirocar/app/interactor/UploadTrack.java b/org.envirocar.app/src/org/envirocar/app/interactor/UploadTrack.java
index 937379633..326cd5b6b 100644
--- a/org.envirocar.app/src/org/envirocar/app/interactor/UploadTrack.java
+++ b/org.envirocar.app/src/org/envirocar/app/interactor/UploadTrack.java
@@ -1,3 +1,21 @@
+/**
+ * Copyright (C) 2013 - 2019 the enviroCar community
+ *
+ * This file is part of the enviroCar app.
+ *
+ * The enviroCar app is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The enviroCar app is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with the enviroCar app. If not, see http://www.gnu.org/licenses/.
+ */
package org.envirocar.app.interactor;
import android.app.Activity;
diff --git a/org.envirocar.app/src/org/envirocar/app/views/BaseMainActivity.java b/org.envirocar.app/src/org/envirocar/app/views/BaseMainActivity.java
index 37b7291a2..ed7d77e16 100644
--- a/org.envirocar.app/src/org/envirocar/app/views/BaseMainActivity.java
+++ b/org.envirocar.app/src/org/envirocar/app/views/BaseMainActivity.java
@@ -18,15 +18,15 @@
*/
package org.envirocar.app.views;
+import android.Manifest;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.SharedPreferences;
import android.os.Bundle;
-import android.preference.PreferenceManager;
import android.view.WindowManager;
+import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
@@ -57,24 +57,30 @@
import org.envirocar.core.logging.Logger;
import org.envirocar.core.utils.ServiceUtils;
+import java.util.List;
+
import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
-import io.reactivex.Observable;
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.observers.DisposableObserver;
-import io.reactivex.schedulers.Schedulers;
+import pub.devrel.easypermissions.AfterPermissionGranted;
+import pub.devrel.easypermissions.EasyPermissions;
+import pub.devrel.easypermissions.PermissionRequest;
/**
* @authro dewall
*/
-public class BaseMainActivity extends BaseInjectorActivity {
+public class BaseMainActivity extends BaseInjectorActivity implements EasyPermissions.PermissionCallbacks {
private static final Logger LOGGER = Logger.getLogger(BaseMainActivity.class);
private static final String TROUBLESHOOTING_TAG = "TROUBLESHOOTING";
+ private static final String[] LOCATION_AND_WRITE = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.WRITE_EXTERNAL_STORAGE};
+ private static final int RC_LOCATION_AND_WRITE_PERM = 124;
+
// Injected variables
@Inject
@@ -193,11 +199,17 @@ public void onReceive(Context context, Intent intent) {
registerReceiver(errorInformationReceiver, new IntentFilter(TroubleshootingFragment.INTENT));
}
+ @Override
+ protected void onStart() {
+ super.onStart();
+ checkPermissions();
+ }
+
private DisposableObserver
+ *
* This file is part of the enviroCar app.
- *
+ *
* The enviroCar app is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* The enviroCar app is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with the enviroCar app. If not, see http://www.gnu.org/licenses/.
*/
diff --git a/org.envirocar.core/src/main/java/org/envirocar/core/exception/TrackUploadException.java b/org.envirocar.core/src/main/java/org/envirocar/core/exception/TrackUploadException.java
index 660e3f06e..4fe457159 100644
--- a/org.envirocar.core/src/main/java/org/envirocar/core/exception/TrackUploadException.java
+++ b/org.envirocar.core/src/main/java/org/envirocar/core/exception/TrackUploadException.java
@@ -1,3 +1,21 @@
+/**
+ * Copyright (C) 2013 - 2019 the enviroCar community
+ *
+ * This file is part of the enviroCar app.
+ *
+ * The enviroCar app is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The enviroCar app is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with the enviroCar app. If not, see http://www.gnu.org/licenses/.
+ */
package org.envirocar.core.exception;
import org.envirocar.core.entity.Track;
diff --git a/org.envirocar.core/src/main/java/org/envirocar/core/utils/rx/OptionalOrError.java b/org.envirocar.core/src/main/java/org/envirocar/core/utils/rx/OptionalOrError.java
index f71f6bcc4..24cfc3c25 100644
--- a/org.envirocar.core/src/main/java/org/envirocar/core/utils/rx/OptionalOrError.java
+++ b/org.envirocar.core/src/main/java/org/envirocar/core/utils/rx/OptionalOrError.java
@@ -1,3 +1,21 @@
+/**
+ * Copyright (C) 2013 - 2019 the enviroCar community
+ *
+ * This file is part of the enviroCar app.
+ *
+ * The enviroCar app is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The enviroCar app is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with the enviroCar app. If not, see http://www.gnu.org/licenses/.
+ */
package org.envirocar.core.utils.rx;
public class OptionalOrError
+ *
* This file is part of the enviroCar app.
- *
+ *
* The enviroCar app is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* The enviroCar app is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with the enviroCar app. If not, see http://www.gnu.org/licenses/.
*/