Commit 98551926 authored by Kazuhiro Inaba's avatar Kazuhiro Inaba Committed by Commit Bot

arc: Enable 'location' service when ARC is enabled via autotest.

Rationales:
* Android CTS requires this configuration.
    https://source.android.com/compatibility/cts/setup#config_device
* All the other existing ARC autotest are oblivious to this config.
    (Moreover, since the default choice of this config when the normal
     user opts-in to ARC is 'enabled', if we were to choose one,
     I think we should test the 'enabled' state rather than disabled.)
So, it was the easiest way for me to just enable it globaly.

Alternatives considered:
[Instead of using autotest API, directly modify the config via adb etc.]
  * Difficult. Only priviledged processes can modify the config with
    confirmation UI suppressed. ArcIntentHandler who syncs
    the kArcLocationServiceEnabled pref to ARC can do that, but adb not.
  * Even if we could, have to deal with race issue between ArcIntentHelper's
    sync timing for the pref.

[Add new autotestPrivate API for this and use in CTS]
  * As I wrote in the rationales, we aren't gonna need this complexity.

BUG=b:111100137
TEST=cheets_CTS_P.9.0_r2.arm.CtsBluetoothTestCases starts passing.
TEST=All (otherwise passing) cheets_* tests continues passing.

Change-Id: I28047775c9c806d6dd24af852c97271f656bb17b
Reviewed-on: https://chromium-review.googlesource.com/1179515
Commit-Queue: Kazuhiro Inaba <kinaba@chromium.org>
Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584692}
parent 05eba098
......@@ -43,6 +43,7 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/printing/printer_configuration.h"
#include "components/arc/arc_prefs.h"
#include "components/user_manager/user_manager.h"
#include "content/public/common/service_manager_connection.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
......@@ -576,6 +577,8 @@ AutotestPrivateSetPlayStoreEnabledFunction::Run() {
return RespondNow(
Error("ARC enabled state cannot be changed for the current user"));
}
profile->GetPrefs()->SetBoolean(arc::prefs::kArcLocationServiceEnabled,
true);
return RespondNow(NoArguments());
} else {
return RespondNow(Error("ARC is not available for the current user"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment