Shelter/app/src/main/AndroidManifest.xml
Peter Cai 625b9a66dc
introduce Camera Proxy
With File Shuttle, users can choose cross-profile files to be used in apps that support Documents UI and SAF. But it turns out that we can do better - even in some apps that do not support SAF natively, they may however support invoking external Camera apps to take photos for them. Shelter can present as a fake Camera app, returning user-chosen images as the "photos". In this way, it is much more convenient to transfer pictrues in and out of Shelter, at least for me it makes me feel way better when I want to post screenshots etc. from apps inside Shelter.
2018-10-24 19:34:50 +08:00

131 lines
6.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.typeblog.shelter">
<uses-feature android:name="android.software.device_admin" android:required="true"/>
<uses-feature android:name="android.software.managed_users" android:required="true"/>
<!--<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>-->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:maxSdkVersion="25"
android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
<application
android:name=".ShelterApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher_egg"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_egg_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<!-- The main activity for UI -->
<activity android:name=".ui.MainActivity"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- The Settings activity -->
<activity android:name=".ui.SettingsActivity"
android:label="@string/settings" />
<!-- An activity that wraps intents that cross the profile boundary -->
<!-- Needed because only cross-profile Activity intents are supported -->
<activity android:name=".ui.DummyActivity"
android:excludeFromRecents="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="net.typeblog.shelter.action.FINALIZE_PROVISION" />
<action android:name="net.typeblog.shelter.action.START_SERVICE" />
<action android:name="net.typeblog.shelter.action.TRY_START_SERVICE" />
<action android:name="net.typeblog.shelter.action.INSTALL_PACKAGE" />
<action android:name="net.typeblog.shelter.action.UNINSTALL_PACKAGE" />
<action android:name="net.typeblog.shelter.action.UNFREEZE_AND_LAUNCH" />
<action android:name="net.typeblog.shelter.action.PUBLIC_UNFREEZE_AND_LAUNCH" />
<action android:name="net.typeblog.shelter.action.PUBLIC_FREEZE_ALL" />
<action android:name="net.typeblog.shelter.action.FREEZE_ALL_IN_LIST" />
<!-- We need two of these to avoid being prompted with an action chooser dialog -->
<!-- When the intent is actually already forwarded to work profile -->
<action android:name="net.typeblog.shelter.action.START_FILE_SHUTTLE" />
<action android:name="net.typeblog.shelter.action.START_FILE_SHUTTLE_2" />
<action android:name="net.typeblog.shelter.action.SYNCHRONIZE_PREFERENCE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Activity to forward ACTION_IMAGE_CAPTURE as ACTION_OPEN_DOCUMENT -->
<activity android:name=".ui.CameraProxyActivity"
android:excludeFromRecents="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:label="@string/camera_proxy_activity">
<intent-filter>
<action android:name="android.media.action.IMAGE_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Implementation of the device policy controller -->
<receiver android:name=".receivers.ShelterDeviceAdminReceiver"
android:label="@string/device_admin_label"
android:description="@string/device_admin_desc"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data android:name="android.app.device_admin"
android:resource="@xml/device_admin" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
<action android:name="android.app.action.DEVICE_ADMIN_DISABLED" />
<action android:name="android.app.action.PROVISION_MANAGED_PROFILE" />
</intent-filter>
</receiver>
<!-- A FileProvider that proxies opened Fd from the other profile -->
<provider
android:name="net.typeblog.shelter.util.FileProviderProxy"
android:authorities="net.typeblog.shelter.files"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<!-- A DocumentsProvider that lists files in another profile -->
<provider
android:name="net.typeblog.shelter.util.CrossProfileDocumentsProvider"
android:authorities="net.typeblog.shelter.documents"
android:grantUriPermissions="true"
android:permission="android.permission.MANAGE_DOCUMENTS"
android:exported="true"
android:enabled="false">
<intent-filter>
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
</intent-filter>
</provider>
<!-- Core service running on both the main profile and the work profile -->
<!-- Actions like cloning / freezing apps will be performed by this service -->
<service android:name=".services.ShelterService"
android:exported="true"
android:permission="android.permission.BIND_DEVICE_ADMIN"/>
<!-- Service to forward file information between profiles -->
<service android:name=".services.FileShuttleService"
android:exported="true"
android:permission="android.permission.BIND_DEVICE_ADMIN" />
<!-- A hack service to ensure every ShelterService is killed when App is removed -->
<!-- from recent tasks -->
<service android:name=".services.KillerService" />
<!-- Service to freeze apps on screen lock -->
<service android:name=".services.FreezeService" />
</application>
</manifest>