<?xml version="1.0" encoding="utf-8"?>
<!--
  This file is part of BOINC.
  http://boinc.berkeley.edu
  Copyright (C) 2016 University of California
  
  BOINC is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License
  as published by the Free Software Foundation,
  either version 3 of the License, or (at your option) any later version.
  
  BOINC is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU Lesser General Public License for more details.
  
  You should have received a copy of the GNU Lesser General Public License
  along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="edu.berkeley.boinc"
    android:installLocation="internalOnly"> <!-- installation on SD card would break boot receiver -->

    <!-- Add Google Play store metadata informing the store we can run on tablets and other large screen devices -->
    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="23" />

    <!-- Required Permissions -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_LOGS" />
    <uses-permission android:name="android.permission.RESTART_PACKAGES" />

    <!-- Features required for Android TV, consoles, and set-top boxes like Nexus Player, OUYA,
         Razer Forge TV, Nvidia SHIELD, etc -->
    <!-- Effectively a hint for the Google Play store only and at the Leanback UI Library -->
    <uses-feature android:name="android.software.leanback" android:required="false" />
    <!-- Implies some sort of D-pad, game controller, joystick, remote control, etc -->
    <uses-feature android:name="android.hardware.gamepad" android:required="false" />
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    <!-- Effectively a hint for the Google Play store only -->
    <uses-feature android:name="android.hardware.type.television" android:required="false" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/boinc"
        android:label="@string/app_name"
        android:theme="@style/Theme.Styled"
        android:largeHeap="true"
        android:banner="@drawable/banner">

        <activity
            android:name="edu.berkeley.boinc.SplashActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/app_name"
            android:theme="@style/Theme.Styled.NoActionBar"
            android:noHistory="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
                <category android:name="tv.ouya.intent.category.APP" />
            </intent-filter>
        </activity>
        <activity
            android:name="edu.berkeley.boinc.BOINCActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop"
            android:exported="true" />
        <activity android:name="edu.berkeley.boinc.attach.AcctMgrFragment" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="edu.berkeley.boinc.BOINCActivity" />
        </activity>
        <activity
            android:name="edu.berkeley.boinc.attach.SelectionListActivity"
            android:theme="@style/Theme.Styled.NoActionBar"/>
        <activity
            android:name="edu.berkeley.boinc.attach.CredentialInputActivity"
            android:theme="@style/Theme.Styled.NoActionBar"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name="edu.berkeley.boinc.attach.BatchProcessingActivity"
            android:theme="@style/Theme.Styled.NoActionBar" />
        <activity
            android:name="edu.berkeley.boinc.attach.BatchConflictListActivity"
            android:theme="@style/Theme.Styled.NoActionBar" />
        <activity android:name="edu.berkeley.boinc.EventLogActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="edu.berkeley.boinc.BOINCActivity" />
        </activity>

        <service android:name="edu.berkeley.boinc.client.Monitor" android:process=":remote" />
        <service android:name="edu.berkeley.boinc.attach.ProjectAttachService" />

        <receiver android:name="edu.berkeley.boinc.receiver.BootReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
        <receiver android:name="edu.berkeley.boinc.receiver.PowerConnectedReceiver">
	        <intent-filter>
	            <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
	        </intent-filter>
        </receiver>
        <receiver android:name="edu.berkeley.boinc.receiver.PackageReplacedReceiver">
            <intent-filter>
                <action android:name="android.intent.action.PACKAGE_REPLACED" />
                <data android:path="edu.berkeley.boinc" android:scheme="package" />
            </intent-filter>
        </receiver>
        <activity android:name=".BoincNotExclusiveDialog" android:theme="@android:style/Theme.Dialog" />
    </application>
</manifest>
