summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp3
-rw-r--r--jarjar-rules-shared.txt1
-rw-r--r--proguard.flags7
-rw-r--r--res/values-ar/strings.xml4
-rw-r--r--res/values-as/strings.xml26
-rw-r--r--res/values-b+sr+Latn/strings.xml26
-rw-r--r--res/values-be/strings.xml26
-rw-r--r--res/values-bs/strings.xml26
-rw-r--r--res/values-en-rCA/strings.xml26
-rw-r--r--res/values-en-rXC/strings.xml26
-rw-r--r--res/values-or/strings.xml26
-rw-r--r--res/values-pa/strings.xml26
-rw-r--r--res/values-pt-rBR/strings.xml26
-rw-r--r--src/com/android/networkstack/metrics/IpProvisioningMetrics.java11
-rw-r--r--tests/unit/src/com/android/networkstack/metrics/NetworkIpProvisioningMetricsTest.java28
15 files changed, 37 insertions, 251 deletions
diff --git a/Android.bp b/Android.bp
index 6ccbd18..ae19a1c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -91,6 +91,7 @@ java_defaults {
"netlink-client",
"networkstack-client",
"net-utils-framework-common",
+ // See note on statsprotos when adding/updating proto build rules
"datastallprotosnano",
"statsprotos",
"captiveportal-lib",
@@ -293,6 +294,8 @@ android_app {
required: ["NetworkPermissionConfig"],
}
+// When adding or modifying protos, the jarjar rules and possibly proguard rules need
+// to be updated: proto libraries may pull additional static libraries.
java_library_static {
name: "statsprotos",
proto: {
diff --git a/jarjar-rules-shared.txt b/jarjar-rules-shared.txt
index c4f4602..438fc61 100644
--- a/jarjar-rules-shared.txt
+++ b/jarjar-rules-shared.txt
@@ -2,6 +2,7 @@
rule com.android.net.module.util.** com.android.networkstack.util.@1
rule com.android.internal.util.** android.net.networkstack.util.@1
+rule com.google.protobuf.** com.android.networkstack.protobuf.@1
# Classes from net-utils-framework-common
rule com.android.net.module.util.** com.android.networkstack.util.@1
diff --git a/proguard.flags b/proguard.flags
index c60f6c3..af4262a 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -7,3 +7,10 @@
static final int CMD_*;
static final int EVENT_*;
}
+
+# The lite proto runtime uses reflection to access fields based on the names in
+# the schema, keep all the fields.
+# This replicates the base proguard rule used by the build by default
+# (proguard_basic_keeps.flags), but needs to be specified here because the
+# com.google.protobuf package is jarjared to the below package.
+-keepclassmembers class * extends com.android.networkstack.protobuf.MessageLite { <fields>; }
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml
index 215b872..fe60a49 100644
--- a/res/values-ar/strings.xml
+++ b/res/values-ar/strings.xml
@@ -16,8 +16,8 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"مصادقة مدخل مقيد الوصول"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"يتم عرض الإشعارات عندما تتم مصادقة الجهاز بنجاح مع شبكة مدخل مقيد الوصول."</string>
+ <string name="notification_channel_name_connected" msgid="1795068343200033922">"مصادقة مدخل مشروط الوصول إليه"</string>
+ <string name="notification_channel_description_connected" msgid="7239184168268014518">"يتم عرض الإشعارات عندما تتم مصادقة الجهاز بنجاح مع شبكة مدخل مشروط الوصول إليه."</string>
<string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"معلومات عن المكان الذي يوفّر الشبكة"</string>
<string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"الإشعارات التي يتم عرضها لتشير إلى أن الشبكة تحتوي على صفحة معلومات عن المكان."</string>
<string name="connected" msgid="4563643884927480998">"الجهاز متصل الآن بالإنترنت."</string>
diff --git a/res/values-as/strings.xml b/res/values-as/strings.xml
deleted file mode 100644
index 2a51122..0000000
--- a/res/values-as/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"কেপটিভ প’ৰ্টেলৰ প্ৰমাণীকৰণ"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"ডিভাইচটোৱে কোনো কেপটিভ প’ৰ্টেল নেটৱর্কত সফলতাৰে বিশ্বাসযোগ্যতা প্ৰমাণীকৰণ কৰিলে জাননীসমূহ দেখুওৱা হয়"</string>
- <string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"নেটৱৰ্ক স্থলীৰ তথ্য"</string>
- <string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"নেটৱৰ্কৰ এখন স্থলীৰ তথ্য পৃষ্ঠা থকাটো দৰ্শাবলৈ জাননীসমূহ দেখুওৱা হয়"</string>
- <string name="connected" msgid="4563643884927480998">"সংযোগ কৰা হৈছে"</string>
- <string name="tap_for_info" msgid="6849746325626883711">"সংযুক্ত / ৱেবছাইট চাবলৈ টিপক"</string>
- <string name="application_label" msgid="1322847171305285454">"নেটৱৰ্ক মেনেজাৰ"</string>
-</resources>
diff --git a/res/values-b+sr+Latn/strings.xml b/res/values-b+sr+Latn/strings.xml
deleted file mode 100644
index e53b2c9..0000000
--- a/res/values-b+sr+Latn/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"Potvrda identiteta na ulaznom portalu"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"Obaveštenja koja se prikazuju kada se potvrdi identitet uređaja na mreži ulaznog portala"</string>
- <string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"Informacije o mestu na mreži"</string>
- <string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"Obaveštenja koja se prikazuju da bi pokazala da mreža ima stranicu sa informacijama o mestu"</string>
- <string name="connected" msgid="4563643884927480998">"Povezano"</string>
- <string name="tap_for_info" msgid="6849746325626883711">"Povezano/dodirnite da biste pregledali veb-sajt"</string>
- <string name="application_label" msgid="1322847171305285454">"Menadžer mreže"</string>
-</resources>
diff --git a/res/values-be/strings.xml b/res/values-be/strings.xml
deleted file mode 100644
index dc0d108..0000000
--- a/res/values-be/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"Аўтэнтыфікацыя на старонцы аўтарызацыі"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"Апавяшчэнні, якія паказваюцца, калі прылада паспяхова прайшла аўтэнтыфікацыю на вэб-старонцы аўтарызацыі ў сетцы"</string>
- <string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"Інфармацыя пра месцазнаходжанне сеткі"</string>
- <string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"Апавяшчэнні, якія паказваюцца, калі ў сетцы ёсць старонка з інфармацыяй пра яе месцазнаходжанне"</string>
- <string name="connected" msgid="4563643884927480998">"Падключана"</string>
- <string name="tap_for_info" msgid="6849746325626883711">"Падключана / Націсніце для прагляду вэб-сайта"</string>
- <string name="application_label" msgid="1322847171305285454">"Менеджар сетак"</string>
-</resources>
diff --git a/res/values-bs/strings.xml b/res/values-bs/strings.xml
deleted file mode 100644
index ed85f6a..0000000
--- a/res/values-bs/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"Autentifikacija na zaštitnom portalu"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"Obavještenja koja se prikazuju kada se uređaj uspješno autentificira na mreži sa zaštitnim portalom"</string>
- <string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"Mrežne informacije o mjestu događaja"</string>
- <string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"Obavještenja koja se prikazuju da pokažu da mreža ima stranicu s informacijama o mjestu događaja"</string>
- <string name="connected" msgid="4563643884927480998">"Povezano"</string>
- <string name="tap_for_info" msgid="6849746325626883711">"Povezano/Dodirnite da vidite web lokaciju"</string>
- <string name="application_label" msgid="1322847171305285454">"Upravitelj mreže"</string>
-</resources>
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
deleted file mode 100644
index d9f3843..0000000
--- a/res/values-en-rCA/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"Captive portal authentication"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"Notifications shown when the device has successfully authenticated to a captive portal network"</string>
- <string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"Network venue information"</string>
- <string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"Notifications shown to indicate that the network has a venue information page"</string>
- <string name="connected" msgid="4563643884927480998">"Connected"</string>
- <string name="tap_for_info" msgid="6849746325626883711">"Connected/Tap to view website"</string>
- <string name="application_label" msgid="1322847171305285454">"Network manager"</string>
-</resources>
diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml
deleted file mode 100644
index c6a7270..0000000
--- a/res/values-en-rXC/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‎‏‏‏‎‎‎‏‏‏‎‏‎‎‏‎‏‎‏‏‏‎‏‎‎‏‎‎‏‎‏‏‎‏‏‏‏‏‏‏‏‏‏‏‏‎‎‏‎‏‎‏‏‎‎‏‎‎‎‎‎‏‎‎Captive portal authentication‎‏‎‎‏‎"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‏‎‎‏‎‎‎‏‏‏‎‏‏‎‏‎‏‏‏‏‏‏‏‎‏‎‎‏‎‏‎‏‏‎‏‏‎‏‎‎‏‏‏‏‏‏‎‎‏‎‎‎‏‏‏‎‏‏‎‏‏‎‎Notifications shown when the device has successfully authenticated to a captive portal network‎‏‎‎‏‎"</string>
- <string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‎‏‏‎‏‎‏‎‎‏‎‎‏‎‏‏‏‏‎‎‎‎‎‏‏‏‎‎‏‏‎‎‎‏‏‏‏‏‎‎‏‏‏‏‎‎‏‏‏‏‏‏‎‎‎‏‎‎‎‏‎‏‎Network venue information‎‏‎‎‏‎"</string>
- <string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‎‎‎‏‏‏‎‎‏‏‎‏‏‎‏‎‏‏‏‏‏‏‏‎‏‏‎‎‎‏‏‎‏‏‎‎‏‏‏‏‎‏‏‎‎‏‎‎‏‏‏‎‏‏‎‎‏‎‎‏‎‏‎Notifications shown to indicate the network has a venue information page‎‏‎‎‏‎"</string>
- <string name="connected" msgid="4563643884927480998">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‎‏‏‏‏‏‏‎‏‎‏‎‏‎‏‎‏‎‏‎‎‎‏‏‏‏‎‏‏‏‏‎‎‏‎‎‎‏‎‎‏‏‏‏‏‎‎‎‏‏‏‎‏‎‎‏‎‏‎‎‏‏‎‎Connected‎‏‎‎‏‎"</string>
- <string name="tap_for_info" msgid="6849746325626883711">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‎‏‏‏‏‏‎‎‎‎‏‏‏‏‎‎‏‎‏‏‏‏‏‏‏‏‏‏‎‏‏‏‎‏‏‏‎‎‏‎‎‎‎‏‏‏‎‎‎‎‏‏‏‎‎‏‏‏‏‏‏‏‎Connected / Tap to view website‎‏‎‎‏‎"</string>
- <string name="application_label" msgid="1322847171305285454">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‎‏‏‎‎‏‎‎‏‎‏‏‎‏‏‏‎‏‏‎‎‏‎‎‏‏‏‏‏‏‎‎‏‎‏‏‎‎‏‏‏‎‎‏‎‎‎‎‎‏‎‎‏‏‏‎‏‎‎‏‏‏‎‎Network manager‎‏‎‎‏‎"</string>
-</resources>
diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml
deleted file mode 100644
index a067683..0000000
--- a/res/values-or/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"କ୍ୟାପ୍ଟିଭ୍ ପୋର୍ଟାଲ୍ ପ୍ରାମାଣିକତା"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"ଡିଭାଇସଟି ଏକ କ୍ୟାପ୍ଟିଭ୍ ପୋର୍ଟାଲ୍ ନେଟୱାର୍କରେ ସଫଳତାର ସହିତ ପ୍ରାମାଣିକୃତ ହେଲେ ବିଜ୍ଞପ୍ତିଗୁଡ଼ିକ ଦେଖାଯାଏ"</string>
- <string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"ନେଟୱାର୍କ ଭେନ୍ୟୁ ସୂଚନା"</string>
- <string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"ନେଟୱାର୍କରେ ଏକ ଭେନ୍ୟୁ ସୂଚନା ପୃଷ୍ଠା ଅଛି ବୋଲି ସୂଚିତ କରିବାକୁ ବିଜ୍ଞପ୍ତିଗୁଡ଼ିକ ଦେଖାଯାଏ"</string>
- <string name="connected" msgid="4563643884927480998">"ସଂଯୋଗ କରାଯାଇଛି"</string>
- <string name="tap_for_info" msgid="6849746325626883711">"ସଂଯୁକ୍ତ ଅଛି / ୱେବସାଇଟ୍ ଦେଖିବା ପାଇଁ ଟାପ୍ କରନ୍ତୁ"</string>
- <string name="application_label" msgid="1322847171305285454">"ନେଟୱାର୍କ ପରିଚାଳକ"</string>
-</resources>
diff --git a/res/values-pa/strings.xml b/res/values-pa/strings.xml
deleted file mode 100644
index 6b9e743..0000000
--- a/res/values-pa/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"ਕੈਪਟਿਵ ਪੋਰਟਲ ਪ੍ਰਮਾਣੀਕਰਨ"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"ਡੀਵਾਈਸ ਦੇ ਸਫਲਤਾਪੂਰਵਕ ਕਨੈਕਟ ਹੋਣ ਅਤੇ ਕੈਪਟਿਵ ਪੋਰਟਲ ਨੈੱਟਵਰਕ \'ਤੇ ਪ੍ਰਮਾਣਿਤ ਹੋਣ \'ਤੇ ਸੂਚਨਾਵਾਂ ਦਿਖਾਈਆਂ ਜਾਂਦੀਆਂ ਹਨ"</string>
- <string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"ਨੈੱਟਵਰਕ ਸਥਾਨ ਬਾਰੇ ਜਾਣਕਾਰੀ"</string>
- <string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"ਇਹ ਦੱਸਣ ਲਈ ਸੂਚਨਾਵਾਂ ਦਿਖਾਈਆਂ ਜਾਂਦੀਆਂ ਹਨ ਕਿ ਨੈੱਟਵਰਕ ਕੋਲ ਸਥਾਨ ਬਾਰੇ ਜਾਣਕਾਰੀ ਵਾਲਾ ਪੰਨਾ ਹੈ"</string>
- <string name="connected" msgid="4563643884927480998">"ਕਨੈਕਟ ਹੈ"</string>
- <string name="tap_for_info" msgid="6849746325626883711">"ਕਨੈਕਟ ਕੀਤਾ ਗਿਆ / ਵੈੱਬਸਾਈਟ ਨੂੰ ਦੇਖਣ ਲਈ ਟੈਪ ਕਰੋ"</string>
- <string name="application_label" msgid="1322847171305285454">"ਨੈੱਟਵਰਕ ਪ੍ਰਬੰਧਕ"</string>
-</resources>
diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml
deleted file mode 100644
index e1f090b..0000000
--- a/res/values-pt-rBR/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="notification_channel_name_connected" msgid="1795068343200033922">"Autenticação de portal cativo"</string>
- <string name="notification_channel_description_connected" msgid="7239184168268014518">"Notificações mostradas quando o dispositivo é autenticado em uma rede de portal cativo"</string>
- <string name="notification_channel_name_network_venue_info" msgid="6526543187249265733">"Informações sobre o local da rede"</string>
- <string name="notification_channel_description_network_venue_info" msgid="5131499595382733605">"Notificações mostradas para indicar que a rede tem uma página de informações sobre o local"</string>
- <string name="connected" msgid="4563643884927480998">"Conectado"</string>
- <string name="tap_for_info" msgid="6849746325626883711">"Conectado / Toque para ver o site"</string>
- <string name="application_label" msgid="1322847171305285454">"Gerenciador de rede"</string>
-</resources>
diff --git a/src/com/android/networkstack/metrics/IpProvisioningMetrics.java b/src/com/android/networkstack/metrics/IpProvisioningMetrics.java
index 1f969d4..64e173d 100644
--- a/src/com/android/networkstack/metrics/IpProvisioningMetrics.java
+++ b/src/com/android/networkstack/metrics/IpProvisioningMetrics.java
@@ -120,12 +120,21 @@ public class IpProvisioningMetrics {
transSuccess ? HostnameTransResult.HTR_SUCCESS : HostnameTransResult.HTR_FAILURE);
}
+ private static DhcpErrorCode dhcpErrorFromNumberSafe(int number) {
+ // See DhcpErrorCode.errorCodeWithOption
+ // TODO: add a DhcpErrorCode method to extract the code;
+ // or replace legacy error codes with the new metrics.
+ final DhcpErrorCode error = DhcpErrorCode.forNumber(number & 0xFFFF0000);
+ if (error == null) return DhcpErrorCode.ET_UNKNOWN;
+ return error;
+ }
+
/**
* write the DHCP error code into DhcpSession.
*/
public void addDhcpErrorCode(final int errorCode) {
if (mDhcpSessionBuilder.getErrorCodeCount() >= MAX_DHCP_ERROR_COUNT) return;
- mDhcpSessionBuilder.addErrorCode(DhcpErrorCode.forNumber(errorCode));
+ mDhcpSessionBuilder.addErrorCode(dhcpErrorFromNumberSafe(errorCode));
}
/**
diff --git a/tests/unit/src/com/android/networkstack/metrics/NetworkIpProvisioningMetricsTest.java b/tests/unit/src/com/android/networkstack/metrics/NetworkIpProvisioningMetricsTest.java
index 08812b7..01d94e2 100644
--- a/tests/unit/src/com/android/networkstack/metrics/NetworkIpProvisioningMetricsTest.java
+++ b/tests/unit/src/com/android/networkstack/metrics/NetworkIpProvisioningMetricsTest.java
@@ -16,6 +16,7 @@
package com.android.networkstack.metrics;
+import android.net.dhcp.DhcpPacket;
import android.net.metrics.DhcpErrorEvent;
import android.stats.connectivity.DhcpErrorCode;
import android.stats.connectivity.DhcpFeature;
@@ -64,25 +65,24 @@ public class NetworkIpProvisioningMetricsTest {
final NetworkIpProvisioningReported mStats;
final IpProvisioningMetrics mMetrics = new IpProvisioningMetrics();
mMetrics.reset();
- mMetrics.addDhcpErrorCode(DhcpErrorEvent.DHCP_ERROR);
- mMetrics.addDhcpErrorCode(DhcpErrorEvent.L2_WRONG_ETH_TYPE);
- mMetrics.addDhcpErrorCode(DhcpErrorEvent.L3_INVALID_IP);
- mMetrics.addDhcpErrorCode(DhcpErrorEvent.L4_WRONG_PORT);
mMetrics.addDhcpErrorCode(DhcpErrorEvent.BOOTP_TOO_SHORT);
- mMetrics.addDhcpErrorCode(DhcpErrorEvent.DHCP_NO_COOKIE);
+ mMetrics.addDhcpErrorCode(DhcpErrorEvent.errorCodeWithOption(
+ DhcpErrorEvent.BUFFER_UNDERFLOW, DhcpPacket.DHCP_HOST_NAME));
+ // Write the incorrect input number 50000 as DHCP error number
+ int incorrectErrorCodeNumber = 50000;
+ mMetrics.addDhcpErrorCode(incorrectErrorCodeNumber);
for (int i = 0; i < mMetrics.MAX_DHCP_ERROR_COUNT; i++) {
mMetrics.addDhcpErrorCode(DhcpErrorEvent.PARSING_ERROR);
}
mStats = mMetrics.statsWrite();
- assertEquals(DhcpErrorCode.ET_DHCP_ERROR, mStats.getDhcpSession().getErrorCode(0));
- assertEquals(DhcpErrorCode.ET_L2_WRONG_ETH_TYPE, mStats.getDhcpSession().getErrorCode(1));
- assertEquals(DhcpErrorCode.ET_L3_INVALID_IP, mStats.getDhcpSession().getErrorCode(2));
- assertEquals(DhcpErrorCode.ET_L4_WRONG_PORT, mStats.getDhcpSession().getErrorCode(3));
- assertEquals(DhcpErrorCode.ET_BOOTP_TOO_SHORT, mStats.getDhcpSession().getErrorCode(4));
- assertEquals(DhcpErrorCode.ET_DHCP_NO_COOKIE, mStats.getDhcpSession().getErrorCode(5));
- // Check can record the same error code
- assertEquals(DhcpErrorCode.ET_PARSING_ERROR, mStats.getDhcpSession().getErrorCode(6));
- assertEquals(DhcpErrorCode.ET_PARSING_ERROR, mStats.getDhcpSession().getErrorCode(6));
+ assertEquals(DhcpErrorCode.ET_BOOTP_TOO_SHORT, mStats.getDhcpSession().getErrorCode(0));
+ assertEquals(DhcpErrorCode.ET_BUFFER_UNDERFLOW, mStats.getDhcpSession().getErrorCode(1));
+ // When the input is an invalid integer value (such as incorrectErrorCodeNumber),
+ // the DhcpErrorCode will be ET_UNKNOWN
+ assertEquals(DhcpErrorCode.ET_UNKNOWN, mStats.getDhcpSession().getErrorCode(2));
+ // If the same error code appears, it must be recorded
+ assertEquals(DhcpErrorCode.ET_PARSING_ERROR, mStats.getDhcpSession().getErrorCode(3));
+ assertEquals(DhcpErrorCode.ET_PARSING_ERROR, mStats.getDhcpSession().getErrorCode(4));
// The maximum number of DHCP error code counts is MAX_DHCP_ERROR_COUNT
assertEquals(mMetrics.MAX_DHCP_ERROR_COUNT, mStats.getDhcpSession().getErrorCodeCount());
}