From 29da253de531bde521dc6fb1cd727c099f1e74ca Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Tue, 25 Jul 2017 10:20:07 -0700 Subject: Update landing activity for wrong password notification Update the landing activity for the notification to show the password dialog when the notification is tapped. Bug: 33245941 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: manual test Change-Id: Ieac2a5e41ab411fb1f8c5cab5f62243281eaabef --- .../src/com/android/server/wifi/WrongPasswordNotifierTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/WrongPasswordNotifierTest.java b/tests/wifitests/src/com/android/server/wifi/WrongPasswordNotifierTest.java index 405ab65c2..74bfdeba5 100644 --- a/tests/wifitests/src/com/android/server/wifi/WrongPasswordNotifierTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WrongPasswordNotifierTest.java @@ -22,13 +22,16 @@ import static org.mockito.Mockito.*; import android.app.Notification; import android.app.NotificationManager; import android.content.Context; +import android.content.Intent; import android.content.res.Resources; +import android.provider.Settings; import com.android.internal.notification.SystemNotificationChannels; import org.junit.Before; import org.junit.Test; import org.mockito.Answers; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -70,6 +73,11 @@ public class WrongPasswordNotifierTest { eq(SystemNotificationChannels.NETWORK_ALERTS))).thenReturn(mNotificationBuilder); mWrongPassNotifier.onWrongPasswordError(TEST_SSID); verify(mNotificationManager).notify(eq(WrongPasswordNotifier.NOTIFICATION_ID), any()); + ArgumentCaptor intent = ArgumentCaptor.forClass(Intent.class); + verify(mFrameworkFacade).getActivity( + any(Context.class), anyInt(), intent.capture(), anyInt()); + assertEquals(Settings.ACTION_WIFI_SETTINGS, intent.getValue().getAction()); + assertEquals(TEST_SSID, intent.getValue().getStringExtra("wifi_start_connect_ssid")); } /** -- cgit v1.2.3