config: Move permission xml to apps
Move required permissions to the respective apps.
This allows people to use a lot of our apps outside lineage
without extra changes.
Change-Id: I840a9edeae38e94ff6592c4817fcea6f5e4a7e8f
diff --git a/config/common.mk b/config/common.mk
index dae7d9c..2fe9cb0 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -68,23 +68,12 @@
# This is Lineage!
PRODUCT_COPY_FILES += \
- vendor/lineage/config/permissions/org.lineageos.android.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/org.lineageos.android.xml \
- vendor/lineage/config/permissions/privapp-permissions-lineage-system.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-lineage.xml \
- vendor/lineage/config/permissions/privapp-permissions-lineage-product.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-lineage.xml \
- vendor/lineage/config/permissions/privapp-permissions-cm-legacy.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-cm-legacy.xml
+ vendor/lineage/config/permissions/org.lineageos.android.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/org.lineageos.android.xml
# Enforce privapp-permissions whitelist
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
ro.control_privapp_permissions=enforce
-# Power whitelist
-PRODUCT_COPY_FILES += \
- vendor/lineage/config/permissions/lineage-power-whitelist.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/sysconfig/lineage-power-whitelist.xml
-
-# Pre-granted permissions
-PRODUCT_COPY_FILES += \
- vendor/lineage/config/permissions/lineage-default-permissions.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/default-permissions/lineage-default-permissions.xml
-
# Include AOSP audio files
include vendor/lineage/config/aosp_audio.mk
diff --git a/config/permissions/lineage-default-permissions.xml b/config/permissions/lineage-default-permissions.xml
deleted file mode 100644
index 464ff47..0000000
--- a/config/permissions/lineage-default-permissions.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
-<!-- Copyright (C) 2019 The LineageOS 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.
--->
-
-<!--
- This file contains permissions to be granted by default. Default
- permissions are granted to special platform components and to apps
- that are approved to get default grants. The special components
- are apps that are expected to work out-of-the-box as they provide
- core use cases such as default dialer, default email, etc. These
- grants are managed by the platform. The apps that are additionally
- approved for default grants are ones that provide carrier specific
- functionality, ones legally required at some location, ones providing
- alternative disclosure and opt-out UI, ones providing highlight features
- of a dedicated device, etc. This file contains only the latter exceptions.
- Fixed permissions cannot be controlled by the user and need a special
- approval. Typically these are to ensure either legally mandated functions
- or the app is considered a part of the OS.
--->
-
-<exceptions>
- <exception package="com.android.exchange">
- <permission name="android.permission.WRITE_EXTERNAL_STORAGE" fixed="false"/>
- <permission name="android.permission.READ_PHONE_STATE" fixed="false"/>
- </exception>
-</exceptions>
diff --git a/config/permissions/lineage-power-whitelist.xml b/config/permissions/lineage-power-whitelist.xml
deleted file mode 100644
index b6545ba..0000000
--- a/config/permissions/lineage-power-whitelist.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 The LineageOS 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.
--->
-
-<config>
- <allow-in-power-save package="com.android.deskclock" />
- <allow-in-power-save package="com.android.messaging" />
-</config>
diff --git a/config/permissions/privapp-permissions-cm-legacy.xml b/config/permissions/privapp-permissions-cm-legacy.xml
deleted file mode 100644
index 803b95f..0000000
--- a/config/permissions/privapp-permissions-cm-legacy.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 The LineageOS 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.
--->
-
-<permissions>
- <privapp-permissions package="org.cyanogenmod.cmsettings">
- <permission name="android.permission.MANAGE_USERS"/>
- </privapp-permissions>
-
- <privapp-permissions package="com.cyanogenmod.eleven">
- <permission name="android.permission.WRITE_MEDIA_STORAGE"/>
- </privapp-permissions>
-
- <privapp-permissions package="org.cyanogenmod.snap">
- <permission name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
- <permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND"/>
- <permission name="android.permission.WRITE_MEDIA_STORAGE"/>
- <permission name="lineage.permission.PREVENT_POWER_KEY"/>
- </privapp-permissions>
-
-</permissions>
diff --git a/config/permissions/privapp-permissions-lineage-product.xml b/config/permissions/privapp-permissions-lineage-product.xml
deleted file mode 100644
index aeb4ce6..0000000
--- a/config/permissions/privapp-permissions-lineage-product.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 The LineageOS 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.
--->
-<permissions>
-
- <privapp-permissions package="com.android.camera2">
- <permission name="android.permission.BIND_WALLPAPER"/>
- <permission name="lineage.permission.PREVENT_POWER_KEY"/>
- </privapp-permissions>
-
- <!-- Additional permissions on top of privapp-permissions-platform.xml -->
- <privapp-permissions package="com.android.dialer">
- <permission name="android.permission.CAPTURE_AUDIO_OUTPUT"/>
- </privapp-permissions>
-
- <privapp-permissions package="com.android.gallery3d">
- <permission name="android.permission.MODIFY_AUDIO_ROUTING"/>
- </privapp-permissions>
-
- <!-- Additional permissions on top of privapp-permissions-platform.xml -->
- <privapp-permissions package="com.android.launcher3">
- <permission name="android.permission.MANAGE_ACTIVITY_STACKS"/>
- <permission name="android.permission.STATUS_BAR"/>
- </privapp-permissions>
-
-</permissions>
diff --git a/config/permissions/privapp-permissions-lineage-system.xml b/config/permissions/privapp-permissions-lineage-system.xml
deleted file mode 100644
index f8206fd..0000000
--- a/config/permissions/privapp-permissions-lineage-system.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017-2019 The LineageOS 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.
--->
-
-<permissions>
-
- <privapp-permissions package="com.android.fmradio">
- <permission name="android.permission.ACCESS_FM_RADIO"/>
- <permission name="android.permission.MODIFY_AUDIO_ROUTING"/>
- <permission name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
- </privapp-permissions>
-
- <privapp-permissions package="org.lineageos.audiofx">
- <permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
- <permission name="android.permission.MEDIA_CONTENT_CONTROL"/>
- <permission name="android.permission.MODIFY_AUDIO_ROUTING"/>
- </privapp-permissions>
-
- <privapp-permissions package="org.lineageos.eleven">
- <permission name="android.permission.WRITE_MEDIA_STORAGE"/>
- </privapp-permissions>
-
- <privapp-permissions package="org.lineageos.flipflap">
- <permission name="android.permission.ACCESS_NOTIFICATIONS"/>
- <permission name="android.permission.MODIFY_PHONE_STATE"/>
- <permission name="android.permission.WRITE_SECURE_SETTINGS"/>
- </privapp-permissions>
-
- <privapp-permissions package="org.lineageos.lineageparts">
- <permission name="android.permission.CHANGE_CONFIGURATION"/>
- <permission name="android.permission.READ_SEARCH_INDEXABLES"/>
- <permission name="android.permission.WRITE_MEDIA_STORAGE"/>
- <permission name="android.permission.WRITE_SECURE_SETTINGS"/>
- </privapp-permissions>
-
- <privapp-permissions package="org.lineageos.lineagesettings">
- <permission name="android.permission.MANAGE_USERS"/>
- </privapp-permissions>
-
- <privapp-permissions package="org.lineageos.setupwizard">
- <permission name="android.permission.BACKUP"/>
- <permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
- <permission name="android.permission.CHANGE_CONFIGURATION"/>
- <permission name="android.permission.GET_ACCOUNTS_PRIVILEGED"/>
- <permission name="android.permission.INTERACT_ACROSS_USERS"/>
- <permission name="android.permission.MANAGE_USERS"/>
- <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
- <permission name="android.permission.SET_TIME"/>
- <permission name="android.permission.SET_TIME_ZONE"/>
- <permission name="android.permission.STATUS_BAR"/>
- <permission name="android.permission.WRITE_SECURE_SETTINGS"/>
- </privapp-permissions>
-
- <privapp-permissions package="org.lineageos.snap">
- <permission name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
- <permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND"/>
- <permission name="android.permission.WRITE_MEDIA_STORAGE"/>
- <permission name="lineage.permission.PREVENT_POWER_KEY"/>
- </privapp-permissions>
-
- <privapp-permissions package="org.lineageos.updater">
- <permission name="android.permission.ACCESS_CACHE_FILESYSTEM"/>
- <permission name="android.permission.REBOOT"/>
- <permission name="android.permission.RECOVERY"/>
- </privapp-permissions>
-
-</permissions>