108 Commits

Author SHA1 Message Date
Dianne Hackborn
65bdf4e634 am c58e9bff: am db56b9bd: Merge "Maybe fix #3076572: phone process crashes in SipService, trying to get wifi lock" into gingerbread
Merge commit 'c58e9bff10200daaad6d06d57745edcc33314325'

* commit 'c58e9bff10200daaad6d06d57745edcc33314325':
  Maybe fix #3076572: phone process crashes in SipService, trying to get wifi lock
2010-10-10 19:11:51 -07:00
Dianne Hackborn
ecfd7f7d95 Maybe fix #3076572: phone process crashes in SipService, trying to get wifi lock
WifiService needs to keep the calling identity cleared while
it is doing all of its internal work.

Change-Id: I2bd720e26efcf5ad5839693307d61e51f0658ace
2010-10-08 14:28:02 -07:00
Ficus Kirkpatrick
6fd771b346 Reduce log spam.
Remove the WifiService ACTION_BATTERY_CHANGED log message.

Change-Id: Idfcdf1661f9243a9eb043419490a7138533f3357
2010-10-05 11:28:23 -07:00
Jaikumar Ganesh
7440fc2e0e Wifi: Update code for new BT Apis.
Change-Id: I1deb0a9a1533958cdb79179bebd2d3b435b0b07c
2010-09-28 20:02:33 -07:00
Irfan Sheriff
b974d0c8f2 am 6db64689: am c89dd54c: Remove logging on wifilock acquire/release
Merge commit '6db6468956fa6d71d68e410a532ed7b1bcaecf74'

* commit '6db6468956fa6d71d68e410a532ed7b1bcaecf74':
  Remove logging on wifilock acquire/release
2010-09-28 13:20:43 -07:00
Irfan Sheriff
c89dd54cee Remove logging on wifilock acquire/release
Bug: 3042300
Change-Id: Ia3ce184f53bdd9afee1c78bb9c294af57364f266
2010-09-28 10:13:14 -07:00
Irfan Sheriff
5ee89800be Add Wifi Protected Setup support
Add WPS PBC and WPS pin method support with pin obtained
from AP

Bug: 2277571

Change-Id: I6ff8e447ab8c5e59456a55152588fd4d6386c610
2010-09-23 09:13:34 -07:00
Irfan Sheriff
0859b76471 Make wifi scan async. (don't auto-merge)
When an entity (NLP for example) acquires
a WifiLock and initiates a scan, scan can
get blocked until driver starts.

scan returns no useful info, scan results
are broadcast when obtained.

Bug: 2964633
Change-Id: Iaefc32bb6b82f0718285a18ac600e6bbbb096e77
2010-09-21 12:38:09 -07:00
Dianne Hackborn
c8314b05b4 DO NOT MERGE. Wifi service now blames apps for its wake lock use.
Change-Id: Ic57d8f77527bbfea6a129b8f348fe9108157b4d8
2010-09-20 16:58:41 -07:00
Dianne Hackborn
03f3cb083d resolved conflicts for merge of 1f377298 to master
Change-Id: I0d92abae3a86792b47777f795143acc0489adfe4
2010-09-17 23:12:26 -07:00
Dianne Hackborn
58e0eefeb5 Improve power tracking of WIFI use.
We now distribute "wifi started" time across all apps that are
holding WIFI locks that cause it to be started.  But only when
WIFI would not normally be running.  Also have a mechanism to
distribute other WIFI work that has happened across those processes
based on their use.

Also fixed a bug where we were not retaining the CPU speed step
stats across boots...!

Change-Id: I00e3153b98429166273750512cc37e7975211ab9
2010-09-17 15:14:57 -07:00
Dianne Hackborn
e746f03c6c resolved conflicts for merge of 53686433 to master
Change-Id: I27004dc464f5771d3205ae5757c6eccc5b16854d
2010-09-13 16:56:10 -07:00
Dianne Hackborn
7e9f4eb260 Track client requests through location manager.
This fixes a problem where applications could ask the location
manager to do very heavy-weight things (like...  say... update
location every minute), which would get accounted against the
system instead of the application because ultimately it is the
system making the heavy calls (wake locks, etc).

To solve this, we introduce a new class WorkSource representing
the source of some work.  Wake locks and Wifi locks allow you
to set the source to use (but only if you are system code and thus
can get the permission to do so), which is what will be reported
to the battery stats until the actual caller.

For the initial implementation, the location manager keeps track
of all clients requesting periodic updates, and tells its providers
about them as a WorkSource param when setting their min update time.
The network location provider uses this to set the source on the
wake and wifi locks it acquires, when doing work because of the
update period.

This should also be used elsewhere, such as in the GPS provider,
but this is a good start.

Change-Id: I2b6ffafad9e90ecf15d7c502e2db675fd52ae3cf
2010-09-13 14:20:48 -07:00
Ben Dodson
4e8620f868 Updated documentation for upcoming fix for @code tags
Change-Id: Id7b163179132b9cf180afecb4e9e10ee39bcd415
2010-08-26 14:02:20 -07:00
Irfan Sheriff
d8134ff9d8 Clean up synchronous calls
We dont plan to have asynchronous versions of the existing
synchronous calls since we have added more powerful
asynchronous calls. Remove functionality to check for
synchronous calls.

Also, remove unused sync call for fetching status

Change-Id: I2982cb7b2aabc88a63289d49686a6e3645085263
2010-08-23 15:50:39 -07:00
Irfan Sheriff
fae66c3ab5 DO NOT MERGE Enable all networks on screen on
Connectivity to a disabled network never happens.
An old dhcp issue for example prevents
connectivity again in future. Allow connectivity
on all networks on screen on.

Bug: 2129037
Change-Id: I42afc17ddb5cd238e46d7e50f1b6e708e107b35d
2010-08-20 14:51:00 -07:00
Irfan Sheriff
e498475b18 asynchronous driver commands
Make some of the common driver commands scan/disconnect/reconnect/reassociate
asynchronous. We already have broadcasts to indicate results.

Change-Id: I343c6be077fb11a3d488e586ab10ab2373b269d8
2010-08-19 12:23:13 -07:00
Irfan Sheriff
6118069b1d Fix WRITE_SECURE_SETTINGS permission issue
The refactor with the new state machine had introduced
a bug with writes to secure settings in public API for
which apps might not have permission.

Bug: 2895750
Change-Id: I7d236253201a47b836996859aa3de2806ad8a800
2010-08-18 16:07:39 -07:00
Irfan Sheriff
8c11e95230 DO NOT MERGE WifiLock extensions for high performance mode
Add extension to WifiLock to allow apps to operate
in high performance mode (high power & disable suspend
optimizations for battery consumption).

Bug: 2834260
Change-Id: I8b33d307f3d569bc92ba2139b9ed224ffc147547
2010-08-17 15:27:54 -07:00
Wink Saville
c7a98341b0 Add documentation to NetworkStateTracker and a small change to the API.
Also, removed some unused NetworkStateTracker event codes.

The API change was to add context and target to startMonitor, this makes
it easier to document what the actual interface contract is.

Change-Id: If9b52486c3c281fe4794bc78417c8b03888414b1
2010-08-13 16:11:42 -07:00
Irfan Sheriff
e04653cbd0 Asynchronous API
Add asynchronous API for simplified connect, save
and remove.

Add a SUPPLICANT_CONFIG_CHANGED_ACTION broadcast to
notifiy a supplicant configuration change.

Change-Id: I69ae116246094de4a469cb2af5baf37e5ad4d6dd
2010-08-12 07:57:36 -07:00
Irfan Sheriff
0d25534fed Split WifiStateMachine from WifiStateTracker
Notifications handled in WifiService. WifiStateTracker tracks
state for connectivity service

Change-Id: Idb0cf494898d28712af0f95f9e60c5417cd4a053
2010-08-10 15:18:25 -07:00
Irfan Sheriff
a2a1b911a3 Refactor WifiStateTracker
Implement WifiStateTracker as a HSM.

Change-Id: Ic12fd78f1f183b5c4dea8ad2301002267ceff0cb
2010-07-27 11:59:29 -07:00
Irfan Sheriff
30683b2ad0 am 53dca61f: am 9005e7f4: Merge "Add setWifiApConfiguration interface" into gingerbread
Merge commit '53dca61f26f4ff348418add60599213297acc899'

* commit '53dca61f26f4ff348418add60599213297acc899':
  Add setWifiApConfiguration interface
2010-06-25 19:53:34 -07:00
Irfan Sheriff
17b232b5b5 Add setWifiApConfiguration interface
Bug: 2538623
Change-Id: I779044173a2fa0e9b851ea92aeec5ca25eb9c86f
2010-06-24 20:03:38 -07:00
Robert Greenwalt
14f2ef4c9d Move the net transition wakelock to ConnService.
When the default network goes down we lose the wake-on-incoming-data capability
until the new net is brought up and apps rebuild their connections.  We fixed this
in Wifi, but it's a general connectivity issue, not a wifi issue so moving the
mechanism to connecitivty so other networks can use it.

bug:2734419
Change-Id: I39b5d825eb6b548bd9bb8f179b89254f4db53147
2010-06-16 11:04:37 -07:00
Irfan Sheriff
afadc8b4e1 Dont persist config on failure
If soft AP bring up does not go through successfully,
dont persist the config. This has the benefit of recovering
from the case where things fail on "=" and "," for SSID since
the IOCTL parsing in driver on broadcom cannot handle it
at this time.

Change-Id: Iaa60fd05972db434500753dcb59092995dab07b1
2010-06-11 14:43:14 -07:00
Chung-yih Wang
047076d170 Make the SSID field of WifiConfiguration consistent with API description.
Bug id http://b/issue?id=2684571

Change-Id: I809478991ba606252d69ef007339754ab2856416
2010-05-15 11:03:30 +08:00
Irfan Sheriff
b2e6c01f44 Disable tethering when airplane mode is enabled
Tethering should be disabled when
airplane mode is enabled. Additionally,
we should restore Wifi (if it was on
before tethering was enabled) when
airplane mode is disabled.

Bug: 2567099
Change-Id: Iba2031f5ecb207954fd155c47134b39ed0167fa0
2010-04-06 10:35:27 -07:00
Irfan Sheriff
60e3ba071d Dont start wifi if in airplane mode
Now that wifi start is asynchronous
at the time of bring up, make sure
Wifi is not started if in airplane
mode.

Bug: 2567652
Change-Id: I947b7c8480029973bcbf028f6143aabbc88c9793
2010-04-02 12:43:04 -07:00
Irfan Sheriff
59610c041a cherry-pick d4f3958bde05d04f97e0a4054d2a6185989d99f3 into Froyo
Setting the allowed channel count in the
driver can take a long time to potentially
cause ANR in the phone process. Make the call
asynchronous

Bug: 2555117
Change-Id: Ie3c2e6f90aa0ec8ee4b85c989ccae1ca0f2b94f9
2010-03-30 13:37:00 -07:00
Irfan Sheriff
b99fe5e622 cherry-pick 288b4ac94571e6f77036831708e7bb7c31874688 into froyo
Killing the WifiWatchdogService thread from
WifiService can cause messages to be handled on
a dead thread. Quit the thread on the broadcast
instead.

A couple of more fixes:
- Do an asynchronous bring up of Wifi. This will
allow WifiWatchdogServiceThread to be immediately
brought up, instead of relying on an update.

- There is no need to listen on supplicant connection
in wifiwatchdog anymore. We kill the thread when
supplicant connection is no more.

Bug: 2546756
Change-Id: I15a188e031bc79856c55aabdd271287b0df0377d
2010-03-29 12:02:44 -07:00
Irfan Sheriff
a3bd409a0a settings variable for wifi saved state
We add a variable for saving wifi state
to restore after tethering.

Bring up wifi on boot up if the state indicates so.

Bug: 2537983
Change-Id: I9c6548b93df6fcbc0cec1e6b857f7224dc6d1b2c
2010-03-25 15:10:34 -07:00
Robert Greenwalt
bfb7bfa538 Update Framework to support multiple dhpc ranges
Previously we only supported a single range - this was inadequate for
multiple interfaces.  Adding a second range so we can support
both usb and wifi tethering.

Also moving out of the zero-conf range as our dhcp client won't
accept ip addrs in that range (no nexus to nexus wifi action).

bug: 2537963
bug: 2533491
bug: 2538303
Change-Id: I600b421343c28c2f9839ed2076122ae3d0ff5d3d
2010-03-25 14:46:13 -07:00
Irfan Sheriff
f91444c5e1 Disallow tethering disable by Wifi
Disallow Tethering being disabled by Wifi
and vice versa. We now need to explicitly
disable tethering to enable Wifi.

Bug: 2539071
Change-Id: Id34a5335e70cb7234367b4709882937a4b8cc526
2010-03-24 18:01:57 -07:00
Irfan Sheriff
3bf504df9f Fix WakeLock issue for driver stop
Due to message removal, wakelock could be held forever.

Do a timer only based wakelock release until we do this
more cleanly in ConnectivityService for later release.

Also, add an optimization to prevent use of wakelocks when driver is
already stopped.

Bug: 2529883
Change-Id: Ia1c2ddd44213ef3aa609855613bf155945bef8e4
2010-03-24 17:59:42 -07:00
Irfan Sheriff
80cb598599 Fix wakelock
Bug: 2413908
Change-Id: Ic7f2efa94b0ad1c561db0ffab8c531d19e6c235e
2010-03-19 12:59:11 -07:00
Irfan Sheriff
c2f54c267b Clean up changing AP configuration
Bug: 2527293
Change-Id: I35e82e24e27349e2966f88189ebca4246ad1a354
2010-03-18 16:02:56 -07:00
Irfan Sheriff
1a543010e5 Dont disable AP for tether failures
Bug: 2524514
Change-Id: I8a59e717c5b36b83adbed43184fd45d7cbfedd9a
2010-03-18 11:44:48 -07:00
Irfan Sheriff
9ab518ad79 softAp framework changes
Remove AP persist settings
Add new netd interface
Handle errors
Handle AP config change
Bug: 2413908
Change-Id: I31a1221ef5479da8d4a2620f0f0ee0b62539bc69
2010-03-16 19:54:17 -07:00
Irfan Sheriff
44113ba31a Remove reload config for priority change
Bug: 2467689
Change-Id: Icd3bb17f5b794282219dd410cb56888d10130281
2010-03-16 15:57:09 -07:00
Irfan Sheriff
7b00978dc7 Run WifiWatchdogServiceThread only on wifi enable
Bug: 2508997
Change-Id: Ib79ee25fcc8e39e9a1d6c5b9ef9681bc00b6d006
2010-03-12 13:16:47 -08:00
Irfan Sheriff
0f34406009 Clean up native access from framework
Driver commands should be issued when driver has started.
Supplicant commands should be issued when Wi-Fi is enabled
Bug: 2339709
Bug: 2371609
Change-Id: I9ba6ddfa0cf4c4b8ca049b0eb7eaaa8edb42bad1
2010-03-10 16:42:23 -08:00
Irfan Sheriff
a8fbe1fb74 Re-organize access to native interface through WifiStateTracker
Bug: 2339709
Change-Id: Ibb2eeb09b83dc24897116ea15a9016f81a08d442
2010-03-10 08:28:08 -08:00
Christopher Tate
4528186e0d Refactor android.backup => android.app.backup
Change-Id: I0b21316ff890d7f3c7d4b82837bb60670724c2e8
2010-03-05 16:27:15 -08:00
Irfan Sheriff
5321aef4a2 Wifi AP framework changes first pass
Bug: 2421638
Change-Id: Ic5ea8f7560a7fe5e1b0769daa5d92cc33eefc692
2010-03-04 16:07:14 -08:00
Joe Onorato
8a9b22056b Switch the services library to using the new Slog 2010-03-01 13:06:50 -08:00
Irfan Sheriff
102d05fa91 get DHCP IP on each connection
The IP state was not being refreshed when the supplicant transitions
from COMPLETED to ASSOCIATED to COMPLETED. This can lead to
a connected state with no real connection due to old IP settings.
The fix refreshes IP on each connection.

Bug: 2329261
Change-Id: I38cd56369ee2d8ab3e0f06f5c9f5712b9b2f35a0
2010-02-10 15:22:58 -08:00
Chia-chi Yeh
784d53e79b WifiService: allow EAP variables to be unset using empty strings. 2010-01-29 16:26:28 +08:00
Irfan Sheriff
cd7703712e Avoid wifi disable in a UNKNOWN state
Multiple broadcast receiver unregister calls cause exception.

Bug: 2361335
2010-01-12 14:53:44 -08:00