252071 Commits

Author SHA1 Message Date
Chih-hung Hsieh
7207562ff7 Merge "Fix google-explicit-constructor warnings in libs/hwui." 2016-08-31 17:18:56 +00:00
Chih-hung Hsieh
2cace65f71 Merge "Fix google-explicit-constructor warnings in media/mca." 2016-08-31 17:18:29 +00:00
Neil Fuller
7a9c0cd854 Merge "Fix receive timeout on LocalSocket" 2016-08-31 16:28:17 +00:00
Sergio Giro
0c8c4a5d98 Merge "java.security.Principal: add default method Principal#implies" 2016-08-31 13:51:37 +00:00
Sergio Giro
c7bd0d0adc Merge "java.security.SecretKey: now extends from Destroyable" 2016-08-31 13:50:23 +00:00
Sergio Giro
d53ae2c285 Merge "java.security: update java.security.KeyStore to jdk8u60" 2016-08-31 12:24:48 +00:00
Neil Fuller
a8280a5d34 Fix receive timeout on LocalSocket
The receive timeout stopped being set incorrect due to commit
c80af6d8. There is an associated CTS regression test in cts/.

Test: Ran CTS test android.net.cts.LocalSocketTest
Bug: 31205169
Change-Id: I99808478946f8eae502c49d2cb83465648b9c904
2016-08-31 11:32:17 +01:00
Sergio Giro
9484bff017 Merge "java.security.cert: update classes in java.security.cert (part 2)" 2016-08-31 08:18:57 +00:00
Chih-hung Hsieh
17f1fc6c76 Merge "Fix google-explicit-constructor warnings in soundpool."
am: feee33ce2c

Change-Id: Id3cf418900b7eb3ac2e3d94f674f4ed6f624ba27
2016-08-30 22:29:05 +00:00
Chih-hung Hsieh
feee33ce2c Merge "Fix google-explicit-constructor warnings in soundpool." 2016-08-30 22:21:34 +00:00
Chih-Hung Hsieh
ed4b31f9e1 Merge "Fix google-explicit-constructor warnings in core/jni."
am: cfc9f5d03d

Change-Id: Ia0378869ca5896734d5dfbdddf937b2b6dc25dbf
2016-08-30 20:37:41 +00:00
Treehugger Robot
cfc9f5d03d Merge "Fix google-explicit-constructor warnings in core/jni." 2016-08-30 20:30:46 +00:00
Sergio Giro
71b95041d6 java.security: update java.security.KeyStore to jdk8u60
Pulling upstream changes from OpenJDK version jdk8u60 for
java.security.KeyStore.

- New method getAttributes in KeyStore.Entry
- New interface Attribute in KeyStore.Entry
- New constructor specifying protection algorithm and protection parameters in
KeyStore.PasswordProtection.
- New getters for protection algorithm and protection parameters in
KeyStore.PasswordProtection
- In PrivateKeyEntry, SecretKeyEntry and TrustedCertificateEntry, new
constructor allowing to specify attributes, and corresponding getter
getAttributes.

This commit also contains cosmetic JavaDoc changes like
- Use of @code in place of <code> tags.
- Tidied up casts/generics.

This completes the port to jdk8u60 for this class.

Change-Id: Ifec9d07b8f6c367a6fa2672fd5c43747057336ad
Test: make droid docs, vogar KS*{Entry,Password}*.java
Bug: 29631070
2016-08-30 19:57:43 +00:00
Sergio Giro
6f285fa91e java.security.Principal: add default method Principal#implies
Given a Subject, Principal#implies returns true iff the principal
is one of the subject's principals.

Bug: 29631070
Test: make droid docs, vogar PrincipalTest.java
Change-Id: Ic24ca4bc26e29abdb67481af8255b8b1683a6f3a
2016-08-30 19:26:17 +01:00
Sergio Giro
7cdfa7499a java.security.SecretKey: now extends from Destroyable
Also:
- added comments
- replace <code> by @code tags

This completes the port of SecretKey to jdk8u60.

Bug: 29631070
Test: make droid docs
Change-Id: Id3604c1e62855d9fa9bf02a704c79c6d2131b006
2016-08-30 18:44:11 +01:00
Neil Fuller
033101bb99 Merge "Track libcore java.lang.reflect API changes"
am: cff3f7001c

Change-Id: Ie68db07c1211f161d7757186ff5ffadd506deef6
2016-08-30 14:33:29 +00:00
Neil Fuller
cff3f7001c Merge "Track libcore java.lang.reflect API changes" 2016-08-30 14:26:34 +00:00
Neil Fuller
2cc1eed174 Track libcore java.lang.reflect API changes
The modifications to Class / Field affect the .txt file
for no good reason: the use of a different generic
variable name results in changes because the tools think
methods have been added / removed when they haven't.

The only interface change from upstream included is adding
"extends AnnotatedElement" to GenericDeclaration. All (platform)
subclasses already did implement this interface. App classes may
be affected but only if they do not currently implement those
methods and they are somehow called.

Bug: 28666126
Test: cts ran for libcore (libcore, harmony_java_lang, org)
Change-Id: Ice5afb80834d7f7a4d23dade21a1590c6b323ed8
2016-08-30 12:08:10 +01:00
Mitchell Wills
6a80a4b05a DO NOT MERGE Revert "Add Bluetooth toggle prompts - framework"
This reverts commit 6bc2a92a5983e971ab9a04301fe4070e5b1f9179.

Change-Id: Ib576085fe190942891480524eb367a94a387a11c
2016-08-29 20:15:59 -07:00
Mitchell Wills
8efb84e3e0 DO NOT MERGE Revert "Add WiFi toggle prompts - framework"
This reverts commit 40f8b9251831c5f009fd476b1a3d216e126d3ef0.

Change-Id: I23e8b6ac97d8853c271429fc13fbfa313717a95a
2016-08-29 20:15:48 -07:00
Chih-Hung Hsieh
a619ec70cf Fix google-explicit-constructor warnings in libs/hwui.
* Add explicit keyword to conversion constructors,
  or add NOLINT for implicit converters.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: Id8ca42433a4fc3652e4cb13787c4cb169f20d9a9
2016-08-29 14:56:58 -07:00
Chih-Hung Hsieh
ae1aadc04f Fix google-explicit-constructor warnings in soundpool.
* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: Id1183b2929242cdf1fd0a1558d0e70194a1de9bb
2016-08-29 14:53:50 -07:00
Chih-Hung Hsieh
bd6b663b47 Fix google-explicit-constructor warnings in media/mca.
* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: Ia820e0a82df4bf74e5846917f6148849aed6ddc0
2016-08-29 14:47:52 -07:00
Chih-Hung Hsieh
a6543289f5 Fix google-explicit-constructor warnings in core/jni.
* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: I6125b7b761cb26831d42aabf10870ed68f0bf092
2016-08-29 14:46:35 -07:00
Mitchell Wills
b0b6afc248 Merge changes from topic 'wifi-aosp-master' into stage-aosp-master
* changes:
  NetworkSelectionStatus: Fix copy constructor
  Deprecate QNS network disable reason BAD_LINK
  [NAN] API changes/fixes addressing apilint issues
  [NAN] Add method to ConfigRequest to determine if non-default
  [NAN] Simplify publish/subscribe configuration - merge match filters
  [NAN] Udpate NAN API documentation, clean-up visibility
  [NAN] Do not expose WifiManager.isNanSupported as new API
  [NAN] Update finalize to check and warn user if resources not freed
  [NAN] Fix bad merge use rethrowFromSystemServer
  Add Log.wtf when transitionTo is used improperly
  Ensure BSSIDs are correctly aged out in settings view
  [NAN] Provide calling package name to service
  Add WiFi toggle prompts - framework
  Reenable the unit tests for StateMachine
  Remove WiFi related methods from NetworkManagementService
  Don't pull in external/junit through mockito
  WifiConfiguration: Expose NetworkSelectionStatus strings
  Add Bluetooth toggle prompts - framework
  [NAN] Add LV utilities (TLV with T size of 0).
  [NAN] Fix TlvElement member names - reflect public access.
  TetherUtil: Use ConnectivityManager for tethering
  [NAN] TLV utilities iterator - throw correct exception
  [NAN] Modify arguments from "array, length" to "array"
  [NAN] NAN System Api: RTT
  Properly disable WiFi tethering
  [NAN] Provide inteface MAC address to app.
  [NAN] Add (T)LV validation testing
  Add IPv6 tethering coordinator
  Stop listening for WiFi interface status changes
  [NAN] Add validity checks for service name
  [NAN] Fix assumption about Strings containing single-byte characters.
  [NAN] NAN data-path API: network specifier
  DO NOT MERGE StateMachine: remove final from SendMessage
  wifi: allow config of default+verbose ring buffers
  Don't save the anonymous identity for EAP-SIM/AKA/AKA-Prime
  Add a WifiScanner API to listener for ongoing scans
  Fix invitation request from persistent GC
  SettingsBackupAgent: Remove redundant size parameter
  WifiConfiguration: Make NetworkSelectionStatus public
  Use WifiManager for wifi backup/restore
  Fix race conditions between Tethering and TetherInterfaceStateMachine
  WifiManager: Add new API to restore old backup data
  Tethering: Own WiFi tethering state and lifetime
  IpConfigStore: Changes for parsing old wifi backup
  WifiManager: Add new API's for backup/restore
  XmlUtils: Add missing readThisByteArrayXml method
  Use an ArrayMap instead of HashMap to track tether interfaces
  Consolidate cleanup logic in TetherInterfaceSM.TetheredState
  Annotate TetherInterfaceStateMachineTest for APCT
  Rely on Tethering mutex for TetherInterfaceSM
  Rename TetherInterfaceSM to TetherInterfaceStateMachine
  [NAN] Add retry count for transmitting L2 NAN messages
  Remove dead code from TetherInterfaceSM
  Remove transient StartingState from TetherInterfaceSM
  Expand test coverage of TetherInterfaceSM
  Add demonstration unittest for TetherInterfaceSM
  Extract TetherInterfaceSM to its own class.
  Make Tethering.TetherInterfaceSM more self contained
  WifiManager: add WIFI_MODE_NO_LOCKS_HELD
  Create frameworks-base-testutils lib
  Clean up class members in Tethering.TetherInterfaceSM
  Move android.net.util.IpUtilsTest into a util/ directory
  Fix trivial warnings in Tethering.java
  Fix some trivial warnings in WifiP2pDevice.java
  [NAN] Add support for NAN RTT.
  [NAN] Remove OnNanDown notification from API
  Remove unused method from NetworkManagementService
  WifiConfiguration: Add new selection disable reasons
  [NAN] Add type and nullability annotations. Update hide annotation.
  [NAN] Add master switch to enable/disable usage of NAN APIs.
  [NAN] Re-factor connect/config flow
  [NAN] Refactor session lifecycle to clarify API & eliminate race conditions
  [NAN] Removed NAN event registration - dispatch all callbacks.
  [NAN] Consolidate publish/subscribe callback sets into single set
  [NAN] Replace session callback configuration control
  [NAN] Expose match style configuration as public API.
  [NAN] API cleanup - rename FLAGS.
  [NAN] Renamed listeners to callback per API guidelines
  [NAN]: API update - consolidate Puslish|Subscribe Data+Subscribe -> Config
  NAN: Support multiple instantiation per UID - introduce a client ID.
2016-08-29 20:03:22 +00:00
Felipe Leme
bb205d5e3e Merge "Fixed statuses on Battery Saver column."
am: 21e0701f76

Change-Id: I4125ff3ad049ef2717fe12ba7ca62d99bf9bd3c5
2016-08-29 18:44:28 +00:00
Felipe Leme
21e0701f76 Merge "Fixed statuses on Battery Saver column." 2016-08-29 18:32:27 +00:00
Felipe Leme
bd1a93a721 Fixed statuses on Battery Saver column.
BUG: 30139400

Change-Id: I1798607af13c9be5e1f21212fd7078f7152562bd
(cherry picked from commit 9e325706f42a1dc48abe80a24323fae4579ab033)
2016-08-29 11:27:16 -07:00
Roshan Pius
521c66e73c NetworkSelectionStatus: Fix copy constructor
Add couple of missing elements in the NetworkSelectionStatus copy constructor.

BUG: 31102798
Change-Id: Ie5f3719b94acf021d4ae2756afd635388640168c
(cherry picked from commit 699680b6b4fb923e4129d678013e3fbbc0421eaa)
2016-08-29 11:26:57 -07:00
Randy Pan
22de5aaca9 Deprecate QNS network disable reason BAD_LINK
WifiNetworkAgent#unwanted no longer disables the network.

Bug: 28558417
Change-Id: I2e7ed99ae4cb952f124c673376d967eeee2b4ece
(cherry picked from commit 4156d615707a7aa27ecaf55c889824fd025a75b5)
2016-08-29 11:26:57 -07:00
Etan Cohen
b81c35f54b [NAN] API changes/fixes addressing apilint issues
Bug: 30983968
Change-Id: I2189442755380ad5d04f80bcb5978ca0c28e6420
(cherry picked from commit 9825309424cab3a3efabac0bde79b3c1419f9be9)
2016-08-29 11:26:56 -07:00
Etan Cohen
30a472e6b3 [NAN] Add method to ConfigRequest to determine if non-default
To be used in permission check.

Bug: 27696149
Change-Id: I5be5aed93c556cf24b596bd2a7c5672502f84d74
(cherry picked from commit 8266b3f876e6b96ac0f18216b2011b03a0504a23)
2016-08-29 11:26:56 -07:00
Etan Cohen
b6701faaf0 [NAN] Simplify publish/subscribe configuration - merge match filters
Merge Tx/Rx match filters into single Match filter configuration. Only
a single filter can be used at a time (either Tx or Rx).

Bug: 30948496
Change-Id: I32a9a0306dfd08295bc63145bccfe3739862f17d
(cherry picked from commit 6007681b19510d2a739ab45c1754d869f8f15e72)
2016-08-29 11:26:55 -07:00
Etan Cohen
b0214c4cd5 [NAN] Udpate NAN API documentation, clean-up visibility
Change-Id: I951340eebab35c10efe98dab86b58fe8efada169
(cherry picked from commit 2e37b06dde2dff019b9143fc6b61021dab79bda3)
2016-08-29 11:26:55 -07:00
Etan Cohen
28035d98f0 [NAN] Do not expose WifiManager.isNanSupported as new API
The WifiManager.isXxxSupported() only functions if HAL is enabled
and seems to be a duplicate of:

PackageManager.hasSystemFeature(PackageManager.FEATURE_WIFI_NAN)

Bug: 28251988
Change-Id: I8f410def6f0bd3d3fc0926072ab66acce52a0e14
(cherry picked from commit a3264c4e3d08d38b08ab0c1c92341cb9cc8f29f8)
2016-08-29 11:26:54 -07:00
Etan Cohen
fd11ec1576 [NAN] Update finalize to check and warn user if resources not freed
Use CloseGuard to check that disconnect() is called to free the resources
allocated by connect(). finalize() will still call disconnect() but now
also print out errors (if StrictMode enabled for feature).

Bug: 28068773
Change-Id: I5f5847c0261ef9f79a21fdb935509a85761591cc
(cherry picked from commit 9d55649613f6ea9926c6e6222965178e91cb501b)
2016-08-29 11:26:54 -07:00
Etan Cohen
fc3c0a0582 [NAN] Fix bad merge use rethrowFromSystemServer
Added 'throw' to the 'e.rethrowXXX()'. Not needed but seems
to be the accepted style.

Change-Id: I75e42d68ee6092699a55e26ee05151373139606d
(cherry picked from commit cb34ec8f3a8dd40f7c49181b008de7314735ca66)
2016-08-29 11:26:53 -07:00
Mitchell Wills
07e317c3cd Add Log.wtf when transitionTo is used improperly
Using transitionTo in exit/enter (except in the terminal state) is
documented as undefined behavior and may cause unexpected results.
The current implementation appears to finish the current transition and
then transition to the new target state.

TEST=flash and play with the phone, no sign of immediate WTFs

Change-Id: I38a34b85c43d53c51514339587fc1269a069a454
(cherry picked from commit 8d3ed21583a8d83047cee1735cf669e131809e73)
2016-08-29 11:26:53 -07:00
Mitchell Wills
18af49395c Ensure BSSIDs are correctly aged out in settings view
When verbose logging is on, recent BSSIDs are displayed under the
network. This ensures that the BSSIDs are aged out after a period of
time instead of based on a fixed size LRU cache. This prevents BSSIDs
that are no longer present from appearing in the results.

FIXED=30711015
TEST=setup two APs, observe both BSSIDs in settings, turn off one,
     observe it disappearing after a short period of time.

Change-Id: Id2b2ccd0899eae8d4e2e1c2b3ae9409136a8c948
(cherry picked from commit b744d6e865e4141cd19cdf279f75f30c3d6590af)
2016-08-29 11:26:52 -07:00
Etan Cohen
4503dc6fba [NAN] Provide calling package name to service
Useful for permission checks.

Bug: 30000323
Change-Id: I8c7f06cff346437aa24ca5da9822cbd7b20c59c4
(cherry picked from commit 7531a28e2611039a8120305c14a96b8c61fff563)
2016-08-29 11:26:52 -07:00
Svetoslav Ganov
40f8b92518 Add WiFi toggle prompts - framework
If permission review is enabled toggling WiFi on or off
results in a user prompt to collect a consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

bug:28715749

Change-Id: I020601e208c0736005bcabc7b7b77b96eee45b03
(cherry picked from commit d3663c04a721e0848dd3e9179c84ba585d91839d)
2016-08-29 11:26:51 -07:00
Mitchell Wills
009ae99582 Reenable the unit tests for StateMachine
In order to make the tests run a few methods must be made public so that
they can be called from a class loaded by a different class loader.

Fixed: 28217358
Change-Id: I98ce1e952a78528ae6ebd3a0e843c9ddfe937337
(cherry picked from commit 36afe5b5cc000620d77150437ba21503c44c87eb)
2016-08-29 11:26:51 -07:00
Christopher Wiley
5de073a6b0 Remove WiFi related methods from NetworkManagementService
These are no longer necessary, since WiFi manages its own details.

Bug: 30041228
Change-Id: Ia3824da43367ae74d3f3a204318cfe5470d74957
Test: Compiles
(cherry picked from commit 212b95f587f4af637fb2429f29f7d0add1bd251f)
2016-08-29 11:26:50 -07:00
Mitchell Wills
079b2f342c Don't pull in external/junit through mockito
android-support-test provides a different version of junit

FIXED=30481239

Change-Id: I6d8f52d5f82b4c9905da8cc4a6ca79216eba9e26
(cherry picked from commit d3868cfc63cd814e43367586f5706f39ec1cd5a9)
2016-08-29 11:26:50 -07:00
Roshan Pius
47fb68bd24 WifiConfiguration: Expose NetworkSelectionStatus strings
Make the status/disable reason string arrays public to be used in
XmlUtil for restoring of data.

BUG: 30448209
Change-Id: If8201df9397edcc4251e5b6aa4d613212fb576ad
TEST: Unit tests
(cherry picked from commit 23173a2efa45e5159a9b958e31cf345f8f0c2347)
2016-08-29 11:26:49 -07:00
Svetoslav Ganov
6bc2a92a59 Add Bluetooth toggle prompts - framework
If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

Also added a configuration resource which controls whether
permission review mode is enabled. By default it is not and
an OEM can change this via an overlay. For now we also keep
the old mechanism to toggle review mode via a build property
which is still used and will be removed when clients have
transitioned.

bug:28715749

Partial cherry-pick of core/res/res/values/{config,symbols}.xml only
Change-Id: I94c5828ad6c8aa6b363622a26ff9da4fc2e2fac7
(cherry picked from commit ac69be543f89ea6e9a27204492e0a170d9b3450e)
2016-08-29 11:26:49 -07:00
Etan Cohen
0e70bdd7a5 [NAN] Add LV utilities (TLV with T size of 0).
NAN uses LV (not TLV). Expose an LV variant of TLV to make API
cleaner.

Bug: 30096512
Change-Id: I74b4c514d50f1df5750b521bd68a5e2d832d92c3
(cherry picked from commit 009b1fcb85ab8f8eb4ab5f3e125127b449df77cb)
2016-08-29 11:26:48 -07:00
Etan Cohen
2b1e7eabfc [NAN] Fix TlvElement member names - reflect public access.
Bug: 30096512
Change-Id: Ic2ab61e891bead6f6e8f13d9ac311ead8fecba5b
(cherry picked from commit e40b4d344e7e4529016fefe9f06f478504949706)
2016-08-29 11:26:48 -07:00
Christopher Wiley
090e9de648 TetherUtil: Use ConnectivityManager for tethering
In the past, enabling the SoftAP would cause tethering to happen because
of some unfortunate side effects.  This is no longer the case, and
using WifiManager for this purpose is not a good idea.

Bug: 30147602
Test: Can toggle tethering on/off via all of settings, quick settings,
      and quick quick settings.

Change-Id: Iebbfc6c48b3e8e3fa52d235594ded3502f5801a3
(cherry picked from commit 26bd4efcaaad4a866310d6421909645e81167d1f)
2016-08-29 11:26:47 -07:00
Etan Cohen
c579d20618 [NAN] TLV utilities iterator - throw correct exception
Make sure that iterator.next() validates that next element exists -
otherwise throw the exception specified by the interface.

Bug: 30096512
Change-Id: I327da433e3f1181e272c81ee503cbe8aab323f7e
(cherry picked from commit 3e5ac12302a78216e706be239dceb5175646bea0)
2016-08-29 11:26:47 -07:00