Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
bitfire web engineering
DAVx⁵
Commits
eb70f869
Commit
eb70f869
authored
Aug 05, 2016
by
Ricki Hirner
🐑
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix OpenTasks regression bug
* version bump to 1.2.3 * enable OpenTasks sync on Android <6 again
parent
bab84d7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
app/build.gradle
app/build.gradle
+2
-2
app/src/main/java/at/bitfire/davdroid/ui/setup/AccountDetailsFragment.java
.../at/bitfire/davdroid/ui/setup/AccountDetailsFragment.java
+11
-5
No files found.
app/build.gradle
View file @
eb70f869
...
...
@@ -17,7 +17,7 @@ android {
minSdkVersion
14
targetSdkVersion
24
versionCode
11
1
versionCode
11
2
buildConfigField
"long"
,
"buildTime"
,
System
.
currentTimeMillis
()
+
"L"
buildConfigField
"boolean"
,
"useMTM"
,
"true"
...
...
@@ -25,7 +25,7 @@ android {
productFlavors
{
standard
{
versionName
"1.2.
2
-ose"
versionName
"1.2.
3
-ose"
}
}
...
...
app/src/main/java/at/bitfire/davdroid/ui/setup/AccountDetailsFragment.java
View file @
eb70f869
...
...
@@ -158,16 +158,22 @@ public class AccountDetailsFragment extends Fragment {
// enable task sync, if possible
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
/*
since
Android
23
, it's possible to gain OpenTasks permissions dynamically, so
/* Android
>=6
, it's possible to gain OpenTasks permissions dynamically, so
* OpenTasks sync will be enabled by default. Setting the sync interval to "manually"
* if OpenTasks is not installed avoids the "sync error" in Android settings / Accounts. */
ContentResolver
.
setIsSyncable
(
account
,
TaskProvider
.
ProviderName
.
OpenTasks
.
authority
,
1
);
settings
.
setSyncInterval
(
TaskProvider
.
ProviderName
.
OpenTasks
.
authority
,
LocalTaskList
.
tasksProviderAvailable
(
getContext
())
?
DEFAULT_SYNC_INTERVAL
:
AccountSettings
.
SYNC_INTERVAL_MANUALLY
);
}
else
// Android <6 only: disable OpenTasks sync forever when OpenTasks is not installed
// because otherwise, there will be a non-catchable SecurityException as soon as OpenTasks is installed
ContentResolver
.
setIsSyncable
(
account
,
TaskProvider
.
ProviderName
.
OpenTasks
.
authority
,
0
);
}
else
{
// Android <6: enable task sync according to whether OpenTasks is accessible
if
(
LocalTaskList
.
tasksProviderAvailable
(
getContext
()))
{
ContentResolver
.
setIsSyncable
(
account
,
TaskProvider
.
ProviderName
.
OpenTasks
.
authority
,
1
);
settings
.
setSyncInterval
(
TaskProvider
.
ProviderName
.
OpenTasks
.
authority
,
DEFAULT_SYNC_INTERVAL
);
}
else
// Android <6 only: disable OpenTasks sync forever when OpenTasks is not installed
// because otherwise, there will be a non-catchable SecurityException as soon as OpenTasks is installed
ContentResolver
.
setIsSyncable
(
account
,
TaskProvider
.
ProviderName
.
OpenTasks
.
authority
,
0
);
}
}
else
{
// disable calendar and task sync when CalDAV is not available
ContentResolver
.
setIsSyncable
(
account
,
CalendarContract
.
AUTHORITY
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment