30191 Commits

Author SHA1 Message Date
Roshan Pius
718df42b23 IpConfigStore: New constructor to accept writer
Add a new constructor to accept a DelayeDiskWrite object from the
caller.

BUG: 27293150
Change-Id: I13fb86c76ee5a0d05b45fec0c42b7e1b2233ee76
TEST: `runtest frameworks-wifi`
2016-02-22 17:13:47 -08:00
Erik Kline
111d55658b Add WaitForProvisioningCallback
This centralizes code that is shared by both bluetooth and ethernet
transport layers.

Bug: 26991160
Change-Id: I8e2dd8580c29c86394119768e3a5529850b4b859
2016-02-22 13:02:02 +09:00
Erik Kline
d0e843b8ef Support setting TCP buffer sizes and HTTP Proxy config
This allows IpManager to send callback recipients a more satisfying
LinkProperties.

Bug: 26991160
Change-Id: I2eb60dc633e5be38dad9410a1096d0095ddf57a0
2016-02-22 12:50:44 +09:00
Lorenzo Colitti
d2457a3ee3 Add a MessageUtils class to convert int constants to strings.
This class uses reflection to find accessible static integer
members in a specified list of classes and returns a SparseArray
mapping the integers to their names. This will allow us to
replace various 400-line switch statements with a simple
array access.

Change-Id: I3607e6389a423cde0bd83270c00b3c863ae1bb29
2016-02-19 10:26:55 +09:00
Erik Kline
efa4209fe0 {,Base}DhcpStateMachine is no more
Bug: 26991160
Change-Id: I21f8c30627bf2a7fbcd5b4d5f1f1ad1a2dda759b
2016-02-18 12:56:45 +09:00
Erik Kline
29a215268d Remove references to BaseDhcpStateMachine and DhcpStateMachine
Bug: 26991160
Change-Id: I3742780a4e5121c163d9d1380951e25edaba19f3
2016-02-17 21:44:25 +09:00
Erik Kline
b1ee39540e Add IpManager#shutdown() to terminate the state machine.
Additionally, remove IpManager.Callback#usingIpReachabilityMonitor()
now that this is now longer used.

Bug: 26991160
Change-Id: I9a17497c82238a9fb37a20d01aeca7bc4913ae2c
2016-02-17 20:54:10 +09:00
Erik Kline
93b1a36e31 Add IpManager.ProvisioningRequest class
This class captures provisioning request parameters to be passed to
IpManager#startProvisioning().

Bug: 26991160
Change-Id: I56652bbc4b9ae6cfca3f225a8d99cdfc01bb54d9
2016-02-16 18:11:47 +09:00
Erik Kline
3b74289fdf Duplicate DhcpStateMachine public constants into DhcpClient
This is so we can ultimately delete DhcpStateMachine altogether.

Bug: 24837343
Bug: 26991160
Change-Id: If116639e5f72c97cfc67f748dc5f6433dccd9cf0
2016-02-12 17:10:15 +09:00
Erik Kline
ef1f39abff Use IpManager.ifname as the tag in log messages.
Bug: 26991160
Change-Id: Idc9231819298b65da3cc3baa88f1f0cd18ab6df7
2016-02-11 21:07:07 +09:00
Erik Kline
990fc4968d Incorporate historical WifiStateMachine notions of provisioning.
Also: considerably expand logging capabilities.

Bug: 26991160
Change-Id: I36c3c1d2158ffd178e8ce163b8799d62938f39c7
2016-02-11 03:21:48 +09:00
Erik Kline
106cdf6c94 Expose measurement results to interested callers.
With this it's possible for callers to:

    Network network = ...
    LinkProperties lp = ...

    NetworkDiagnostics netdiag = new NetworkDiagnostics(network, lp, 5000);
    netdiag.startMeasurements();
    netdiag.waitForMeasurements();

    boolean result = true;
    for (Measurement m : netdiag.getMeasurements()) {
        if (!m.checkSucceeded()) {
            result = false;
            // Additional error handling here.
        }
    }

    return result;

Bug: 21832299
Bug: 26780890
Change-Id: Iaf7ff029e2c6a998b574c23d0dcde8d57a467a22
2016-02-11 00:28:27 +09:00
Paul Jensen
5f3dec374f Fix FrameworksServicesTests.apk to include libc++.so
libc++.so is no longer accessible to the app, so it must be
bundled in the app. This should get ApfTest passing again.

Change-Id: Ide004cb84f7f50feffb8f5acb46b7001dcffd208
2016-02-07 21:58:09 -05:00
Paul Jensen
514a3bfde6 Fix FrameworksServicesTests.apk to include libnativehelper.so
libnativehelper.so is no longer accessible to the app, so it must be
bundled in the app. This should get ApfTest passing again.

Change-Id: Ie4fe66e44d46ddb12b3c7ac5c91118a69a8ebe2e
2016-02-04 09:11:40 -05:00
Paul Jensen
44307adcf3 Merge "Android packet filtering program interpreter test & program generator" into mm-wireless-dev 2016-02-03 16:48:43 +00:00
Paul Jensen
d38fb7662d Android packet filtering program interpreter test & program generator
Change-Id: I17951bd6320b9eb3b6c43f2ae37f62c2025705c1
2016-02-03 10:19:13 -05:00
Erik Kline
6076cb0b85 Ignore link properties updates when nothing actually changed.
Change-Id: Ia3c0a652cb3b67707a5c5a0bb40f991ef1e6f777
2016-02-03 22:42:54 +09:00
Erik Kline
8deac7793c Partial unification of DHCPv4 and static IPv4 configuration codepaths
Change-Id: Ic796f9b7bb853a332175c34e0f557588efb6247a
2016-02-03 22:42:53 +09:00
Erik Kline
8afa558c52 Move DHCPv4 mechanics into IpManager
Bug: 17345682
Change-Id: I2c3d9d665ff3c38f02084c0cf86cd76035e7b0aa
2016-02-03 17:23:45 +09:00
Erik Kline
1e91e4ebb6 Support static IP configuration internally
Also, stop passing around "reason" for IPv4 provision success
or failure.

Bug: 17345682
Change-Id: I4c4b22977a93048e0b291206721d0ccc77cfaaf2
2016-02-01 22:32:21 +09:00
Erik Kline
a636761bd6 Initial refactoring to group IP-related elements into an IpManager
Bug: 17345682
Change-Id: I88f3f4bd32d18cd8d4f1404493648c8bcc1deeec
2016-02-01 17:59:47 +09:00
Etan Cohen
bd0858ba67 Merge "Allow NetworkFactories to match any network specifier on a request" into mm-wireless-dev 2016-01-28 18:20:09 +00:00
Shishir Agrawal
3a86d3d534 DO NOT MERGE : Unhiding MSIM APIs.
1. Unhide MSIM APIs in TelephonyManager that already have non-MSIM equivalent
   APIs public.
2. Make MSIM API naming consistent (overloaded, no suffix).
3. Unhide APIs in SubscriptionManager that are necessary for MSIM.

Bug: 26772894
Change-Id: Ibebab7379ea79c8e4812bbd190342827048e30e2
2016-01-26 09:29:24 -08:00
Etan Cohen
20d329b08d NAN: baseline NAN manager for discovery.
Initial framework for user API (all @hide for now). Supports:
- NAN configuration
- Publish/Subscribe = Discovery
- Message passing
- Notifications

Bug: 26216681
Change-Id: I72e467756a02f7b80c52fae916b9a47c8174af42
2016-01-14 11:34:07 -08:00
Etan Cohen
ddb9ef0357 Allow NetworkFactories to match any network specifier on a request
Current usage of NetworkSpecifier: network factory will match a request
if the request has either a (1) empty network specifier, or (2) a
network specifier which is identical to that of the network factory.
Note: 'matching' w.r.t. network specifier - all other matching rules
are still in effect.

Change: add rule (3) or the network specifier of the network factory
is the special string (which is defined as "*" and which user-facing
network requests aren't allowed to use).

Rationale: allows on-demand network creation.

Example:
- Can specify a Wi-Fi NetworkRequest with NetworkSpecifier="ssid"
- It will match a Wi-Fi network factory specifying NetworkSpecifier="*"
- That network factory will bring up a Wi-Fi network, connecting to the
  specified SSID.
- Once the network is created it will create a NetworkAgent which will
  now have a NetworkSpecifier matching that of the request (not the
  match-all special string!)

That final step of making sure that the NetworkAgent matches the request
and not the match-all is critical to delivering any subsequent callbacks
correctly. I.e. your network will only get callbacks which match it.

Bug: 26192833
Change-Id: I49e3b492e0bb48a3f6e9a34e3f94f0e1cf89741f
2015-12-15 08:06:54 -08:00
Jack Yu
a11d3ac4c2 Merge "merge from master" into mm-wireless-dev 2015-12-11 01:07:24 +00:00
Lorenzo Colitti
6b212287d0 DO NOT MERGE Don't crash when canceling alarms if a direct listener is present
If a direct listener alarm attempts to match a regular
PendingIntent alarm, it will attempt to fetch the binder of the
regular alarm's direct listener, which is null, and crash the
system with an NPE.

Cherry-picked from 9b43ce0c98ce9f865d6db547529d098c8982cc
Bug: 25823676
Change-Id: I85fb98b43436930a2513274dc5ab408f7d41d97f
2015-12-10 16:06:50 -08:00
Christopher Tate
4aa47e58c4 DO NOT MERGE Introduce direct listener API for alarm delivery
The Alarm Manager now supports a set() variant that takes a listener
callback to invoke at alarm trigger time rather than a PendingIntent.
This is much lower overhead and has guaranteed low delivery latency
from the trigger time.  The tradeoff is that the app must be running
*continuously* from the time the alarm is set to the time it is
delivered.  If the app exits for any reason before the alarm fires,
the listener becomes invalid and the alarm will be dropped.  This is
more or less equivalent to setting an alarm with a broadcast
PendingIntent that matches only a runtime-registered receiver.

The app's alarm listener can be any object that implements the new
AlarmManager.OnAlarmListener interface and implements its onAlarm()
method.  There is no data delivered at alarm trigger time: whatever
state needs to be associated with the specific alarm instance should
simply be packaged inside the OnAlarmListener instance.

An alarm using OnAlarmListener can request that the onAlarm() method
be called on an arbitrary handler.  If the program passes 'null' for
this parameter when setting the alarm, the callback occurs on the
application's main Looper thread.

Cherry-picked from 14a7bb0d370fffdf902a4e2345f46754ed2d7684
Bug 20157436

Change-Id: I2eb030a24efdd466a2eee1666c5231201b43684b
2015-12-10 16:06:50 -08:00
Dianne Hackborn
13a6158d6e DO NOT MERGE Add some debugging for device idle alarms.
Cherry-picked from ae78bf8552d0a3ff83b8300630d47188434173ea
Change-Id: I6792f0ffc5cc40af5ec35cb03ab78b52c17678fd
2015-12-10 16:06:50 -08:00
Erik Kline
7cb501310e DO NOT MERGE Refactor netlink and IpReachabilityMonitor into services/net
- netlink from core to services/net/netlink
    - IpReachabilityMonitor from core to services/net/ip

Cherry-picked from 02cc5a030a6f132e776b754dd5684ae632009f76
Change-Id: I45ac3f591bade45dd5ec441111b02b621234c0e4
2015-12-10 16:06:50 -08:00
Jack Yu
6714030083 merge from master
Change-Id: Ic03669db3f4595336a7dbc13ffc77d055d11acf9
2015-12-10 12:27:58 -08:00
Nicolas Geoffray
4e390fa8e6 Merge "Remove DEBUG_JIT from Zygote flags." am: cf49583bd0
am: 5485d81578

* commit '5485d815788e4037829d70d041fe4fc1a35416f3':
  Remove DEBUG_JIT from Zygote flags.
2015-11-18 11:05:23 +00:00
Nicolas Geoffray
5485d81578 Merge "Remove DEBUG_JIT from Zygote flags."
am: cf49583bd0

* commit 'cf49583bd02d01b5d7aa57912d5469b466722c65':
  Remove DEBUG_JIT from Zygote flags.
2015-11-18 10:54:19 +00:00
Nicolas Geoffray
cf49583bd0 Merge "Remove DEBUG_JIT from Zygote flags." 2015-11-18 10:47:50 +00:00
Nicolas Geoffray
245ec92b65 Remove DEBUG_JIT from Zygote flags.
The flag is being obsolete by the move to JIT.

(cherry picked from commit 9abbf45c8dcdb2e5b13b615e5138ad996fe8afa3)

Change-Id: I3ce4577e81f91e9dd55d44116e0f9e2014bd00b8
2015-11-18 10:07:53 +00:00
Joe LaPenna
7a3db8cc4d Revert "Don\'t dispatch when non-interactive and the display is off." am: f2b9b2d85a
am: f7aceb60e3

* commit 'f7aceb60e3e0d6ec611b3fa2dd64e6e4e1196f4c':
  Revert "Don't dispatch when non-interactive and the display is off."
2015-11-17 22:41:49 +00:00
Joe LaPenna
f7aceb60e3 Revert "Don\'t dispatch when non-interactive and the display is off."
am: f2b9b2d85a

* commit 'f2b9b2d85ae1b48896ad6b685de4cda8fab1c8fb':
  Revert "Don't dispatch when non-interactive and the display is off."
2015-11-17 22:32:57 +00:00
Joe LaPenna
f2b9b2d85a Revert "Don't dispatch when non-interactive and the display is off."
This reverts commit 2ccf0c8e636fd3be75c3a07f4cf60d72a4cfaa28.

BUG: 22422588
BUG: 25067918

Change-Id: I916c8bb19cd6a73c0be4bd3a0e3112938651e775
2015-11-17 22:26:41 +00:00
Svetoslav Ganov
9bf367030c Merge "Handle renamed packages during default grants" am: 140b101fcd
am: 60cb22008c

* commit '60cb22008c602c5345504eacb4eb68ea0ac69cf0':
  Handle renamed packages during default grants
2015-11-17 20:24:06 +00:00
Colin Cross
68cea4e7d1 Merge "Vibra: Add loading of the vibrator hardware module." am: 5603eca33c
am: 358ad4980f

* commit '358ad4980fd6ea0ed22e81b3816572ec9ba39f53':
  Vibra: Add loading of the vibrator hardware module.
2015-11-17 20:06:25 +00:00
Svetoslav Ganov
60cb22008c Merge "Handle renamed packages during default grants"
am: 140b101fcd

* commit '140b101fcdbdf413b914b5625b19577784ad9d88':
  Handle renamed packages during default grants
2015-11-17 20:06:21 +00:00
Svet Ganov
f443384d9e Handle renamed packages during default grants
If an L device has a privileged app on the system image which was
updated and an M OTA renames the app package (supported only for
privileged apps) we end up with a disabled system package setting
with no package information. Since we are not doing a null check
of the package we get from the disabled package settings during
default grants we crash leaving the system in a bad state.

bug:25687380

Change-Id: I4f2ebcaf471e4bd1696298eab4716b50c52ca5c4
2015-11-17 11:53:31 -08:00
Colin Cross
358ad4980f Merge "Vibra: Add loading of the vibrator hardware module."
am: 5603eca33c

* commit '5603eca33c8e322997029d3101fd2442df3c274e':
  Vibra: Add loading of the vibrator hardware module.
2015-11-17 19:51:57 +00:00
Colin Cross
5603eca33c Merge "Vibra: Add loading of the vibrator hardware module." 2015-11-17 19:31:19 +00:00
Joe LaPenna
d083b37917 Merge "Revert "Enable debugging for DeviceIdle DO NOT MERGE ANYWHERE"" into cw-e-dev 2015-11-17 02:42:22 +00:00
Joe LaPenna
f6ca46d301 Revert "Enable debugging for DeviceIdle DO NOT MERGE ANYWHERE"
This reverts commit 88c7c3e08051f4a2be8ee5194214678a07ff7f01.

Change-Id: I2c6d7d1d076bee0dc905d0986ced55e49481af26
BUG: 23753686
2015-11-17 02:42:10 +00:00
Michael Kwan
8d6630b87c DO NOT MERGE ANYWHERE - Hack to disable MTP mode on Clockwork devices.
Android currently forces USB into MTP mode if there was no modes
specified. This causes issues on Clockwork devices as they do not
support MTP.

The hack stops this behaviour, and also sets MTP mode back to none.

Bug: 25547826
Bug: 25582050
Bug: 25244201
Change-Id: I772e35d0a5db51b17e9d71c59e6a157dabb1d296
2015-11-16 14:05:29 -08:00
Filip Gruszczynski
f9661eafa0 Merge "Initialize DisplayContent base info when object is constructed" into cw-e-dev am: fe482e0bca
am: 0e6007d229

* commit '0e6007d22928da4c529a5fa773fbeeb441421804':
  Initialize DisplayContent base info when object is constructed
2015-11-13 17:26:47 +00:00
Filip Gruszczynski
0e6007d229 Merge "Initialize DisplayContent base info when object is constructed" into cw-e-dev
am: fe482e0bca

* commit 'fe482e0bcabb98d983ecb4080b35490b9814c809':
  Initialize DisplayContent base info when object is constructed
2015-11-13 17:20:05 +00:00
Wale Ogunwale
4ff84631af Initialize DisplayContent base info when object is constructed
It is possible for an external process (e.g. sys-ui) to call into
WM to get the bounds of a stack in between the construction of the
DisplayContent object and SystemServer telling WM that the display
is ready. Incorrect bounds would be returned to the caller in this
case since the baseDisplayWidth/Height is only set when the displayReady
call is made.
We now initialize the base display information when the DisplayContent
object is created so any call to get the logical display rect of the
display will always return the right bounds. This should be okay as the
display manager is initialized way before window manager.

Bug: 22961090
Change-Id: Iebd688ad8f4c08556846fcebb543e58bd2c01414
2015-11-12 20:46:07 -08:00