Commit Graph

20427 Commits

Author SHA1 Message Date
Treehugger Robot
c3d4693f79 Merge "UpdateAvailableNetworks apis" 2018-12-05 19:16:39 +00:00
Sooraj Sasindran
a3ab858fda UpdateAvailableNetworks apis
Provide API to inform available networks

Bug: 117982838
Test: make and unit test
Merged-In: I9de1f767560551914de80031c1675d7e03b09775
Change-Id: I9de1f767560551914de80031c1675d7e03b09775
2018-12-04 23:56:04 +00:00
Hall Liu
239b0de673 Merge "Add API scaffolding for number verification" 2018-12-04 17:58:28 +00:00
Dario Freni
e8129a31bb Add MATCH_APEX flag to getInstalledPackages.
If set, PackageManager will query apexservice and ask for activated
packages.

Test: wrote a small app to test the new query.
Bug: 117589375
Merged-In: I498bd97896f3eab65c88e9684874a30713be585e
Change-Id: I498bd97896f3eab65c88e9684874a30713be585e
2018-12-03 22:29:31 +09:00
Jeff Sharkey
0da04839b7 Support for appending "standalone" WHERE chunks.
The existing appendWhere() methods aren't very friendly for
developers, since they require manual tracking of state to decide if
subsequent standalone chunks should be prefixed with "AND".

While it's tempting to offer direct argument binding on the builder
class, we can't really deliver on that API in a secure way, so instead
add separate bindSelection() method which explicitly burns arguments
into a standalone selection string, which can then be appended to
the builder.

This was the last piece of new functionality being used by
SQLiteStatementBuilder, so we can delete that class and migrate
users back to SQLiteQueryBuilder.

Bug: 111268862
Test: atest frameworks/base/core/tests/coretests/src/android/database/DatabaseUtilsTest.java
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Merged-In: I418f24338c90bae8a9dad473fa76329cea00a8c5
Change-Id: I418f24338c90bae8a9dad473fa76329cea00a8c5
2018-12-01 17:23:05 -07:00
Jeff Sharkey
8a634372b3 Bind update() args as Object[] for performance.
It's wasteful to convert them to String when SQLite already knows
how to bind specific data types, including funky types like byte[].

Also promote to public API, since they're generally useful.

Bug: 111085900
Test: atest packages/providers/DownloadProvider/tests/
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Merged-In: I5b418bca1204773fd2795156a2f47906ca1e1a6b
Change-Id: I5b418bca1204773fd2795156a2f47906ca1e1a6b
2018-12-01 17:23:05 -07:00
Jeff Sharkey
6c90f1ded2 Revert SQLiteQueryBuilder for now.
We've encountered subtle bugs in how apps are using this public
API, so revert it back to exactly what shipped in the last
release, and move functionality to new SQLiteStatementBuilder
class, since we already have several customers using it.

Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111486645
Merged-In: Ief059e987f2421e19f6f57a94320c313946a26d7
Change-Id: Ief059e987f2421e19f6f57a94320c313946a26d7
2018-12-01 17:23:04 -07:00
Jeff Sharkey
55777e52df Add support for appending standalone phrases.
When users are building queries, they often need to append several
standalone SQL clauses, and it's tedious to track their first clause
so they can manually append " AND " to each subsequent clause.

So add new appendWherePhrase() API which appends a standalone phrase
which is AND'ed together with any existing WHERE query.

Also fix bug in update() which would turn null values into the
string literal "null" instead of passing them through as SQL NULL.

Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111085900
Merged-In: Ia280dd864895654239503e080eaef925f5620d37
Change-Id: Ia280dd864895654239503e080eaef925f5620d37
2018-12-01 17:23:04 -07:00
Jeff Sharkey
3e26b7db55 Extend SQLiteQueryBuilder for update and delete.
Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks.  This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.

Extend it to support selection arguments being provided when
appending appendWhere() clauses, meaning developers no longer need
to manually track their local selection arguments along with
remote arguments.

Extend it to support newer ContentProvider.query() variant that
accepts "Bundle queryArgs", and have all query() callers flow
through that common code path.  (This paves the way for a future
CL that will offer to gracefully extract non-WHERE clauses that
callers have tried smashing into their selections.)

Updates ContentValues to internally use more efficient ArrayMap.

Bug: 111268862
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Merged-In: I60b6f69045766bb28d2f21a32c120ec8c383b917
Change-Id: I60b6f69045766bb28d2f21a32c120ec8c383b917
2018-12-01 17:23:04 -07:00
Shuo Qian
9a9dbf05e0 Merge "Remove static for getSubscriptionIds" 2018-11-30 20:21:45 +00:00
Adrian Roos
6fc3189e37 Merge "API: Make implicit APIs from type usage explicit" 2018-11-30 16:25:06 +00:00
Treehugger Robot
98b78236d0 Merge "API to switch preferred data" 2018-11-30 01:29:39 +00:00
Hall Liu
5314036bb1 Add API scaffolding for number verification
Add the PhoneNumberRange and NumberVerificationCallback classes. Add a
method in TelephonyManager to activate the API, but it does nothing for
now.

Bug: 119675160
Test: todo
Change-Id: I3ccd62b47f02a3aa324b675fdb16c8e7a1e9feec
2018-11-29 17:20:02 -08:00
sqian
d8c30b9a80 Remove static for getSubscriptionIds
Bug: 118675557
Test: compile
Change-Id: Id2ba95331f87115daf6c0c074faccf812a1661c9
Merged-In: Id2ba95331f87115daf6c0c074faccf812a1661c9
(cherry picked from commit 705dec5255)
2018-11-28 12:11:52 -08:00
Josh Hou
72973de352 Merge "Support set/get carrier id from ApnSetting" 2018-11-28 02:42:23 +00:00
Xiangyu/Malcolm Chen
103d515c80 Merge "Clean up SubMgr#getOpportunisticSubscriptions." 2018-11-27 18:01:58 +00:00
Josh Hou
73ada28be9 Support set/get carrier id from ApnSetting
To align with using carrier id instead of mccmnc and mvno for APN
settings, add new public api setCarrierId and getCarrierId

Bug: 115709816
Test: run telephony unit test
Change-Id: Ia716a02dfa88996cb0539e34b411aab371ef8aa7
Merged-in: Ia716a02dfa88996cb0539e34b411aab371ef8aa7
2018-11-27 08:48:08 +00:00
Hall Liu
50cc796c28 Merge "Make MBMS group call API changes" 2018-11-27 01:06:55 +00:00
Xiangyu/Malcolm Chen
d413b5c713 Merge "Remove parentSubId and define API to set groupSubId" 2018-11-27 00:24:00 +00:00
Jordan Liu
0e706db965 Merge "Expose ApnService as a SystemApi and use subId arg" 2018-11-26 22:47:52 +00:00
Hall Liu
c81cba4e2b Make MBMS group call API changes
Change the API to respond to API council comments
See bug for details

Bug: 117145859
Test: CTS
Change-Id: I4342e6e95da57fbcd550c571357ff7bc1923b70a
2018-11-26 14:37:56 -08:00
Malcolm Chen
aea9b02a22 Remove parentSubId and define API to set groupSubId
Bug: 118349116
Test: unittest
Change-Id: I539a67df8f30c2f58d87a3417f78fef8b43ff56d
Merged-In: I539a67df8f30c2f58d87a3417f78fef8b43ff56d
2018-11-26 14:13:10 -08:00
Sooraj Sasindran
3535f43518 API to switch preferred data
Provide API to switch preferred data between default subscription
and opportunistic subscription.

Bug: 118491136
Test: make and called the APIs using setting app
Merged-In: Ic4f7a0aac6f7e1234c30aaee2fed177dbd5e53cd
Change-Id: Ic4f7a0aac6f7e1234c30aaee2fed177dbd5e53cd
2018-11-26 22:08:18 +00:00
Youming Ye
4d73d87d83 Merge "Add CarrierConfig to hide Preset APN setting details" 2018-11-26 21:14:14 +00:00
Adrian Roos
27432dba6b API: Make implicit APIs from type usage explicit
API stubs generation implicitly made any types used by an API also part
of that API. This has caused DeviceIdAttestationException and
ImsFeature.Capabilities to become implicit APIs, so they are added to
the API files.

After this, using non-API types in APIs will become an error to prevent
implicit APIs occuring in the future.

Bug: 119556446
Test: METALAVA_PREPEND_ARGS="--error ReferencesHidden" make
Exempt-From-Owner-Approval: Identical CL has been approved on other branch
Change-Id: I5fe4f20502b8d4e287b28e9f07139456d4191e22
Merged-In: I5fe4f20502b8d4e287b28e9f07139456d4191e22
(cherry picked from commit 8f91e5fde8)
2018-11-22 15:22:09 +00:00
David Brazdil
67c6ab38ba Merge "Create AppComponentFactory.instantiateClassLoader API" 2018-11-22 11:09:15 +00:00
David Brazdil
a21de6f376 Merge "Update public API after libcore InMemoryDexClassLoader change" 2018-11-22 10:09:19 +00:00
taiki tsutsumi
2ee968289e Add CarrierConfig to hide Preset APN setting details
Add new key to hide Preset APN setting details. When the key is set to
true, Preset APN is still shown and selectable in APN list, however,
user cannot enter APN editor view. It means details of Preset APN will
be hidden from user.

Test: manual - check Preset APN setting details are hidden
Bug: 115453290
Change-Id: I8a5c6f92f876d349b304acf89b4ffab86ff3f24b
2018-11-21 15:41:49 -08:00
Brad Ebinger
8a3518cc90 Merge "Expose ImsMmTelManager APIs as SystemApi" 2018-11-21 18:59:33 +00:00
Neil Fuller
4492ec573a Merge "API for retrieving time zone IDs by country" 2018-11-21 15:18:27 +00:00
David Brazdil
12a95bafe7 Update public API after libcore InMemoryDexClassLoader change
Bug: 35458580
Test: compiles
Change-Id: I7debcedac0a6e8b2cfaa8b2dca5f88aebdd32910
2018-11-21 11:17:38 +00:00
Jack Yu
860d8d0d80 Merge "Move hidden APIs into system APIs" 2018-11-21 02:40:30 +00:00
Brad Ebinger
fd88080d22 Expose ImsMmTelManager APIs as SystemApi
Bug: 116493310
Bug: 112538960
Bug: 112866475
Test: Telephony unit tests
Change-Id: I698d9ab6000dc2e2e9be8d614e94d59b3a8e3028
2018-11-20 13:59:37 -08:00
Neil Fuller
6caa954ead API for retrieving time zone IDs by country
New method has been requested by Setup Wizard.

Test: CTS: run cts-dev -m CtsUtilTestCases -t android.util.cts.TimeUtilsTest
Bug: 116544863
Merged-In: I31a9e3d07d5c3fbc8ba1d9c9b398cb2661aa71f9
Change-Id: I31a9e3d07d5c3fbc8ba1d9c9b398cb2661aa71f9
(cherry picked from commit f9bb2d8f02)
2018-11-20 10:59:18 +00:00
Jordan Liu
2f2dd0a6e1 Expose ApnService as a SystemApi and use subId arg
IApnSourceService#getApns now takes a subId argument, and can be
implemented by extending ApnService.

Bug: 113075153
Test: unit tests and manual
Change-Id: I0202c1f0529ecef558f06a9f8a90a3906912f2f0
Merged-In: I9cfcf977c20f33abd2d773393780f9e54d75fe21
2018-11-19 17:26:09 -08:00
Jack Yu
4f956e0fca Move hidden APIs into system APIs
To allow vendor code to construct LinkAddress, which is
one of the parameter in the system API DataCallResponse.

Test: Build
Bug: 73659459
Merged-In: I3e203781d3a03285fa0e047cc8837ccb4a09016a
Change-Id: I3e203781d3a03285fa0e047cc8837ccb4a09016a
2018-11-19 14:40:13 -08:00
David Brazdil
b319ccfdcc Create AppComponentFactory.instantiateClassLoader API
Adds a hook to AppComponentFactory to allow control over the
instantiation of the main app class loader. LoadedApk creates
the default class loader and uses it to load the base APK. If
AppComponentFactory is declared in the manifest, its new method
instantiateClassLoader is called and its result becomes the
class loader used by LoadedApk to instantiate other classes
declared in the manifest. By default this is simply the class
loader created by LoadedApk.

Second method provides AppComponentFactory with a copy of
ApplicationInfo. The factory otherwise cannot locate any of the
app's resources, including its APK or the data folder.

Bug: 111342996
Test: atest CtsClassLoaderFactoryPathClassLoaderTestCases
Test: atest CtsClassLoaderFactoryInMemoryDexClassLoaderTestCases
Merged-In: Id21d9afaf00b9cb64a107bc9893b952407cff0b5
Change-Id: Id21d9afaf00b9cb64a107bc9893b952407cff0b5
(cherry picked from commit fd6dcc21d9)
2018-11-19 17:47:13 +00:00
Nathan Harold
992aafb2bd Merge "Add Support for Async requestCellInfoUpdate()" 2018-11-16 19:13:36 +00:00
Brad Ebinger
082bf0ccca Merge "Expose ProvisioningManager API for IMS configurations" 2018-11-15 22:07:29 +00:00
Nathan Harold
2aa2cc1b75 Add Support for Async requestCellInfoUpdate()
Add asynchronous calls to request CellInfo updates.
-Add a request for CellInfo
-Add a request for CellInfo that allows system apps
 such as the LocationProvider to bill the work to
 the app that initiated the location fix.
-Update the behavioral language for getAllCellInfo
 to indicate that depending on the API level of the
 caller, this API will only provide cached info, which
 means that apps can always request an update without
 possibly triggering a call to the modem. This also
 means that the binder will not block due to modem
 delay.

Bug: 37100068
Bug: 63737292
Bug: 26569588
Test: manual (via SL4A)
Change-Id: I25cbc3cecd5d396fc3baa21457c05cd6e273c9c3
2018-11-15 10:53:05 -08:00
Chen Xu
8715c1545e Merge "new Systeam API for CarrierConfig#KEY_CARRIER_SETUP_APP_STRING" 2018-11-15 16:59:44 +00:00
Chen Xu
16533c35d3 Merge "new System API for sim voice activation state." 2018-11-15 16:59:03 +00:00
Treehugger Robot
ee59e69b8b Merge "Catch SecurityException in EuiccCardController and trigger callback." 2018-11-14 22:30:54 +00:00
Nathan Harold
7581efdb9d Add Executor Support for PhoneStateListener
Support an Executor so that PhoneStateListener
can invoke callbacks not only on a user's preferred
Looper but also on a preferred Handler or in another
thread management scheme.

PhoneStateListener uses an odd pattern for its API,
so to support the historical use cases of having the
internal callback instance be instantiated during
object construction, the Executor needs to be passed
in to the PhoneStateListener during construction. This
also permits the listen() method in TelephonyManager to
avoid odd situations of having a version with an
Executor be passed in when requesting to stop listening
for events.

Bug: 118350385
Test: atest PhoneStateListenerTest
      atest PhoneStateListenerExecutorTest
Change-Id: I8eeb2e156f6d67d192d17586e6aa5579ff6d675d
2018-11-13 15:08:56 -08:00
Brad Ebinger
0d36ed248f Expose ProvisioningManager API for IMS configurations
Bug: 117648104
Test: Manual
Change-Id: I71ef979cee6467fd3d70fe70e4b899dbee70e2ae
2018-11-13 12:49:28 -08:00
Tyler Gunn
a2b2183a24 Merge "Unsupported app usage API cleanup" 2018-11-13 17:49:01 +00:00
vichang
6274341f10 Merge "Expose Transliterator API" 2018-11-13 15:43:35 +00:00
Treehugger Robot
36ac46a915 Merge "Add PreciseDisconnectCause for SIP status code 481 Transaction Does Not Exist" 2018-11-13 03:48:59 +00:00
Chen Xu
24df195e78 Merge "new SystemAPI for roamingType in NetworkRegistrationState" 2018-11-13 01:16:25 +00:00
Tyler Gunn
6e3ecc40f8 Unsupported app usage API cleanup
This CL includes a number of cleanups related to unsupported app usage
tags.

TelecomManager#EXTRA_IS_HANDOVER - public APIS exist for this usecase;
updated docs and limit to P with maxtarget sdk.
TelecomManager#getSimCallManager(int userId) - marked as max target P;
there is a public API available which can be used to accomplish the same
thing.  Nobody should be calling this.
TelecomManager#getCallCapablePhoneAccounts(boolean) - marked as max
target P; callers should use the version without the boolean parameter.

Deprecate CAPABILITY_CAN_UPGRADE_TO_VIDEO; its redundant.

New public API:
Promote TelecomManager#getSystemDialerPackage() to public API; its a
benign API and doesn't expose anything which can't be inferred other ways.

New system APIs:
TelecomManager#getCurrentTtyMode() - used by settings app.
TelecomManager#setDefaultDialer() - used by useful for settings app.
TelecomManager#TTY_MODE* constants - used by getCurrentTtyMode API.

Test: Compile / run unit tests
Bug: 119305590
Change-Id: I67d6213e6c689fb545fc9ceae4a359831f97c32f
2018-11-12 11:30:56 -08:00