Android自动Google Play拒绝

时间:2016-08-04 13:36:15

标签: android android-auto

Google一直拒绝我的应用,原因如下: "在审核期间,我们发现如果在插入Android Auto体验时设备上播放音频,则音乐将继续通过汽车扬声器播放而无需用户意图。我们认为这会让驾驶员分心,并且不适合Android自动应用。"

我认为我已按照此处的文档采取了相应的步骤来解决此问题:https://developer.android.com/training/auto/audio/index.html#isconnected

然而,出于同样的原因,他们再次拒绝了我。

在我的MediaBrowserServiceCompat StreamService类中,我添加了以下代码:

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

在onCreate()中,我添加了:

registerReceiver(androidAutoConnectionStatusReceiver, androidAutoConnectionIntentFilter);

并将此类添加到服务中:

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);
            }
        }
    }

知道如何更新我的应用以解决此拒绝问题吗?

0 个答案:

没有答案