<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.advanced_android.screenonoffbroadcastreceiver" >
    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="21" />

    <!-- Required to control wifi state -->
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" >
    </uses-permission>
<!--     <uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" > -->
<!--     </uses-permission> -->
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" >
    </uses-permission>
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" >
    </uses-permission>

    <!-- Required to be able to hold wakelocks -->
    <uses-permission android:name="android.permission.WAKE_LOCK" >
    </uses-permission>

    <!-- admob and ConnectivityManager -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- required for writing own logs files -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <!-- start service on boot -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <!-- detect when battery is charged -->
    <uses-permission android:name="android.permission.BATTERY_STATS" />

    <!-- detect  when screen is turned on/off -->
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!--     detect unplug actions -->
<!--     <uses-permission android:name="android.permission.DEVICE_POWER" /> -->

    <!-- access own logcat -->
    <uses-permission android:name="android.permission.READ_LOGS" />
    
    <!-- access to cell location -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >
        <activity android:name=".MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver android:name=".Receiver" android:enabled="true" >
            <intent-filter android:priority="100">
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
                <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
                <action android:name="android.intent.action.SCREEN_ON" />
                <action android:name="android.intent.action.BATTERY_CHANGED" />
                <action android:name="android.intent.action.PACKAGE_CHANGED" />
                <action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
                <action android:name="android.net.wifi.STATE_CHANGE" />
                <action android:name="android.net.wifi.SCAN_RESULTS" />
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />     
                <action android:name="android.media.VOLUME_CHANGED_ACTION" />
                <action android:name="com.oculus.vrpowermanager.unmounted_wake" />
                <action android:name="com.oculus.vrpowermanager.wake" />
            </intent-filter>
        </receiver>
    </application>

</manifest>
