Android M Permissions : checkSelfPermission() always returns -1
<p>In my app, i have a background service which needs several permissions.
Because M OS requires developers to make sure that those permissions have approved in run-time, i've tried to check permissions with the following code.</p>

<pre><code>getApplicationContext().checkSelfPermission()
</code></pre>

<p>I didn't show any pup-up for getting allow/deny. Instead I've allowed those permissions in the Application Info page(In settings > applications > application manager > my background service)
But although I've enabled those permissions in the Application Info page,
the above function always returns -1.</p>

<p>How do I properly check permissions if I changed permission approvals on the application info page?</p>