forked from threema-ch/threema-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Threema
committed
Dec 4, 2023
1 parent
dae8136
commit a59da15
Showing
379 changed files
with
12,308 additions
and
4,271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,12 +175,6 @@ <h2>Emoji art supplied by <a href="http://emojione.com">EmojiOne</a></h2> | |
<p>Licensed under Creative Commons License (CC-BY 4.0).</p> | ||
|
||
|
||
<h2>ExoPlayer</h2> | ||
|
||
<p>Copyright (c) 2017 Google, Inc.</p> | ||
|
||
<p>Licensed under the Apache License, version 2.0 (copy below).</p> | ||
|
||
<h2>ez-vcard</h2> | ||
|
||
<p>Copyright (c) 2012-2021, Michael Angstadt</p> | ||
|
@@ -216,6 +210,12 @@ <h2>ez-vcard</h2> | |
of the authors and should not be interpreted as representing official policies, | ||
either expressed or implied, of the FreeBSD Project.</p> | ||
|
||
<h2>Gesture Views</h2> | ||
|
||
<p>Copyright (c) 2022 Alex Vasilkov</p> | ||
|
||
<p>Licensed under the Apache License, version 2.0 (copy below).</p> | ||
|
||
<h2>Jackson JSON-processor</h2> | ||
|
||
<p>Copyright (c) 2007-2017 Tatu Saloranta, [email protected]</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
app/src/androidTest/java/ch/threema/app/PermissionRuleUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* _____ _ | ||
* |_ _| |_ _ _ ___ ___ _ __ __ _ | ||
* | | | ' \| '_/ -_) -_) ' \/ _` |_ | ||
* |_| |_||_|_| \___\___|_|_|_\__,_(_) | ||
* | ||
* Threema for Android | ||
* Copyright (c) 2023 Threema GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License, version 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program 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 Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package ch.threema.app | ||
|
||
import android.os.Build | ||
import androidx.test.rule.GrantPermissionRule | ||
|
||
/** | ||
* Get the permission rule for the notification permission. This method can be used to only grant | ||
* the permission for Android TIRAMISU and newer. | ||
*/ | ||
fun getNotificationPermissionRule(): GrantPermissionRule { | ||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||
GrantPermissionRule.grant(android.Manifest.permission.POST_NOTIFICATIONS) | ||
} else { | ||
GrantPermissionRule.grant() | ||
} | ||
} | ||
|
||
/** | ||
* Get the READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions. This method can be used to | ||
* grant the permissions only for those android versions that need them. | ||
*/ | ||
fun getReadWriteExternalStoragePermissionRule(): GrantPermissionRule { | ||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | ||
// Not needed for Q and newer, therefore return an empty grant permission rule | ||
GrantPermissionRule.grant() | ||
} else { | ||
GrantPermissionRule.grant( | ||
android.Manifest.permission.READ_EXTERNAL_STORAGE, | ||
android.Manifest.permission.WRITE_EXTERNAL_STORAGE | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.