How to get MIUI Security app auto start permission programmatically?
<p>I am not getting <code>BOOT_COMPLETE</code> broadcast in my Xiaomi Redmi 2 Prime mobile.</p>

<p>My <code>BroadcastReciever</code> is ---</p>

<pre><code>public class OnBootReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
    // Setting singleAlarm
    SingleAlarmHandler.getInstance().setAlarm(context);

    try {
        // Sending System Setting broadcast
        String offDate = SharedPrefrencesHandler.getInstance(context).readString(SharedPrefrencesConstants.SWITCH_OFF_DATE);
        int type = SystemSettingsType.PHONE_SWITCH_ON_OFF.getNumericType();

        if (offDate == null)
            offDate = "";

        SystemSettingsHandler.getSystemSettingsHandler().makeSystemSettingsCall(context, type, offDate);
        SharedPrefrencesHandler.getInstance(context).removePrefrence(SharedPrefrencesConstants.SWITCH_OFF_DATE);
        } catch (Exception e) {
            Log.e(ChaseForceApplication.TAG, e.getMessage());
        }
    }
}
</code></pre>

<p><strong>and manifest:</strong></p>

<pre><code>    &lt;receiver
        android:name=".broadcastlisteners.OnBootReceiver"
        android:enabled="true"
        android:exported="true"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
        &lt;/intent-filter&gt;
    &lt;/receiver&gt;
</code></pre>

<p><strong>with permission:</strong></p>

<pre><code>&lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
</code></pre>

<p>Now I am not getting BOOT COMPLETE broadcast in my Xiaomi Redmi 2 Prime mobile as alarm is not set. But in other android mobiles it is working correctly.</p>

<p>I searched and found that it is problem in MIUI firmware. In such mobile they provide an in built security app and until you allow auto start permission in that Security app, you are unable to get broad cast (any notification).</p>

<p>And as soon as you check that permission in that app you start to get the broadcast.</p>

<p>Now my question is:</p>

<p>How to get MIUI Security app auto start permission( Phones like Redmi) programmatically?</p>