Skip to content

Commit

Permalink
Update RequiresPermissions Annotation to WithPermissions
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtan403 committed Feb 15, 2018
1 parent 395f562 commit 2401b86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package com.livinglifetechway.quickpermissions.annotations
*/
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
annotation class RequiresPermissions(
annotation class WithPermissions(
val permissions: Array<String>,
val rationaleMessage: String = "",
val permanentlyDeniedMessage: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.livinglifetechway.k4kotlin.transact
import com.livinglifetechway.quickpermissions.annotations.OnPermissionsDenied
import com.livinglifetechway.quickpermissions.annotations.OnPermissionsPermanentlyDenied
import com.livinglifetechway.quickpermissions.annotations.OnShowRationale
import com.livinglifetechway.quickpermissions.annotations.RequiresPermissions
import com.livinglifetechway.quickpermissions.annotations.WithPermissions
import com.livinglifetechway.quickpermissions.util.PermissionCheckerFragment
import com.livinglifetechway.quickpermissions.util.PermissionUtil
import com.livinglifetechway.quickpermissions.util.QuickPermissionsRequest
Expand All @@ -28,7 +28,7 @@ class PermissionsManager {

companion object {
private val TAG = PermissionsManager::class.java.simpleName
private const val POINTCUT_METHOD = "execution(@com.livinglifetechway.quickpermissions.annotations.RequiresPermissions * *(..))"
private const val POINTCUT_METHOD = "execution(@com.livinglifetechway.quickpermissions.annotations.WithPermissions * *(..))"
}

@Pointcut(POINTCUT_METHOD)
Expand All @@ -43,7 +43,7 @@ class PermissionsManager {
// get the permissions defined in annotation
val methodSignature = joinPoint.signature as MethodSignature
val method = methodSignature.method
val annotation = method.getAnnotation(RequiresPermissions::class.java)
val annotation = method.getAnnotation(WithPermissions::class.java)
val permissions = annotation.permissions

Log.d(TAG, "permissions to check: " + permissions)
Expand Down

0 comments on commit 2401b86

Please sign in to comment.