aboutsummaryrefslogtreecommitdiffstats
path: root/cm
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-09-01 15:09:46 -0700
committerAdnan Begovic <adnan@cyngn.com>2015-09-01 15:40:58 -0700
commit052391135bcdce944226cfac858a3ad7fc6eb914 (patch)
tree3de76b427e62b69325d66d9b4b707223fad5e772 /cm
parent88bc9965e97852ef4520ec9cf75c2ace378126c8 (diff)
downloadvendor_cmsdk-052391135bcdce944226cfac858a3ad7fc6eb914.zip
vendor_cmsdk-052391135bcdce944226cfac858a3ad7fc6eb914.tar.gz
vendor_cmsdk-052391135bcdce944226cfac858a3ad7fc6eb914.tar.bz2
cmsdk: Enforce cyanogenmod.permission.MODIFY_PROFILES for profiles.
Change-Id: Id14bfd9b214b4f53960c55d8abab2764f990b1b6
Diffstat (limited to 'cm')
-rw-r--r--cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java5
-rw-r--r--cm/res/AndroidManifest.xml6
-rw-r--r--cm/res/res/values/strings.xml4
3 files changed, 12 insertions, 3 deletions
diff --git a/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java b/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java
index d4d2b9d..aa7c27c 100644
--- a/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java
+++ b/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java
@@ -64,8 +64,6 @@ public class ProfileManagerService extends SystemService {
// Enable the below for detailed logging of this class
private static final boolean LOCAL_LOGV = false;
- public static final String PERMISSION_CHANGE_SETTINGS = "android.permission.WRITE_SETTINGS";
-
public static final String KEYGUARD_PACKAGE = "com.android.systemui";
public static final String KEYGUARD_CLASS = "com.android.systemui.keyguard.KeyguardService";
@@ -520,7 +518,8 @@ public class ProfileManagerService extends SystemService {
}
private void enforceChangePermissions() {
- mContext.enforceCallingOrSelfPermission(PERMISSION_CHANGE_SETTINGS,
+ mContext.enforceCallingOrSelfPermission(
+ cyanogenmod.platform.Manifest.permission.MODIFY_PROFILES,
"You do not have permissions to change the Profile Manager.");
}
diff --git a/cm/res/AndroidManifest.xml b/cm/res/AndroidManifest.xml
index 5817946..35fdd0c 100644
--- a/cm/res/AndroidManifest.xml
+++ b/cm/res/AndroidManifest.xml
@@ -75,6 +75,12 @@
android:description="@string/permdesc_writeSettings"
android:protectionLevel="normal" />
+ <!-- Allows an application to modify system profiles -->
+ <permission android:name="cyanogenmod.permission.MODIFY_PROFILES"
+ android:label="@string/permlab_modifyProfiles"
+ android:description="@string/permdesc_modifyProfiles"
+ android:protectionLevel="normal" />
+
<!-- Allows an application to write to secure CM system settings.
<p>Not for use by third-party applications. -->
<permission android:name="cyanogenmod.permission.WRITE_SECURE_SETTINGS"
diff --git a/cm/res/res/values/strings.xml b/cm/res/res/values/strings.xml
index 43e49c6..636ca3b 100644
--- a/cm/res/res/values/strings.xml
+++ b/cm/res/res/values/strings.xml
@@ -38,6 +38,10 @@
<string name="permlab_modifyMSPhoneState">modify the phone state and data connection with support to multiple SIMs</string>
<string name="permdesc_modifyMSPhoneState">Allows an app to modify the phone state and data connection with support to multiple SIMs.</string>
+ <!-- Labels for the MODIFY_PROFILES permission. -->
+ <string name="permlab_modifyProfiles">modify system profiles</string>
+ <string name="permdesc_modifyProfiles">Allows an application to modify system profiles</string>
+
<!-- Labels for the HARDWARE_ABSTRACTION_ACCESS permission. -->
<string name="permlab_useHardwareFramework">use hardware framework</string>
<string name="permdesc_useHardwareFramework">Allows an app access to the CM hardware framework.</string>