Merge "Revert "Revert "Revert "Correct nullability and final constraints on new APIs.""""

This commit is contained in:
Slava Shklyaev
2019-03-04 14:42:17 +00:00
committed by Gerrit Code Review
4 changed files with 27 additions and 33 deletions

View File

@@ -41262,14 +41262,14 @@ package android.telecom {
field public static final android.os.Parcelable.Creator<android.telecom.CallIdentification> CREATOR; field public static final android.os.Parcelable.Creator<android.telecom.CallIdentification> CREATOR;
} }
public static final class CallIdentification.Builder { public static class CallIdentification.Builder {
ctor public CallIdentification.Builder(); ctor public CallIdentification.Builder();
method @NonNull public android.telecom.CallIdentification build(); method public android.telecom.CallIdentification build();
method @NonNull public android.telecom.CallIdentification.Builder setDescription(@Nullable CharSequence); method public android.telecom.CallIdentification.Builder setDescription(@Nullable CharSequence);
method @NonNull public android.telecom.CallIdentification.Builder setDetails(@Nullable CharSequence); method public android.telecom.CallIdentification.Builder setDetails(@Nullable CharSequence);
method @NonNull public android.telecom.CallIdentification.Builder setName(@Nullable CharSequence); method public android.telecom.CallIdentification.Builder setName(@Nullable CharSequence);
method @NonNull public android.telecom.CallIdentification.Builder setNuisanceConfidence(int); method public android.telecom.CallIdentification.Builder setNuisanceConfidence(int);
method @NonNull public android.telecom.CallIdentification.Builder setPhoto(@Nullable android.graphics.drawable.Icon); method public android.telecom.CallIdentification.Builder setPhoto(@Nullable android.graphics.drawable.Icon);
} }
public abstract class CallRedirectionService extends android.app.Service { public abstract class CallRedirectionService extends android.app.Service {
@@ -41890,8 +41890,8 @@ package android.telecom {
method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle); method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle);
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telecom.PhoneAccountHandle> getSelfManagedPhoneAccounts(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telecom.PhoneAccountHandle> getSelfManagedPhoneAccounts();
method public android.telecom.PhoneAccountHandle getSimCallManager(); method public android.telecom.PhoneAccountHandle getSimCallManager();
method @Nullable public String getSystemDialerPackage(); method public String getSystemDialerPackage();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @Nullable public android.telecom.PhoneAccountHandle getUserSelectedOutgoingPhoneAccount(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telecom.PhoneAccountHandle getUserSelectedOutgoingPhoneAccount();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber(android.telecom.PhoneAccountHandle); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber(android.telecom.PhoneAccountHandle);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handleMmi(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handleMmi(String);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handleMmi(String, android.telecom.PhoneAccountHandle); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handleMmi(String, android.telecom.PhoneAccountHandle);

View File

@@ -5491,8 +5491,8 @@ package android.telecom {
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsSupportingScheme(String); method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsSupportingScheme(String);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isInEmergencyCall(); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isInEmergencyCall();
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging(); method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging();
method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.WRITE_SECURE_SETTINGS}) public boolean setDefaultDialer(@Nullable String); method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.WRITE_SECURE_SETTINGS}) public boolean setDefaultDialer(String);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUserSelectedOutgoingPhoneAccount(@Nullable android.telecom.PhoneAccountHandle); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUserSelectedOutgoingPhoneAccount(android.telecom.PhoneAccountHandle);
field public static final String EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT"; field public static final String EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT";
field public static final String EXTRA_CLEAR_MISSED_CALLS_INTENT = "android.telecom.extra.CLEAR_MISSED_CALLS_INTENT"; field public static final String EXTRA_CLEAR_MISSED_CALLS_INTENT = "android.telecom.extra.CLEAR_MISSED_CALLS_INTENT";
field public static final String EXTRA_CONNECTION_SERVICE = "android.telecom.extra.CONNECTION_SERVICE"; field public static final String EXTRA_CONNECTION_SERVICE = "android.telecom.extra.CONNECTION_SERVICE";

View File

@@ -44,7 +44,7 @@ public final class CallIdentification implements Parcelable {
* A {@link CallScreeningService} uses this class to create new instances of * A {@link CallScreeningService} uses this class to create new instances of
* {@link CallIdentification} for a screened call. * {@link CallIdentification} for a screened call.
*/ */
public final static class Builder { public static class Builder {
private CharSequence mName; private CharSequence mName;
private CharSequence mDescription; private CharSequence mDescription;
private CharSequence mDetails; private CharSequence mDetails;
@@ -67,7 +67,7 @@ public final class CallIdentification implements Parcelable {
* @param callIdAppName The app name. * @param callIdAppName The app name.
* @hide * @hide
*/ */
public Builder(@NonNull String callIdPackageName, @NonNull CharSequence callIdAppName) { public Builder(String callIdPackageName, CharSequence callIdAppName) {
mPackageName = callIdPackageName; mPackageName = callIdPackageName;
mAppName = callIdAppName; mAppName = callIdAppName;
} }
@@ -80,7 +80,7 @@ public final class CallIdentification implements Parcelable {
* @param name The name associated with the call, or {@code null} if none is provided. * @param name The name associated with the call, or {@code null} if none is provided.
* @return Builder instance. * @return Builder instance.
*/ */
public @NonNull Builder setName(@Nullable CharSequence name) { public Builder setName(@Nullable CharSequence name) {
mName = name; mName = name;
return this; return this;
} }
@@ -97,7 +97,7 @@ public final class CallIdentification implements Parcelable {
* @param description The call description, or {@code null} if none is provided. * @param description The call description, or {@code null} if none is provided.
* @return Builder instance. * @return Builder instance.
*/ */
public @NonNull Builder setDescription(@Nullable CharSequence description) { public Builder setDescription(@Nullable CharSequence description) {
mDescription = description; mDescription = description;
return this; return this;
} }
@@ -114,8 +114,7 @@ public final class CallIdentification implements Parcelable {
* @param details The call details, or {@code null} if none is provided. * @param details The call details, or {@code null} if none is provided.
* @return Builder instance. * @return Builder instance.
*/ */
public Builder setDetails(@Nullable CharSequence details) {
public @NonNull Builder setDetails(@Nullable CharSequence details) {
mDetails = details; mDetails = details;
return this; return this;
} }
@@ -128,7 +127,7 @@ public final class CallIdentification implements Parcelable {
* @param photo The photo associated with the call, or {@code null} if none was provided. * @param photo The photo associated with the call, or {@code null} if none was provided.
* @return Builder instance. * @return Builder instance.
*/ */
public @NonNull Builder setPhoto(@Nullable Icon photo) { public Builder setPhoto(@Nullable Icon photo) {
mPhoto = photo; mPhoto = photo;
return this; return this;
} }
@@ -142,7 +141,7 @@ public final class CallIdentification implements Parcelable {
* @param nuisanceConfidence The nuisance confidence. * @param nuisanceConfidence The nuisance confidence.
* @return The builder. * @return The builder.
*/ */
public @NonNull Builder setNuisanceConfidence(@NuisanceConfidence int nuisanceConfidence) { public Builder setNuisanceConfidence(@NuisanceConfidence int nuisanceConfidence) {
mNuisanceConfidence = nuisanceConfidence; mNuisanceConfidence = nuisanceConfidence;
return this; return this;
} }
@@ -153,7 +152,7 @@ public final class CallIdentification implements Parcelable {
* *
* @return {@link CallIdentification} instance. * @return {@link CallIdentification} instance.
*/ */
public @NonNull CallIdentification build() { public CallIdentification build() {
return new CallIdentification(mName, mDescription, mDetails, mPhoto, return new CallIdentification(mName, mDescription, mDetails, mPhoto,
mNuisanceConfidence, mPackageName, mAppName); mNuisanceConfidence, mPackageName, mAppName);
} }

View File

@@ -17,7 +17,6 @@ package android.telecom;
import android.Manifest; import android.Manifest;
import android.annotation.IntDef; import android.annotation.IntDef;
import android.annotation.NonNull; import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission; import android.annotation.RequiresPermission;
import android.annotation.SuppressAutoDoc; import android.annotation.SuppressAutoDoc;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
@@ -810,11 +809,10 @@ public class TelecomManager {
* <p> * <p>
* The default dialer has access to use this method. * The default dialer has access to use this method.
* *
* @return The user outgoing phone account selected by the user, or {@code null} if there is no * @return The user outgoing phone account selected by the user.
* user selected outgoing {@link PhoneAccountHandle}.
*/ */
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public @Nullable PhoneAccountHandle getUserSelectedOutgoingPhoneAccount() { public PhoneAccountHandle getUserSelectedOutgoingPhoneAccount() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
return getTelecomService().getUserSelectedOutgoingPhoneAccount( return getTelecomService().getUserSelectedOutgoingPhoneAccount(
@@ -830,14 +828,13 @@ public class TelecomManager {
* Sets the user-chosen default {@link PhoneAccountHandle} for making outgoing phone calls. * Sets the user-chosen default {@link PhoneAccountHandle} for making outgoing phone calls.
* *
* @param accountHandle The {@link PhoneAccountHandle} which will be used by default for making * @param accountHandle The {@link PhoneAccountHandle} which will be used by default for making
* outgoing voice calls, or {@code null} if no default is specified (the * outgoing voice calls.
* user will be asked each time a call is placed in this case).
* @hide * @hide
*/ */
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
@TestApi @TestApi
@SystemApi @SystemApi
public void setUserSelectedOutgoingPhoneAccount(@Nullable PhoneAccountHandle accountHandle) { public void setUserSelectedOutgoingPhoneAccount(PhoneAccountHandle accountHandle) {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
getTelecomService().setUserSelectedOutgoingPhoneAccount(accountHandle); getTelecomService().setUserSelectedOutgoingPhoneAccount(accountHandle);
@@ -1204,8 +1201,7 @@ public class TelecomManager {
/** /**
* Used to set the default dialer package. * Used to set the default dialer package.
* *
* @param packageName to set the default dialer to, or {@code null} if the system provided * @param packageName to set the default dialer to.
* dialer should be used instead.
* *
* @result {@code true} if the default dialer was successfully changed, {@code false} if * @result {@code true} if the default dialer was successfully changed, {@code false} if
* the specified package does not correspond to an installed dialer, or is already * the specified package does not correspond to an installed dialer, or is already
@@ -1222,7 +1218,7 @@ public class TelecomManager {
@RequiresPermission(allOf = { @RequiresPermission(allOf = {
android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.MODIFY_PHONE_STATE,
android.Manifest.permission.WRITE_SECURE_SETTINGS}) android.Manifest.permission.WRITE_SECURE_SETTINGS})
public boolean setDefaultDialer(@Nullable String packageName) { public boolean setDefaultDialer(String packageName) {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
return getTelecomService().setDefaultDialer(packageName); return getTelecomService().setDefaultDialer(packageName);
@@ -1236,10 +1232,9 @@ public class TelecomManager {
/** /**
* Determines the package name of the system-provided default phone app. * Determines the package name of the system-provided default phone app.
* *
* @return package name for the system dialer package or {@code null} if no system dialer is * @return package name for the system dialer package or null if no system dialer is preloaded.
* preloaded.
*/ */
public @Nullable String getSystemDialerPackage() { public String getSystemDialerPackage() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
return getTelecomService().getSystemDialerPackage(); return getTelecomService().getSystemDialerPackage();