Commit 7152b335 authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

Revert "[CrOS Tether] Update "enable GmsCore notifications" UI."

This reverts commit affdaea5.

Reason for revert: This patch is being split into two so that one can be submitted with string changes and one can be submitted without string changes. See https://bugs.chromium.org/p/chromium/issues/detail?id=793936.

Original change's description:
> [CrOS Tether] Update "enable GmsCore notifications" UI.
> 
> This UI is shown on the settings page when a phone tells the Chromebook
> that it does not have GmsCore notifications enabled.
> 
> This CL:
>   (1) Updates HostScannerOperation to accept an additional enum value
>       indicating that GmsCore notifications are disabled.
>   (2) Updates the settings page to show an extra step which is needed in
>       some cases to enable notifications.
> 
> Bug: 793936, 672263
> Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
> Change-Id: I65f34db384956189e6ea3c157a57f48bc4701fe4
> Reviewed-on: https://chromium-review.googlesource.com/894729
> Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
> Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#533167}

TBR=stevenjb@chromium.org,khorimoto@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 793936, 672263
Change-Id: I95c7c434b2eecce7b5462f495bab936c2ab082fe
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Reviewed-on: https://chromium-review.googlesource.com/897471Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533866}
parent f83a6e0f
......@@ -1625,28 +1625,25 @@
Unable to detect your phone
</message>
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_TITLE" desc="Title of the section which explains how to enable Google Play Services notifications on an Android phone in order to use Instant Tethering.">
To use Instant Tethering, turn on notifications for Google Play Services.
Google Play Services notifications are required for Instant Tethering
</message>
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_ONE_DEVICE_SUBTITLE" desc="Subtitle of the section which explains how to enable Google Play Services notifications. This subtitle is used when only one phone needs to have its notifications enabled.">
On your '<ph name="PHONE_NAME">$1<ex>Google Pixel</ex></ph>':
On your '<ph name="PHONE_NAME">$1<ex>Google Pixel</ex></ph>', enable notifications by following these steps:
</message>
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_TWO_DEVICES_SUBTITLE" desc="Subtitle of the section which explains how to enable Google Play Services notifications. This subtitle is used when two phones need to have their notifications enabled.">
On your '<ph name="PHONE_NAME_1">$1<ex>Google Pixel</ex></ph>' and '<ph name="PHONE_NAME_2">$2<ex>Google Pixel 2</ex></ph>':
On your '<ph name="PHONE_NAME_1">$1<ex>Google Pixel</ex></ph>' and '<ph name="PHONE_NAME_2">$2<ex>Google Pixel 2</ex></ph>', enable notifications by following these steps:
</message>
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_MANY_DEVICES_SUBTITLE" desc="Subtitle of the section which explains how to enable Google Play Services notifications. This subtitle is used when three or more phones need to have their notifications enabled.">
On your devices:
On your devices, enable notifications by following these steps:
</message>
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_FIRST_STEP" desc="First instruction for how to enable Google Play Services notifications on an Android phone. This step teaches the user how to look at notification settings.">
Go to Settings &gt; Apps &amp; notifications &gt; Notifications.
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_FIRST_STEP" desc="First instruction for how to enable Google Play Services notifications on an Android phone. This step teaches the user how to look at Google Play Services settings.">
Go to Settings &gt; Apps &amp; notifications &gt; All apps &gt; Google Play Services.
</message>
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_SECOND_STEP" desc="Second instruction for how to enable Google Play Services notifications on an Android phone. This step teaches the user how to look at notification settings for the Google Play Services app.">
Tap App notifications &gt; Google Play services.
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_SECOND_STEP" desc="Second instruction for how to enable Google Play Services notifications on an Android phone. This step teaches the user how to look at notification settings when already viewing Google Play Services settings.">
Tap on App notifications.
</message>
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_THIRD_STEP" desc="Third instruction for how to enable Google Play Services notifications on an Android phone. This step teaches the user how to enable notifications when already viewing noticiations settings for Google Play Services.">
Turn on Google Play services.
</message>
<message name="IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_FOURTH_STEP" desc="Fourth instruction for how to enable Google Play Services notifications on an Android phone. This step teaches the user how to enable the Instant Tethering notification channel for Google Play Services.">
Scroll to the bottom of the screen and turn on Instant Tethering, if it appears. If it doesn't, you're all set.
Check that app notifications are "On". If not, toggle to enable.
</message>
<message name="IDS_SETTINGS_INTERNET_NO_NETWORKS_MOBILE_DATA" desc="Text shown when viewing the Mobile data page when there are no cellular or tether networks available.">
No mobile connection found. Turn on Instant Tethering on your other devices and try again. &lt;a target="_blank" href="<ph name="URL">$1<ex>https://google.com/</ex></ph>"&gt;Learn more&lt;/a&gt;
......
......@@ -143,7 +143,6 @@
<li>$i18n{gmscoreNotificationsFirstStep}</li>
<li>$i18n{gmscoreNotificationsSecondStep}</li>
<li>$i18n{gmscoreNotificationsThirdStep}</li>
<li>$i18n{gmscoreNotificationsFourthStep}</li>
</ol>
</div>
</template>
......
......@@ -1091,8 +1091,6 @@ void AddInternetStrings(content::WebUIDataSource* html_source) {
IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_SECOND_STEP},
{"gmscoreNotificationsThirdStep",
IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_THIRD_STEP},
{"gmscoreNotificationsFourthStep",
IDS_SETTINGS_INTERNET_GMSCORE_NOTIFICATIONS_FOURTH_STEP},
{"tetherConnectionDialogTitle",
IDS_SETTINGS_INTERNET_TETHER_CONNECTION_DIALOG_TITLE},
{"tetherConnectionAvailableDeviceTitle",
......
......@@ -64,11 +64,8 @@ bool AreGmsCoreNotificationsDisabled(
return false;
return response->response_code() ==
TetherAvailabilityResponse_ResponseCode::
TetherAvailabilityResponse_ResponseCode_NOTIFICATIONS_DISABLED_LEGACY ||
response->response_code() ==
TetherAvailabilityResponse_ResponseCode::
TetherAvailabilityResponse_ResponseCode_NOTIFICATIONS_DISABLED_WITH_NOTIFICATION_CHANNEL;
TetherAvailabilityResponse_ResponseCode::
TetherAvailabilityResponse_ResponseCode_NOTIFICATIONS_DISABLED;
}
} // namespace
......@@ -184,7 +181,7 @@ void HostScannerOperation::OnMessageReceived(
PA_LOG(INFO) << "Received TetherAvailabilityResponse from device with ID "
<< remote_device.GetTruncatedDeviceIdForLogs() << " which "
<< "indicates that Google Play Services notifications are "
<< "disabled. Response code: " << response->response_code();
<< "disabled.";
gms_core_notifications_disabled_devices_.push_back(remote_device);
NotifyObserversOfScannedDeviceList(false /* is_final_scan_result */);
} else if (!IsTetheringAvailableWithValidDeviceStatus(response)) {
......
......@@ -319,27 +319,14 @@ TEST_F(HostScannerOperationTest, TestOperation_OneDevice_NoSimCard) {
}
TEST_F(HostScannerOperationTest,
TestOperation_OneDevice_NotificationsDisabled_Legacy) {
TestOperation_OneDevice_NotificationsDisabled) {
EXPECT_CALL(*mock_tether_host_response_recorder_,
RecordSuccessfulTetherAvailabilityResponse(_))
.Times(0);
TestOperationWithOneDevice(
TetherAvailabilityResponse_ResponseCode ::
TetherAvailabilityResponse_ResponseCode_NOTIFICATIONS_DISABLED_LEGACY);
EXPECT_EQ(std::vector<cryptauth::RemoteDevice>{test_devices_[0]},
test_observer_->gms_core_notifications_disabled_devices());
}
TEST_F(HostScannerOperationTest,
TestOperation_OneDevice_NotificationsDisabled_NotificationChannel) {
EXPECT_CALL(*mock_tether_host_response_recorder_,
RecordSuccessfulTetherAvailabilityResponse(_))
.Times(0);
TestOperationWithOneDevice(
TetherAvailabilityResponse_ResponseCode ::
TetherAvailabilityResponse_ResponseCode_NOTIFICATIONS_DISABLED_WITH_NOTIFICATION_CHANNEL);
TetherAvailabilityResponse_ResponseCode_NOTIFICATIONS_DISABLED);
EXPECT_EQ(std::vector<cryptauth::RemoteDevice>{test_devices_[0]},
test_observer_->gms_core_notifications_disabled_devices());
}
......
......@@ -63,7 +63,7 @@ message DeviceStatus {
// Next id: 1
message TetherAvailabilityRequest {}
// Next id: 7
// Next id: 6
message TetherAvailabilityResponse {
enum ResponseCode {
UNKNOWN_ERROR = 0;
......@@ -71,8 +71,7 @@ message TetherAvailabilityResponse {
SETUP_NEEDED = 2;
NO_RECEPTION = 3;
NO_SIM_CARD = 4;
NOTIFICATIONS_DISABLED_LEGACY = 5;
NOTIFICATIONS_DISABLED_WITH_NOTIFICATION_CHANNEL = 6;
NOTIFICATIONS_DISABLED = 5;
}
optional ResponseCode response_code = 1;
......
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