Class PermissionMapping
- java.lang.Object
-
- com.ensoftcorp.open.android.essentials.permissions.mappings.PermissionMapping
-
public class PermissionMapping extends java.lang.Object
Applies permission mapping results on the Atlas program graph- Author:
- Ben Holland, Yuqing Chen, Xing Yan
-
-
Field Summary
Fields Modifier and Type Field Description static int
HIGHEST_AVAILABLE_MAPPING
Defines the highest available permission mapping, if no mapping can be found for the requested version this is the default.
-
Constructor Summary
Constructors Constructor Description PermissionMapping()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.HashMap<Permission,com.ensoftcorp.atlas.core.db.set.AtlasHashSet<com.ensoftcorp.atlas.core.db.graph.GraphElement>>
applyTags(int apiVersion)
This method applies tags to the Android api's.static java.util.ArrayList<java.lang.Integer>
getAvailableMappings()
Returns a sorted list of Android API versions that mappings exist forstatic int
getBestAvailableMapping(int apiVersion)
Returns the api version of the closest available permission mapping to a given android api version Searches for forward for next higher available mapping If no mapping is found, defaults to the highest available mappingstatic com.ensoftcorp.atlas.core.query.Q
getMethods(PermissionGroup permissionGroup, int apiVersion)
Returns the permission tagged methods for the permissions in the permission group Assumes the permission mapping tags have already been appliedstatic com.ensoftcorp.atlas.core.query.Q
getMethods(Permission permission, int apiVersion)
Returns the permission tagged methods for the permission instance Assumes the permission mapping tags have already been appliedstatic com.ensoftcorp.atlas.core.query.Q
getMethods(ProtectionLevel protectionLevel, int apiVersion)
Returns the permission tagged methods for the permissions in the protection level Assumes the permission mapping tags have already been appliedstatic com.ensoftcorp.atlas.core.query.Q
getPermissionTaggedMethods(Permission permission, int apiVersion)
Returns a Q of permission tagged nodes for the given API versionstatic java.lang.String
getTagPrefix(int apiVersion)
Returns the tagging prefix for a given android api version
-
-
-
Field Detail
-
HIGHEST_AVAILABLE_MAPPING
public static final int HIGHEST_AVAILABLE_MAPPING
Defines the highest available permission mapping, if no mapping can be found for the requested version this is the default.- See Also:
- Constant Field Values
-
-
Method Detail
-
getMethods
public static com.ensoftcorp.atlas.core.query.Q getMethods(Permission permission, int apiVersion)
Returns the permission tagged methods for the permission instance Assumes the permission mapping tags have already been applied- Parameters:
apiVersion
-- Returns:
-
getMethods
public static com.ensoftcorp.atlas.core.query.Q getMethods(PermissionGroup permissionGroup, int apiVersion)
Returns the permission tagged methods for the permissions in the permission group Assumes the permission mapping tags have already been applied- Parameters:
apiVersion
-- Returns:
-
getMethods
public static com.ensoftcorp.atlas.core.query.Q getMethods(ProtectionLevel protectionLevel, int apiVersion)
Returns the permission tagged methods for the permissions in the protection level Assumes the permission mapping tags have already been applied- Parameters:
apiVersion
-- Returns:
-
getTagPrefix
public static java.lang.String getTagPrefix(int apiVersion)
Returns the tagging prefix for a given android api version- Parameters:
apiVersion
-- Returns:
-
getAvailableMappings
public static java.util.ArrayList<java.lang.Integer> getAvailableMappings()
Returns a sorted list of Android API versions that mappings exist for- Returns:
-
getBestAvailableMapping
public static int getBestAvailableMapping(int apiVersion)
Returns the api version of the closest available permission mapping to a given android api version Searches for forward for next higher available mapping If no mapping is found, defaults to the highest available mapping- Parameters:
apiVersion
-- Returns:
-
getPermissionTaggedMethods
public static com.ensoftcorp.atlas.core.query.Q getPermissionTaggedMethods(Permission permission, int apiVersion)
Returns a Q of permission tagged nodes for the given API version- Parameters:
permission
-apiVersion
-- Returns:
-
applyTags
public static java.util.HashMap<Permission,com.ensoftcorp.atlas.core.db.set.AtlasHashSet<com.ensoftcorp.atlas.core.db.graph.GraphElement>> applyTags(int apiVersion)
This method applies tags to the Android api's. The versions with no Permission mapping will switch to the next available version.
-
-