forked from boostcampwm-2022/android04-BEEP
-
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.
Issues boostcampwm-2022#287 feat: Permission 을 위해 설정화면으로 이동하는 로직 추가
- Loading branch information
Showing
12 changed files
with
102 additions
and
139 deletions.
There are no files selected for viewing
21 changes: 17 additions & 4 deletions
21
...d/src/main/java/com/lighthouse/core/android/utils/permission/LocationPermissionManager.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 |
---|---|---|
@@ -1,18 +1,31 @@ | ||
package com.lighthouse.core.android.utils.permission | ||
|
||
import android.Manifest | ||
import android.app.Activity | ||
import android.content.Context | ||
import android.content.Intent | ||
import android.net.Uri | ||
import android.os.Build | ||
import android.provider.Settings | ||
import com.lighthouse.core.android.utils.permission.core.PermissionManager | ||
|
||
class LocationPermissionManager(activity: Activity) : PermissionManager(activity) { | ||
class LocationPermissionManager(context: Context) : PermissionManager(context) { | ||
|
||
override val additionalPermission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | ||
override val additionalPermissions = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | ||
arrayOf(Manifest.permission.ACCESS_BACKGROUND_LOCATION) | ||
} else { | ||
emptyArray() | ||
} | ||
|
||
override val permissions = | ||
arrayOf(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION) | ||
arrayOf( | ||
Manifest.permission.ACCESS_FINE_LOCATION, | ||
Manifest.permission.ACCESS_COARSE_LOCATION | ||
) | ||
|
||
override fun settingIntent(): Intent { | ||
return Intent( | ||
Settings.ACTION_APPLICATION_DETAILS_SETTINGS, | ||
Uri.fromParts("package", context.packageName, null) | ||
) | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...id/src/main/java/com/lighthouse/core/android/utils/permission/StoragePermissionManager.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
26 changes: 0 additions & 26 deletions
26
...main/java/com/lighthouse/core/android/utils/permission/core/ActivityPermissionDelegate.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...id/src/main/java/com/lighthouse/core/android/utils/permission/core/BeepPermissionState.kt
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
...main/java/com/lighthouse/core/android/utils/permission/core/FragmentPermissionDelegate.kt
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
...oid/src/main/java/com/lighthouse/core/android/utils/permission/core/PermissionDelegate.kt
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
...roid/src/main/java/com/lighthouse/core/android/utils/permission/core/PermissionFactory.kt
This file was deleted.
Oops, something went wrong.
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
7 changes: 7 additions & 0 deletions
7
...android/src/main/java/com/lighthouse/core/android/utils/permission/core/PermissionType.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,7 @@ | ||
package com.lighthouse.core.android.utils.permission.core | ||
|
||
enum class PermissionType { | ||
All, | ||
Basic, | ||
Additional | ||
} |
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
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