322899 Commits

Author SHA1 Message Date
Colin Cross
3abddeca75 Merge "Fix errorprone build" 2017-08-30 00:25:36 +00:00
Colin Cross
46a435a378 Fix errorprone build
Fixes:
frameworks/base/tests/net/java/com/android/server/connectivity/tethering/OffloadControllerTest.java:149: error: [JUnit4TestNotRun] Test method will not be run; please add @Test annotation
    public void testNoSettingsValueDefaultDisabledDoesNotStart() throws Exception {
                ^
    (see http://errorprone.info/bugpattern/JUnit4TestNotRun)
  Did you mean '@Test'?
frameworks/base/tests/net/java/com/android/server/connectivity/tethering/OffloadControllerTest.java:170: error: [JUnit4TestNotRun] Test method will not be run; please add @Test annotation
    public void testNoSettingsValueDefaultEnabledDoesStart() throws Exception {
                ^
    (see http://errorprone.info/bugpattern/JUnit4TestNotRun)
  Did you mean '@Test'?

Bug: 64489631
Test: m -j RUN_ERROR_PRONE=true javac-check
Merged-In: Ib32489d07778465134bca52c589baddbd78ab129
Change-Id: I41dfdf87529e532df385617fa05c7006a7a14c86
2017-08-29 12:54:11 -07:00
Jason Monk
7d4e9b81b4 Merge "Fix QS user icon in guest mode" 2017-08-29 14:25:12 +00:00
Joachim Sauer
e048261656 Merge "Adapt ICU 59 API update to Doclava changes." 2017-08-29 13:42:26 +00:00
Akari Tsuneta
23fdba10d2 Fix QS user icon in guest mode
When the profile is updated in guest mode, the user icon in QS footer
is not displayed correctly. To fix this issue, the tinting of
guest icon is applied only when the drawable is not UserIconDrawable.

Fixes: 65148947
Test: manual - switch to guest and update the profile.

Change-Id: I9690e9fd286703a25ee08d877c3dd7f4729e2b31
2017-08-29 10:32:32 +00:00
Joachim Sauer
e447d9f0fb Adapt ICU 59 API update to Doclava changes.
Add methods that were missing from the previous API update because the
update-api version used for that had different behaviour from the
current one.

Specifically overrides for methods that differ only in sychronization
are now considered API-worthy and weren't before (b/62576297).

All methods added in this commit are methods that exist in the base
class without synchronization and are synchronized in the class they are
now being added in.

Bug: 64807220
Test: m checkapi
Change-Id: I9bf1b3d02e6a8f04b93ec36c0adffb7eedad3ad3
Merged-In: Iff584fb72dc8d651f9482b573f4b8cec89840ca6
2017-08-29 11:26:29 +01:00
Jakub Pawlowski
3cc1ad87f0 Merge "Fix GATT client leakage when scan is throttled (1/2)" 2017-08-29 08:00:55 +00:00
Hugo Benichi
91817b3129 Merge "Nat464Xlat: interface notification handler on ConnectivityService" 2017-08-29 05:08:00 +00:00
Hugo Benichi
771d5c2f01 Nat464Xlat: interface notification handler on ConnectivityService
This patch adds a layer of asynchonicity to the NetworkBaseObserver
callbacks implemented by Nat464Xlat in order to allow these callbacks
to run on the main ConnectivityService handler.

This allows to run interfaceLinkStateChanged and interfaceRemoved
callbacks in the same thread context as other Nat464Xlat methods and
solves the following issues:
  - NPE risk due to race between fixupLinkProperties called on the
    ConnectivityService thread and interfaceRemoved called as a
    callback by NetworkManagementService.
  - stale LinkProperties reads in both callbacks not called on
    ConnectivityService handler.
  - removes the race between stop() and interfaceRemoved().

This patch also:
  - removes/simplifies comments related to the threading
    model which are no obsolete.
  - extract clatd management logic from ConnectivityService into
    NetworkAgentInfo

Bug: 62997041
Bug: 64571917
Test:  runtest frameworks-net
       manually connected to ipv6 network and went to test-ipv6.com
Change-Id: I889d98e47423ff3d4746d6ed8015b265286e7c52
2017-08-29 08:55:18 +09:00
Colin Cross
edb2e0c722 Merge "Use guava 21.0" 2017-08-28 23:50:52 +00:00
Hugo Benichi
aee703e7e4 Merge "Nat464Xlat: internal state guards cleanup + state enum" 2017-08-28 22:30:27 +00:00
Treehugger Robot
3c28e2b280 Merge "Fixed mimetype error of PPT file" 2017-08-28 22:12:37 +00:00
bokyung.kim
9806330b52 Fixed mimetype error of PPT file
Change mimetype of PPT file to match MS specification.
(MimeUtils.java matched the MS specification)

Test: Check mimetype of DB after saving PPT file.

Change-Id: Ie559499ae39bc527fcc656ba37f28845af209e6c
Signed-off-by: bokyung.kim <bokyung.kim@lge.com>
2017-08-28 13:16:35 -07:00
Treehugger Robot
11ae580f81 Merge "Ensure the generation is not changed before put value to cache" 2017-08-28 19:42:11 +00:00
Jakub Pawlowski
ee02e1ce77 Fix GATT client leakage when scan is throttled (1/2)
Currently, scan throttling happens after client is registered, but
before the scan is started. This might lead to scan client being leaked.
This patch fixed that by moving check before client registration.

Bug: 64887233
Test: manual
Change-Id: I22ae624a0c51110cb69679f796926e3b2b36d0ac
2017-08-28 18:09:03 +00:00
Edward Savage-Jones
4d318287ba IllegalArgumentException in MagnificationGestureHandler
When enabling the magnifier feature it is possible to trigger
a system crash.

Problem:
On ACTION_DOWN a MESSAGE_ON_ACTION_TAP_AND_HOLD is sent to the
handler with a delay based on long-press timeout.  If the user
then removes their finger while outside of the magnification area,
(ACTION_UP) this message is not removed.  Then when the message
is handled on long-press timeout, it puts the state into
STATE_VIEWPORT_DRAGGING.  If the user then taps the screen again
it is handled by the StateViewportDraggingHandler resulting in:

 IllegalArgumentException: Unexpected event type: ACTION_DOWN

and a system server crash.

Bug: 65101895
Test: Manual:
1. Enable "Magnify with button" from accessibility settings
2. Tap accessibility button on the right navbar
3. Touch & hold bottom part of application area
4. Quickly drag down to the navbar and release
5. Touch anywhere
With this patch it should not crash

Change-Id: I7df8d2185f6db9d148d24d2b155cb357b3637a71
2017-08-28 15:26:31 +00:00
Treehugger Robot
c0d8300b32 Merge "Trivial change to test expectations." 2017-08-28 12:39:29 +00:00
Hugo Benichi
81b179cfdd Merge "Nat464Xlat: clat management cleanup" 2017-08-28 11:47:08 +00:00
Lorenzo Colitti
f612b609db Trivial change to test expectations.
(cherry picked from commit 0fee732ca579bbc4320ade35f238bdfa1aa500f5)

Bug: 32163131
Test: runtest frameworks-net
Change-Id: Iec8af5191b4da495e47ef97d70a03a5d2e75cfe2
2017-08-28 18:58:13 +09:00
Lorenzo Colitti
5fe8e51904 Merge "switch to native_handle_create() for passing ownership" 2017-08-28 08:02:19 +00:00
Hugo Benichi
4f6f139869 Nat464Xlat: internal state guards cleanup + state enum
This patch does some cleanup of Nat464Xlat internal state guards
against the Nat464Xlat state Idle | Started | Running, which reduces
code nesting.

It also replaces introspection of internal state for distinguishing
between different stages in 464xlat lifecycle with an enum explicitly
introducing these three Idle | Started | Running states.

Bug: 62997041
Bug: 64571917
Test:  runtest frameworks-net
       manually connected to ipv6 network and went to test-ipv6.com
Change-Id: I6efc9fed2420ca488731a2b9b9c3c025b16eca10
2017-08-28 15:29:27 +09:00
Hugo Benichi
b577d65825 Nat464Xlat: clat management cleanup
This patch does some minor refactoring of clat starting/stopping code:
 - remove unused LinkProperties arguments in updateClat
 - remove unused Context argument in Nat464Xlat ctor
 - introduce ensureClatIsStarted and ensureClatIsStopped methods and
   simplify updateClat
 - add clatd to NetworkAgentInfo toString() method
 - clarify some comments

This changes prepare for moving BaseNetworkObserver callbacks to
ConnectivityService.

Bug: 62997041
Bug: 64571917
Test: runtest frameworks-net
      manually connected to IPv6 only network and went to test-ipv6.com
Change-Id: Idb204784614cfe700f73255a7a7b78c5e9ee6eca
2017-08-28 15:29:23 +09:00
Treehugger Robot
b5b1308f2f Merge "DeviceInfoUtils.java: support to show kernel version compiled with clang" 2017-08-26 00:24:23 +00:00
Lingjun Li
3652b9453f Whitelist free sms shortcode 76551 in Mexico for constlletion.
Constellation team has acquire a free shortcode 76551 in Mexico
for contellation MO verification. We don't want to scare people
by poping up the non-necessary warning dialog.
BUG: 65050702
Test: manual

Change-Id: Iab79032f31f99c80a750e02be0f1e6c32aa85363
2017-08-25 13:22:46 -07:00
Brad Ebinger
b3b09849bc Merge "Emergency redial implementation" 2017-08-25 20:05:53 +00:00
Colin Cross
3b0ea225ab Use guava 21.0
guava 20.0 is being removed.

Test: m -j checkbuild
Change-Id: I48ac4f641da3567985339c061dad5d60829aeee0
2017-08-25 11:27:46 -07:00
Shuo Qian
387ed22fef Merge "Add new error code in SmsManager" 2017-08-25 18:01:18 +00:00
Srikanth Chintala
fcb1501620 Emergency redial implementation
Define connection event to notify
Telecom/InCallUi about change in
account handle after redial and extra
for emergency phone handle.

Bug: 27059146
Change-Id: Ie72ab2901ec05d972204ed11f115a05b79173c1d
2017-08-25 10:08:56 -07:00
Mark Salyzyn
0172ce8dbf Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property" 2017-08-25 14:16:12 +00:00
Erik Kline
f57aeea077 switch to native_handle_create() for passing ownership
Test: builds
Bug: 29337859
Bug: 32163131
Bug: 64976634
Change-Id: Ifd064736c9fcb633b72e56e93b7baa5f4a5ff051
2017-08-24 18:33:35 -07:00
xulicheng
a5db9b42ea Ensure the generation is not changed before put value to cache
It may get old value from mValues, so check the generation
is not changed before update cache

Bug: https://issuetracker.google.com/issues/64995655
Test: Build
Change-Id: Ia7ae18baa269d0590e36f186e2f14b0bfbab3504
Signed-off-by: xulicheng <xulicheng@xiaomi.com>
2017-08-25 01:22:24 +00:00
Tyler Gunn
3b166fba8a Merge "Track conference start in system elapsed time." 2017-08-24 22:24:16 +00:00
sqian
85bb4b35f1 Add new error code in SmsManager
Design doc: https://docs.google.com/a/google.com/document/d
/1YPTNoM2Atjz8oISGAsRYlFVSA1NcYP8MbqYQIzLcJ9E/edit?usp=sharing

Test: compile/flash code; test locally
Bug: 34773406
Change-Id: I0b227e76048dd46d9c8023d37647db763e1e38e1
Merged-In: I0b227e76048dd46d9c8023d37647db763e1e38e1
2017-08-24 14:40:59 -07:00
Treehugger Robot
573948c49c Merge "Add new telephony disconnect causes for low battery scenario." 2017-08-24 21:33:55 +00:00
Treehugger Robot
838ab94a0f Merge changes from topic "bt-fix-checkstyle-errors"
* changes:
  Fix checkstyle errors (2/2)
  Fix checkstyle errors (1/2)
2017-08-24 21:25:49 +00:00
Tyler Gunn
69388170d7 Add new telephony disconnect causes for low battery scenario.
LOW_BATTERY is for disconnect mid-call due to low battery.
DIAL_LOW_BATTERY is for failure while dialing due to low battery.

Test: Manual.
Merged-In: Ife7a4ca5645b3fb42ab20effb4d8d4a8fef8116b
Change-Id: Ife7a4ca5645b3fb42ab20effb4d8d4a8fef8116b
Fixes: 63936576
2017-08-24 13:08:01 -07:00
Jack He
2992cd084c Fix checkstyle errors (2/2)
* Manual style corrections with IDE assistance
* Variable name refactors are done through IDE
* Corrected general style errors such as:
  - "final private var" -> "private final var"
  - "&&", "+", "||" should not be at the end of line
  - Non-static private variable should be like "mVar"
  - Private static variable should be like "sVar"
  - Code file should always end with newline
  - Inherited methods should be annotated with @Override
    and no @hide tags
  - Public methods should always have a JavaDoc entry
  - "int[] array" is preferred over "int array[]"
  - private methods should be accessed without "this."
    when there is no name collisions.
  - "boolean ? true : false" -> boolean
  - "boolean ? false : true" -> !boolean
  - "boolean == true" OR "boolean != false" -> boolean
  - "boolean != true" OR "boolean == false" -> !boolean

Bug: 63596319
Test: make checkbuild, no functional changes
Change-Id: Iabdc2be912a32dd63a53213d175cf1bfef268ccd
2017-08-24 19:09:58 +00:00
Jack He
a355e5efaf Fix checkstyle errors (1/2)
* Automatic style corrections through IDE

Bug: 63596319
Test: make checkbuild, no manual changes, no functional changes
Change-Id: I2397d55abc34c9b7a9b748bec6137778df3421a7
2017-08-24 19:09:48 +00:00
Yongqin Liu
fa89b60167 DeviceInfoUtils.java: support to show kernel version compiled with clang
The kernel version displayed in settings is only shown correctly
when built with gcc, this change adds support for a kernel built
with clang.

Test: manually on hikey with following command:
adb shell am instrument -w -e class com.android.settings.DeviceInfoSettingsTest com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner

Change-Id: I9b7991681cb5abdf44e7d1d1bff84c7c866be2ed
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2017-08-24 19:19:09 +08:00
Treehugger Robot
b09cf3fbf1 Merge changes from topic "offload_cherrypick"
* changes:
  Send add/removeDownstream info to offload HAL
  Don't completely stop offload if setting data limit fails.
2017-08-24 05:18:23 +00:00
Erik Kline
b3bb26eaa7 Send add/removeDownstream info to offload HAL
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passed
Bug: 29337859
Bug: 32163131

Merged-In: I0cb81ac054fc2bf6c8b8bfe658e9404a15091d7a
Merged-In: I7abcdcc2d7d967179c47081a6db2b417164891f3
Change-Id: I6c59aa7cb80b54f376f294b24c1409710c553d74
(cherry picked from commit ed962a84122ab950a103fbbc0bf911f61b6b9500)
2017-08-23 20:55:47 -07:00
Lorenzo Colitti
ddce7ee20f Don't completely stop offload if setting data limit fails.
Currently, if setting a data limit fails, we completely stop
offload in order to avoid data overages. However, the next thing
we do is try to fetch the stats and crash, because once offload
is stopped all our local state is cleared.

Fix this by fetching stats before we stop offload.

Bug: 29337859
Bug: 32163131
Bug: 64867836
Test: OffloadControllerTest passes
Test: no crash when disabling wifi tethering with BT tethering active
Merged-In: I7fc47e60b2da5f39c26fb22c1325618f9948dd38
Merged-In: I464dd2a6d1996b1cfb8bbf82b6ee453fd0747569
Change-Id: I260f5450f8b67f055983af68fb23a5f3cfc0bc69
(cherry picked from commit d743601a002ac12c02da58e92ebd0544ab0b77ea)
2017-08-23 20:51:35 -07:00
Hugo Benichi
29b1826ff2 Merge "Make NetworkManagementServiceTest pass again." 2017-08-24 03:36:20 +00:00
Hugo Benichi
ff12ba9376 Merge "Tethering offload stats updates are eventually consistent" 2017-08-24 02:37:03 +00:00
Hall Liu
3f6a95e8b0 Merge "Embms adjustments for 7/28" 2017-08-23 20:18:15 +00:00
Hall Liu
8e47fe35c8 Embms adjustments for 7/28
* Move some vendor intents and extras into a VendorIntents class
* Add a download result RESULT_IO_ERROR
* Add documentation noting that repeated calls to
setTempFileRootDirectory will not throw an error if the parameter is the
same.
* Add getTempFileRootDirectory method for app
* Hide AIDL classes from the public/system API surfaces for download
* Remove size and md5hash from FileInfo

Change-Id: I8c968a7d68db2588ee550167ed2693fe89c5925a
2017-08-23 10:56:09 -07:00
Hall Liu
489dcb7cca Merge "Embms API adjustments for 7/21" 2017-08-23 16:37:50 +00:00
Hugo Benichi
752c1287bd Tethering offload stats updates are eventually consistent
This patch removes the call to runWithScissors() in
OffloadController#getTetherStats() that was causing a deadlock when
NetworkStatsService would be polled for stats in certain threading
contexts.

Instead of trying to query the tethering offload HAL synchronously all
the time, this patch:
 - changes getTetherStats() to only call into the offload HAL when it
   detects that it is called on the same thread as the Tethering handler
   thread.
 - changes the map of interface to accumulated tethering forwarded stats
   to be concurrent.

This makes stats reading from getTetherStats() eventually consistent.
From the point of view of getTetherStats(), it preserves the guarantees
that tethering stats are monotonically increasing, and also guarantees
no tearing between rx bytes and tx bytes.

Bug: 29337859
Bug: 32163131
Bug: 64771555
Test: runtest frameworks-net
Merged-In: Ibcd351ad0225ef146b00a807833f76d2a886f6c1
Merged-In: I61786d61fe1422e429c0dd9eadaff6f02eb850e7
Merged-In: I999d1d1bf72e7ab02c5d17f37aad00bc711d3fc5

(cherry pick from commit eb5e465edd78bea26289f779b635c7e94d934854)

Change-Id: I28646b962cee8c8a6efd66059f84873c02ac5810
2017-08-23 09:58:09 +09:00
Lorenzo Colitti
a086800e04 Make NetworkManagementServiceTest pass again.
1. Mock the service manager so that NMS can fetch mock versions
   of INetd and IBatteryStats.
2. Call LocalServices.removeServiceForTest to avoid a duplicate
   service registration error. // check this
3. Change the timeout from 100ms to 200ms, as otherwise the tests
   that check for IfaceClass fail.
4. Convert NetworkManagementServiceTest to JUnit 4.
5. Move NetworkManagementServiceTest to tests/net

Bug: 29337859
Bug: 32163131
Bug: 32561414
Bug: 62918393
Test: runtest frameworks-net
Change-Id: Ic7371b427b35809ccd446addf35c9d8ae99ccfd3
2017-08-23 09:49:05 +09:00
Hall Liu
d5c955fcdc Embms API adjustments for 7/21
* Enforce that only one instance of each manager can be active.
* Add a death receipient for both managers to notify the app of binder
death
* Add documentation informing the app that it may not call create()
multiple times
* Fix a collision in streaming state reason codes
* Add documentation in DownloadRequest to indicate which methods should
be called by the middleware.

Change-Id: Ie15283b5c34fee736e8023dbd4f889c2ca95299e
2017-08-22 17:07:48 -07:00