mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-25 10:44:44 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 721b54b06f | |||
| b65230bc5d | |||
| 7c8fae66ef |
+3
-3
@@ -6,7 +6,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.7.2'
|
||||
classpath 'com.android.tools.build:gradle:8.7.3'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "de.dennisguse.opentracks"
|
||||
versionCode 5938
|
||||
versionName "v4.15.0"
|
||||
versionCode 5941
|
||||
versionName "v4.16.0"
|
||||
|
||||
buildConfigField "String", "VERSION_NAME_FULL", "\"${getVersionName()}\""
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
v4.16.0: OpenTracks
|
||||
|
||||
Bugfix:
|
||||
- PublicAPI: starting a recording didn't record no data
|
||||
|
||||
@@ -31,13 +31,7 @@ public class PublicApiTest {
|
||||
|
||||
private final Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
@Test
|
||||
public void StartTest() {
|
||||
PreferencesUtils.setBoolean(R.string.publicapi_enabled_key, true);
|
||||
|
||||
context.startActivity(IntentUtils.newIntent(context, StartRecording.class));
|
||||
}
|
||||
|
||||
//NOTE: this doesn't check if the TrackRecordingService was started in foreground.
|
||||
@Test
|
||||
public void StartStopTest() throws InterruptedException {
|
||||
PreferencesUtils.setBoolean(R.string.publicapi_enabled_key, true);
|
||||
|
||||
@@ -33,11 +33,15 @@ public abstract class AbstractAPIActivity extends AppCompatActivity {
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
splashScreen.setKeepOnScreenCondition(() -> true );
|
||||
splashScreen.setKeepOnScreenCondition(() -> true);
|
||||
|
||||
if (PreferencesUtils.isPublicAPIenabled()) {
|
||||
Log.i(TAG, "Received and trying to execute requested action.");
|
||||
TrackRecordingServiceConnection.execute(this, serviceConnectedCallback);
|
||||
if (requiresForeground()) {
|
||||
TrackRecordingServiceConnection.executeForeground(this, serviceConnectedCallback);
|
||||
} else {
|
||||
TrackRecordingServiceConnection.execute(this, serviceConnectedCallback);
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, getString(R.string.settings_public_api_disabled_toast), Toast.LENGTH_LONG).show();
|
||||
Log.w(TAG, "Public API is disabled; ignoring request.");
|
||||
@@ -48,4 +52,8 @@ public abstract class AbstractAPIActivity extends AppCompatActivity {
|
||||
protected abstract void execute(TrackRecordingService service);
|
||||
|
||||
protected abstract boolean isPostExecuteStopService();
|
||||
|
||||
protected boolean requiresForeground() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,4 +62,9 @@ public class StartRecording extends AbstractAPIActivity {
|
||||
protected boolean isPostExecuteStopService() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean requiresForeground() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user