Commit Graph

333383 Commits

Author SHA1 Message Date
Tyler Gunn
79e2bf90c3 Prevent INTERACT_ACROSS_USERS exception in DefaultDialerManager.
When TelecomManager methods perform a read phonestate check from a work
profile user, it is possible to get an INTERACT_ACROSS_USERS exception.
This is due to the fact that the filterByIntent method was not calling
queryIntentActivitiesAsUser.

Test: Manual
Bug: 31304557
Merged-In: I6bc7419ba260050281d83e33f7f328ec5ccb3cd8
Change-Id: I2a1869162e5a52aed986a99cc378a6c630af4a70
2017-10-27 13:02:46 -07:00
Treehugger Robot
47b23176bd Merge "Ensure CallId is not null when connection creation is complete." 2017-10-27 19:09:47 +00:00
Treehugger Robot
6ac8f42d9e Merge "Fix: AccountManagerService crashed by accessing closed db" 2017-10-27 18:41:59 +00:00
Tyler Gunn
0a88f2e21b Ensure CallId is not null when connection creation is complete.
When calling "get" on the mConnectoinById map, a null callId will result
in an NPE.

In findConnectionForAction, defaulting to returning the "null" connection
which is the same behavior as if it isn't found.
In notifyCreateConnectionComplete, specifically checking if the callId
is null and skipping the onCreateConnectionComplete callback.
This scenario is possible if the connection is remove from the
ConnectionService before the connection complete callback comes back from
Telecom.

Test: Manual
Fixes: 62588734
Merged-In: I1de7a0a4cc9c630019e38b8154bfc1d470f56ae3
Change-Id: Ie610c51155ed417e0f916000fe20e4484bdb6603
2017-10-27 10:55:05 -07:00
Manoj Boopathi Raj
bf74a93eb2 Merge "Fixed NullPointerException in IpSecService-Netd binder layer" 2017-10-27 17:32:56 +00:00
Cassie Han
1565803cd2 Merge "Add the operator name and MCC/MNC in string format into the CellIdentity." 2017-10-27 17:17:54 +00:00
Hans Boehm
1455a1d0c0 Merge "Don't allocate GlobalRefs for BinderProxy" 2017-10-27 17:15:41 +00:00
Treehugger Robot
536d241fb2 Merge "Remove unused method on VersionedBroadcastListener" 2017-10-27 12:47:45 +00:00
Neil Fuller
4e0a02ce1f Merge changes from topic "tz_catchup1"
* changes:
  Add newly available version information to dumpsys
  Be more explicit about users
2017-10-27 09:54:15 +00:00
Erik Kline
5526d44916 Remove unused method on VersionedBroadcastListener
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - manually enabling USB tethering toward Wi-Fi worked
Bug: 32163131

Change-Id: I38e4b77a7d59584ebeb450ebe5a9dcbcb36f4fa1
2017-10-27 14:17:04 +09:00
Hans Boehm
bd6d3c5743 Merge "Convert Binder & BinderProxy to NativeAllocationRegistry" 2017-10-27 03:27:29 +00:00
Tetsutoki Shiozawa
be2d96a724 Fix: AccountManagerService crashed by accessing closed db
Symptom:
When a current user was switched, AccountManagerService crashed with
IllegalStateException.

Root cause:
accountsDb was closed when user was stopped. AccountManagerService
tried to insert a log record to the closed db and it failed.

Solution:
It catches the exception if it's failed to insert a log record.

Bug: 68233592
Change-Id: I97b63e4777bf7f8a1d38d96e494f6a21847d374b
2017-10-27 02:24:38 +00:00
Treehugger Robot
171c82acb4 Merge "IMMS should preserve enabled/selected IMEs upon boot" 2017-10-27 00:49:19 +00:00
Yohei Yukawa
1f9a3cbe39 IMMS should preserve enabled/selected IMEs upon boot
This is a follow up CL to my refactoring CL [1], which unintentionally
changed the condition to reset default enabled IMEs when the device
boots up.

Previously, InputMethodManagerService (IMMS) resets default enabled
IMEs upon device boot only for the first boot scenario, by checking
whether Settings.Secure.DEFAULT_INPUT_METHOD is already set or not.

My refactoring CL accidentally replaced that check with unconditional
"true", which means now IMMS always resets default enabled IMEs every
time the device boots up.  This behavior change is of course
unintentional but has no effect after the user unlocks the device
because IMMS also discard all the settings change made while
UserManager.isUserUnlocked() returns false [2].  Hence the above
behavior change is completely hidden on direct-boot disabled devices,
where the system behaves as if the user unlocked the device
immediately after the boot is completed.  The behavior change is
observable only on direct-boot devices.

Anyway, IMMS should try to do its best to keep the last used IME and
user selected IMEs even in user locked state as long as those IMEs
are compatible with direct-boot.  This CL revives the previous
behavior by adding the same condition check again.

 [1]: I5b37c450db4b25b3e635b6d634293a34eec8b9d4
      7924782c00
 [2]: Ifa2225070bf8223f8964cf063c86889e312c5e9a
      ed4952ad0f

Fixes: 67093433
Fixes: 67491290
Test: Manually verified as follows
      1. Check out AOSP master
      2. Build an OS image for a direct-boot aware device then
         flash it.
      3. Open
            development/samples/SoftKeyboard/AndroidManifest.xml
         then add
            android:directBootAware="true"
         to the IME service.
      4. Open
            development/samples/SoftKeyboard/res/xml/method.xml
         then add
            android:isAsciiCapable="true"
         to "en_US" IME subtype.
      5. tapas SoftKeyboard
      6. make -j
      7. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
      8. Open system settings:
           System -> Languages & input -> Virtual keyboard
	     -> Manage keyboards
      9. Enable Sample Soft keyboard
     10. Disable Android Keyboard (AOSP)
     11. Open system settings:
           Security -> Screen lock -> Password
         then set up a device password "aaaa".
     12. Reboot the device.
     13. Make sure that
          * Sample Soft keyboard is shown in the unlock screen.
          * AOSP Keyboard is not enabled in the unlock screen.
Change-Id: Id624d577d941245cca944498dc6935eb364865cf
2017-10-26 15:00:59 -07:00
Hans Boehm
29f388fc21 Don't allocate GlobalRefs for BinderProxy
This removes all GlobalRef allocation as part of building BinderProxys.
Previously these were used to map IBinders to the corresponding
Java object, so the Java objects could be reused. We now keep
that mapping at the Java level.

This means we often need to call into Java to look up or allocate
a BinderProxy. But this replaces a prior call to Java to dereference
a WeakReference. The Java custom Java map-to-WeakReference data
structure is probably not terribly efficient, but the original
attachement mechanism did not seem to be either. And this
avoids potentially even more catastrophic issues when the number
of GlobalRefs approaches its limit.

We decrease GC triggering frequency from 200 to 1000 allocated
references. This now only applies to other kinds of JNI References
allocated by Binder.

I saw a maximum bucket size of 16 for the ProxyMap data structure
while briefly exercising a freshly booted device. That occurred
in system_server.

Bug: 65760710

Test: Built and booted master with some debugging output. Looks sane.
Change-Id: I322c4d8e9c8e198586d591580c2cdbb094906677
2017-10-26 13:34:19 -07:00
Manoj Boopathi Raj
fffa8113e0 Fixed NullPointerException in IpSecService-Netd binder layer
Replaced null with empty byte array in createTransportModeTransform
for null auth.getKey, crypt.getKey() and authCrypt.getKey()

Test: Ran CTS test
Bug: 68052730
Change-Id: I5110b1297b4bfbb5766e8ecfd3d64f8110b52945
2017-10-26 13:10:22 -07:00
Hugo Benichi
9009eabbfe Merge changes I59b6e04f,I55694d89
* changes:
  Remove Parcelable interface from DefaultNetworkEvent
  Extract logging of default network events
2017-10-26 06:01:06 +00:00
Treehugger Robot
28ed91161d Merge "HwBinder: Clean up code, add logging" 2017-10-26 01:52:40 +00:00
Colin Cross
d4609af986 Merge "Convert framework-protos to Android.bp" 2017-10-26 01:01:08 +00:00
Hans Boehm
5e5b13f27e Convert Binder & BinderProxy to NativeAllocationRegistry
Change the Java BinderProxy to only contain a single native pointer,
so that we can get by with a single NativeAllocationRegistry
registration. This adds some indirections and a new allocation. But it
marginally reduces the number of (expensive) JNI field lookups from
native code, and the extra allocation involves significantly less
overhead than registering each object twice. This also cleans up the
code a little by avoiding some explicit reference count adjustments.

Change BinderProxy Binder to use NativeAllocationRegistry instead of
finalize().

Change the mObject field in Binder to hold a non-reference-counted
but owning pointer to JavaBBinderHolder. Have JavaBBinderHolder no
longer inherit from RefBase.

Make it clear that neither Binder.mObject, not BinderProxy.mNativeData
can be null. Remove null checks.

Avoid checking for null returns from C++ new. It would throw
anyway, which would cause the process to abort.

Test: Booted master.

Bug: 65760710

Change-Id: I323d4bdc7e25f8c27b847b6fe2c073eac3f2efe5
2017-10-25 17:17:24 -07:00
Hans Boehm
ceb336fc8a Merge "Fix issue #64224738: Document return value of IBinder.transact()" 2017-10-26 00:01:12 +00:00
Treehugger Robot
65944e79b2 Merge "android.os.HwBinder: fix native static method signature" 2017-10-25 22:08:36 +00:00
Andreas Gampe
63c0193331 HwBinder: Clean up code, add logging
Used ScopedUtfChars to handle lifetime, and correctly throw NPE. It
is illegal to call JNI String functions with a null argument.

Output the service name when starting a thread pool to aid debugging.

Bug: 68217725
Test: m
Test: Device boots
Change-Id: Ie40d3e77a63918330ef1a8a9e0c294f2c451a52a
2017-10-25 15:07:08 -07:00
Dianne Hackborn
8de9566375 Fix issue #64224738: Document return value of IBinder.transact()
Also add appropriate @NonNull and @Nullable annotations.

Test: built

Change-Id: I22de48105ef685baf594cfc004dd3e27e2ba09e9
Merged-In: I22de48105ef685baf594cfc004dd3e27e2ba09e9
(cherry picked from commit 4cd650c008)
2017-10-25 14:21:32 -07:00
Brad Ebinger
3ab81b9694 Merge "Fix dial emergency call redial issue by China Unicom." 2017-10-25 20:36:17 +00:00
Yifan Hong
029b08c807 android.os.HwBinder: fix native static method signature
Test: pass
Change-Id: I54c384abaad7c7aafab31836f34edee5c7c75aac
2017-10-25 13:19:22 -07:00
Jordan Liu
f4f4ba3d42 Merge "Make it possible to dial an operator specific code" 2017-10-25 18:22:31 +00:00
Treehugger Robot
14a51058b1 Merge "Improve NetworkCapabilities docs." 2017-10-25 17:16:03 +00:00
Cassie
933b78d977 Add the operator name and MCC/MNC in string format into the CellIdentity.
Bug: 63984327
Test: Basic telephony sanity
Change-Id: Ia5e7f5b980efbde647f95f3e83a62d56132b90da
2017-10-25 10:04:31 -07:00
Treehugger Robot
c21effd526 Merge "Switch to listening for CarrierConfig changes for provisioning rechecks" 2017-10-25 13:37:40 +00:00
Neil Fuller
562df0e05c Add newly available version information to dumpsys
The tzlookup.xml file now contains a rules version
so we can output that from dumpsys timezone now
too. That is used in xTS tests to confirm that
the correct tzlookup.xml file is being used
on device.

Bug: 65575839
Test: PTS: run pts -m PtsTimeZoneTestCases
Change-Id: Ib8cd3a41c625c6b442c0b9775108e4015ed020e2
Merged-In: Ib8cd3a41c625c6b442c0b9775108e4015ed020e2
(cherry picked from commit c90361404a)
2017-10-25 14:09:35 +01:00
Neil Fuller
b755291e65 Be more explicit about users
Be more explicit about users executing processes in the time
zone updates code.The code was already running everything as the
system user but now that's more explicit / by design.

To service unit tests:
make -j30 FrameworksServicesTests
adb install -r -g "${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk"
adb shell am instrument -e package com.android.server.timezone -w com.android.frameworks.servicestests \
  "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

Bug: 64111659
Test: Unit tests: See above
Test: Manual testing installing updates as secondary device user
Test: PTS: run pts -m PtsTimeZoneTestCases
Change-Id: Idb754f3e1aa3830ba1ada8ef5740f9f7340f03d5
Merged-In: Idb754f3e1aa3830ba1ada8ef5740f9f7340f03d5
(cherry picked from commit 1281f39f86)
2017-10-25 14:00:24 +01:00
Steven Moreland
65d1e549b6 Merge "Revert "HIDL Java getService now the same as C++."" 2017-10-25 04:50:08 +00:00
Steven Moreland
cc9e67c019 Revert "HIDL Java getService now the same as C++."
Appears to be causing problems on 2017 devices.

This reverts commit c1f00f8cd8.

Change-Id: I6c1717a612bfa3fe63f08160a1db652c284f6ba4
2017-10-25 04:46:26 +00:00
Colin Cross
a12eab69d1 Merge changes from topic "keystorebp"
* changes:
  Convert lockregioncodeinjection to Android.bp
  Export AIDL for keystore Android.bp.
2017-10-25 04:43:08 +00:00
Hugo Benichi
1193a9c9ab Remove Parcelable interface from DefaultNetworkEvent
This patch takes advantage of the direct DefaultNetworkMetrics interface
between ConnectivityService and IpConnectivityMetrics and removes the
Parcelable interface from DefaultNetworkEvent.

IpConnectivityMetrics, IpConnectivityEventBuilder and associated tests
are updated as necessary.

Bug: 34901696
Test: runtest frameworks-net
Change-Id: I59b6e04fc126051320d08a422cfbd4d27042123e
2017-10-25 12:40:13 +09:00
Hugo Benichi
64901e5963 Extract logging of default network events
This patch extracts the logging of DefaultNetworkEvent from inside
ConnectivityService and move it to a new DefaultNetworkMetrics class.

The DefaultNetworkMetrics is a singleton owned by the
IpConnectivityMetrics singleton implementing the metrics service for
core networking. ConnectivityService has access to this singleton via
LocalServices.

This class layout will allow to remove the Parcelable interface of
DefaultNetworkEvent and will instead let the IpConnectivityMetrics
service grab metrics from the DefaultNetworkMetrics directly.

Bug: 34901696
Test: runtest frameworks-net
Change-Id: I55694d89124272732aba114198776462372de18b
2017-10-25 12:36:29 +09:00
Jeff Sharkey
de570313bb Improve NetworkCapabilities docs.
Add IntDef for constants, and rely on new auto-documentation feature
to expand all of them at usage sites.

Test: docs-only change
Bug: 64133169
Change-Id: I8a6b5f54c8eb9d4fc7ae3d0d3fb673d52320664b
2017-10-24 21:26:04 -06:00
Treehugger Robot
61e3189ec7 Merge changes I119cf83a,Icc5a1e38,If07a04d3
* changes:
  Binder: Update to new ScopedLocalRef
  Binder: Clean up JNI code
  Binder: Change reaction to Error
2017-10-25 02:34:18 +00:00
Treehugger Robot
0c41ad872f Merge "HIDL Java getService now the same as C++." 2017-10-25 01:53:16 +00:00
Colin Cross
747e7c15d8 Convert framework-protos to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Change-Id: Id7992ff0cc5d631b64c1fa8e82e8a130ea508236
2017-10-24 17:48:49 -07:00
Andreas Gampe
3d5811d3ce Binder: Update to new ScopedLocalRef
Follow-up to commit 625e0007ac and
commit fac8cb2405999d18aefd75387a5bbdb0c6160e7f.

(cherry picked from commit 8571ec370d)

Bug: 64689630
Test: m
Merged-In: I119cf83a5a54c15973ed3701ee448a9590bb404d
Change-Id: I119cf83a5a54c15973ed3701ee448a9590bb404d
2017-10-24 17:13:52 -07:00
Andreas Gampe
2b1494fc0a Binder: Clean up JNI code
Factor out Error handling code and clean up. Use ScopedLocalRef,
fix minor logic issues.

(cherry picked from commit 625e0007ac)

Bug: 64689630
Test: m
Test: manual test
Merged-In: Icc5a1e38fa66aa79d87d0abb81acef6918ca78f5
Change-Id: Icc5a1e38fa66aa79d87d0abb81acef6918ca78f5
2017-10-24 17:11:11 -07:00
Andreas Gampe
176e3e2909 Binder: Change reaction to Error
Instead of aborting immediately with a native error, try to call
Thread.dispatchUncaughtException to trigger a Java-side abort.
Only fall back to the old strategy if this fails.

(cherry picked from commit 1cd76f5c93)

Bug: 64689630
Test: m
Test: manual test
Merged-In: If07a04d3769f3b9181c4736220333df9a2871a16
Change-Id: If07a04d3769f3b9181c4736220333df9a2871a16
2017-10-24 17:08:18 -07:00
Colin Cross
a218b561e8 Convert lockregioncodeinjection to Android.bp
See build/soong/README.md for more information

Test: m checkbuild
Change-Id: I78e91a70e786df8e6722c6ec3fe762371e8f475a
2017-10-24 16:09:01 -07:00
Jeff Sharkey
01478ec183 Export AIDL for keystore Android.bp.
Test: builds, boots
Bug: 67041047
Change-Id: Iaff1de1f9c015a824ffc1f4946ced4a13d9bd7c1
Merged-In: Iaff1de1f9c015a824ffc1f4946ced4a13d9bd7c1
(cherry picked from commit 0c686e78ad)
2017-10-24 16:09:01 -07:00
Kazuya Ohshiro
990af17cd3 Make it possible to dial an operator specific code
Added a new array config that indicating list of
FAC (feature access codes) to dial as a normal call.

Test: manual - Checked that special codes which configured in
CarrierConfig are dialed as a normal call.
Bug: 67664279

Change-Id: I1c4b60ae4f28c25e55b38563fe445f831793d466
2017-10-24 15:51:47 -07:00
Treehugger Robot
03c6030ce9 Merge "Copy layout file of preference category from Settings." 2017-10-24 22:22:57 +00:00
Malcolm Chen
464a977ac3 Copy layout file of preference category from Settings.
Platform packages other than Settings may also use this layout to
be consistent with Settings.

Test: manual
bug: 62200881
Change-Id: I9e45772abac5aacfabbbafb38e287d0b523ef694
Merged-In: I9e45772abac5aacfabbbafb38e287d0b523ef694
2017-10-24 14:14:31 -07:00
Benedict Wong
d6ab173f6c Merge "Return a port from bindToPort() in IpSecService"
am: 9305fb7ea1

Change-Id: I51705d5db6af560f2423ef7861bfde6734632ec9
2017-10-24 16:44:59 +00:00