Commit Graph

33516 Commits

Author SHA1 Message Date
Janis Danisevskis
552992ac12 Enable the clear credentials buttons when wifi keys are installed.
This patch updates the ResetCredentialsPreferenceController to check the
WIFI keystore namespace if called by the primary user.

Test: Install a WIFI certificate or key and watch the
      "Clear credentials" button become enabled in the credential
      storage dialog of Settings.
Bug: 189601008
Merged-In: I69828b64a7e3c707c27b4582d64ff0ddb863a4ff
Change-Id: I69828b64a7e3c707c27b4582d64ff0ddb863a4ff
2021-06-02 16:46:18 -07:00
Les Lee
c0245bb982 Merge "wifi: Use new API for data usage function" 2021-06-01 10:42:08 +00:00
Treehugger Robot
ca3051403f Merge "Settings: remove Bluetooth related text from DNS-dialog" 2021-05-17 03:19:59 +00:00
Timi Rautamäki
a84987564b Settings: remove Bluetooth related text from DNS-dialog
* String ´bluetooth_select_a2dp_codec_type_help_info´
   is set on the ´preference_widget_dialog_summary´-dialog
   by default.

Test: make Settings, visual observation
Signed-off-by: Timi Rautamäki <timi.rautamaki@gmail.com>
Change-Id: I6d403f231797bcf5b10bf726cca4e128f4c517ea
2021-05-16 21:08:36 +02:00
Lucas Lin
2e7309ffd3 Merge "Use [set|get]PrivateDnsMode directly" 2021-05-12 17:09:50 +00:00
lesl
74822b6dc3 wifi: Use new API for data usage function
For mobile, a old API: buildTemplateMobileAll doesn't includes the
merged wifi network, call the new API: buildTemplateCarrierMetered
to replace the old one.

PS: Not only usage functionality but also apply to network policy
control since the default policy is changing to use
new API: buildTemplateCarrier now.

Test: make RunSettingsRoboTests ROBOTEST_FILTER=SettingsDumpServiceTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageLibTest
Test: Manual Test, modify the mobile usage warming and limit bytes and
      check the data via adb shell dumpsys netpolicy
Change-Id: I6fbec14e7be4dc4b5c2fd3659a801521c81b233c
2021-05-11 20:06:11 +08:00
Xin Li
bb6f5b264f DO NOT MERGE - Merge RQ2A.210505.003.
Bug: 187544653
Merged-In: I3e6f6200e82e86d6a2085652906ad2d0d44814f5
Change-Id: I9a8ebe5b65b682015225c8c1ba9de1984bac7a8d
2021-05-07 23:32:36 -07:00
Treehugger Robot
9119105da9 Merge "Move myself to the emeritus section" 2021-05-06 22:24:55 +00:00
Eran Messeri
6f3630c393 Move myself to the emeritus section
As I no longer expect to be working on security-related settings, move
myself to the emeritus section.

Bug: 187395769
Test: N/A
Change-Id: Ic91dd36f6de39ef79f1ced90083e1c5c7836c651
2021-05-06 15:16:40 +01:00
lesl
fd41cce94b wifi: Use new API for wifi data usage function
For wifi, a old API: buildTemplateWifiWildcard will includes the merged
wifi which is included to mobile usage. It should not double count
again. Call new API: buildTemplateWifi with
NetworkId: NetworkTemplate.WIFI_NETWORKID_ALL
and null subscriberId to get non-merged wifi usage.

Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppDataUsageTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppDataUsagePreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryPreferenceTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageUtilsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SettingsDumpServiceTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiSettingsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageInfoControllerTest
Test: Manual Test, wifi data usage count correctly.
Bug: 176396812
Merged-In: Ia4d8fa67ea3cb75c2d35be9ab60e5c5ffa391ffb
Change-Id: Ia4d8fa67ea3cb75c2d35be9ab60e5c5ffa391ffb
2021-05-06 09:37:09 +08:00
lucaslin
1fbe34fbc7 Use [set|get]PrivateDnsMode directly
The value of PRIVATE_DNS_MODE_* has changed from String to int and
ConnectivityManager provides 2 new APIs to set and get private
DNS mode, the caller can use them directly and doesn't need to update
Settings by itself.

Bug: 185311744
Test: 1. make RunSettingsRoboTests ROBOTEST_FILTER=PrivateDnsModeDialogPreferenceTest
      2. make RunSettingsRoboTests ROBOTEST_FILTER=PrivateDnsPreferenceControllerTest
Change-Id: I47706efe9c53a00438fdec97fda244638cecb3dc
Merged-In: I47706efe9c53a00438fdec97fda244638cecb3dc
    (Cherry-picked from ag/14230401)
2021-05-05 03:26:58 +00:00
Jeremy Goldman
162029c5b6 Merge "Check if the SubscriptionsChangeListener has been started before stop" 2021-04-20 05:24:37 +00:00
Jeremy Goldman
660e7164c7 Check if the SubscriptionsChangeListener has been started before stop
calling mContext.unregisterReceiver on an unregistered broadcast
receiver will result in an exception. To make the
SubscriptionsChangeListener safe from this kind of error, add a check to
see whether start has been called before implementing stop's
functionality.

Bug: 184662284
Bug: 184521296
Test: atest -c SettingsUnitTests
Change-Id: Ic13911ee7573666f5d42ab4612c025968984ba47
2021-04-20 11:33:17 +08:00
Treehugger Robot
a1cf8135e6 Merge "Update OWNER file for TTS subfolder" 2021-04-20 02:19:53 +00:00
Tsung-Mao Fang
b6b63bec6c Update OWNER file for TTS subfolder
Change-Id: If0efd5051bc8ddcaa406746d4eb4e4a03d9023b7
Test: N/A
Fix: 185232773
2021-04-14 01:29:15 +00:00
Jack He
8cc23bd2fe BT: Use DeviceConfig for Bluetooth GD toggle
Bug: 184235563
Test: make and toggle GD settings, unit test
Change-Id: I643339f80a82950b1b1ffcf60830f93a955e6666
2021-04-13 20:31:38 +00:00
Almaz Mingaleev
3be24f4ab2 Move MIN_USE_DATE_OF_TIMEZONE to TimeUtils.
That timestamp is used in two places for the same purpose.

Bug: 155738410
Test: presubmit
Change-Id: Ia6836fd34c63aef6e335ef97922d34a60dbf3703
2021-04-06 14:10:05 +01:00
Bonian Chen
194af56330 Merge changes from topic "revert-1645152-getSystemService(Class<T>)-KMFSZZGDPU"
* changes:
  Revert "[Settings] Support getSystemService(Class<T>)"
  Revert "[Settings] Convert to getSystemService(Class<T>)"
2021-03-31 14:30:40 +00:00
Bonian Chen
2b195b4335 Revert "[Settings] Support getSystemService(Class<T>)"
Revert submission 1645152-getSystemService(Class<T>)

Reason for revert: Fix JUnit test failure
Reverted Changes:
I1b4812044:[Settings] Convert to getSystemService(Class<T>)
I278951c24:[Settings] Support getSystemService(Class<T>)

Change-Id: I5ca453c30c39d52e772033820f36ad448aeabe9e
2021-03-31 09:37:03 +00:00
Bonian Chen
d6f54ed90b Revert "[Settings] Convert to getSystemService(Class<T>)"
Revert submission 1645152-getSystemService(Class<T>)

Reason for revert: Fix JUnit test failure
Reverted Changes:
I1b4812044:[Settings] Convert to getSystemService(Class<T>)
I278951c24:[Settings] Support getSystemService(Class<T>)

Change-Id: I864a40f82ba9cb4170900ac0c1d77f781b17341f
2021-03-31 09:37:03 +00:00
Almaz Mingaleev
dd2a685756 Allow alternative time zone ID to be set device's zone.
If America/Godthab is set as device time zone, display it as if
America/Nuuk is chosen.
If time zone is known, but is not an alternative and not shown
in time zone picker, region will de derived from user's locale.

Bug: 155738410
Test: atest com.android.settings.datetime.timezone.model
Test: set persist.sys.timezone via adb and checked
Date & Time screen

Change-Id: I168fb4319e144dbe9e2496d06a681d4c09b411c0
2021-03-29 11:18:57 +01:00
Peter Wang
5babfac3d1 Fix coding styles for erase euicc only options
Bug: 159650638
Test: Build
Change-Id: I08bb8d9f73dbe6b9f18f36c45ae7652b36d422b2
Merged-In: I08bb8d9f73dbe6b9f18f36c45ae7652b36d422b2
2021-03-25 11:13:29 -07:00
Peter Wang
0b5532f67c Merge "Added an option in reset menu in Settings to enable resetting Euicc data only" 2021-03-24 18:12:14 +00:00
Janis Danisevskis
7aa99fe966 Merge "Keystore 2.0: Remove references to Keystore 1.0" 2021-03-23 03:14:28 +00:00
Janis Danisevskis
75a91836e7 Keystore 2.0: Remove references to Keystore 1.0
Test: N/A
Bug: 171305684
Change-Id: I8b50c024e919d5b98348b792e0769c510ff1a33d
2021-03-22 13:35:53 -07:00
SongFerng Wang
5292baf810 Merge "KEY_CARRIER_NR_AVAILABILITIES_INT_ARRAY change type as IntArray" 2021-03-22 19:06:48 +00:00
Bonian Chen
13fb77c652 Merge "[Settings] Convert to getSystemService(Class<T>)" 2021-03-22 08:18:59 +00:00
Bonian Chen
513da92357 Merge "[Settings] Support getSystemService(Class<T>)" 2021-03-22 08:18:59 +00:00
SongFerngWang
e88740eae2 KEY_CARRIER_NR_AVAILABILITIES_INT_ARRAY change type as IntArray
Bug: 179814490
Test: build pass
Change-Id: I9d2abe1abe3082267ed64b71602d8ada21c95c6c
Merged-In: I9d2abe1abe3082267ed64b71602d8ada21c95c6c
2021-03-22 07:17:22 +00:00
Bonian Chen
db6c47756d [Settings] Convert to getSystemService(Class<T>)
Change to getSystemService(Class<T>) to align the capability with framework
part.

Bug: 179640862
Test: local
Change-Id: I1b4812044fc4876bec6645570049a60f9470dbbd
2021-03-22 06:20:19 +00:00
SongFerng Wang
3ac3cce15b Merge "Change the behavior of notifyAllowedNetworkTypesChanged." 2021-03-21 16:45:59 +00:00
Chiachang Wang
3e737c11db Merge "Remove hidden connectivity methods access" 2021-03-19 08:13:06 +00:00
Chiachang Wang
f26f579c8d Merge "Replace the way to get the network for no internet dialog" 2021-03-19 07:54:24 +00:00
Jeremy Goldman
19c5d0a749 Merge "Add goldmanj to the Settings' vpn2 directory Owners file" 2021-03-19 06:15:40 +00:00
Andras Kloczl
d4f04398c7 Prevent using invalid result uri during multi user image change
Test: manual
Bug: 172939189
Change-Id: I3e6f6200e82e86d6a2085652906ad2d0d44814f5
Merged-In: Id2e598878b3250e8b3590905c6def561e2437d55
Merged-In: I15e15ad88b768a5b679de32c5429d921d850a3cb
(cherry picked from commit 07e414017c)
2021-03-19 00:00:22 +00:00
Chiachang Wang
eedfa1d307 Remove hidden connectivity methods access
This commit resolves the hidden methods accesses for
LinkProperties, IpConfiguration and RouteInfo with atlernative
way for the connectivity mainline module preparation.

Bug: 172183305
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.details2.WifiDetailPreferenceController2Test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.details.WifiDetailPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.UtilsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.WifiConfigController2Test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.WifiConfigController2Test

Change-Id: Iec4dab5d9fa12dedcf69a1cfe2a8be0956bc0d79
Merged-In: Iec4dab5d9fa12dedcf69a1cfe2a8be0956bc0d79
2021-03-18 22:25:05 +08:00
Chiachang Wang
11c37350d9 Replace the way to get the network for no internet dialog
It's a refactor work for incoming connectivity mainline. The
network information contained in the no ineternet notification
action was placed the target network id. The receiver which is
Settings will need to construct the network from the network id
using the hidden Network constructor. Since Network is moving
into module, Settings will not be able to access it. Apps should
use Network instead of network id, so just send the network
object to Settings.

Update the corresponding logic in Settings.

Bug: 172183305
Test: manually test with no internet dialog and check the
      behavior and log
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiNoInternetDialogTest
Change-Id: I75c04d6f1c2159ae990f6015551eb39d99266336
2021-03-18 11:35:05 +00:00
Treehugger Robot
959325e88a Merge "Replace hidden CM#isNetworkSupported() usage" 2021-03-18 02:39:21 +00:00
Peter Wang
66fd9dbad2 Added an option in reset menu in Settings to enable resetting Euicc data
only

Bug: 159650638
Fix: 159650638
Test: Local
Change-Id: Ia260b47a4dd0ddf0363740891b5e1d818c8631b7
Merged-In: Ia260b47a4dd0ddf0363740891b5e1d818c8631b7
2021-03-17 15:47:48 -07:00
Chiachang Wang
d507dc19b1 Replace hidden CM#isNetworkSupported() usage
It's a refactor work for connectivity mainline module. The
hidden methods access is no longer allowed, so the usage for
isNetworkSupported() should be replaced. Settings use it to
check if device support telephony, wifi or ethernet service.
There are alternative methods to check if device supports such
features. Replace as it is.

Bug: 172183305
Test: m ; make RunSettingsRoboTests
Change-Id: I8f1d11558b1be575a0777ed195abe027e838cb74
Merged-In: I8f1d11558b1be575a0777ed195abe027e838cb74
2021-03-17 15:22:40 +00:00
SongFerngWang
2166de23f3 Change the behavior of notifyAllowedNetworkTypesChanged.
Bug: 180903931
Test: atest AllowedNetworkTypesListenerTest.java
Change-Id: Ic94816415920bf25896ef2b198e228f369039c94
Merged-In: Ic94816415920bf25896ef2b198e228f369039c94
2021-03-17 21:20:21 +08:00
Chiachang Wang
eb16ebd14a Replace the hidden ProxyInfo methods usage
The hidden ProxyInfo methods usage should be replaced because
ProxyInfo is moving to connectivity mainline module. Setting
will not be able to access it. Replace the usage with
corresponding APIs.

Bug: 172183305
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiConfigControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiConfigController2Test
Test: manually update proxy from setting and check the result
Change-Id: I59192d0d5d38c833eb83cc930e358a738ebe3d13
2021-03-17 12:47:22 +00:00
Chiachang Wang
b16da1a9ca Replace the way to access StaticIpConfiguration
StaticIpConfiguration is a part of incoming connectivity
mainline module. The hidden variable is not accessible for
module outside. The caller should use getter and builder
to access it. Replace the usage with the formal way.

Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiConfigControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiConfigController2Test
Change-Id: I2ccd427ba19a4ec7df863c38ee0b34cf0be87fa5
2021-03-17 11:30:11 +00:00
Lucas Lin
5ee7a7d07d Merge "Change the parameter type from ContentResolver to Context" 2021-03-17 06:35:21 +00:00
Bonian Chen
49cdb602ea [Settings] Support getSystemService(Class<T>)
Add getSystemService(Class<T>) to align the capability with framework
part.

Bug: 179640862
Test: local
Change-Id: I278951c2402aa8551cee37923f45626ab1830dd3
2021-03-17 13:32:32 +08:00
Bonian Chen
203f0fe89d [Settings] Code refactor - remove unused import lines
Remove some unused import lines within source code based on
https://source.android.com/setup/contribute/code-style

Bug: 182867979
Test: build pass
Change-Id: I76dbcfa9e5b435b2838401dfee15b12f472d07d0
2021-03-16 10:24:24 +00:00
lucaslin
11e738c3a0 Change the parameter type from ContentResolver to Context
Context is more useful than ContentResolver, it can provide more
information if we want to change the behavior in the future.

Bug: 172183305
Test: make RunSettingsRoboTests \
      ROBOTEST_FILTER=PrivateDnsPreferenceControllerTest
Test: make RunSettingsRoboTests \
      ROBOTEST_FILTER=PrivateDnsModeDialogPreferenceTest
Change-Id: I6c06460b67f81112db311f0739457d5f1e2e4554
Merged-In: I6c06460b67f81112db311f0739457d5f1e2e4554
2021-03-16 09:36:12 +00:00
Lucas Lin
159f261889 Merge "Use getPrivateDnsMode() to get the value of private DNS" 2021-03-16 07:39:35 +00:00
Treehugger Robot
56834d2ce3 Merge "Add OWNER to network/datausage/wifi path" 2021-03-15 11:02:28 +00:00
Chiachang Wang
fd1fa9c0a8 Replace the hidden getActiveLinkProperties usage
It's a refactor work to remove the hidden connectivity method
usages outside the incoming connectivity module.

CM#getActiveLinkProperties is hidden and no longer supported
outside the module. Caller should replace it with
CM#getLinkProperties(Network), so replace the usage as it is.

Bug: 172183305
Test: m
Change-Id: I20bcc9da97113da352e43a87d029596c9729cad8
2021-03-15 09:07:48 +00:00