16

Google keeps rejecting my app for the following reason: "During review, we found that if audio is playing on the device while plugging into the Android Auto experience, the music continues to play through the car speakers without user intent. We see this as a driver distraction, and isn't appropriate for Android Auto apps."

I thought I had taken the appropriate steps to resolve this by following the documentation from here: https://developer.android.com/training/auto/audio/index.html#isconnected

However, they rejected me again for the same reason.

In my MediaBrowserServiceCompat StreamService class, I've added the following code:

private IntentFilter androidAutoConnectionIntentFilter = new IntentFilter("com.google.android.gms.car.media.STATUS");
private AndroidAutoConnectionStatusReceiver androidAutoConnectionStatusReceiver = new AndroidAutoConnectionStatusReceiver();

In the onCreate(), I've added:

registerReceiver(androidAutoConnectionStatusReceiver, androidAutoConnectionIntentFilter);

and added this class to the service as well:

private class AndroidAutoConnectionStatusReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
            System.out.println("*** ANDROID AUTO CONNECTED: " + intent);
            String status = intent.getStringExtra("media_connection_status");
            boolean isConnectedToCar = "media_connected".equals(status);
            if (isConnectedToCar) {
                // android auto connected so stop playback
                Intent stopIntent = new Intent(context, StreamService.class);
                stopIntent.setAction(StreamService.ACTION_PLAYER_STOP);
                context.startService(stopIntent);
            }
        }
    }

Any idea how I can update my app to resolve this rejection?

codeman
  • 8,868
  • 13
  • 50
  • 79
  • When you try your app on Android Auto, can you reproduce the problem cited by Google? – CommonsWare Aug 04 '16 at 13:43
  • I don't have access to Android Auto hardware, but when I try with the Media Sim app, I never get any thing in the console from the AndroidAutoConnectionStatusReceiver. – codeman Aug 04 '16 at 13:47
  • 5
    "I don't have access to Android Auto hardware" -- IMHO, submitting an Android Auto app without testing it on Android Auto hardware is akin to submitting an Android app without testing it on Android hardware. Emulators and simulators only get you so far. – CommonsWare Aug 04 '16 at 13:50
  • This is true. But the weird thing is I have a few apps that were approved before this using the same Android Auto code. So they just started rejecting for this reason. – codeman Aug 04 '16 at 13:54
  • 1
    Do you have a receiver to handle ACTION_AUDIO_BECOMING_NOISY? i.e `new IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY);` – Nagesh Susarla Aug 06 '16 at 00:31
  • Yes, and I'm stopping playback with that too. – codeman Aug 06 '16 at 02:47
  • The other question is whether you are abandoning audio focus on `AUDIOFOCUS_LOSS` https://developer.android.com/training/managing-audio/audio-focus.html#HandleFocusLoss – Nagesh Susarla Aug 17 '16 at 22:55

0 Answers0