在模拟器上删除Google Play服务

时间:2018-12-22 20:58:22

标签: java android android-studio google-api google-play-services

我正在开发将使用Google云端硬盘的应用程序,并且进行设置的一部分是查看Google Services API是否为最新/有效。我想测试并确保对话框能够按预期工作,但是我不想用手机进行测试,并且尝试在模拟器上删除Google Play服务会导致日志中出现以下错误:

2018-12-22 14:54:22.390 13934-15195/? E/SystemServiceRegistry: No service published for: wifip2p
    android.os.ServiceManager$ServiceNotFoundException: No service published for: wifip2p
        at android.os.ServiceManager.getServiceOrThrow(ServiceManager.java:75)
        at android.app.SystemServiceRegistry$49.createService(SystemServiceRegistry.java:569)
        at android.app.SystemServiceRegistry$49.createService(SystemServiceRegistry.java:567)
        at android.app.SystemServiceRegistry$StaticServiceFetcher.getService(SystemServiceRegistry.java:987)
        at android.app.SystemServiceRegistry.getSystemService(SystemServiceRegistry.java:914)
        at android.app.ContextImpl.getSystemService(ContextImpl.java:1667)
        at android.view.ContextThemeWrapper.getSystemService(ContextThemeWrapper.java:171)
        at android.app.Activity.getSystemService(Activity.java:5925)
        at com.android.settings.wfd.WifiDisplaySettings.isAvailable(WifiDisplaySettings.java:216)
        at com.android.settings.SettingsActivity.doUpdateTilesList(SettingsActivity.java:845)
        at com.android.settings.SettingsActivity.-wrap0(Unknown Source:0)
        at com.android.settings.SettingsActivity$5.run(SettingsActivity.java:747)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)
2018-12-22 14:54:22.462 1639-1656/? E/BluetoothAdapter: Bluetooth binder is null
2018-12-22 14:54:22.472 1639-1656/? E/KernelCpuSpeedReader: Failed to read cpu-freq: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state (No such file or directory)
2018-12-22 14:54:22.476 1639-1656/? E/BatteryExternalStatsWorker: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}

如何正确禁用/卸载此服务以进行测试,或者有更好的方法进行此操作?

0 个答案:

没有答案