<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.voiceblue.phone"
    android:installLocation="auto"
    android:versionCode="2355"
    android:versionName="1.02.00.ngvoice" >

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />

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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <!--
    <uses-permission android:name="android.permission.CALL_PRIVILEGED" /> 
    was useless anyway as only granted to system app and
    we don't have core integration anymore with these plugins
    -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.READ_LOGS" />
    <uses-permission android:name="android.permission.USE_SIP" />
    <uses-permission android:name="android.permission.CONFIGURE_SIP" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
    <uses-permission android:name="android.permission.READ_PROFILE" />
    <uses-permission android:name="android.permission.WRITE_CALL_LOG" />
    
    
    <permission android:name="com.voiceblue.permission.C2D_MESSAGE" android:protectionLevel="signature" />
	<uses-permission android:name="com.voiceblue.permission.C2D_MESSAGE" />    	
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
    
    <!--
    Not taken into account?
    Regarding Diane's comment this was never implemented 
    and was dropped in most recent android versions 
    <uses-permission android:name="android.permission.RAISED_THREAD_PRIORITY" />
    -->
	
	

    <!-- COMMENT THIS if you plan to use in library mode -->
    <permission
        android:name="android.permission.USE_SIP"
        android:description="@string/permdesc_useSip"
        android:label="@string/permlab_useSip"
        android:permissionGroup="android.permission-group.COST_MONEY"
        android:protectionLevel="dangerous" />
    <permission
        android:name="android.permission.CONFIGURE_SIP"
        android:description="@string/permdesc_configureSip"
        android:label="@string/permlab_configureSip"
        android:permissionGroup="android.permission-group.COST_MONEY"
        android:protectionLevel="dangerous" />

    <!-- END OF COMMENT THIS -->

    <uses-feature
        android:name="android.hardware.wifi"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.telephony"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.microphone"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.bluetooth"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.screen.portrait"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.flash"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.front"
        android:required="false" />

    <application
        android:allowBackup="true"
        android:backupAgent="com.voiceblue.phone.backup.SipBackupAgent"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_logo_flat"
        android:label="@string/app_name" >              
        
        <meta-data
            android:name="app_type"
            android:value="nightly" />
        <meta-data
            android:name="app_channel"
            android:value="trunk" />
        
        <meta-data
            android:name="com.google.android.backup.api_key"
            android:value="AEdPqrEAAAAIL5x8Klvg-Y8nV4j4PNSy2JH6yQZ49yKbrqKJAw" />
        
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyAStrTYDlRgLjzEWhrAA-IytrDmddaTPus" />

        <!--
        Samsung multiview support
        <uses-library
            android:name="com.sec.android.app.multiwindow"
            android:required="false" />
        -->
        <meta-data
            android:name="com.sec.android.support.multiwindow"
            android:value="true" />

        <activity
            android:name="com.voiceblue.custom.ui.SplashScreen"
            android:icon="@drawable/ic_logo_flat"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:theme="@style/Theme.Splash"
            android:uiOptions="splitActionBarWhenNarrow" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        
        <activity
            android:name="com.jwetherell.quick_response_code.CaptureActivity"
            android:screenOrientation="landscape"
            android:clearTaskOnLaunch="true"
            android:stateNotNeeded="true"
            android:configChanges="orientation|keyboardHidden"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:windowSoftInputMode="stateAlwaysHidden">            
        </activity>

        <activity
            android:name="com.caruizdiaz.custom.ui.QRScannedActivity"
			android:icon="@drawable/ic_logo_flat"
            android:label="@string/voiceblue_qr_auto_config_title"
            android:launchMode="singleTask"            
            android:uiOptions="splitActionBarWhenNarrow"                        
            >            
        </activity>

        <!-- Main service -->
        <!-- Require at least the configure permission to use -->
        <service
            android:name="com.voiceblue.phone.service.SipService"
            android:exported="true"
            android:permission="android.permission.CONFIGURE_SIP"
            android:process=":sipStack" >
            <intent-filter>
                <action android:name="com.voiceblue.phone.service.SipService" />
                <action android:name="com.voiceblue.phone.service.SipConfiguration" />
            </intent-filter>
        </service>
        <service android:name="com.voiceblue.phone.service.Downloader" />		
		
        <receiver
            android:name="com.voiceblue.phone.service.DeviceStateReceiver"
            android:process=":sipStack" >

            <!-- Here filter for protected-broadcasts -->
            <intent-filter>
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.PACKAGE_ADDED" />
                <action android:name="android.intent.action.PACKAGE_REMOVED" />

                <data android:scheme="package" />
            </intent-filter>
        </receiver>
        
        <receiver
            android:name="com.voiceblue.phone.service.DeviceStateReceiver"
            android:permission="android.permission.CONFIGURE_SIP"
            android:process=":sipStack" >
            <intent-filter>
                <action android:name="com.voiceblue.phone.accounts.activate" />
            </intent-filter>
        </receiver>

		<receiver
            android:name="com.voiceblue.custom.config.ota.OTAConfigBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="com.voiceblue.config.ota" />
            </intent-filter>
        </receiver>       
        <service android:name="com.voiceblue.custom.config.ota.OTAConfigService" />        
        
        <!-- Main ui -->
        <activity
            android:name="com.voiceblue.phone.ui.calllog.CallLogDetailsActivity"
            android:theme="@style/DarkTheme" />

        <!-- Accounts -->
        <activity
            android:name="com.voiceblue.phone.ui.filters.AccountFilters"
            android:configChanges="orientation"
            android:label="@string/filters"
            android:theme="@style/DarkTheme" />
        <activity
            android:name="com.voiceblue.phone.ui.filters.EditFilter"
            android:configChanges="orientation"
            android:label="@string/filters"
            android:theme="@style/DarkTheme" />
        <activity
            android:name="com.voiceblue.phone.wizards.WizardChooser"
            android:configChanges="orientation"
            android:label="@string/choose_wizard"
            android:theme="@style/DarkTheme.Dialog" />

        <!-- Preferences -->
        <activity
            android:name="com.voiceblue.phone.ui.prefs.hc.MainPrefs"
            android:configChanges="orientation"
            android:enabled="@bool/use_hc_prefs"
            android:label="@string/prefs"
            android:permission="android.permission.CONFIGURE_SIP"
            android:theme="@style/DarkTheme" >
            <intent-filter>
                <action android:name="com.voiceblue.phone.ui.action.PREFS_GLOBAL" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.voiceblue.phone.ui.prefs.cupcake.MainPrefs"
            android:configChanges="orientation"
            android:enabled="@bool/use_cupcake_prefs"
            android:label="@string/prefs"
            android:permission="android.permission.CONFIGURE_SIP"
            android:theme="@style/DarkTheme" >
            <intent-filter>
                <action android:name="com.voiceblue.phone.ui.action.PREFS_GLOBAL" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.voiceblue.phone.ui.prefs.cupcake.PrefsLoaderActivity"
            android:label=""
            android:theme="@style/DarkTheme" />
        <activity
            android:name="com.voiceblue.phone.ui.prefs.PrefsFilters"
            android:configChanges="orientation"
            android:label="@string/filters"
            android:theme="@style/DarkTheme" />
        <activity
            android:name="com.voiceblue.phone.ui.prefs.PrefsFast"
            android:configChanges="orientation"
            android:label="@string/prefs_fast"
            android:permission="android.permission.CONFIGURE_SIP"
            android:theme="@style/DarkTheme.Dialog" >
            <intent-filter>
                <action android:name="com.voiceblue.phone.ui.action.PREFS_FAST" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.voiceblue.phone.ui.prefs.Codecs"
            android:configChanges="orientation"
            android:label="@string/codecs"
            android:theme="@style/DarkTheme" />
        <activity
            android:name="com.voiceblue.phone.ui.prefs.AudioTester"
            android:label="@string/test_audio"
            android:screenOrientation="portrait"
            android:theme="@style/DarkTheme.Dialog" />        
        <activity
            android:name="com.voiceblue.phone.wizards.BasePrefsWizard"
            android:configChanges="orientation"
            android:label="@string/edit"
            android:theme="@style/DarkTheme" />

        <!-- Call management -->
        <receiver
            android:name="com.voiceblue.phone.service.OutgoingCall"
            android:permission="android.permission.CALL_PHONE"
            android:process=":sipStack" >

            <!-- Here filter for protected-broadcasts -->
            <intent-filter android:priority="0" >
                <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
            </intent-filter>
        </receiver>

        <activity
            android:name="com.voiceblue.phone.ui.outgoingcall.OutgoingCallChooser"
            android:allowTaskReparenting="false"
            android:configChanges="orientation"
            android:excludeFromRecents="true"
            android:label="@string/call"
            android:launchMode="singleTask"
            android:permission="android.permission.USE_SIP"
            android:process=":sipStack"
            android:taskAffinity=""
            android:theme="@style/DarkTheme.Dialog" >
            <intent-filter>
                <action android:name="android.intent.action.CALL" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="csip" />
                <data android:scheme="sip" />
                <data android:scheme="sips" />
            </intent-filter>
            <intent-filter android:priority="10" >
                <action android:name="android.phone.extra.NEW_CALL_INTENT" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="csip" />
                <data android:scheme="sip" />
                <data android:scheme="sips" />
            </intent-filter>
        </activity>

        <activity-alias
            android:name="com.voiceblue.phone.ui.PrivilegedOutgoingSipCallBroadcaster"
            android:configChanges="orientation"
            android:excludeFromRecents="true"
            android:launchMode="singleTask"
            android:permission="android.permission.CALL_PRIVILEGED"
            android:targetActivity="com.voiceblue.phone.ui.outgoingcall.OutgoingCallChooser"
            android:theme="@style/DarkTheme.Dialog" >
            <intent-filter>
                <action android:name="android.intent.action.CALL_PRIVILEGED" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="sip" />
            </intent-filter>
        </activity-alias>
        <activity-alias
            android:name="com.voiceblue.phone.ui.PrivilegedOutgoingCallBroadcaster"
            android:configChanges="orientation"
            android:enabled="false"
            android:excludeFromRecents="true"
            android:label="@string/sip_call"
            android:launchMode="singleTask"
            android:permission="android.permission.CALL_PRIVILEGED"
            android:targetActivity="com.voiceblue.phone.ui.outgoingcall.OutgoingCallChooser"
            android:theme="@style/DarkTheme.Dialog" >
            <intent-filter>
                <action android:name="android.intent.action.CALL_PRIVILEGED" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="tel" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.CALL_PRIVILEGED" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="vnd.android.cursor.item/phone" />
                <data android:mimeType="vnd.android.cursor.item/phone_v2" />
                <data android:mimeType="vnd.android.cursor.item/person" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SENDTO" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="smsto" />
            </intent-filter>
        </activity-alias>

        <!-- To be able to do video, this has to be launched in sipStack process -->
        <activity
            android:name="com.voiceblue.phone.ui.incall.InCallActivity"
            android:allowTaskReparenting="true"
            android:configChanges="orientation"
            android:excludeFromRecents="true"
            android:launchMode="singleTask"
            android:permission="android.permission.CONFIGURE_SIP"
            android:process=":sipStack"
            android:taskAffinity=""
            android:theme="@style/DarkTheme.NoTitle" >
            <intent-filter android:priority="10" >
                <action android:name="com.voiceblue.phone.phone.action.INCALL" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.voiceblue.phone.ui.PickupSipUri"
            android:configChanges="orientation"
            android:label="@string/pickup_sip_uri"
            android:theme="@style/DarkTheme" />
        <activity
            android:name="com.voiceblue.phone.ui.incall.InCallMediaControl"
            android:configChanges="orientation"
            android:label="@string/prefs_media"
            android:taskAffinity="com.voiceblue.phone.ui.incall.InCallActivity"
            android:theme="@style/DarkTheme.Dialog" />

        <receiver android:name="com.voiceblue.phone.service.HeadsetButtonReceiver" />

        <!-- Widget -->
        <receiver
            android:name="com.voiceblue.phone.widgets.AccountWidgetProvider"
            android:icon="@drawable/ic_logo_flat"
            android:label="@string/gadget_title" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
                <action android:name="com.voiceblue.phone.service.ACCOUNT_CHANGED" />
                <action android:name="com.voiceblue.phone.service.REGISTRATION_CHANGED" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/appwidget_info" />
        </receiver>

        <activity
            android:name="com.voiceblue.phone.widgets.AccountWidgetConfigure"
            android:theme="@style/DarkTheme" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>

        <receiver
            android:name="com.voiceblue.phone.widgets.ShortcutWidgetProvider"
            android:icon="@drawable/ic_logo_flat"
            android:label="@string/csipsimple_shortcut" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/appshortcut_info" />
        </receiver>

        <activity
            android:name="com.voiceblue.phone.widgets.ShortcutWidgetConfigure"
            android:theme="@style/DarkTheme" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>

        <!-- Messages -->
        <activity
            android:name="com.voiceblue.phone.ui.messages.MessageActivity"
            android:configChanges="orientation"
            android:launchMode="singleTop"
            android:theme="@style/DarkTheme"
            android:windowSoftInputMode="stateHidden" />

        <!-- Embedded plugins -->
        <!-- Call handlers android:process=":telCallHandler" -->
        <receiver
            android:name="com.voiceblue.phone.plugins.telephony.CallHandler"
            android:permission="android.permission.PROCESS_OUTGOING_CALLS"
            android:process=":sipStack" >
            <intent-filter>
                <action android:name="com.voiceblue.phone.phone.action.HANDLE_CALL" />
            </intent-filter>
        </receiver>

        <!-- Databases providers -->
        <provider
            android:name="com.voiceblue.phone.service.PreferenceProvider"
            android:authorities="com.voiceblue.phone.prefs"
            android:permission="android.permission.CONFIGURE_SIP" />
        <provider
            android:name="com.voiceblue.phone.db.DBProvider"
            android:authorities="com.voiceblue.phone.db"
            android:permission="android.permission.CONFIGURE_SIP"
            android:process=":sipStack" />

        <!-- New UI -->
        <activity
            android:name="com.voiceblue.phone.ui.account.AccountsEditList"
            android:label="@string/accounts"
            android:theme="@style/DarkTheme" />
        <activity
            android:name="com.voiceblue.phone.ui.account.AccountEdit"
            android:theme="@style/DarkTheme" />

        <!-- Extra codecs -->


        <!-- OPUS? -->


        <!-- Extra wizard creation account activities -->
        <activity
            android:name="com.voiceblue.phone.wizards.impl.MondotalkCreate"
            android:theme="@style/DarkTheme" />
        <!--
        activity
            android:name="com.voiceblue.phone.ui.SplashScreen"
            android:label="@string/title_activity_splash_screen" >
        </activity
        -->
        <activity
            android:name="com.voiceblue.phone.ui.SipHome"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:theme="@style/DarkTheme"
            android:uiOptions="splitActionBarWhenNarrow" >
            <intent-filter android:priority="10" >
                <action android:name="com.voiceblue.phone.phone.action.DIALER" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter android:priority="10" >
                <action android:name="android.intent.action.DIAL" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:scheme="sip" />
                <data android:scheme="csip" />
            </intent-filter>
            <intent-filter android:priority="10" >
                <action android:name="com.voiceblue.phone.phone.action.CALLLOG" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter android:priority="10" >
                <action android:name="com.voiceblue.phone.phone.action.FAVORITES" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter android:priority="10" >
                <action android:name="com.voiceblue.phone.phone.action.MESSAGES" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:theme="@style/Theme.Splash"
            android:name="com.voiceblue.custom.ui.LoginActivity"
            android:label="@string/title_activity_login" >
        </activity>
        
        
          <!-- Receiver for standard video -->
        <receiver android:name="com.voiceblue.phone.plugin.video.PluginReceiver" >
            <intent-filter>
                <action android:name="com.voiceblue.phone.plugins.action.REGISTER_VIDEO" />
            </intent-filter>

            <meta-data
                android:name="lib_name"
                android:value="libpj_video_android.so" />
            <!-- For now it does not matter in the future we should have one per device, codec, and converter (if needed) -->
            <meta-data
                android:name="init_factory"
                android:value="pjmedia_webrtc_vid_render_factory" />
        </receiver>

        <!--
        Receiver for video capture
        <receiver android:name=".CaptureReceiver" >
            <intent-filter>
                <action android:name="com.csipsimple.plugins.action.REGISTER_CAPTURE_VIDEO" />
            </intent-filter>

            <meta-data
                android:name="lib_name"
                android:value="libpj_screen_capture_android.so" />
            <meta-data
                android:name="init_factory"
                android:value="pjmedia_webrtc_vid_capture_factory" />
        </receiver>
        -->
        <receiver android:name="com.voiceblue.phone.plugin.video.PluginReceiverFfmpeg" >
            <intent-filter>
                <action android:name="com.voiceblue.phone.codecs.action.REGISTER_VIDEO_CODEC" />
            </intent-filter>

            <meta-data
                android:name="lib_name"
                android:value="libpj_video_android.so" />
            <meta-data
                android:name="init_factory"
                android:value="pjmedia_codec_ffmpeg_vid_init" />
            <meta-data
                android:name="deinit_factory"
                android:value="pjmedia_codec_ffmpeg_vid_deinit" />
        </receiver>
        <receiver android:name="com.voiceblue.phone.plugin.video.PluginReceiverVpx" >
            <intent-filter>
                <action android:name="com.voiceblue.phone.codecs.action.REGISTER_VIDEO_CODEC" />
            </intent-filter>

            <meta-data
                android:name="lib_name"
                android:value="libpj_vpx.so" />
            <meta-data
                android:name="init_factory"
                android:value="pjmedia_codec_vpx_init" />
            <meta-data
                android:name="deinit_factory"
                android:value="pjmedia_codec_vpx_deinit" />
        </receiver>    
        
        
    </application>

</manifest>