<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="fr.unix_experience.owncloud_sms"
    android:versionCode="18"
    android:versionName="0.17.0">

    <!-- From Android 4.0 to 5.0 -->
    <uses-sdk
        android:maxSdkVersion="21"
        android:minSdkVersion="14"
        android:targetSdkVersion="21" />

    <uses-permission android:name="android.permission.READ_SMS" />
    <!-- For SMS Broadcaster -->
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <!-- For syncer -->
    <uses-permission android:name="android.permission.READ_SYNC_STATS" />
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <!-- For account management -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/OcSmsTheme" >

        <!-- Related to periodic sync -->
        <service
            android:name=".observers.SmsObserverService"
            android:exported="false" />
        <service
            android:name=".sync_adapters.SmsSyncService"
            android:exported="true"
            android:process=":sync" >
            <intent-filter>
                <action android:name="android.content.SyncAdapter" />
            </intent-filter>

            <meta-data
                android:name="android.content.SyncAdapter"
                android:resource="@xml/sync_adapter" />
        </service>

        <provider
            android:name=".providers.SmsDataProvider"
            android:authorities="@string/account_authority"
            android:label="@string/pref_title_sync" >
        </provider>

        <!--
        <service
            android:name=".sync_adapters.SmsSlowSyncService"
            android:exported="true"
            android:process=":sync">
            <intent-filter>
                <action android:name="android.content.SyncAdapter" />
            </intent-filter>

            <meta-data
                android:name="android.content.SyncAdapter"
                android:resource="@xml/slow_sync_adapter" />
        </service>
        
        <provider
            android:name=".providers.SmsDataProvider"
            android:label="@string/pref_title_slow_sync"
            android:authorities="@string/slowsync_account_authority">
        </provider>
        -->


        <!-- Related to Login -->
        <service android:name=".authenticators.OwnCloudAuthenticatorService" >
            <intent-filter>
                <action android:name="android.accounts.AccountAuthenticator" />
            </intent-filter>

            <meta-data
                android:name="android.accounts.AccountAuthenticator"
                android:resource="@xml/owncloud_account_authenticator" />
        </service>

        <receiver android:name=".broadcast_receivers.IncomingSms" >
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>
        </receiver>
        <receiver android:name=".broadcast_receivers.ConnectivityChanged" >
            <intent-filter>
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".activities.LoginActivity"
            android:label="@string/title_activity_login" >
        </activity>
        <activity
            android:name=".activities.GeneralSettingsActivity"
            android:label="@string/title_activity_general_settings" >
        </activity>
        <activity
            android:name=".activities.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity2"
            android:label="@string/title_activity_main_activity2" >
        </activity>
    </application>

</manifest>
