Rework category mapping and perform some code cleanup.
Map the app IDs to a category pair rather than a single category.
With this scheme, we can represent up to 2^16 app IDs, which exceeds
the maximum of 10000 imposed by Android. This also only uses category
bits 0-511, so 512-1023 remain free for use for other purposes (or we
could shrink the number of categories defined in the policy).
Also perform other minor code cleanups previously suggested, e.g.
fix const declaration, use an enum rather than #define, correct %lu
to %u for format string, etc.
Change-Id: I5bb727bfb4297e3e13ba1ef078e41db3ea7d1b8f
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2 files changed