Appel nécessite des autorisations qui peuvent être rejetées par l'utilisateur

Je suis en train de faire une application qui envoie de l'emplacement des mises à jour d'un utilisateur après toutes les cinq minutes. Je suppose que mon code fonctionne bien, mais j'obtiens un message d'erreur concernant les autorisations qui sont utilisés par l'application. Je suis assez sûr que je l'ai ajouté les permissions dans le fichier manifeste. Quelqu'un peut me dire quel est le problème? Voici mon code.

MainActivity.java

LocationManager locationManager ;
String provider;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Getting LocationManager object
locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
//Creating an empty criteria object
Criteria criteria = new Criteria();
//Getting the name of the provider that meets the criteria
provider = locationManager.getBestProvider(criteria, false);
if(provider!=null && !provider.equals("")){
//Get the location from the given provider
Location location = locationManager.getLastKnownLocation(provider);
locationManager.requestLocationUpdates(provider,5*60*1000,0,this);
if(location!=null)
onLocationChanged(location);
else
Toast.makeText(getBaseContext(), "Location can't be retrieved", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(getBaseContext(), "No Provider Found", Toast.LENGTH_SHORT).show();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public void onLocationChanged(Location location) {
//Getting reference to TextView tv_longitude
TextView tvLongitude = (TextView)findViewById(R.id.tv_longitude);
//Getting reference to TextView tv_latitude
TextView tvLatitude = (TextView)findViewById(R.id.tv_latitude);
//Setting Current Longitude
tvLongitude.setText("Longitude:" + location.getLongitude());
//Setting Current Latitude
tvLatitude.setText("Latitude:" + location.getLatitude() );
}
@Override
public void onProviderDisabled(String provider) {
//TODO Auto-generated method stub
}
@Override
public void onProviderEnabled(String provider) {
//TODO Auto-generated method stub
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
//TODO Auto-generated method stub
}

}

J'obtiens une erreur comme Appel nécessite une autorisation qui peut être rejetée par l'utilisateur dans ces lignes-

Location location = locationManager.getLastKnownLocation(provider);
locationManager.requestLocationUpdates(provider,5*60*1000,0,this);

Mon AndroidManifest est comme ça

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

source d'informationauteur Aman Verma