mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 09:49:25 +02:00
Compare commits
3 commits
5f69014850
...
53732e47dd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
53732e47dd | ||
![]() |
acdd83c39a | ||
![]() |
f4c35dec55 |
4 changed files with 41 additions and 23 deletions
|
@ -167,24 +167,24 @@ wire {
|
|||
|
||||
dependencies {
|
||||
def nav_version = "2.5.3"
|
||||
def room_version = "2.7.1"
|
||||
def work_version = '2.10.1'
|
||||
def room_version = "2.7.2"
|
||||
def work_version = '2.10.2'
|
||||
def paging_version = "3.3.6"
|
||||
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.21"
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||
implementation 'androidx.core:core:1.16.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.gridlayout:gridlayout:1.1.0'
|
||||
implementation "com.google.android.material:material:1.12.0"
|
||||
implementation 'androidx.compose.material:material:1.8.1'
|
||||
implementation 'androidx.compose.material:material:1.8.3'
|
||||
implementation 'androidx.activity:activity-compose:1.10.1'
|
||||
implementation "com.google.accompanist:accompanist-flowlayout:0.30.0"
|
||||
implementation 'androidx.compose.material:material-icons-extended:1.7.8'
|
||||
debugImplementation "androidx.compose.ui:ui-tooling:1.8.1"
|
||||
implementation 'androidx.fragment:fragment-ktx:1.8.6'
|
||||
implementation 'androidx.fragment:fragment-compose:1.8.6'
|
||||
debugImplementation "androidx.compose.ui:ui-tooling:1.8.3"
|
||||
implementation 'androidx.fragment:fragment-ktx:1.8.8'
|
||||
implementation 'androidx.fragment:fragment-compose:1.8.8'
|
||||
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
|
||||
implementation "androidx.navigation:navigation-ui:$nav_version"
|
||||
|
|
|
@ -134,9 +134,19 @@ class AndroidDeviceOwnerApi(
|
|||
if (VERSION.SDK_INT < VERSION_CODES.LOLLIPOP) return false
|
||||
if (!devicePolicyManager.isDeviceOwnerApp(componentName.packageName)) return false
|
||||
|
||||
try {
|
||||
return devicePolicyManager.setPermissionGrantState(
|
||||
componentName, componentName.packageName, Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
DevicePolicyManager.PERMISSION_GRANT_STATE_GRANTED
|
||||
)
|
||||
} catch (ex: SecurityException) {
|
||||
// set to default so that granting this manually is possible
|
||||
devicePolicyManager.setPermissionGrantState(
|
||||
componentName, componentName.packageName, Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
DevicePolicyManager.PERMISSION_GRANT_STATE_DEFAULT
|
||||
)
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
|
@ -519,17 +519,25 @@ class AndroidIntegration(context: Context): PlatformIntegration(maximumProtectio
|
|||
context.packageName,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
).let {
|
||||
try {
|
||||
if (it == DevicePolicyManager.PERMISSION_GRANT_STATE_DEFAULT) {
|
||||
policyManager.setPermissionGrantState(
|
||||
deviceAdmin,
|
||||
context.packageName,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)
|
||||
if (ContextCompat.checkSelfPermission(
|
||||
context,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION
|
||||
) == PackageManager.PERMISSION_GRANTED
|
||||
)
|
||||
DevicePolicyManager.PERMISSION_GRANT_STATE_GRANTED
|
||||
else
|
||||
DevicePolicyManager.PERMISSION_GRANT_STATE_DENIED
|
||||
)
|
||||
}
|
||||
} catch (ex: SecurityException) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
policyManager.setPermissionGrantState(
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
|
||||
plugins {
|
||||
id 'com.android.application' version '8.10.0' apply false
|
||||
id 'com.android.library' version '8.10.0' apply false
|
||||
id 'com.android.application' version '8.10.1' apply false
|
||||
id 'com.android.library' version '8.10.1' apply false
|
||||
id 'org.jetbrains.kotlin.android' version "2.0.21" apply false
|
||||
id 'com.google.devtools.ksp' version '1.9.21-1.0.16' apply false
|
||||
id 'androidx.navigation.safeargs' version '2.6.0' apply false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue