Commit Graph

1142 Commits

Author SHA1 Message Date
Jeff Davidson
dd6fd1e62b Class for managing the active scorer application.
Allows listing all possible scorer apps, getting the active scorer
app, setting the active scorer app, and determining whether a given
UID is for the active scorer.

Note that setting a default scorer with a system image will be handled
separately - the plan here is to add a read-only build property
containing a package name to use as the scorer out of the box.
When NetworkScorerService is initialized, it will check a provisioning
bit; if that bit isn't set, it will set the current scorer to the
package specified in this build property (if any) and set the
provisioning bit to true.

Bug: 13769362
Change-Id: I18c0b2ba2aceccc88b70c3611a49149e0bf17ecf
2014-04-16 14:17:01 -07:00
Jeff Davidson
b51e0a6c4b Stub APIs for network scoring.
NetworkScoreManager defines all interactions between the framework and
the scorer app. An ACTION_SCORE_NETWORKS broadcast is sent to the
default scorer with any unscored networks, which responds by calling
updateScores() with scores for those networks. An app may also check
whether they are currently the default scorer with
getDefaultScorerPackage() and request to become the default via the
ACTION_CHANGE_DEFAULT broadcast.

Bug: 13786258
Change-Id: Id3dc0f7c1109f0e3afd73356e2475b7f34167419
2014-04-16 11:55:14 -07:00
Jeff Davidson
dc960e21ef Data structures for communication with network scorer apps.
NetworkKey represents the necessary information to identify a network
to be scored. ScoredNetwork contains the key to identify a network as
well as a score to be used when evaluating that network (as a curve
based on RSSI).

Bug: 13767776
Change-Id: I6bfebd105c9381e615513167b4332b767b43a23a
2014-04-16 11:28:51 -07:00
Christopher Lane
111db01a26 resolved conflicts for merge of 381ac080 to master
Change-Id: I779c49c48980ba7737ee4e7b04a9e4c3e02fca21
2014-04-14 15:14:01 -07:00
Christopher Lane
381ac08054 am 62538940: Merge "Add support for custom TXT records in NSD" into klp-modular-dev
* commit '62538940de1755c71c56b0e5d81e12397e5de58a':
  Add support for custom TXT records in NSD
2014-04-14 21:16:27 +00:00
Christopher Lane
b72d8b4091 Add support for custom TXT records in NSD
Change-Id: I8e6dc9852ad4d273c71ad6a63a7fbd28a206806d
2014-04-14 14:10:36 -07:00
Jaewan Kim
baa00cc350 Merge "Revert "Refactor IpConfiguration from WifiConfiguration"" 2014-04-07 09:01:43 +00:00
Jaewan Kim
6789797485 Revert "Refactor IpConfiguration from WifiConfiguration"
This reverts commit 1284767ceb.

Change-Id: Ibccea84e5dc44c1b8954779660e0721b27f762d4
2014-04-07 09:01:24 +00:00
Jaewan Kim
e277433ed7 Revert "Hide IpConfiguration"
This reverts commit d07372e2e9.

Change-Id: I5728114dbd9ef37509e8ab3c942648ec92ef0c1a
2014-04-07 08:54:45 +00:00
Jaewan Kim
d07372e2e9 Hide IpConfiguration
Bug: 7606609, Bug: 8687763
Change-Id: I2970bf79ef14cb993878c1dc10c7022a716f46c5
2014-04-07 17:11:39 +09:00
Jaewan Kim
ce245e1c65 Merge "Refactor IpConfiguration from WifiConfiguration" 2014-04-07 04:40:45 +00:00
Jaewan Kim
1284767ceb Refactor IpConfiguration from WifiConfiguration
Bug: 7606609, Bug: 8687763
Change-Id: I736eb3c73a8ffc8f137a04a5ea66ee564dc2b530
2014-04-07 11:35:35 +09:00
Dave Platt
db89fe2a2b Merge "Document and enforce "one request per Listener" rule" 2014-04-02 21:09:43 +00:00
Dave Platt
e7369bd4df Document and enforce "one request per Listener" rule
The API and implementation of NsdManager imply that a separate
Listener is to be used for each active registration or discovery
request.  This isn't formally documented or properly enforced, and
weird and unpredictable things happen if an application uses a
Listener for more than one request at a time.

Update documentation to make this an explicit requirement.

Enforce the restriction when a new request is submitted for
processing; if the Listener is already being used to track an active
request, throw an exception.

Document the fact that apps should unregister services and cancel
service discoveries when the app is stopped (in KitKat and prior
releases, they'll leak if this isn't done.)

Re-order "release the Listener" operation to occur before the Listener
callback, so that the Listener can be reused by the application once
the callback has been entered - this eliminates a race condition.
Document this.

Pass 2: typos, added documentation about API level, changed to using
an explicitly defined return value for "busy listener".

Bug: 13512512
Change-Id: Ic164110759204b27d8a14376777b593ebe1865fa
2014-03-31 13:43:45 -07:00
Brian Carlstrom
ed99dc89c3 am 7156b7c6: am b11952d6: am e3434fc4: Merge "Improve detail message for X509TrustManagerExtensions argument validation"
* commit '7156b7c65d6f158c4898a93f8e2cea0bf94791d1':
  Improve detail message for X509TrustManagerExtensions argument validation
2014-03-31 20:06:06 +00:00
Brian Carlstrom
7156b7c65d am b11952d6: am e3434fc4: Merge "Improve detail message for X509TrustManagerExtensions argument validation"
* commit 'b11952d6f6851dbd1da447da967f6e07984942fe':
  Improve detail message for X509TrustManagerExtensions argument validation
2014-03-31 19:59:31 +00:00
Brian Carlstrom
ff9ca781d0 Improve detail message for X509TrustManagerExtensions argument validation
Bug: 13728564
Change-Id: I03d08babcdc0d11baff5e76a339b4285e92edee8
2014-03-31 11:22:34 -07:00
Kenny Root
0072a417f1 am 1dc1d6b2: am 5b93685a: am 57f2764b: Merge "CertificateChainValidator: initialize TrustManagerFactory"
* commit '1dc1d6b22deb38d78960f3ce89f94e536610492e':
  CertificateChainValidator: initialize TrustManagerFactory
2014-03-27 00:17:47 +00:00
Kenny Root
1dc1d6b22d am 5b93685a: am 57f2764b: Merge "CertificateChainValidator: initialize TrustManagerFactory"
* commit '5b93685af37d840e7ef6d415bcfe8a8a4c004032':
  CertificateChainValidator: initialize TrustManagerFactory
2014-03-27 00:10:41 +00:00
Kenny Root
587a9455de CertificateChainValidator: initialize TrustManagerFactory
Need to call TrustManagerFactory#init before use. I suspect this class
isn't used anywhere since this hasn't caused a problem yet.

Change-Id: I17425d0bba4795d71960062361a755830abba7de
2014-03-26 08:40:45 -07:00
Kenny Root
6ab41d71eb am 266de3ef: am dd3e6399: am c1d863e7: am 77ceb5e8: Merge "Use X509ExtendedTrustManager and not Conscrypt"
* commit '266de3efcd4b57ba3b301d87ff0fb692090d9a95':
  Use X509ExtendedTrustManager and not Conscrypt
2014-03-25 21:23:18 +00:00
Kenny Root
dd3e639909 am c1d863e7: am 77ceb5e8: Merge "Use X509ExtendedTrustManager and not Conscrypt"
* commit 'c1d863e7a4b55f8e583067eebaffc6686723d7ab':
  Use X509ExtendedTrustManager and not Conscrypt
2014-03-25 19:09:27 +00:00
Kenny Root
da776c872e Use X509ExtendedTrustManager and not Conscrypt
This allows the new X509ExtendedTrustManager to be used instead of
Conscrypt directly.

Bug: 13103812
Change-Id: I736f475342395f26657f2371828a6d3a0065a50a
2014-03-24 17:05:22 -07:00
Alex Klyubin
f96bfe86a6 am 7ae93b1d: am 92ec0a0c: am d8c32164: am 88517170: Merge "Adjust to the change in the private SSLParameterImpl API."
* commit '7ae93b1d0cd1eb43b5fc8248dfc2703608a461f3':
  Adjust to the change in the private SSLParameterImpl API.
2014-03-24 17:34:11 +00:00
Alex Klyubin
92ec0a0c7a am d8c32164: am 88517170: Merge "Adjust to the change in the private SSLParameterImpl API."
* commit 'd8c32164e19d16cf7d66b9aee368369ae16a4f0d':
  Adjust to the change in the private SSLParameterImpl API.
2014-03-21 18:47:27 +00:00
Alex Klyubin
a2507e8764 Adjust to the change in the private SSLParameterImpl API.
Conscrypt's SSLParameterImpl getDefaultTrustManager was renamed to
getDefaultX509TrustManager.

Bug: 13563574
Change-Id: I601c651d631f5a2e4a04d21941186553988e5286
2014-03-21 11:13:50 -07:00
Jaewan Kim
34e2799c61 Merge "EthernetDataTracker: Set more detailed status" 2014-03-20 06:48:40 +00:00
Robert Greenwalt
1b98e90db0 resolved conflicts for merge of 0bff77d6 to master
Change-Id: Ia4c86126079740978658a05579b56d59d41a7b01
2014-03-19 12:41:54 -07:00
Robert Greenwalt
42b746e4d8 am bd84f01c: am 5d3d4ee3: Merge "Handle provisioning APN by turning off/on data." into klp-dev
* commit 'bd84f01c6ce122ab58fc7c5b687dc8bfb0fb03e6':
  Handle provisioning APN by turning off/on data.
2014-03-19 19:08:44 +00:00
Robert Greenwalt
5d3d4ee300 Merge "Handle provisioning APN by turning off/on data." into klp-dev 2014-03-19 16:12:01 +00:00
Dave Platt
c76bccd6ea am 17e7c407: am 98a027a5: Merge "Harden NsdManager against null-dereference crashes" into klp-dev
* commit '17e7c4076b8f1617ed397dae570e9d5240cd9c1b':
  Harden NsdManager against null-dereference crashes
2014-03-19 00:59:47 +00:00
Ashish Sharma
0535a9f7aa Include elapsed realtime (nanos) of the event in the radio state change notifications.
Bug: 13247811
Change-Id: I3454aa159a68b9087b4762df947b41965b5a3941
2014-03-18 21:42:02 +00:00
Wink Saville
c8e8e3eba6 Handle provisioning APN by turning off/on data.
This is a start and two tests succeed:

Tested expired AT&T SIM and waiting 15min for alarm to fire.
Tested a provisioned Verizon SIM and works normally.

I've NOT tested AT&T where I've properly completed the provisioning.
I've NOT tested T-Mobile SIM either provisioned or not-provisioned.
I've NOT tested provisioning over WiFi.
I've NOT tested that WiFi <-> Mobile works
I've NOT tested voice calls, SMS, MMS
...

The current bug is below, but it is poorly named either it should be
renamed or a new bug created.

Bug: 13190133
Change-Id: I0a09f642614cd27a8655e9dae764b8999ce485b8
2014-03-18 10:58:40 -07:00
Jaewan Kim
3f4733b77b EthernetDataTracker: Set more detailed status
Change-Id: If2a5c8bda2cb24c044903df64705bf7b3587fee1
2014-03-17 17:12:14 +09:00
Chad Brubaker
7c2b1625d6 am 78f204ae: am 8e240af5: Merge "Remove SO_BINDTODEVICE from VPN protect" into klp-dev
* commit '78f204aed8c0f3c8174616801d66f96a9a00a5fd':
  Remove SO_BINDTODEVICE from VPN protect
2014-03-14 16:27:58 +00:00
Dave Platt
97121c923c Harden NsdManager against null-dereference crashes
Due to race conditions or programming errors, the NsdManager
can attempt to process an asynchronous status message (and issue
a callback to the listener) after the listener has already been
removed from the NsdManager state.  This causes dereferencing of
null objects, and a crash.

Split out the three async-queue message cases:  these are ones
in which message.arg2 does not hold an NsdManager array index
and the code should not interpret this field as if it were.

Add an explicit check for "null listener" (the array index in the
message has already been released), log a warning, and exit early.

Safeguard accesses to the "NSD service type" string from a possibly
null) NsdServiceInfo object... return a constant "?" string rather
than crashing.

Bug: 9016259

Manual cherrypick of commit b1fbb14122a99c62363a949dd634294f5e887ef,
change-ID I7a6ff6842cf035cefbafe2a023ae1fd43734081e in master.

Change-Id: I8d9b7a1763d47d061a0f46b3cb453de4bdb8c2ed
2014-03-13 17:27:03 -07:00
Chad Brubaker
f5729a6a15 am 1011960c: am decfd707: Merge "Add the calling package name to requestRouteToHost" into klp-dev
* commit '1011960c44a4f84d53d05199fe1ca09be9473822':
  Add the calling package name to requestRouteToHost
2014-03-13 18:18:36 +00:00
Jaewan Kim
6a5becac37 EthernetDataTracker: Update hardware address when interface is changed
Change-Id: I154f151ca676e1e4137eb8210fd377659cfc7867
2014-03-14 00:43:04 +09:00
Jaewan Kim
68c9d2592c Merge "EthernetDataTracker: Return proper interface name" 2014-03-13 12:07:36 +00:00
Chad Brubaker
a1d7c74449 Remove SO_BINDTODEVICE from VPN protect
SO_BINDTODEVICE is not needed with policy routing.
SO_BINDTODEVICE was also used on the default iface which causes problems
when the default iface is IPv6 only and the socket tries to connect to a
IPv4 address.

Bug: 12940882
Change-Id: I5b2bde0ac5459433fc5749f509072a548532f730
2014-03-11 10:58:19 -07:00
Jaewan Kim
5df87942b9 EthernetDataTracker: Return proper interface name
Change-Id: Ib01333894cc4dfbe223ef26e6eb815812d32092d
2014-03-10 21:29:16 +09:00
Jeff Davidson
16340670af Merge "Add a warning about the SSID format in CaptivePortalTracker." 2014-03-06 18:22:07 +00:00
Chad Brubaker
18dd015e6e Add the calling package name to requestRouteToHost
The calling package name will be used to check if an application is a
system application when deciding if a route should be exempt from VPN
routing rules.

Bug: 12937545
Change-Id: I2c09c875fe9bb9685871a0a801ddcbb32fc17405
2014-03-05 13:35:20 -08:00
Dave Platt
63761a2d79 am bf588bda: am f08cd8c6: am 7d8262cb: am 22f66b76: Merge "Harden NsdManager against null-dereference crashes"
* commit 'bf588bda2c4dc98919439946e905e98ad4d352dd':
  Harden NsdManager against null-dereference crashes
2014-03-04 23:51:51 +00:00
Dave Platt
f08cd8c656 am 7d8262cb: am 22f66b76: Merge "Harden NsdManager against null-dereference crashes"
* commit '7d8262cb554c41892794f23b92e01b52458288bb':
  Harden NsdManager against null-dereference crashes
2014-03-04 22:02:55 +00:00
Dave Platt
3fc376b733 Harden NsdManager against null-dereference crashes
Due to race conditions or programming errors, the NsdManager
can attempt to process an asynchronous status message (and issue
a callback to the listener) after the listener has already been
removed from the NsdManager state.  This causes dereferencing of
null objects, and a crash.

Split out the three async-queue message cases:  these are ones
in which message.arg2 does not hold an NsdManager array index
and the code should not interpret this field as if it were.

Add an explicit check for "null listener" (the array index in the
message has already been released), log a warning, and exit early.

Safeguard accesses to the "NSD service type" string from a (possibly
null) NsdServiceInfo object... return a constant "?" string rather
than crashing.

Bug: 9016259

Change-Id: I40aabdfc65d86fdd0eaac7a1e7e56e6ff69796cf
2014-03-04 13:25:02 -08:00
Yuhao Zheng
d5273da95b Merge "Allow more proxy bypass patterns" 2014-03-04 17:44:04 +00:00
Yuhao Zheng
5c43d4e451 Merge "Return detailed reason of invalid proxy settings" 2014-03-04 17:43:47 +00:00
Yuhao Zheng
3dce5af6ab Allow more proxy bypass patterns
The current restriction on proxy bypass pattern is harsh. For instance,
"*google.com" is allowed, but "*.google.com" is not. We loosen the validity
check to allow patterns like "*.cnn.com", "*.google*.com", "10.20.*.*".

bug: 13287210
Change-Id: I7551150f785cd087c963f3a8f4c9d05f0002ff04
2014-03-03 16:00:06 -08:00
Yuhao Zheng
9070484e17 Return detailed reason of invalid proxy settings
Make Proxy.validate() return valid/invalid int code, instead of throwing
exceptions. If invalid, detailed reason code is returned (currently for
Settings UI use).

bug: 13248097
Change-Id: Ic68d03f666f1cd63667afc311de7dc370d233901
2014-03-03 11:23:07 -08:00