- If Wi-Fi tethering is enabled or enabling, avoid to startTethering again.
- If Wi-Fi tethering is disabled or disabling, avoid to stopTethering again.
- Add more logs to know which module stopped Tethering.
Bug: 230457055
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSwitchBarControllerTest
Change-Id: I51d42ac0117d935ecaa9fa7312acc646b43d3593
- Filter out unnecessary onSwitchChanged callbacks when the switch is
disabled, which should not be triggered by user input.
- Refine the state handling function to avoid unnecessary
onSwitchChanged callback.
- Refine the error handling of isHotspotPasswordValid function.
Bug: 227719584
Test: manual test
make RunSettingsRoboTests \
ROBOTEST_FILTER=WifiTetherSwitchBarControllerTest
Change-Id: If62aaadc8ddb214769b1367d7801b6125bb5377c
- The Wi-Fi hotspot switch only handles the click event from the UI.
- Use the onSwitchChanged callback to handle click and swipe events.
Bug: 218891956
Test: manual test
make RunSettingsRoboTests \
ROBOTEST_FILTER=WifiTetherSwitchBarControllerTest
Change-Id: Ie4136443845489be295a8ee0f3058f493a3b5829
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting T or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. This commit updates all the exposed receivers
with a new RECEIVER_EXPORTED_UNAUDITED flag to maintain the existing
behavior of exporting the receiver while also flagging the receiver
for audit before the T release.
Bug: 161145287
Test: Build
Change-Id: Ie97372efebd8258d9a4c503771d55109a85e6ae9
Add getSystemService(Class<T>) to align the capability with framework
part.
This is a back port from aosp/1639943, aosp/1645152 and aosp/1648047
Bug: 179640862
Test: local
Change-Id: I035db55a71f94000ca35f8d71f03c19208423c73
To log Settings metrics, the MainSwitch extends MainSwitchBar and
replace the SwitchBar in SettingsActivity.
Bug: 175181773
Test: Run robotest and apply the widget in Settings and see the ui
Change-Id: I3add3702e9058ad9192b5172c7cf0e2ccfb55a70
Change wordings in data usage part into inclusive language.
Bug: 160707804
Test: make RunSettingsRoboTests
Change-Id: I713e52df8201413b884257a51bc1f71a0d43179d
In the current Settings framework onSwitchToggled has been implemented
to monitor the change in Settings done by user but its getting called
even when Settings is changed using setChecked where under certain
condition like rotation during config changed,
Tether Settings is disabled and then enabled and later before Rotation
Settings remained false due to stop Tethering with Tether Enabled
After Rotation when settings is initialized it is set as disabled
and even after receiving the Tether Enabled it remains Off.
Hence used onClick to monitor user ON/OFF Settings
Bug: 142625203
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSwitchBarControllerTest.java
Test: Manual
1. Go to Wifi Hotspot Settings
2. Turn ON
3. Change SSID and save
4. Rotate screen soon after saving
Result: Hotspot does not turn ON, remains in OFF state.
Signed-off-by:JeiFeng Lee <linger.lee@mediatek.com>
Change-Id: Ibddacdf35eb3196f40cdb2c240efa902f9123646
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
This reverts commit 81ca3dd4c0.
Reason for revert:
This breaks carrier requirement to show error dialog/roaming warning.
Will make an entitlement app change to suppress the progress dialog
so that if the entitlement check succeeds no dialog will be shown
in most cases.
Bug: 78680359
Change-Id: I98d2aa5cc676308b1e2d16bf877dc6878a7bf4cb
The toggle in the tether page currently tries to start tethering if
it gets turned on. However, changing a wifi config can cause
startTether to be called and also the toggle to switch leading to
a double call to startTether. This CL makes it so that if we are
already connected to tethering we don't try to start it again.
Test: robotests
Change-Id: I91085244c5d1fcc245a6b6480e638a32bc14f0ac
Fixes: 78028548
Fixes: 78441216
Fixes: 74368363
Wifi Tethering is already turned off when appropriate. However
if you re-enable it you still can't toggle the tether switchbar.
This CL makes it so that if you disable data saver the toggle
becomes enabled again.
Test: robotests
Bug: 77860936
Change-Id: I03fa74c21674678a90cde7bd20fa68167f02ae3c
We no longer want this dialog to show when a user toggles tethering.
Failures to set up the AP will still be handled correctly.
Test: robotests pass
Bug: 62629055
Change-Id: Id3d0bf9694a1c8b6ae353bfd6634dd0b56813497
Add real callback instead of using NoOpCallback. When it fails,
reset the switchbar.
Change-Id: I6f87d7cefa67ff8f9f59a815fd976940fb61c06c
Fixes: 72904303
Test: RunSettingsRoboTests
Before this cl, the update of toggle depends on BroadcastReceiver.
However it is not called when toggle is inited, which make the toggle in
broken state sometimes.
This cl make it execute the update method in constructor, so toggle can
get the correct state when it is created.
Fixes: 73718975
Test: RunSettingsRoboTests
Change-Id: Icb798afaff0bdeedad3a966315441712be2e2523
In previous code there are two main issues:
1. It listens to update from both WIFI_AP_STATE_CHANGED_ACTION and
ACTION_TETHER_STATE_CHANGED. It is unnecessary because they provides
same info(whether wifi hotspot is enabled, enabling...)
2. New API softApCallback already covers the
WIFI_AP_STATE_CHANGED_ACTION, so we don't need this broadcast anymore.
This cl fixes those two issues by cleaning up BroadcastReceiver and
update the tests.
Bug: 72702183
Test: RunSettingsRoboTests
Change-Id: I21c2818e0f0185172f34447a1716dc47ee065e23
The preset initial state helps eliminating animation jank when first
landing on the page.
Change-Id: Ia7ba83983f18409b1c653cc1ebb0f3aad281358c
Fixes: 64811322
Test: robotests
- Make hotspot password show in plain text
- Make main control into a master switch style
Change-Id: I8fdb293a617787f256fb663708cfc0e454f548d2
Fixes: 63865785
Test: robotests
- Deprecated WifiAPEnabler, and copied most of its logic into various
controllers and WifiTetherSettings.
- Added tests
Fix: 37253404
Fix: 36181835
Test: make RunSettingsRoboTests
Change-Id: Iad994d61b694ad7f1113d045a3e7500eeaec178b