Commit Graph

2397 Commits

Author SHA1 Message Date
Jeremy Joslin
5519d7cf71 Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED.
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33752149
Change-Id: I7d91fa9a4f6ef4f9170c6af98567ce443c805e74
2017-01-06 15:42:57 -08:00
Ajay Panicker
d02e1c3024 Merge "Prevent LocalSocket from creating an fd if fd is already there" am: 616910fd53 am: d76576b6d1 am: e0211af867
am: af525ff403

Change-Id: I564721fb1ba889cd159f10e769aee4a5bee3db67
2017-01-06 01:57:10 +00:00
Ajay Panicker
af525ff403 Merge "Prevent LocalSocket from creating an fd if fd is already there" am: 616910fd53 am: d76576b6d1
am: e0211af867

Change-Id: I5ac57ca6439359fc65622254090a3ea6cc2aec18
2017-01-06 01:50:03 +00:00
Ajay Panicker
e0211af867 Merge "Prevent LocalSocket from creating an fd if fd is already there" am: 616910fd53
am: d76576b6d1

Change-Id: I0b59b10a095bf23d4f26856690bf6be2a5304cbc
2017-01-06 01:46:10 +00:00
Ajay Panicker
d76576b6d1 Merge "Prevent LocalSocket from creating an fd if fd is already there"
am: 616910fd53

Change-Id: I90192dd7e656b9bec62815ad628fc4e67f806240
2017-01-06 01:41:09 +00:00
Treehugger Robot
616910fd53 Merge "Prevent LocalSocket from creating an fd if fd is already there" 2017-01-06 01:29:47 +00:00
Amin Shaikh
cf9ad83520 Merge "Fix NetworkScorerAppManager#isCallerActiveScorer." am: 48eecdcbc4 am: 7495cf633c am: d7f371813a
am: ea7931d107

Change-Id: I193abae0fef7cb976ef970085363822f4770215c
2017-01-06 00:29:31 +00:00
Amin Shaikh
ea7931d107 Merge "Fix NetworkScorerAppManager#isCallerActiveScorer." am: 48eecdcbc4 am: 7495cf633c
am: d7f371813a

Change-Id: I8fc3a45a910294c46982bac9a3f6e183977aad16
2017-01-06 00:21:56 +00:00
Amin Shaikh
d7f371813a Merge "Fix NetworkScorerAppManager#isCallerActiveScorer." am: 48eecdcbc4
am: 7495cf633c

Change-Id: Ie6913526fbc1b0ae63eb7c0c7be7d9eac5772f50
2017-01-06 00:15:01 +00:00
Amin Shaikh
7495cf633c Merge "Fix NetworkScorerAppManager#isCallerActiveScorer."
am: 48eecdcbc4

Change-Id: I6b9ecd35dbc0758cd45b804dc9586287428af293
2017-01-06 00:08:19 +00:00
Ajay Panicker
7a8c36aa4e Prevent LocalSocket from creating an fd if fd is already there
Any LocalSocket created with a FileDescriptor will throw IOExceptions
when performing most opperations due to the fact that the LocalSocket
tries to create an implementation but fails since there is a FileDescriptor
already set.

Bug: 34095140
Test: Setup using tap&go
Change-Id: Ie8f50def6156c16617697d939d6c0ab570281642
2017-01-05 23:52:30 +00:00
Amin Shaikh
2cd918a63e Fix NetworkScorerAppManager#isCallerActiveScorer.
The current implementation checks whether the caller's uid has the
SCORE_NETWORKS permission instead of checking the passed in callingUid. I
removed this check entirely because the getActiveScorer method already checks
whether the scorer's package has the SCORE_NETWORKS permission. There is no way
callingUid can equal the active scoring package's uid without also having the
SCORE_NETWORKS permission.

Bug: 34107721
Test: runtest --path core/tests/coretests/src/android/net/NetworkScorerAppManagerTest.java
Change-Id: Ifd427792169837c84a10a76b208c76137db06ae9
2017-01-05 14:28:47 -08:00
Joe LaPenna
bb879cedc7 Merge "Expose RecommendationRequest.Builder as SystemApi." am: 944b017031 am: 1c4cfe1af9
am: 303b853671

Change-Id: Ic35415f7d7b721faf09f9968cb2fd8e9ba6749b0
2017-01-04 19:58:56 +00:00
Joe LaPenna
303b853671 Merge "Expose RecommendationRequest.Builder as SystemApi." am: 944b017031
am: 1c4cfe1af9

Change-Id: I094905e8fa7f54f4f5f0be80fa833ca44654f334
2017-01-04 19:54:32 +00:00
Joe LaPenna
1c4cfe1af9 Merge "Expose RecommendationRequest.Builder as SystemApi."
am: 944b017031

Change-Id: If63881b8b33ced7950ebb7e83fb8994e454b8642
2017-01-04 19:49:35 +00:00
Treehugger Robot
944b017031 Merge "Expose RecommendationRequest.Builder as SystemApi." 2017-01-04 19:42:17 +00:00
Joe LaPenna
010e8b0dc8 Expose RecommendationRequest.Builder as SystemApi.
In order to test our recommender, we need to be able to create
network recommendation requests.

Test: make update-api
Change-Id: I68df0d3e684bcdb90709a34478d2aa669ee23547
Merged-In: I68df0d3e684bcdb90709a34478d2aa669ee23547
2017-01-04 10:15:52 -08:00
Joe LaPenna
3eca29e119 Merge "Expose RecommendationRequest.Builder as SystemApi." 2017-01-04 17:50:08 +00:00
Neil Fuller
7f6136ae03 Merge "Set isConnected, isBound, implCreated on server-side LocalSockets" am: 75ba827a4e am: 6a29676687 am: df49ab5576
am: 88c9e31fd3

Change-Id: Ia30d6e094db10e479ef5a4d2159c4ca50ce6d9b1
2017-01-04 12:51:54 +00:00
Neil Fuller
88c9e31fd3 Merge "Set isConnected, isBound, implCreated on server-side LocalSockets" am: 75ba827a4e am: 6a29676687
am: df49ab5576

Change-Id: I6aac69506e00ec9f0fdb431191a94b7b9b9fc0df
2017-01-04 12:45:11 +00:00
Neil Fuller
df49ab5576 Merge "Set isConnected, isBound, implCreated on server-side LocalSockets" am: 75ba827a4e
am: 6a29676687

Change-Id: Icb55f2b160f6bd2f6c12845613ea3b4ea834693d
2017-01-04 12:38:50 +00:00
Neil Fuller
6a29676687 Merge "Set isConnected, isBound, implCreated on server-side LocalSockets"
am: 75ba827a4e

Change-Id: I08b809241b6e025c9a30377c09f616be3484d7af
2017-01-04 12:32:29 +00:00
Treehugger Robot
75ba827a4e Merge "Set isConnected, isBound, implCreated on server-side LocalSockets" 2017-01-04 12:26:49 +00:00
Neil Fuller
b08c7bc0bd Set isConnected, isBound, implCreated on server-side LocalSockets
Previously LocalServerSocket.accept() would return a LocalSocket
instance with isConnected, isBound and implCreated set to false.
[implCreated determines whether impl.create() needs to called].

A socket created via accept() in this way is implicitly bound
and connected. impl.create() does not need to be called because
impl.accept(LocalSocketImpl s) is called instead and has the same
effect (s.fd and s.mFdCreatedInternally set correctly).

This change modifies the behavior so that the flags are now all
set to true in this case and isBound() and isConnected() will
now return the correct answer.

Attempts to call bind() and connect() will still throw
IOException as before, but with a different exception message.

Correctly setting implCreated in LocalSocket means that
LocalSocketImpl.create() will no longer be called for accept()
created sockets and no longer needs to treat the "fd != null"
case as a no-op: we can now assert that there must be no fd set
when create() is called as we will no longer call it with sockets
created using accept().

Bug: https://code.google.com/p/android/issues/detail?id=35942
Test: Device boot
Test: vogar --mode app_process cts/tests/tests/net/src/android/net/cts/LocalServerSocketTest.java
Test: vogar --mode app_process cts/tests/tests/net/src/android/net/cts/LocalSocketTest.java
Change-Id: I3ac55439412e84501ae7c5ae6c9976e03b2d6fc5
2017-01-04 10:33:18 +00:00
Joe LaPenna
25b4602cdc Expose RecommendationRequest.Builder as SystemApi.
In order to test our recommender, we need to be able to create
network recommendation requests.

Test: make update-api
Change-Id: I68df0d3e684bcdb90709a34478d2aa669ee23547
2017-01-04 00:44:25 -08:00
Sundeep Ghuman
6c92962153 Create ScoredNetwork Badging API changes.
Defines an attribute bundles key to hold the badging curve, the
enums for badge values, and an API to retrieve a badge for a
specific RSSI.

Bug: 33457699
Test: Unit tests
Change-Id: If9e8a60c4670b51c395fb501f55ddece8a72981e
2016-12-29 12:47:45 -08:00
Sundeep Ghuman
4ac2f9f53e Merge "Cherrypick: Define the calculateRankingScore method and Key." am: 425af45d02 am: 41577a0029
am: bfc0bfe645

Change-Id: Ia3d455791e3f219a3e0cff3b6946184757487d71
2016-12-22 19:26:05 +00:00
Alex Klyubin
aedc94bf11 resolve merge conflicts of a9888fc to master
Change-Id: I6ad00bf5bc1b18406b7fc8969c35bf7970fd1967
2016-12-22 11:20:26 -08:00
Sundeep Ghuman
bfc0bfe645 Merge "Cherrypick: Define the calculateRankingScore method and Key." am: 425af45d02
am: 41577a0029

Change-Id: I7807d92a705a8ec9d9c7b04159e1cd2290846e38
2016-12-22 19:14:48 +00:00
Alex Klyubin
a9888fc0c4 resolve merge conflicts of febd982 to stage-aosp-master am: 5c53fdb893
am: b824658494

Change-Id: Ic1dd2aef96889f0f68a55093cfb04b4d90f34818
2016-12-22 19:06:09 +00:00
Sundeep Ghuman
41577a0029 Merge "Cherrypick: Define the calculateRankingScore method and Key."
am: 425af45d02

Change-Id: Ib61f91087967f1b026cd2ba77175ccf47943bc53
2016-12-22 19:04:22 +00:00
Alex Klyubin
b824658494 resolve merge conflicts of febd982 to stage-aosp-master
am: 5c53fdb893

Change-Id: Ib0878f0f17c3799ff9ffb92d7e85904fc91fdab7
2016-12-22 19:01:13 +00:00
Alex Klyubin
5c53fdb893 resolve merge conflicts of febd982 to stage-aosp-master
Change-Id: I40c27e3159b8f7acd60c6fa42509bb23d146b937
2016-12-22 10:20:23 -08:00
Treehugger Robot
425af45d02 Merge "Cherrypick: Define the calculateRankingScore method and Key." 2016-12-22 00:03:57 +00:00
Sundeep Ghuman
0d79bdef27 Cherrypick: Define the calculateRankingScore method and Key.
Define the key to be used to store the rankingScoreOffset inside the
ScoredNetwork bundle. Implement a platform API method to calculate the
ranking score for a given rssi.

OCL: ag/1688711

Bug: 33049302
Test: Unit tests
Change-Id: Ia3fea2197d7c211a2313fced8713d79d8d5f4f6e
Merged-In: Ia3fea2197d7c211a2313fced8713d79d8d5f4f6e
Topic: ScoredNetworkRankingScore
2016-12-21 13:57:24 -08:00
Jeff Sharkey
febd982cdd Merge "Avoid Calendar's unexpect change in snapToCycleDay()" 2016-12-21 21:11:20 +00:00
Amin Shaikh
9926363b09 Merge "Expose ScanResult#untrusted as a @SystemApi." am: a93e57f1ac am: a3943850ab
am: 471093b58e

Change-Id: I129d3abd329d9e00de1177ca39cf3ce0ff06946b
2016-12-21 20:10:30 +00:00
Amin Shaikh
471093b58e Merge "Expose ScanResult#untrusted as a @SystemApi." am: a93e57f1ac
am: a3943850ab

Change-Id: Id763d2f82e10dd5843258ef09d0e65824e2c2de6
2016-12-21 20:02:03 +00:00
Amin Shaikh
a3943850ab Merge "Expose ScanResult#untrusted as a @SystemApi."
am: a93e57f1ac

Change-Id: I9cac16dbceb36d6ff72e92d2ab8de20bd8d70e36
2016-12-21 19:56:19 +00:00
Amin Shaikh
3d18c621cb Expose ScanResult#untrusted as a @SystemApi.
- Expose ScanResult#untrusted to inform NetworkRecommendationProviders
  that a ScanResult does not correspond to a saved network.
- Add static construction methods and assertions to RecommendationResult

Test: runtest frameworks-services

Bug: 33490132
Change-Id: If7006040f63843c1c468c9d95c5c017383c5c5dd
Merged-In: If7006040f63843c1c468c9d95c5c017383c5c5dd
2016-12-21 11:46:22 -08:00
Shunta Sato
d18ffd8223 Avoid Calendar's unexpect change in snapToCycleDay()
Symptom:
Calendar object's certain field is unexpectedly changed after
using Calendar.add() method.

Detail and sample:
Following patch causes this issue.
- Switch network cycle calculation to use Calendar.
  https://android.googlesource.com/platform/frameworks/base/+/f2bead5

Call of Calendar.add() method might make a smaller field value
invariant. The smaller field means such a field of
Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND and so on
if Calendar.MONTH field is focused.
According to above, sometimes correct Calendar value won't be
acquired by original code.
To avoid unexpected change, it requires initialization toward
each smaller field after Calendar.add() call.

Solutions:
Calendar.DAY_OF_MONTH, Calendar.HOUR_OF_DAY, Calendar.MINUTE,
and Calendar.SECOND fields is set to 0 after added value to
Calendar.MONTH field.

Bug: 32724903
Author: Shigeki Yokomichi <shigeki.x.yokomichi@sonymobile.com>
Change-Id: I7af6391653be21786b662b2f8eaad10c413733c1
2016-12-21 12:44:30 -07:00
TreeHugger Robot
0e4b9cd97d Merge "Expose ScanResult#untrusted as a @SystemApi." 2016-12-20 22:30:35 +00:00
Amin Shaikh
f9d47b79b2 Expose ScanResult#untrusted as a @SystemApi.
- Expose ScanResult#untrusted to inform NetworkRecommendationProviders
  that a ScanResult does not correspond to a saved network.
- Add static construction methods and assertions to RecommendationResult

Test: runtest frameworks-services

Bug: 33490132
Change-Id: If7006040f63843c1c468c9d95c5c017383c5c5dd
2016-12-20 12:22:08 -08:00
Sundeep Ghuman
c63d5b0c74 Define the calculateRankingScore method and Key.
Define the key to be used to store the rankingScoreOffset inside the
ScoredNetwork bundle. Implement a platform API method to calculate the
ranking score for a given rssi.

Bug: 33049302
Test: Unit tests
Change-Id: Ia3fea2197d7c211a2313fced8713d79d8d5f4f6e
Topic: ScoredNetworkRankingScore
2016-12-20 11:02:29 -08:00
Jeremy Joslin
71909ea39a Merge "Implement the request and recommend calls." am: 1e814b3928 am: b50fdc7faa
am: 949893f5b2

Change-Id: Ibd03bace49bc277a2777c8483da6b4ebfc56d217
2016-12-20 06:37:11 +00:00
Jeremy Joslin
949893f5b2 Merge "Implement the request and recommend calls." am: 1e814b3928
am: b50fdc7faa

Change-Id: I81f998b6934715f43797247f411919a4ceee5631
2016-12-20 06:32:42 +00:00
Jeremy Joslin
b50fdc7faa Merge "Implement the request and recommend calls."
am: 1e814b3928

Change-Id: I91c905ab2fc7e061462fb96c2c81a783aa93a391
2016-12-20 06:25:08 +00:00
Jeremy Joslin
d0d32e238e Merge "Implement the discovery of a network recommendation provider." am: 470d256519 am: 8fbeb1d74a
am: af811c2650

Change-Id: I18d4c618f78796cbbe6d895c5b2f888c4a9a55ff
2016-12-20 03:37:58 +00:00
Jeremy Joslin
af811c2650 Merge "Implement the discovery of a network recommendation provider." am: 470d256519
am: 8fbeb1d74a

Change-Id: I322592326e0a409131a4dd33ab1f907b9262dbf2
2016-12-20 03:34:02 +00:00
Jeremy Joslin
8fbeb1d74a Merge "Implement the discovery of a network recommendation provider."
am: 470d256519

Change-Id: I804df594669be3b42704dead7007790666bef0f6
2016-12-20 03:26:04 +00:00