summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorEcco Park <eccopark@google.com>2018-03-23 11:29:34 -0700
committerRoshan Pius <rpius@google.com>2018-07-27 13:53:10 -0700
commit4446fd4dc77a44ee3ede75c2b109209110ab5a15 (patch)
tree6738dc5de2f082a45321c2cec8e28a9346a5eec1 /service
parenta9774358660dc94a6e6f87e910869f61eb40ba7c (diff)
Enable new version of mockito (mockito-target-extend)
The new mockito supports: 1) mocking static methods 2) mocking private classes 3) mocking final methods and classes Also, fixed a unit test failure with the new mockito enabled. Context.getText() is a final method, so previously the test was using the "real" version of the method (getResources().getText(resId)). With the new mockito, this fails because the method needs to be explicitly mocked now. ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh ... Time: 94 OK (2678 tests) Bug: 72571446 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Ib100e6d05db2b56a550e03858fd328b5412f3d58
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiApConfigStore.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/WifiApConfigStore.java b/service/java/com/android/server/wifi/WifiApConfigStore.java
index 117202fb3..6981618b8 100644
--- a/service/java/com/android/server/wifi/WifiApConfigStore.java
+++ b/service/java/com/android/server/wifi/WifiApConfigStore.java
@@ -202,11 +202,15 @@ public class WifiApConfigStore {
}
private Notification createConversionNotification() {
- CharSequence title = mContext.getText(R.string.wifi_softap_config_change);
- CharSequence contentSummary = mContext.getText(R.string.wifi_softap_config_change_summary);
- CharSequence content = mContext.getText(R.string.wifi_softap_config_change_detailed);
- int color = mContext.getResources()
- .getColor(R.color.system_notification_accent_color, mContext.getTheme());
+ CharSequence title =
+ mContext.getResources().getText(R.string.wifi_softap_config_change);
+ CharSequence contentSummary =
+ mContext.getResources().getText(R.string.wifi_softap_config_change_summary);
+ CharSequence content =
+ mContext.getResources().getText(R.string.wifi_softap_config_change_detailed);
+ int color =
+ mContext.getResources().getColor(
+ R.color.system_notification_accent_color, mContext.getTheme());
return new Notification.Builder(mContext, SystemNotificationChannels.NETWORK_STATUS)
.setSmallIcon(R.drawable.ic_wifi_settings)