<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="{{config.package}}"
          android:versionCode="{{config.numeric_version}}"
          android:versionName="{{config.version}}"
          android:installLocation="auto"
          >

  <application android:label="@string/appName"
               android:icon="@drawable/icon"
               >

    <activity android:name="org.renpy.android.PythonActivity"
              android:label="@string/iconName"
              android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode"
              android:launchMode="singleTask"
              android:process=":python"
              android:screenOrientation="{{ config.orientation }}"
              android:windowSoftInputMode="stateAlwaysHidden"
            >
{% if not config.expansion %}
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="tv.ouya.intent.category.GAME" />
        </intent-filter>
{% endif %}
    </activity>

{% if config.expansion %}
       <activity
           android:label="@string/iconName"
           android:name="org.renpy.android.DownloaderActivity" >
           <intent-filter >
               <action android:name="android.intent.action.MAIN" />
               <category android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
       </activity>

       <service android:name="org.renpy.android.DownloaderService" />
       <receiver android:name="org.renpy.android.DownloaderAlarmReceiver" />
{% endif %}
  </application>

  <uses-feature android:glEsVersion="0x00020000" android:required="true" />
  <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="{{ config.target_version }}"/>
  <uses-permission android:name="android.permission.WAKE_LOCK" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

  {% if config.expansion %}
    <uses-permission android:name="com.android.vending.CHECK_LICENSE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  {% endif %}

  {% for perm in config.permissions %}
  <uses-permission android:name="android.permission.{{ perm }}" />
  {% endfor %}

{{ manifest_extra }}
</manifest>
