summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-06-15 16:36:24 -0700
committerSvet Ganov <svetoslavganov@google.com>2015-06-19 15:17:56 -0700
commitadc1cf46045ae756d3a9ccbccf6b0f894e4c1edd (patch)
tree3026471435d1bda05cdac444e2499703a53ff78d /core
parent90b3b93de460ccd1fc1116154f5d61bd2bc93d25 (diff)
downloadframeworks_base-adc1cf46045ae756d3a9ccbccf6b0f894e4c1edd.zip
frameworks_base-adc1cf46045ae756d3a9ccbccf6b0f894e4c1edd.tar.gz
frameworks_base-adc1cf46045ae756d3a9ccbccf6b0f894e4c1edd.tar.bz2
Only grant runtime permissions to special components.
Now runtime permissions are granted only to components that are part of the system or perform special system operations. For exmple, the shell UID gets its runtime permissions granted by default and the default phone app gets the phone permissions granted by default. bug:21764803 Change-Id: If8b8cadbd1980ffe7a6fc15bbb5f54a425f6e8f9
Diffstat (limited to 'core')
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java7
-rw-r--r--core/java/android/content/pm/PackageManagerInternal.java58
-rw-r--r--core/java/android/content/pm/PackageParser.java7
3 files changed, 72 insertions, 0 deletions
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 9fb6f4d..6feb860 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -962,6 +962,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
/**
* @hide
*/
+ public boolean isPrivilegedApp() {
+ return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0;
+ }
+
+ /**
+ * @hide
+ */
public boolean isUpdatedSystemApp() {
return (flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0;
}
diff --git a/core/java/android/content/pm/PackageManagerInternal.java b/core/java/android/content/pm/PackageManagerInternal.java
new file mode 100644
index 0000000..7599bd6
--- /dev/null
+++ b/core/java/android/content/pm/PackageManagerInternal.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.content.pm;
+
+import android.annotation.NonNull;
+
+/**
+ * Package manager local system service interface.
+ *
+ * @hide Only for use within the system server.
+ */
+public abstract class PackageManagerInternal {
+
+ /**
+ * Provider for package names.
+ */
+ public interface PackagesProvider {
+
+ /**
+ * Gets the packages for a given user.
+ * @param userId The user id.
+ * @return The package names.
+ */
+ public String[] getPackages(int userId);
+ }
+
+ /**
+ * Sets the location provider packages provider.
+ * @param provider The packages provider.
+ */
+ public abstract void setLocationPackagesProvider(PackagesProvider provider);
+
+ /**
+ * Sets the input method packages provider.
+ * @param provider The packages provider.
+ */
+ public abstract void setImePackagesProvider(PackagesProvider provider);
+
+ /**
+ * Sets the voice interaction packages provider.
+ * @param provider The packages provider.
+ */
+ public abstract void setVoiceInteractionPackagesProvider(PackagesProvider provider);
+}
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 287e0c5..faf71ee 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -4508,6 +4508,13 @@ public class PackageParser {
/**
* @hide
*/
+ public boolean isPrivilegedApp() {
+ return applicationInfo.isPrivilegedApp();
+ }
+
+ /**
+ * @hide
+ */
public boolean isUpdatedSystemApp() {
return applicationInfo.isUpdatedSystemApp();
}