Commit 0281622a authored by Wei Lee's avatar Wei Lee Committed by Commit Bot

Fix issue that camera app don't launch with Play Store ToS

This CL fix the issue that Camera App don't launch when Play Store ToS
dialog is shown. Now GCA will only be launched when it is ready. Otherwise,
just fallback to launch CCA.

BUG=b/119152926
TEST=Tested by enabling/disabling Google Play Store in Settings App and it works as expectation.

Change-Id: I51c0a80a3eb6160429b98d40adaf5c56e28d6b61
Reviewed-on: https://chromium-review.googlesource.com/c/1339089Reviewed-by: default avatarHidehiko Abe <hidehiko@chromium.org>
Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Commit-Queue: Wei Lee <wtlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610300}
parent 941a0d74
......@@ -19,6 +19,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/session_sync_service_factory.h"
#include "chrome/browser/ui/app_list/app_list_client_impl.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "chrome/browser/ui/ash/ksv/keyboard_shortcut_viewer_util.h"
#include "chrome/browser/ui/chrome_pages.h"
......@@ -238,15 +239,20 @@ void OnArcFeaturesRead(Profile* profile,
registry->GetInstalledExtension(chrome_app_id);
bool arc_enabled = arc::IsArcPlayStoreEnabledForProfile(profile);
bool is_android_camera_app_registered =
arc_enabled &&
ArcAppListPrefs::Get(profile)->IsRegistered(kAndroidCameraAppId);
bool chrome_camera_migrated =
profile->GetPrefs()->GetBoolean(prefs::kCameraMediaConsolidated);
VLOG(1) << "Launching camera app. arc_enabled = " << arc_enabled
<< " is_android_camera_app_registered = "
<< is_android_camera_app_registered
<< " arc_p_or_above = " << arc_p_or_above
<< " chrome_camera_migrated = " << chrome_camera_migrated
<< " cca_exist = " << (extension != nullptr);
if (arc_enabled && arc_p_or_above && (!extension || chrome_camera_migrated)) {
if (arc_p_or_above && is_android_camera_app_registered &&
(!extension || chrome_camera_migrated)) {
// Open Google camera app or GCA migration app according to GCA
// migration system property.
arc::ArcPropertyBridge* property =
......
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