Commit Graph

91705 Commits

Author SHA1 Message Date
Hung-ying Tyan
c359bbe0ec Allow all system configs in /product
Bug: 115848786
Bug: 110072687
Bug: 80053945
Test: boot Pixel 2 with GSI as system
Change-Id: Ie5baf7d857d765b7cb3def722be4d30e30c2d6a2
Merged-In: Ie5baf7d857d765b7cb3def722be4d30e30c2d6a2
2018-10-02 08:39:47 +00:00
Tony Huang
ac45599364 Fix ExternalStorageProvider always throw exception when rename
ExternalStorageProvider always throw exception when renameDocument
because it will check file exist when getFileForDocId. However,
beforeVisibleFile is not exist after rename, it will throw
exception. Fix it by put getting beforeVisibleFile before rename.

Test: manual test rename in DocumentsUI
Test: atest RenameActualProviderUiTest
Fix: 113302685
Fix: 115304092
Change-Id: I45d60d2f940e3dbc2b121f7cd28acc3c2d085ec4
Merged-In: I45d60d2f940e3dbc2b121f7cd28acc3c2d085ec4
2018-09-25 17:20:28 -06:00
Vasu Nori
694752d5b9 Add hidden API to return "Uploading" bit value from SDP record's MapSupportedFeatures.
Bug: 111614861
Test: tested w/ KitchenSink App
Change-Id: I43895183d7b315f57257e1d2045f17dedcb0cfcd
2018-09-25 21:39:31 +00:00
Adam Vartanian
54148c0e57 Inline two short methods from Conscrypt
We're trying to reduce unnecessary direct dependencies on Conscrypt.
These two methods are simple and the implementations can't change, so
they're good candidates for inlining directly instead of depending on
the Conscrypt implementation.

Bug: 110404540
Test: atest NetworkSecurityConfigTests (same failures pre/post)
Change-Id: I303d955e3f49885326fe75f451c06a52af745053
2018-09-24 15:34:13 +01:00
Jeffrey Vander Stoep
f8529dc891 Merge "Add ConnectivityManager.getConnectionOwnerUid()" 2018-09-21 21:04:20 +00:00
Jeff Vander Stoep
0ac2c0945b Add ConnectivityManager.getConnectionOwnerUid()
Allow VPN apps to lookup the UID owner of a network connection.

Requires specifying the:
 - IP address and port for both the source and destination of a TCP
   connection.
 - IP address and port for either source and destination or just
   source for a UDP connection.
Only TCP and UDP protocols are supported. Only connections for UIDs
that apply to the calling VPN app will be resolved. This is intended
to replace direct app access to /proc/net/{tcp,tcp6,udp,udp6}.

The implementation uses netlink inet_diag sockets[1] to perform
the lookup on TCP sockets as well as UDP sockets when supported
(kernel has CONFIG_INET_UDP_DIAG=y).

[1] http://man7.org/linux/man-pages/man7/sock_diag.7.html

Bug: 9496886
Bug: 109758967
Test: atest HostsideVpnTests
Test: atest InetDiagSocketTest on Taimen with CONFIG_INET_UDP_DIAG
    and on Sailfish without CONFIG_INET_UDP_DIAG.
Change-Id: I2bbc7072dd091e2e653dadf6dc05024c04180f34
2018-09-21 06:16:09 +00:00
Tianjie Xu
aff3248507 Merge "Remove the metrics report in recovery system" 2018-09-20 17:39:36 +00:00
Treehugger Robot
7bd18423f6 Merge "Set InputMethoMananger#mCurRootView to null when window dismissed" 2018-09-20 00:35:25 +00:00
daqi
dff365ef4d Set InputMethoMananger#mCurRootView to null when window dismissed
InputMethodManager#sInstance is a long live static object so we have to
set its field with right value, otherwise any object referenced by it
cannot be gc including potential activity context.

Now InputMethodManager#mCurRootView is set to null in
InputMethodManager#onPreWindowFocus which is invoked when app's
ViewRootImpl received ViewRootImpl#W#windowfocusChanged from WMS.
However, in the ViewRootImpl#W#windowfocusChanged, mViewAncestor is a
weak reference which get() may returns null sometimes.
One scenario is the ViewRootImpl#W#windowfocusChanged is called after
ActivityThread#handleDestroyActivity. The activity is destroyed and its
ViewRootImpl get GC'd. Then InputMethodManager#onPreWindowFocus won't
get called and InputMethodManager#mCurRootView won't be set to null.

And it is a proper time to set InputMethodManager#mCurRootView to null
when the window it served dismissed.

Fix: 116078227
Test: Break at ActivityThread#handleDestroyActivity and ViewRootImpl#W#windowfocusChanged

Change-Id: I8fabb30f14bcb2cd7019e29b6642b4562d49d248
Signed-off-by: daqi <daqi@xiaomi.com>
2018-09-20 08:30:40 +08:00
Treehugger Robot
0677766615 Merge "Unhide the LE CoC APIs" 2018-09-18 18:31:26 +00:00
Treehugger Robot
ada39fe63d Merge "Fix typo in IntentFilter documentation." 2018-09-18 01:44:46 +00:00
Treehugger Robot
056a095dd3 Merge "Unifying source of statsd BleScan calls and cleaning it up." 2018-09-17 17:46:01 +00:00
Yuanjia Hsu
55b91f6d93 Merge "Add feature flag in Settings." 2018-09-17 13:43:08 +00:00
Stanley Tng
1bff4bab9a Unhide the LE CoC APIs
Expose the LE Connection-oriented Channels APIs for applications to use.

Test: Run the SL4A ACTS test: BleCocTest
Bug: 70683224
Change-Id: I68128bc7154966ec065091c973351f8892da9b4d
2018-09-13 13:46:39 -07:00
Bookatz
ae6738ed2a Unifying source of statsd BleScan calls and cleaning it up.
Bug: 80308558
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases
Change-Id: I0b4a0b56631b4354b73f0fafea2c0dc7dff248d1
2018-09-13 18:48:10 +00:00
Steven Moreland
82e3d2f066 Merge changes from topic "remove-hidl-boot-jars"
* changes:
  pm: Add hidl libraries to old class paths.
  preloaded-classes: remove core HIDL libs
2018-09-13 15:14:35 +00:00
Treehugger Robot
ec52757ecb Merge "Restrict IMM.notifyUserAction() with targetSdkVersion <= P" 2018-09-12 19:04:40 +00:00
Chih-hung Hsieh
d3f10fe89c Merge "Use multiple patterns and emails in per-file syntax." 2018-09-12 16:27:02 +00:00
Steven Moreland
f36ad62907 pm: Add hidl libraries to old class paths.
These two libraries:
android.hidl.base-V1.0-java
android.hidl.manager-V1.0-java

are being removed from BOOT_JARS. This change facilitates linking to them
for libraries or prebuilts in or before P.

Test: atest android.content.pm.AndroidHidlUpdaterTest
Bug: 77307025

Change-Id: Ic0db24cc68d66f5dbfab126ce7e304eec0bfc969
2018-09-12 09:18:40 -07:00
Treehugger Robot
8dc7e43bad Merge "Fix typo in android.net.Uri documentation." 2018-09-12 15:33:36 +00:00
Yohei Yukawa
5b83a80aab Restrict IMM.notifyUserAction() with targetSdkVersion <= P
With my change [1] in Android N, applications no longer need to
manually call this hidden API even when directly implementing
InputConnection interface without extending BaseInputConnection [2].

So far applications that we have confirmed to be using this hidden API
is Chromium and browsers that are supposed to be built on top of
Chromium source code [3].  Actually my change [1] was per request from
Chromium team and Chromium does not use this hidden API on Android N
and later devices [4].

Moving forward, with this CL applications that target API 29 and later
are no longer allowed to use this hidden API since we see no actual
use case of this hidden API on Android N and later devices so far.

If you have any reason to continue relying on this hidden API, please
leave a comment in Bug 114740982.

 [1]: I571d6cc9c6e461d8994aa7496e7e18be13766411
      159dd47db3
 [2]: This scenario had not been suppored until Android N.
      See also other CLs that are tagged with Bug 24688781.
 [3]: https://cs.chromium.org/chromium/src/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapperImpl.java?rcl=525c72b0f4694d6b3f93bcc7797d0411c2fa683c&l=113-128
 [4]: crbug.com/551193

Bug: 114159783
Bug: 114740982
Test: compile
Merged-In: I41d6419438cef92cce81cc33d9db00dd2ee89d33
Change-Id: Iac81f49413605271fccc0b8aec3e6ed95925f061
2018-09-11 13:34:36 -07:00
Kweku Adams
ce8e43f8d2 Avoiding potential NPE when dumping to proto.
Inspired by aosp/736453. Cherry-picked from ag/4934453

Bug: 113087610
Test: Android builds
Change-Id: I9f0dae9cd5a839947c7ed150980eb30b928beef7
2018-09-11 19:21:52 +00:00
Treehugger Robot
98627fa455 Merge "Framework: Remove a nonsensical substring(0)" 2018-09-11 16:30:36 +00:00
Tobias Thierer
149e506efc Fix typo in android.net.Uri documentation.
This typo has been present since before the "auto import"
of cupcake sources in 2009.

Bug: 114704047
Test: Treehugger
Test: Checked through source inspection that this really returns
      the encoded form: its implementation is ssp.getEncoded(),
      whose implementation in turn is:
      return hasEncoded ? encoded : (encoded = encode(decoded));
Change-Id: I0e4fed702e6b3012429778ccbd18a495a5d69e9f
2018-09-11 10:40:36 +01:00
yuanjiahsu
88363e9b2f Add feature flag in Settings.
User can enable/disable faster emergency phone call feature by switching
this flag from Settings, and the old flag switched by adb command was
replaced by this feature flag.

Test: Manually
Bug: 113539598
Change-Id: Ie38f4657bfd76d8386ce2a075f4ec5d0038f5c3d
2018-09-11 15:04:51 +08:00
Treehugger Robot
0890a2b51e Merge "Stop invoke initAppOps in Camera default constructor." 2018-09-11 01:32:53 +00:00
Chih-Hung Hsieh
83a24d8e9b Use multiple patterns and emails in per-file syntax.
Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: I46a4788c0cda69d0a3aadcf1f3dc539aa3c62fc3
2018-09-10 10:26:49 -07:00
Tianjie Xu
d12e150f7a Remove the metrics report in recovery system
Move the report for non-A/B metrics to the native code in
recovery-persist. We will also handle the report of sideload
status for all devices there.

Bug: 114278989
Test: check the metrics report from recovery-persist.
Change-Id: I856f2f301a9d42979d0b207294cdf5d51d7e1e3f
2018-09-07 17:05:43 -07:00
David Brazdil
fdd378c594 Merge "Move ApplicationInfo.usesNonSdkApi to private flags" 2018-09-07 09:32:13 +00:00
Ryan Prichard
c9fc995e0e Merge changes from topic "b113052379-cp-from-pi-dev-p2"
* changes:
  Camera: Documentation update to remove physicalIds
  Camera: Documentation updates for calibration and distortion correction
2018-09-06 20:35:24 +00:00
David Brazdil
fa5e8361c4 Move ApplicationInfo.usesNonSdkApi to private flags
No need to create an extra field for a boolean flag. Move the recently
added ApplicationInfo.usesNonSdkApi to one bit in privateFlags.

This also solves an issue where the field was not propagated during
copying of the data structure.

Bug: 113315999
Test: phone boots
Merged-In: I09f8f39454c013a84893ac304904a4412fc542bf
Change-Id: I09f8f39454c013a84893ac304904a4412fc542bf
(cherry picked from commit a5b4df2a89)
2018-09-06 15:31:33 +01:00
Andreas Gampe
214c76cd70 Framework: Remove a nonsensical substring(0)
String.substring(0) will return the same String instance. There is
also no reason to make a copy.

Found by errorprone.

Bug: 114129741
Test: m
Change-Id: Ic089f04efc3c73f70aa15a132d62ac665c8b8f4c
2018-09-05 16:58:45 -07:00
Daichi Hirono
2dba5c8417 Stop invoke initAppOps in Camera default constructor.
Camera default constructor does not create the underlying native camera
object. Thus calling _enableShutterSound after the default constuctor
causes application crash.

Bug: 80498247
Test: Manually modify the code to return MODE_IGNORED for
      AppOpsService#checkAudioOperation() and to return false for
      CameraManager#supportsCamera2ApiLocked. Then start voice call in
      Hangouts.

Change-Id: Id738c4d46a8e3625bc3b1142b11acac9cfb0b603
Merged-In: Id738c4d46a8e3625bc3b1142b11acac9cfb0b603
(cherry picked from commit cb63c640cd)
2018-09-05 01:51:59 +00:00
Ryan Prichard
3cd4b66ceb Merge changes from topic "b113052379-cp-from-pi-dev-p1"
* changes:
  Camera: hardware level related doc update
  Camera: codegen doc update
2018-09-04 20:20:17 +00:00
Treehugger Robot
680f6e802c Merge "Let SoftInputWindow handle BadTokenException" 2018-09-04 19:08:27 +00:00
Treehugger Robot
8ac363088c Merge "Add DENSITY_600" 2018-09-03 20:25:30 +00:00
David Brazdil
9446fbbeb8 Merge "Add android:usesNonSdkApi manifest attribute" 2018-08-31 09:59:39 +00:00
Chih-hung Hsieh
1d3571cb88 Merge "Use multiple emails in per-file syntax." 2018-08-31 07:19:22 +00:00
Shuzhen Wang
44397643f4 Camera: Documentation update to remove physicalIds
Public API doesn't see android.logicalcam.physicalIds. Remove it
from public doc.

Bug: 112655222
Bug: 113052379
Test: make offline-sdk-docs
Change-Id: Idf6958fb7c117912e33ece4fbaed04cb8e5e14c0
Merged-In: Idf6958fb7c117912e33ece4fbaed04cb8e5e14c0
(cherry picked from commit de23d28d07)
2018-08-30 16:42:19 -07:00
Eino-Ville Talvala
96024af857 Camera: Documentation updates for calibration and distortion correction
- Add more notes on coordinate axes
- Add more text on metadata when distortion correction is active
- Note that poseTranslation needs to be negated in many use cases
- Fix coordinate system references for OIS reporting, add more information
- Note that pixel centers at half-integers for the camera API metadata
  such as lens intrinsics

Bug: 79371566
Bug: 74434422
Bug: 109742048
Bug: 109834325
Bug: 109817371
Bug: 112107924
Bug: 113052379
Test: Manual reading of added text
Change-Id: I450e80b79ef66ce8d82a4dee835db6abd1e598a3
Merged-In: I450e80b79ef66ce8d82a4dee835db6abd1e598a3
(cherry picked from commit 08bd163e2d)
2018-08-30 16:42:19 -07:00
Yin-Chia Yeh
a8cfb0ae93 Camera: hardware level related doc update
Codegen doc update + CameraDevice manual update about EXTERNAL
hardware level.

Test: check offline-sdk-docs output
Bug: 77861412
Bug: 113052379
Change-Id: I70c87a176cf873cf8bec2037f973a94fe99aef2e
Merged-In: I70c87a176cf873cf8bec2037f973a94fe99aef2e
(cherry picked from commit c565700b94)
2018-08-30 16:42:18 -07:00
Yin-Chia Yeh
c925656a1e Camera: codegen doc update
Test: N/A. Doc update
Bug: 109666939
Bug: 113052379
Change-Id: I2bd176a7f5ada755c8a79201d142a98131e2e82c
Merged-In: I2bd176a7f5ada755c8a79201d142a98131e2e82c
(cherry picked from commit 6c73e409fc)
2018-08-30 16:42:18 -07:00
David Brazdil
ca6f81d395 Add android:usesNonSdkApi manifest attribute
ActivityManagerService decides on the non-SDK API enforcement policy
of every newly spawned process. System apps can be exempted by adding
their package name to a config XML file, tests can pass a flag to
'am instrument'. This patch adds a new @hide attribute on the <application>
manifest tag, "android:usesNonSdkApi", which can be used by both
system apps and tests, and is automatically set by the build system.

The use of the attribute remains guarded as follows:
- if invoked via 'am instrument', must hold shell user permission,
- if app launched, must be a system app or an updated system app.
The attribute is ignored in all other cases.

Bug: 113315999
Test: N/A
Merged-In: I2f6cb56f63fa2c5dd6c7c25fcefe8205da1ec96a
Change-Id: I2f6cb56f63fa2c5dd6c7c25fcefe8205da1ec96a
(cherry picked from commit 787b6f22a6)
2018-08-30 14:10:33 +01:00
Mathew Inwood
71da3a1fe4 Add @UnsupportedAppUsage annotations
For all remaining unannotated code.

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I32861fa341a08f11a9c50c07a1ef7404dadf6bb6
Merged-In: I67c8b71ea535ebffb10bf577948bd4ccb8ca069d
2018-08-30 13:38:01 +01:00
Yohei Yukawa
13a9ffba01 Let SoftInputWindow handle BadTokenException
After several attempts [1][2], this is our latest attempt to
gracefully ignore BadTokenException an IME that is being destroyed is
still handling pending showSoftInput() requests.

The point is that SoftInputWindow is a hidden API. This means that
instead of adding a bunch of try/catch blocks around mWindow.show() in
InputMethodService we can always override SoftInputWindow#show() to
inject our own code around mWindow.show().

With this CL, we can now fully track the internal lifecycle of
SoftInputWindow in SoftInputWindow#mWindowState.  It enables us to
easily sort out cases like double fault cases discussed
in Bug 113159114, where showSoftInput() requests were queued multiple
times and still IMEs crash because what mWindow.show() throws for
the 2nd failure is IllegaStateException not BadTokenException.

 [1] Id1e5f236f48c8ef01b7f157ba3f6e7ab2c26b135
     6fcbb56290
 [2] I2c21573cf972145ab08e66604cdb9344139a3f31
     e4bbb1cc45

Fix: 113159114
Test: Manually verified IME switching scenario as follows.
  1. Build and flush aosp_taimen-userdebug
  2. make -j SoftKeyboard
  3. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  4. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  5. Open the Dialer app and tap the top edit field.
  6. Make sure that AOSP Keyboard is shown.
  7. Tap the globe button on AOSP Keyboard.
  8. Make sure that AOSP Keyboard is dismissed and SoftKeybaord is
     shown.
  9. Tap the globe button on SoftKeybaord.
 10. Make sure that SoftKeybaord. is dismissed and AOSP Keyboard is
     shown again.
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I1f51ed29df6b22b003ca285698e06b8f3ee5106a
2018-08-29 19:56:02 -07:00
Nitin Shivpure
1555eae7fa BLE: Add service solicitation uuid feature in scan filter
Adding service solicitation uuid feature in
scan filter, So BLE Scanner can set scan filter for
advertising packets that includes the Service Solicitation
uuid, which can be one of the below types.
 - List of 16 bit Service UUIDs
 - List of 32 bit Service UUIDs
 - List of 128 bit Service UUIDs

Test: BLE Scanner can do filter scan for advertising packets that
includes the Service Solicitation uuid.

Bug: 78483310
Change-Id: I3d83c50e446fca06a76db002dad716759c145d6e
2018-08-29 07:40:29 +00:00
Remi NGUYEN VAN
64dda3cf18 Merge "Add global setting to use new DHCPv4 server" 2018-08-29 06:24:40 +00:00
Remi NGUYEN VAN
e3a0f42e8e Merge "Add DhcpServer" 2018-08-29 03:19:27 +00:00
Treehugger Robot
0e1621296f Merge "Remove ResolveUtil from frameworks/base callers" 2018-08-29 02:58:08 +00:00
Treehugger Robot
20cc0ef048 Merge "Q." 2018-08-28 18:40:11 +00:00