title: Missing permission to control media error on Android 5/L
body: <p>Missing permission to control media error on Android 5/L</p>
  
  <p>Got the below error on this line while trying to setup a RemoteController.  I couldn't find any info on this error so wanted to post the error and the simple solution.</p>
  
  <p>Code that triggered it:</p>
  
  <pre><code>if(!((AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE)).registerRemoteController(mRemoteController)) {...}
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>E/AndroidRuntime(21073): FATAL EXCEPTION: main
  E/AndroidRuntime(21073): Process: com.example.widgetdemo, PID: 21073
  E/AndroidRuntime(21073): java.lang.SecurityException: Missing permission to control media.
  E/AndroidRuntime(21073):    at android.os.Parcel.readException(Parcel.java:1540)
  E/AndroidRuntime(21073):    at android.os.Parcel.readException(Parcel.java:1493)
  E/AndroidRuntime(21073):    at android.media.session.ISessionManager$Stub$Proxy.addSessionsListener(ISessionManager.java:274)
  E/AndroidRuntime(21073):    at android.media.session.MediaSessionManager.addOnActiveSessionsChangedListener(MediaSessionManager.java:208)
  E/AndroidRuntime(21073):    at android.media.RemoteController.startListeningToSessions(RemoteController.java:796)
  E/AndroidRuntime(21073):    at android.media.AudioManager.registerRemoteController(AudioManager.java:2530)
  E/AndroidRuntime(21073):    at com.example.widgetdemo.RemoteControlService.setRemoteControllerEnabled(RemoteControlService.java:68)
  E/AndroidRuntime(21073):    at com.example.widgetdemo.MainActivity$3.onServiceConnected(MainActivity.java:216)
  E/AndroidRuntime(21073):    at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1203)
  E/AndroidRuntime(21073):    at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1220)
  </code></pre>