Commit Graph

21 Commits

Author SHA1 Message Date
Michael Wright
eec778ccdd Remove replaced PreciseDataConnectionState methods from SDK.
Prior to finalization, we need to remove all methods which were
replaced but kept around for short-term compatibility purposes.
PreciseDataConnectionState had a couple methods that fell into this
category that had yet to be removed.

Bug: 152787887
Test: builds
Change-Id: Ib175b2530791cec7e31684a1d3f318c95e27f707
2020-03-30 20:39:27 +00:00
Nathan Harold
4005f21d68 Remove FIXME that getApnSetting should be NonNull
API Council has asked that I remove a comment suggesting that
this API be NonNull. While in theory, we should be able to
make this NonNull in the future, the tooling doesn't work in a
way that makes such a change beneficial.

Bug: 151928851
Test: compilation (comment-only change)
Change-Id: Ifd80f2859e4a090225aab1b3a483325d654a2412
2020-03-19 11:59:56 -07:00
Shuo Qian
1e154a345c Hide several System APIs
Test: Treehugger
Bug: 151241308
Change-Id: Ie611320f4651b83e0ced6f5c8fede34a8a0a41c1
2020-03-17 04:41:21 +00:00
Rambo Wang
8a54f49ba6 Expose DataFailCause as public API
API Council requests to add document for public API getLastCauseCode()
which return DataFailCause constants. DataFailCause constants are widely
used in system to report data connection failure code. But currently it
is system and hide API.

By opening DataFailCause, we can have better javadoc for both system and
public APIs. This also benefits applications that need to refer to the
consistent data connection failure code.

Bug: 147804257
Test: atest com.android.internal.telephony.dataconnection.DataFailCauseTest
Change-Id: I27bc1d88ba0e7b25fe8f032df1f4d14b805a68bf
2020-02-19 13:25:55 -08:00
Nathan Harold
a61992b67a Expose PreciseDataConnectionstate#getApnSetting()
Expose an API that was accidentally left as package private.

This is was missed when exposing other methods for the same
class; however, other methods have been deprecated based on
the presumption that this method is available in the public
API.

This method deprecated:
PreciseDataConnectionState#getDataConnectionApnTypeBitMask()
PreciseDataConnectionState#getDataConnectionApn()

Bug: 148565164
Bug: 147600208
Test: make update-api && make offline-sdk-docs
Change-Id: I0207c18d853d0b83db2622ff3abcda98565eac30
2020-01-31 18:07:57 +00:00
Shuo Qian
b32797b202 Create the ID for each gating key.
Modify the names and descriptions per Compat team requirement.

Test: Treehugger
Bug: 148534348
Bug: 148535736
Bug: 147600208
Change-Id: Id9d0366714aa4ecb240d2b9e726d35a474879325
2020-01-29 10:41:26 -08:00
Mathew Inwood
12be21dc21 Fix some @link tags in @ChangeId docs.
We now have javadoc based docs generated from these comments now. Ensure
the links can be resolved.

Bug: 144927670
Test: Test: m -j offline-sdk-docs
Change-Id: Ie9827ad02ad91ab7f01226a3a741c94fa46de730
2020-01-17 11:29:23 +00:00
Shuo Qian
a78143c86a Modify the build version to match changeId stuff
Test: Treehugger
Bug: 145147528
Bug: 147600208
Change-Id: I4294359fc7bcf4d739b6e01439dc47fa99999d2c
2020-01-14 19:16:31 -08:00
Shuo Qian
d0c818129a Use changeID and Compatibility.isChangeEnabled for Mainline
Test: Treehugger
Bug: 145147528
Bug: 147600208

Change-Id: I8092f4c7d3be046da337cdcbadeed89844b3aaab
2020-01-13 17:04:14 -08:00
Artur Satayev
74cb719964 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I547d7fb2e6bc2e9707bbc0d14dc1e8cd632c5a23
2020-01-07 14:19:21 +00:00
Shuo Qian
ac4c8da309 Make PreciseDataConnectionState constructor System API
TelephonyRegistry is using the deprecated constructor of
 PreciseDataConnectionState; it should use the other constructor of
PreciseDataConnectionState, which is not deprecated; Also need to make
that constructor System API for Mainline.

Test: make update-api (no functional change in this CL).
Test: atest FrameworksTelephonyTests

Bug: 146793835
Change-Id: I83f98aa8b818f654d497867cd16e8afa987114fc
2019-12-26 17:21:30 +00:00
Nathan Harold
4d340f12c9 Expose PreciseDataConnectionState to Public API
1) Remove Unused Parameters for onDataConnectionState:
The data connection state broadcast includes a number of
parameters that are never used anywhere. To prepare for
updated code that relies on PreciseDataConnectionState,
remove the unused parameters that were internal-only and
included in the broadcast.

-LinkProperties
-NetworkCapabilities
-DataRoaming
-DataAllowed
-Interface name

2) Add Disconnecting State for Data Connections

Add a disconnecting state to correct a mismatch
between the internal and externally visible enums.

This will allow apps to know when connections are
in the process of being torn down, which in the case
of radio link issues could be as much as 15 seconds.

3) Expose PreciseDataConnection for Carrier Apps

Exposes the PSL for PreciseDataConnectionState along
with existing fields in the PreciseDataConnectionState
class.

-Make PreciseDataConnectionState public along with some
 of its fields.
-Expose onPreciseDataConnectionStateChanged.
-Add onPreciseDataConnectionStatesChanged to provide PDCS
 for all APNs in one cohesive batch.

4) Cache PreciseDataConnectionState by APN Type

In telephony registry, multiple different APN types
are all piped through the same cache entry, so every
time any APN changes relative to the previous type,
it triggers an update. This also means that when
a registrant requests the data connection state, only
the most recent type's state is updated.

This change caches entries in TelephonyRegistry based
on the APN's type (specifically the type among types
which triggered the change).

Bug: 143083105
Test: make update-api && make offline-sdk-docs
      (no functional change in this CL).
Test: atest FrameworksTelephonyTests

Change-Id: Ib6a769f5a0cae923ca47a842733bd28755a90ed5
2019-12-16 16:16:51 -08:00
Chen Xu
c9d4ee112e new telephony annotation class
This is a preparatory work for mainline. since Intdef is hidden, so we
have to move some annotations (applied in SDK/system API) to a separate
annotation class and having other module statically link to it.

TODO: include telephony annotation in framework-non-updatable-sources

Bug: 140908357
Test: Build
Change-Id: I37f8a0624bbf27f264870ee9dbf03d3aaa5cadc1
2019-09-30 14:36:11 -07:00
Aurimas Liutikas
4d1699da48 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-29 17:15:44 -07:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00
chen xu
8165386bfe add NonNull and Nullable annotation to APIs
Bug: 126699430
Bug: 126699963
Bug: 126700457
Bug: 126700771
Bug: 126702453
Bug: 123939479
Test: Build
Change-Id: Ib429d2918e63f8d272fc7842b0abd83ffd5a9090
2019-02-28 14:15:58 -08:00
chen xu
896e3d4580 precisedataState refactor part 3
1. expose DataFailCause to systemAPI
2. expose PreciseDataState to systemAPI
3. change string apntype to bitmask.
4. change string dataFaiLcause to intdef

Bug: 119891533
Change-Id: Ife380a5063f44f80d41f60ffaecc5185f2f5b16b
(cherry picked from commit 16e24cd5de)
Merged-in: Ife380a5063f44f80d41f60ffaecc5185f2f5b16b
2019-01-09 22:49:42 -08:00
Jack Yu
f05919ab76 Stop exposing reasons through phone state listener
The data connection reasons are implementation details
of telephony and should not be exposed externally. The
data connection fail cause, which is different from
reasons, are still available.

Test: Telephony sanity tests + unit tests
Bug: 73659459

Merged-In: Ia005abf19664e6213118ee932495950af118456d
Change-Id: Ia005abf19664e6213118ee932495950af118456d
(cherry picked from commit 4d1c945000)
2019-01-07 06:39:38 +00:00
Mathew Inwood
a838206e94 Add @UnsupportedAppUsage annotations
For packages:
  android.telephony
  android.telephony.cdma
  android.telephony.data
  android.telephony.euicc
  android.telephony.gsm
  android.telephony.ims
  android.telephony.ims.aidl
  android.telephony.ims.compat
  android.telephony.ims.compat.feature
  android.telephony.ims.compat.stub
  android.telephony.ims.feature
  android.telephony.ims.stub
  android.telephony.mbms
  android.telephony.mbms.vendor

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: I02d900d6d0ec9a6b2172a71911fec61d04e4d235
Merged-In: I22547ac0ed384d74d61cfd51d20c140e392a597f
2018-08-23 09:37:53 +01:00
John Spurlock
08c7116ab9 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00
Antonio Marín Cerezuela
c5ac15a3e1 Telephony API extension v2
Added new AndroidManifest permission:

android.permission.READ_PRECISE_PHONE_STATE

Added the following PhoneStateListeners and corresponding broadcast intents:

onPreciseCallStateChanged(PreciseCallState callState);
onPreciseDataConnectionStateChanged(PreciseDataConnectionState dataConnectionState);

broadcastPreciseCallStateChanged(int ringingCallState, int foregroundCallState, int backgroundCallState,
	int disconnectCause, int preciseDisconnectCause)
broadcastPreciseDataConnectionStateChanged(int state, int networkType, String apnType, String apn,
	String reason, LinkProperties linkProperties, String failCause)

Added TelephonyManager intent actions with their extras and constants:

public static final String ACTION_PRECISE_CALL_STATE_CHANGED = "android.intent.action.PRECISE_CALL_STATE";
public static final String ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED = "android.intent.action.PRECISE_DATA_CONNECTION_STATE_CHANGED";

public static final int PRECISE_CALL_STATE_*

Moved public static final int DISCONNECT_CAUSE_* from PreciseCallState.java to a new class DisconnectCause.java

Moved public static final int PRECISE_DISCONNECT_CAUSE_* from PreciseCallState.java to a new class PreciseDisconnectCause.java

Change-Id: If3b88c679507c529b746046c4a17cf6d9974bd09
2014-01-10 11:08:06 +01:00