Android Auto Google Play Rejection
Asked Answered
C

0

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?

Coca answered 4/8, 2016 at 13:36 Comment(7)
When you try your app on Android Auto, can you reproduce the problem cited by Google?Intercalary
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.Coca
"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.Intercalary
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.Coca
Do you have a receiver to handle ACTION_AUDIO_BECOMING_NOISY? i.e new IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY);Matherly
Yes, and I'm stopping playback with that too.Coca
The other question is whether you are abandoning audio focus on AUDIOFOCUS_LOSS developer.android.com/training/managing-audio/…Matherly

© 2022 - 2024 — McMap. All rights reserved.