Commit Graph

61 Commits

Author SHA1 Message Date
Michael Groover
911f7e7aa9 Add unaudited exported flag to exposed runtime receivers
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
2021-12-09 20:34:02 -08:00
Bonian Chen
234b698fb2 Revert "[Settings] Support getSystemService(Class<T>)"
This reverts commit d5ccde31a8.

Reason for revert: failure on test cases

Change-Id: I0a179a6ebb5ef1dec566ce6e8facd5f3b82d7c8a
2021-03-30 00:51:15 +00:00
Bonian Chen
d5ccde31a8 [Settings] Support getSystemService(Class<T>)
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
2021-03-24 00:59:46 +08:00
Pavel Grafov
25054ba36d Stop disabling wifi toggle when tethering is restricted
When an admin disallows the user from configuring tethering, the
user should still be able to configure wifi.
When an admin disallows wifi configuration, the behavior is
unchanged: the toggle stays enabled and allows the user to turn
wifi on and off, but clicking on the text results in admin
transparency dialog, so the user won't be able to change wifi
config.

Bug: 149481093
Test: manual with TestDPC as the device owner
Change-Id: I6b33e43901454125c7f3f4dd3c70f050997e4e71
2020-04-17 15:06:43 +01:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Philip P. Moltmann
e3f721132a RestrictedLockUtils was split into ...Internal
This means that in some cases RestrictedLockUtils has to be used and in
some RestrictedLockUtilsInternal.

This causes a lot of trivial code changes.

I also updated the ordering of the imports in all affected files.

Bug: 110953302
Test: Built
      make -j RunSettingsRoboTests
Change-Id: I9bdf8b89134f853bae4f38c81af436715c73e924
2018-08-30 08:11:39 -07:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Salvador Martinez
188af9439e Make it so client code does not tie tether to wifi
The wifi service already handles turning off tethering if
multi-interface is/isn't supported. We don't need to do tie wifi
and tethering stuff together in the UI.

Test: robotests still pass
Bug: 79213401
Change-Id: I699dfe2d7646f248a54faa5a8429176697614cdf
2018-05-10 13:36:08 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Fan Zhang
01cfb9d8c5 Remove wrapper for ConnectionManager/IPackageManager
Bug: 76167422
Test: robotests
Change-Id: I5f051b0ce58b97a3cfd5d4bae469463dcd6d83ac
2018-04-02 17:09:10 -07:00
Leif Hendrik Wilden
28dee1f086 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: I70a6e76cc8440547746ecc008c32bd06a7de8161
2018-01-24 12:30:39 -08:00
Leif Wilden
cab0ee611d Revert "Migrate to use instrumentation classes from settingslib."
This reverts commit 1546cca529.

Reason for revert: Broke fingerprint setup flow. b/72267201

Change-Id: I8321265ae64732c526325882ddea51080decddf5
2018-01-22 20:57:36 +00:00
Leif Hendrik Wilden
1546cca529 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: Ie5515bb0fe3e621fc7723a9b04ba23e4bfa9c401
2018-01-18 11:13:24 -08:00
Doris Ling
dee1a22c45 Consolidate all wrappers used for testing.
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.

Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
2017-09-14 18:24:49 -07:00
Doris Ling
f38ed2fbb2 Remove call to WifiManager.setWifiApEnabled().
- replace it with ConnectivityManager.stopTethering() instead.

Change-Id: I112863b1be37c0fef5d59c16d73f0c6cf71c6dea
Fix: 62191978
Test: make RunSettingsRoboTests
2017-06-05 23:00:46 +00:00
Stephen Chen
19b74d9213 Improve responsiveness of toggling wifi and refactor user restriction logic.
Moved logic for handling wifi state changes into correct listener
method. Changed logic for handling isUiRestricted. This should
streamline toggling flow for WiFi both when Wifi Scanning is on and off,
and in guest mode.

Bug: 36724409
Bug: 36711085
Bug: 36398321

Test: make, test cases in tracking bug
Change-Id: I69fe07369db192c94f81dd678087ac4e8c35197b
2017-03-31 15:47:43 -07:00
Stephen Chen
a82c048e12 Do not disable toggle when Wi-Fi is enabling and disabling.
The toggle disabling of Wi-Fi in its ENABLING and DISABLING states
are not in sync with the loading of access points, and so removed
the disabling entirely.

Bug:34287227
Test: manual inspection.
Change-Id: Ibcb401eaaa34be79e1e73a947b2ea845cca79996
2017-03-28 17:20:41 -07:00
Matthew Fritze
5c83cfa278 Remove Index.java from old Search and its dependents
Test: make RunSettingsRoboTests
Bug: 35763944, 36192909
Change-Id:  If216e1eeb4c29e7372720c6228fa4e99ea2a9904
2017-03-17 14:26:05 -07:00
Doris Ling
c4c9f4d50e Update Network & internet->Wi-Fi to use MasterSwitchPreference.
- Add a preference controller for Network & internet->Wi-Fi to control
  the preference toggling and summary update.
- Refactor WifiSettings and WifiEnabler to share code between the new
  wifi preference controller and the wifi setting.
- Refactor BluetoothSummaryHelper to have a common base class with the
  WifiSummaryHelper.
- Rename the summary helper to summary updater.

Bug: 34280769
Test: make RunSettingsRoboTests
Change-Id: I00ebfc161bcef89331bb41ba405ed8cb8232d248
2017-01-25 10:43:01 -08:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Stephen Chen
d9e2c946af Add subtypes to tron logging for Wifi toggles.
For ACTION_WIFI_CONNECT, added subtype to specify whether user is
connecting to saved network.
For ACTION_WIFI_OFF, added subtype to specify whether user was connected
to a network at the time.

Bug: 32371451
Change-Id: I1d4445bda2fbeb062831e6f858ccc711bff65105
Fixes: 32371451
Test: Verify logs by running:
adb logcat -b events | egrep '(sysui_|notification_)'
2016-11-01 13:18:55 -07:00
Fan Zhang
aa71afe597 Use MetricsFeatureProvider for logging in Settings.
Bug: 31664539
Test: make RunSettingsRoboTests for regression
Test: adb logcat -b events | egrep "(sysui_|notification_)" for
      verifying log

Change-Id: Id944be7c4ff9911aebee481c2df485542f1318f0
2016-09-23 08:37:37 -07:00
Zoltan Szatmary-Ban
3f6208170d Apply policy transparency to HotspotCondition and WiFi settings...
...when there is an active hotspot and user restriction for disallowing
tether config is in effect. This is to avoid getting security exceptions
from WifiManager when engaging with HotspotCondition or Wifi enable switch.

Bug:27936528
Change-Id: Ib3324e853277c177966b55668758d349ffe6ecf5
2016-04-15 16:13:27 +01:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Chris Wren
f22e8c4c2e log wifi actions from settings
To start:
  enable
  disable
  forget
  connect
  add

Depends-On: I60163e44602b8e23b643b9103c324fa0e0d2c4c4
Change-Id: I52f40298db63f410ced2dbf5ba05d3ad098a85a2
2015-03-30 14:33:27 -04:00
Jason Monk
fc1b00cfe4 Move some wifi tracking code to SettingsLib
Move tracking of which networks are available/saved and their state
over to SettingsLib to share it with Quick Settings.

Bug: 19180466
Change-Id: Iaeef06b26da8cb38e1ba09a7d105d04d499dc181
2015-02-04 20:40:32 +00:00
PauloftheWest
4da0e819ee Fixed a Settings crash when exiting Wi-Fi Settings.
Bug: 17600287
Change-Id: Id2d35e450798785db8e485972036483946f67ef3
2014-09-22 15:12:13 -07:00
Vinit Deshpande
e2c1d504fc Fix automatic Wi-fi toggle
It is happening because there previous view doesn't disconnect
itself from setting change; and then two views alternatively
enable/disable wifi.

Bug: 17157005

Change-Id: I42916a7bbd735960a26efbae670c9b927ec8574d
2014-09-15 20:18:35 -07:00
Fabrice Di Meglio
92239ed799 Fix bug #15890188 wifi toggle on-off switch missing after skipping setup wizard
- remove any reference to the Switch and use the SwitchBar API instead
- set the initial state of the SwitchBar depending on the WifiManager

Change-Id: I556bf8a007892c057edf7c6c144f71b2dcfe4f99
2014-09-05 14:08:58 -07:00
Fabrice Di Meglio
204521626f resolved conflicts for merge of f9360dbc to master
Change-Id: I2e468d83a7ce5200c59f63b4362e7bee10d0a2eb
2014-06-12 15:46:41 -07:00
Fabrice Di Meglio
138ff8c045 Make the SwitchBar appear immediately
- change the way the SwitchBar is shown and hidden
- save its state
- remove the delay transition code

Change-Id: I07260430e6709b42517ca011f6d3c3446a626731
2014-06-12 11:13:23 -07:00
Fabrice Di Meglio
c75417a758 Fix bug #15170508 When I initially load settings, all on/off toggles
...start in off position then move to on after pane loads

Another look at this issue.

- start the Switch as View.GONE and make it View.VISIBLE when
the Wi-Fi state is defined.

Change-Id: I2f3077f779fc4030b2ba9ff3b21be8148add33c3
2014-05-28 11:43:13 -07:00
Fabrice Di Meglio
00b5e6b247 This CL is not working (even after careful testing) but when I tried I was not completely ToT.
Revert "Fix bug #15170508 When I initially load settings, all on/off toggles start in off position then move to on after pane loads"

This reverts commit 1e52db8063.

Change-Id: I73bdfeba4a4b3e993e37cdae1e3733ffe272b9eb
2014-05-28 17:36:37 +00:00
Fabrice Di Meglio
1e52db8063 Fix bug #15170508 When I initially load settings, all on/off toggles start in off position then move to on after pane loads
- refactor all the code that was using the Switch to control it thru the SwitchBar
- start the Switch as View.GONE and make it View.VISIBLE when it is set
as "enabled" or "checked" so that you dont see the Switch transition (it shows
only with it final state)

Change-Id: I382076bf3c819c530b5b2c06ca2429dfb2cdc6bf
2014-05-27 17:01:10 -07:00
Fabrice Di Meglio
4193776698 Introduce SwitchBar widget
- SwitchBar is a LinearLayout that containts a TextView and a Switch and
is intended to replace all Switches that are put in the ActionBar as a
custom view
- use the new SwitchBar for WifiSetting only for now (a later CL will
take care of all the other Setting that are using a Switch in the
ActionBar)

Related to bug #14898161 On/Off switches must move down from Action Bar

Change-Id: I5e98dbe995bba8f440d08459e09ca3ac09d3464b
2014-05-14 16:42:06 -07:00
Fabrice Di Meglio
da0e6ff8c2 Force Search Index rebuilding for Wifi remembered networks
... when the WiFi swich will be toggled on/off

Change-Id: Iea93819e4c473aafc6aaedf6abb723969dbc9e52
2014-04-21 11:24:33 -07:00
Fabrice Di Meglio
784f266cbd Better decoupling of Index updates in WiFi Settings
- use a Handler

Change-Id: I1e35f2e437021001900468d0df2b75e53b8c62f6
2014-04-21 10:57:07 -07:00
Fabrice Di Meglio
490099b135 Allow partial Index rebuilding thru updateFromClassNameResource(...)
- add a new boolean parameter to ask for Index rebuilding:
passing "true" will delete first all the data corresponding to the
"className" and then apply the update.

Change-Id: Ifc42fc560a14f5470b466cf6982915d9207fa3c7
2014-04-14 13:31:14 -07:00
Fabrice Di Meglio
d25314d330 Settings - update for new UI (no more Drawer)
- follow the UX spec by no more using a Drawer
- the Dashboard is now a Fragment that contains the list of Headers
- the search results are also put into a Fragment that is replacing
the initial one (Dashboard or other) when expanding the SearchView
- use a SearchView for query input
- when tapping on a Header or a Search Result, re-launch Settings as
an Activity so that we are benefiting from the Activity stack for
UP affordance and BACK button
- manage UP affordance to show it only when needed
- move some Actions to the Menu in the ActionBar for allowing space
to the Search action and removing some clutter
- fix an issue with the Index and WiFiEnabler and their cached Context
that was not updated when there was a Configuration change
- simplify the SettingsActivity code by extracting some inner classes

Change-Id: I50b5f77bb44a7fade1886114dbbc820609a5e63d
2014-03-28 15:51:29 -07:00
Fabrice Di Meglio
5f3442af6f Use SearchIndexableData enable state for WiFi Settings
- same as for Bluetooth
- now the remembered WiFi networks names can be indexed when
WiFi is turned on

Change-Id: I904ce6a425c21ee07ce3ee8fdc0cd71ab5a18d12
2014-03-21 13:50:25 -07:00
Robert Greenwalt
7a2466b511 am 50702355: am 5d3ef571: am a1454529: Merge "Dont enable Wi-Fi if it\'s not toggleable in flight mode"
* commit '50702355f23d5e270727018c2af7cc76a1bd91eb':
  Dont enable Wi-Fi if it's not toggleable in flight mode
2013-06-28 10:48:40 -07:00
Robert Greenwalt
5d3ef5715c am a1454529: Merge "Dont enable Wi-Fi if it\'s not toggleable in flight mode"
* commit 'a1454529c3eb6d0e87b254888abfea3bb714f7fe':
  Dont enable Wi-Fi if it's not toggleable in flight mode
2013-06-28 08:06:25 -07:00
Johan Redestig
2acaf22ad1 Dont enable Wi-Fi if it's not toggleable in flight mode
Dont enable Wi-Fi if it's not toggleable in flight mode
by restoring the return which was removed by
e78c187905

Change-Id: I8ca5a3e9b3f36f148f08ce97b8a2b854bf7de21c
2013-06-28 10:37:07 +02:00
Dmitry Shmidt
70c35ef071 Disable On/OFF switch before action
Bug: 8715336

Change-Id: I3d4b05ae9dfe109af0b9b06340d52004b73ad0f4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-05-20 17:39:24 -07:00
Robert Greenwalt
7e59f73e9c Remove wifi scan-always dialog.
When wifi is switched off we no longer want a notification dialog
about scan-always, instead using in-panel text.

bug:8907190
Change-Id: I707f306a056068d92f69070873f1e6330b598b1e
2013-05-13 11:39:08 -07:00
Irfan Sheriff
c591a8b95d Add reminder about scan settings on wifi off
Notify the user that scans will be available when
wifi is turned off

Bug: 8732391
Change-Id: If232bfb9f6c3976059bde11280318901c35161e7
2013-04-29 09:42:22 -07:00
Jeff Sharkey
860eceba2c More migration to Global settings.
Bug: 7375796
Change-Id: I43079368c32e91e8bb75b00377cd57d1766f15d4
2012-10-18 15:38:42 -07:00
Irfan Sheriff
b1c0e0b1c9 Fix settings handling of wifi events
When wifi events come out, settings has to change the switch state.
Changing switch state causes settings to also enable/disable wifi which
gets into a loop when there is a driver hung event.

Fix to only send framework calls when a user has changed the switch
settings

Bug: 5271322
Change-Id: I0a7d03a3fe0f28622de05981e5f72a9a8814b2d2
2011-09-15 19:11:29 -07:00
Gilles Debunne
e78c187905 Settings refactoring
Wifi and bluetooth pane refactored, main toggles moved to left pane.

Change-Id: I42ea4cf3bdf24158f3c67e0dea311258206cd78a
2011-06-21 11:05:29 -07:00