Add ephemeral protection level

Ephemeral applications will only be able to be granted permissions that
have the ephemeral proteciton level, this allows us to tighly define
what behavior is OK for ephemeral applications.

This includes an initial small whitelist of permissions for ephemeral
apps, it may be expanded later.

Test: adb install --ephemeral, verified against both runtime and install
time permissions
Test: cts-tradefed run cts -m CtsPermission2TestCases
Change-Id: I854c44cf7a293d484b674cdd4fb5141e362a2f1a
diff --git a/services/core/java/com/android/server/pm/BasePermission.java b/services/core/java/com/android/server/pm/BasePermission.java
index 52d0928..8948fa3 100644
--- a/services/core/java/com/android/server/pm/BasePermission.java
+++ b/services/core/java/com/android/server/pm/BasePermission.java
@@ -94,4 +94,8 @@
                 == PermissionInfo.PROTECTION_SIGNATURE
                 && (protectionLevel & PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0;
     }
+
+    public boolean isEphemeral() {
+        return (protectionLevel & PermissionInfo.PROTECTION_FLAG_EPHEMERAL) != 0;
+    }
 }