Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e502ae8 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Squashed commit of the following:

commit 56f5f5a6cbad595534148a160678972734ca6cf2
Author: Ricki Hirner <hirner@bitfire.at>
Date:   Wed Sep 29 10:59:23 2021 +0200

    Version bump to 4.0-beta1

commit 2a4d7501d9d6cd572269de21e82c204c5a2a57e8
Author: Ricki Hirner <hirner@bitfire.at>
Date:   Tue Sep 28 21:45:49 2021 +0200

    Fix UiUtils.launchUri once again

commit 293accaf8f26842d198e9d5c4fc9029cb6ac71cc
Author: Ricki Hirner <hirner@bitfire.at>
Date:   Tue Sep 28 13:47:06 2021 +0200

    Adjust gradle daemon heap size

commit 7763a51c9bbc7baee36ef71648889f7fb4fe965d
Author: Ricki Hirner <hirner@bitfire.at>
Date:   Tue Sep 28 12:21:37 2021 +0200

    Query and show quota

commit 95f4dbfd8ffadd930aab9fc36dc3865bfee54fb7
Author: Ricki Hirner <hirner@bitfire.at>
Date:   Mon Sep 27 22:16:48 2021 +0200

    Persist cookies over WebDAV sessions

commit 17c9327eb3ef3d9384b28b70aa9637718d34e8a2
Author: Ricki Hirner <hirner@bitfire.at>
Date:   Sun Sep 26 19:54:57 2021 +0200

    Add WebDAV caches

    * add random access page cache
    * add thumbnail cache
    * add HEAD response cache

commit 0e5237f8b178ab66099999f72e657c59c9302d71
Author: Ricki Hirner <hirner@bitfire.at>
Date:   Tue Aug 31 13:25:36 2021 +0200

    Add WebDAV Access over Storage Access Framework
parent da7d1e1e
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ android {
    defaultConfig {
        applicationId "at.bitfire.davdroid"

        versionCode 304010000
        versionCode 400000000
        buildConfigField "long", "buildTime", System.currentTimeMillis() + "L"

        minSdkVersion 21        // Android 5
@@ -55,7 +55,7 @@ android {
    flavorDimensions "distribution"
    productFlavors {
        standard {
            versionName "3.4.1-beta1-ose"
            versionName "4.0-beta1-ose"
        }
    }

@@ -124,25 +124,26 @@ dependencies {
    implementation project(':ical4android')
    implementation project(':vcard4android')

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.browser:browser:1.3.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.fragment:fragment-ktx:1.3.6'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
    implementation 'androidx.paging:paging-runtime-ktx:3.0.1'
    implementation 'androidx.preference:preference-ktx:1.1.1'
    implementation 'androidx.security:security-crypto:1.1.0-alpha03'
    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
    implementation 'com.google.android.flexbox:flexbox:3.0.0'
    implementation 'com.google.android.material:material:1.4.0'

    def room_version = '2.3.0'
    def room_version = '2.4.0-alpha04'
    implementation "androidx.room:room-runtime:$room_version"
    implementation "androidx.room:room-ktx:$room_version"
    kapt "androidx.room:room-compiler:$room_version"
+398 −0
Original line number Diff line number Diff line
{
  "formatVersion": 1,
  "database": {
    "version": 10,
    "identityHash": "6fcabe50cbd00a4215dbe536a565dd2a",
    "entities": [
      {
        "tableName": "service",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `accountName` TEXT NOT NULL, `type` TEXT NOT NULL, `principal` TEXT)",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "accountName",
            "columnName": "accountName",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "type",
            "columnName": "type",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "principal",
            "columnName": "principal",
            "affinity": "TEXT",
            "notNull": false
          }
        ],
        "primaryKey": {
          "columnNames": [
            "id"
          ],
          "autoGenerate": true
        },
        "indices": [
          {
            "name": "index_service_accountName_type",
            "unique": true,
            "columnNames": [
              "accountName",
              "type"
            ],
            "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_service_accountName_type` ON `${TABLE_NAME}` (`accountName`, `type`)"
          }
        ],
        "foreignKeys": []
      },
      {
        "tableName": "homeset",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `serviceId` INTEGER NOT NULL, `personal` INTEGER NOT NULL, `url` TEXT NOT NULL, `privBind` INTEGER NOT NULL, `displayName` TEXT, FOREIGN KEY(`serviceId`) REFERENCES `service`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "serviceId",
            "columnName": "serviceId",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "personal",
            "columnName": "personal",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "url",
            "columnName": "url",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "privBind",
            "columnName": "privBind",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "displayName",
            "columnName": "displayName",
            "affinity": "TEXT",
            "notNull": false
          }
        ],
        "primaryKey": {
          "columnNames": [
            "id"
          ],
          "autoGenerate": true
        },
        "indices": [
          {
            "name": "index_homeset_serviceId_url",
            "unique": true,
            "columnNames": [
              "serviceId",
              "url"
            ],
            "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_homeset_serviceId_url` ON `${TABLE_NAME}` (`serviceId`, `url`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "service",
            "onDelete": "CASCADE",
            "onUpdate": "NO ACTION",
            "columns": [
              "serviceId"
            ],
            "referencedColumns": [
              "id"
            ]
          }
        ]
      },
      {
        "tableName": "collection",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `serviceId` INTEGER NOT NULL, `homeSetId` INTEGER, `type` TEXT NOT NULL, `url` TEXT NOT NULL, `privWriteContent` INTEGER NOT NULL, `privUnbind` INTEGER NOT NULL, `forceReadOnly` INTEGER NOT NULL, `displayName` TEXT, `description` TEXT, `owner` TEXT, `color` INTEGER, `timezone` TEXT, `supportsVEVENT` INTEGER, `supportsVTODO` INTEGER, `supportsVJOURNAL` INTEGER, `source` TEXT, `sync` INTEGER NOT NULL, FOREIGN KEY(`serviceId`) REFERENCES `service`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`homeSetId`) REFERENCES `homeset`(`id`) ON UPDATE NO ACTION ON DELETE SET NULL )",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "serviceId",
            "columnName": "serviceId",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "homeSetId",
            "columnName": "homeSetId",
            "affinity": "INTEGER",
            "notNull": false
          },
          {
            "fieldPath": "type",
            "columnName": "type",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "url",
            "columnName": "url",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "privWriteContent",
            "columnName": "privWriteContent",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "privUnbind",
            "columnName": "privUnbind",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "forceReadOnly",
            "columnName": "forceReadOnly",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "displayName",
            "columnName": "displayName",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "description",
            "columnName": "description",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "owner",
            "columnName": "owner",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "color",
            "columnName": "color",
            "affinity": "INTEGER",
            "notNull": false
          },
          {
            "fieldPath": "timezone",
            "columnName": "timezone",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "supportsVEVENT",
            "columnName": "supportsVEVENT",
            "affinity": "INTEGER",
            "notNull": false
          },
          {
            "fieldPath": "supportsVTODO",
            "columnName": "supportsVTODO",
            "affinity": "INTEGER",
            "notNull": false
          },
          {
            "fieldPath": "supportsVJOURNAL",
            "columnName": "supportsVJOURNAL",
            "affinity": "INTEGER",
            "notNull": false
          },
          {
            "fieldPath": "source",
            "columnName": "source",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "sync",
            "columnName": "sync",
            "affinity": "INTEGER",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "id"
          ],
          "autoGenerate": true
        },
        "indices": [
          {
            "name": "index_collection_serviceId_type",
            "unique": false,
            "columnNames": [
              "serviceId",
              "type"
            ],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_collection_serviceId_type` ON `${TABLE_NAME}` (`serviceId`, `type`)"
          },
          {
            "name": "index_collection_homeSetId_type",
            "unique": false,
            "columnNames": [
              "homeSetId",
              "type"
            ],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_collection_homeSetId_type` ON `${TABLE_NAME}` (`homeSetId`, `type`)"
          },
          {
            "name": "index_collection_url",
            "unique": false,
            "columnNames": [
              "url"
            ],
            "createSql": "CREATE INDEX IF NOT EXISTS `index_collection_url` ON `${TABLE_NAME}` (`url`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "service",
            "onDelete": "CASCADE",
            "onUpdate": "NO ACTION",
            "columns": [
              "serviceId"
            ],
            "referencedColumns": [
              "id"
            ]
          },
          {
            "table": "homeset",
            "onDelete": "SET NULL",
            "onUpdate": "NO ACTION",
            "columns": [
              "homeSetId"
            ],
            "referencedColumns": [
              "id"
            ]
          }
        ]
      },
      {
        "tableName": "syncstats",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `collectionId` INTEGER NOT NULL, `authority` TEXT NOT NULL, `lastSync` INTEGER NOT NULL, FOREIGN KEY(`collectionId`) REFERENCES `collection`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "collectionId",
            "columnName": "collectionId",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "authority",
            "columnName": "authority",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "lastSync",
            "columnName": "lastSync",
            "affinity": "INTEGER",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "id"
          ],
          "autoGenerate": true
        },
        "indices": [
          {
            "name": "index_syncstats_collectionId_authority",
            "unique": true,
            "columnNames": [
              "collectionId",
              "authority"
            ],
            "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_syncstats_collectionId_authority` ON `${TABLE_NAME}` (`collectionId`, `authority`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "collection",
            "onDelete": "CASCADE",
            "onUpdate": "NO ACTION",
            "columns": [
              "collectionId"
            ],
            "referencedColumns": [
              "id"
            ]
          }
        ]
      },
      {
        "tableName": "webdav_mount",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT NOT NULL, `url` TEXT NOT NULL)",
        "fields": [
          {
            "fieldPath": "id",
            "columnName": "id",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "name",
            "columnName": "name",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "url",
            "columnName": "url",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "id"
          ],
          "autoGenerate": true
        },
        "indices": [],
        "foreignKeys": []
      }
    ],
    "views": [],
    "setupQueries": [
      "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
      "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '6fcabe50cbd00a4215dbe536a565dd2a')"
    ]
  }
}
 No newline at end of file
+536 −0

File added.

Preview size limit exceeded, changes collapsed.

+21 −1
Original line number Diff line number Diff line
@@ -130,6 +130,16 @@
            android:label="@string/wifi_permissions_label"
            android:parentActivityName=".ui.account.SettingsActivity" />

        <activity
            android:name=".ui.webdav.WebdavMountsActivity"
            android:label="@string/webdav_mounts_title"
            android:parentActivityName=".ui.AccountsActivity"
            android:exported="true" />
        <activity
            android:name=".ui.webdav.AddWebdavMountActivity"
            android:label="@string/webdav_add_mount_title"
            android:parentActivityName=".ui.webdav.WebdavMountsActivity" />

        <!-- account type "DAVx⁵" -->
        <service
            android:name=".syncadapter.AccountAuthenticatorService"
@@ -174,6 +184,16 @@
                android:name="android.content.SyncAdapter"
                android:resource="@xml/sync_tasks_org"/>
        </service>
        <provider
            android:authorities="@string/webdav_authority"
            android:name=".webdav.DavDocumentsProvider"
            android:exported="true"
            android:grantUriPermissions="true"
            android:permission="android.permission.MANAGE_DOCUMENTS">
            <intent-filter>
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
        </provider>

        <!-- account type "DAVx⁵ Address book" -->
        <service
@@ -261,7 +281,7 @@
            <data android:scheme="content" android:host="com.android.calendar" />
        </intent>

        <!-- Web browsers (to check whether a Web browser is installed before viewing a URL) -->
        <!-- Open URLs in a browser or other app [https://developer.android.com/training/package-visibility/use-cases#open-urls-browser-or-other-app] -->
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="https" />
+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ object DavUtils {
        ACTIVE, PENDING, IDLE
    }

    const val MIME_TYPE_ALL = "*/*"


    @Suppress("FunctionName")
    fun ARGBtoCalDAVColor(colorWithAlpha: Int): String {
Loading