<?xml version="1.0" encoding="utf-8"?>

<!-- The package name here must match the Studio namespace given in
     WallpaperPickerGoogle gradle config for Studio builds to succeed.
     `package_name` in Android.bp overrides this with the actual package name.
 -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="com.google.android.apps.wallpaper">

    <uses-sdk android:targetSdkVersion="30" android:minSdkVersion="28"/>

    <uses-permission android:name="android.permission.CHANGE_OVERLAY_PACKAGES"/>
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
    <uses-permission android:name="android.permission.SET_WALLPAPER_COMPONENT" />
    <uses-permission android:name="android.permission.READ_DEVICE_CONFIG" />
    <uses-permission android:name="android.permission.MODIFY_DAY_NIGHT_MODE" />
    <uses-permission android:name="android.permission.CUSTOMIZE_SYSTEM_UI" />
    <uses-permission android:name="android.permission.BIND_WALLPAPER"/>
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
    <uses-permission android:name="android.permission.READ_WALLPAPER_INTERNAL"/>
    <uses-permission android:name="android.permission.SET_WALLPAPER"/>
    <uses-permission android:name="android.permission.SET_WALLPAPER_DIM_AMOUNT" />

    <queries>
        <package android:name="android"/>
        <package android:name="com.android.launcher3"/>
        <package android:name="com.android.settings"/>
        <package android:name="com.android.systemui"/>

        <!-- Specific intents Wallpaper picker query for -->
        <!-- Package for theme stub -->
        <package android:name="com.android.customization.themes" />
        <!-- Intent filter with action SET_WALLPAPER -->
        <intent>
            <action android:name="android.intent.action.SET_WALLPAPER" />
        </intent>
        <!-- Intent filter with action GET_CONTENT and data's mimeType as "image/*" -->
        <intent>
            <action android:name="android.intent.action.GET_CONTENT" />
            <data android:mimeType="image/*" />
        </intent>
        <!-- Intent filter with action VIEW -->
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="http" />
        </intent>
        <!-- Intent filter with action WallpaperService (live wallpaper interface) -->
        <intent>
            <action android:name="android.service.wallpaper.WallpaperService" />
        </intent>
        <!-- Intent filter with action used to discover partner -->
        <intent>
            <action android:name="com.android.launcher3.action.PARTNER_CUSTOMIZATION" />
        </intent>
        <!-- Intent filter used to query the launcher Activity for grid preview metadata -->
        <intent>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME" />
        </intent>
    </queries>

    <application
        tools:replace="android:icon,android:name"
        android:extractNativeLibs="false"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_home"
        android:label="@string/app_name"
        android:requiredForAllUsers="true"
        android:restoreAnyVersion="true"
        android:supportsRtl="true"
        android:name="com.android.customization.picker.CustomizationPickerApplication"
        android:theme="@style/CustomizationTheme">
        <activity
            tools:node="replace"
            android:name="com.android.wallpaper.picker.CustomizationPickerActivity"
            android:label="@string/app_name"
            android:relinquishTaskIdentity="true"
            android:resizeableActivity="false"
            android:theme="@style/CustomizationTheme.NoActionBar"
            android:exported="false"/>

        <activity
            tools:node="replace"
            android:name="com.android.wallpaper.picker.PassThroughCustomizationPickerActivity"
            android:label="@string/app_name"
            android:resizeableActivity="false"
            android:theme="@style/CustomizationTheme.NoActionBar"
            android:exported="false"/>

        <activity
            tools:node="replace"
            android:name="com.android.wallpaper.picker.TrampolinePickerActivity"
            android:label="@string/app_name"
            android:relinquishTaskIdentity="true"
            android:resizeableActivity="false"
            android:theme="@style/CustomizationTheme.NoActionBar"
            android:exported="false"/>

        <activity-alias
            android:name="com.android.customization.picker.CustomizationPickerActivity"
            android:targetActivity="com.android.wallpaper.picker.TrampolinePickerActivity"
            android:label="@string/app_name"
            android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.SET_WALLPAPER"/>
                 <category android:name="android.intent.category.DEFAULT"/>
             </intent-filter>
        </activity-alias>

    </application>
</manifest>
