Skip to content
Snippets Groups Projects
Commit 4587df0f authored by Michael Peck's avatar Michael Peck Committed by android-build-merger
Browse files

Add minTargetSdkVersion input selector to seapp_contexts am: f54b3622

am: 2afdf49a

Change-Id: Ic017d638035ce5be10ac2aeda60049a1087d83df
parents 1e2b5557 2afdf49a
Branches
Tags
No related merge requests found
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
# name (string) # name (string)
# path (string) # path (string)
# isPrivApp (boolean) # isPrivApp (boolean)
# minTargetSdkVersion (unsigned integer)
# isSystemServer=true can only be used once. # isSystemServer=true can only be used once.
# An unspecified isSystemServer defaults to false. # An unspecified isSystemServer defaults to false.
# isEphemeralApp=true will match apps marked by PackageManager as Ephemeral # isEphemeralApp=true will match apps marked by PackageManager as Ephemeral
...@@ -19,6 +20,9 @@ ...@@ -19,6 +20,9 @@
# user=_isolated will match any isolated service UID. # user=_isolated will match any isolated service UID.
# isPrivApp=true will only match for applications preinstalled in # isPrivApp=true will only match for applications preinstalled in
# /system/priv-app. # /system/priv-app.
# minTargetSdkVersion will match applications with a targetSdkVersion
# greater than or equal to the specified value. If unspecified,
# it has a default value of 0.
# All specified input selectors in an entry must match (i.e. logical AND). # All specified input selectors in an entry must match (i.e. logical AND).
# Matching is case-insensitive. # Matching is case-insensitive.
# #
...@@ -34,6 +38,8 @@ ...@@ -34,6 +38,8 @@
# (8) Specified name= string before unspecified name= string. # (8) Specified name= string before unspecified name= string.
# (9) Specified path= string before unspecified path= string. # (9) Specified path= string before unspecified path= string.
# (10) Specified isPrivApp= before unspecified isPrivApp= boolean. # (10) Specified isPrivApp= before unspecified isPrivApp= boolean.
# (11) Higher value of minTargetSdkVersion= before lower value of minTargetSdkVersion=
# integer. Note that minTargetSdkVersion= defaults to 0 if unspecified.
# #
# Outputs: # Outputs:
# domain (string) # domain (string)
......
...@@ -194,6 +194,7 @@ static bool validate_bool(char *value, char **errmsg); ...@@ -194,6 +194,7 @@ static bool validate_bool(char *value, char **errmsg);
static bool validate_levelFrom(char *value, char **errmsg); static bool validate_levelFrom(char *value, char **errmsg);
static bool validate_selinux_type(char *value, char **errmsg); static bool validate_selinux_type(char *value, char **errmsg);
static bool validate_selinux_level(char *value, char **errmsg); static bool validate_selinux_level(char *value, char **errmsg);
static bool validate_uint(char *value, char **errmsg);
/** /**
* The heart of the mapping process, this must be updated if a new key value pair is added * The heart of the mapping process, this must be updated if a new key value pair is added
...@@ -209,6 +210,7 @@ key_map rules[] = { ...@@ -209,6 +210,7 @@ key_map rules[] = {
{ .name = "name", .dir = dir_in, }, { .name = "name", .dir = dir_in, },
{ .name = "path", .dir = dir_in, }, { .name = "path", .dir = dir_in, },
{ .name = "isPrivApp", .dir = dir_in, .fn_validate = validate_bool }, { .name = "isPrivApp", .dir = dir_in, .fn_validate = validate_bool },
{ .name = "minTargetSdkVersion", .dir = dir_in, .fn_validate = validate_uint },
/*Outputs*/ /*Outputs*/
{ .name = "domain", .dir = dir_out, .fn_validate = validate_selinux_type }, { .name = "domain", .dir = dir_out, .fn_validate = validate_selinux_type },
{ .name = "type", .dir = dir_out, .fn_validate = validate_selinux_type }, { .name = "type", .dir = dir_out, .fn_validate = validate_selinux_type },
...@@ -417,6 +419,19 @@ static bool validate_selinux_level(char *value, char **errmsg) { ...@@ -417,6 +419,19 @@ static bool validate_selinux_level(char *value, char **errmsg) {
return true; return true;
} }
static bool validate_uint(char *value, char **errmsg) {
char *endptr;
long longvalue;
longvalue = strtol(value, &endptr, 10);
if (('\0' != *endptr) || (longvalue < 0) || (longvalue > INT32_MAX)) {
*errmsg = "Expecting a valid unsigned integer";
return false;
}
return true;
}
/** /**
* Validates a key_map against a set of enforcement rules, this * Validates a key_map against a set of enforcement rules, this
* function exits the application on a type that cannot be properly * function exits the application on a type that cannot be properly
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment