Use a fixed string for the level rather than the caller's range.
Otherwise we can get an unexpected result if the caller is already
running with categories set.
Change-Id: I9146a202b3175a75aecd0b38939b44cec63a67f2
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
diff --git a/src/android.c b/src/android.c
index 95d4f2f..8aa1ef6 100644
--- a/src/android.c
+++ b/src/android.c
@@ -449,19 +449,18 @@
char level[255];
switch (cur->levelFrom) {
case LEVELFROM_APP:
- snprintf(level, sizeof level, "%s:c%u,c%u",
- context_range_get(ctx), appid & 0xff,
+ snprintf(level, sizeof level, "s0:c%u,c%u",
+ appid & 0xff,
256 + (appid>>8 & 0xff));
break;
case LEVELFROM_USER:
- snprintf(level, sizeof level, "%s:c%u,c%u",
- context_range_get(ctx),
+ snprintf(level, sizeof level, "s0:c%u,c%u",
512 + (userid & 0xff),
768 + (userid>>8 & 0xff));
break;
case LEVELFROM_ALL:
- snprintf(level, sizeof level, "%s:c%u,c%u,c%u,c%u",
- context_range_get(ctx), appid & 0xff,
+ snprintf(level, sizeof level, "s0:c%u,c%u,c%u,c%u",
+ appid & 0xff,
256 + (appid>>8 & 0xff),
512 + (userid & 0xff),
768 + (userid>>8 & 0xff));