Apply @hide / @SystemApi to android.telecom.*

Move the android.telecom.* namespace back to @hide, and also mark it
with @SystemApi so that system-privileged apps can use them.

Bug: 18302450
Change-Id: I33ae1b9b0dfdb1c5eff51ca3c829196bcfc9411c
diff --git a/api/current.txt b/api/current.txt
index e2ae611..7df6e6e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -113,9 +113,6 @@
     field public static final java.lang.String RECEIVE_SMS = "android.permission.RECEIVE_SMS";
     field public static final java.lang.String RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";
     field public static final java.lang.String RECORD_AUDIO = "android.permission.RECORD_AUDIO";
-    field public static final java.lang.String REGISTER_CALL_PROVIDER = "android.permission.REGISTER_CALL_PROVIDER";
-    field public static final java.lang.String REGISTER_CONNECTION_MANAGER = "android.permission.REGISTER_CONNECTION_MANAGER";
-    field public static final java.lang.String REGISTER_SIM_SUBSCRIPTION = "android.permission.REGISTER_SIM_SUBSCRIPTION";
     field public static final java.lang.String REORDER_TASKS = "android.permission.REORDER_TASKS";
     field public static final deprecated java.lang.String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES";
     field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
@@ -28094,350 +28091,16 @@
 
 package android.telecom {
 
-  public final class AudioState implements android.os.Parcelable {
-    ctor public AudioState(boolean, int, int);
-    ctor public AudioState(android.telecom.AudioState);
-    method public int describeContents();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.telecom.AudioState> CREATOR;
-    field public static final int ROUTE_BLUETOOTH = 2; // 0x2
-    field public static final int ROUTE_EARPIECE = 1; // 0x1
-    field public static final int ROUTE_SPEAKER = 8; // 0x8
-    field public static final int ROUTE_WIRED_HEADSET = 4; // 0x4
-    field public static final int ROUTE_WIRED_OR_EARPIECE = 5; // 0x5
-    field public final boolean isMuted;
-    field public final int route;
-    field public final int supportedRouteMask;
-  }
-
-  public abstract class Conference {
-    ctor public Conference(android.telecom.PhoneAccountHandle);
-    method public final boolean addConnection(android.telecom.Connection);
-    method public final void destroy();
-    method public final android.telecom.AudioState getAudioState();
-    method public final int getCapabilities();
-    method public final java.util.List<android.telecom.Connection> getConferenceableConnections();
-    method public final java.util.List<android.telecom.Connection> getConnections();
-    method public final android.telecom.DisconnectCause getDisconnectCause();
-    method public final android.telecom.PhoneAccountHandle getPhoneAccountHandle();
-    method public android.telecom.Connection getPrimaryConnection();
-    method public final int getState();
-    method public void onAudioStateChanged(android.telecom.AudioState);
-    method public void onConnectionAdded(android.telecom.Connection);
-    method public void onDisconnect();
-    method public void onHold();
-    method public void onMerge(android.telecom.Connection);
-    method public void onMerge();
-    method public void onPlayDtmfTone(char);
-    method public void onSeparate(android.telecom.Connection);
-    method public void onStopDtmfTone();
-    method public void onSwap();
-    method public void onUnhold();
-    method public final void removeConnection(android.telecom.Connection);
-    method public final void setActive();
-    method public final void setCapabilities(int);
-    method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>);
-    method public final void setDisconnected(android.telecom.DisconnectCause);
-    method public final void setOnHold();
-  }
-
-  public abstract class Connection {
-    ctor public Connection();
-    method public static android.telecom.Connection createCanceledConnection();
-    method public static android.telecom.Connection createFailedConnection(android.telecom.DisconnectCause);
-    method public final void destroy();
-    method public final android.net.Uri getAddress();
-    method public final int getAddressPresentation();
-    method public final boolean getAudioModeIsVoip();
-    method public final android.telecom.AudioState getAudioState();
-    method public final int getCallCapabilities();
-    method public final java.lang.String getCallerDisplayName();
-    method public final int getCallerDisplayNamePresentation();
-    method public final android.telecom.Conference getConference();
-    method public final java.util.List<android.telecom.Connection> getConferenceableConnections();
-    method public final android.telecom.DisconnectCause getDisconnectCause();
-    method public final int getState();
-    method public final android.telecom.StatusHints getStatusHints();
-    method public final boolean isRingbackRequested();
-    method public void onAbort();
-    method public void onAnswer();
-    method public void onAudioStateChanged(android.telecom.AudioState);
-    method public void onDisconnect();
-    method public void onHold();
-    method public void onPlayDtmfTone(char);
-    method public void onPostDialContinue(boolean);
-    method public void onReject();
-    method public void onSeparate();
-    method public void onStateChanged(int);
-    method public void onStopDtmfTone();
-    method public void onUnhold();
-    method public final void setActive();
-    method public final void setAddress(android.net.Uri, int);
-    method public final void setAudioModeIsVoip(boolean);
-    method public final void setCallCapabilities(int);
-    method public final void setCallerDisplayName(java.lang.String, int);
-    method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>);
-    method public final void setConnectionService(android.telecom.ConnectionService);
-    method public final void setDialing();
-    method public final void setDisconnected(android.telecom.DisconnectCause);
-    method public final void setInitialized();
-    method public final void setInitializing();
-    method public final void setOnHold();
-    method public final void setPostDialWait(java.lang.String);
-    method public final void setRingbackRequested(boolean);
-    method public final void setRinging();
-    method public final void setStatusHints(android.telecom.StatusHints);
-    method public static java.lang.String stateToString(int);
-    field public static final int STATE_ACTIVE = 4; // 0x4
-    field public static final int STATE_DIALING = 3; // 0x3
-    field public static final int STATE_DISCONNECTED = 6; // 0x6
-    field public static final int STATE_HOLDING = 5; // 0x5
-    field public static final int STATE_INITIALIZING = 0; // 0x0
-    field public static final int STATE_NEW = 1; // 0x1
-    field public static final int STATE_RINGING = 2; // 0x2
-  }
-
-  public final class ConnectionRequest implements android.os.Parcelable {
-    ctor public ConnectionRequest(android.telecom.PhoneAccountHandle, android.net.Uri, android.os.Bundle);
-    method public int describeContents();
-    method public android.telecom.PhoneAccountHandle getAccountHandle();
-    method public android.net.Uri getAddress();
-    method public android.os.Bundle getExtras();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.telecom.ConnectionRequest> CREATOR;
-  }
-
-  public abstract class ConnectionService extends android.app.Service {
-    ctor public ConnectionService();
-    method public final void addConference(android.telecom.Conference);
-    method public final void addExistingConnection(android.telecom.PhoneAccountHandle, android.telecom.Connection);
-    method public final void conferenceRemoteConnections(android.telecom.RemoteConnection, android.telecom.RemoteConnection);
-    method public final android.telecom.RemoteConnection createRemoteIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
-    method public final android.telecom.RemoteConnection createRemoteOutgoingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
-    method public final java.util.Collection<android.telecom.Connection> getAllConnections();
-    method public final android.os.IBinder onBind(android.content.Intent);
-    method public void onConference(android.telecom.Connection, android.telecom.Connection);
-    method public android.telecom.Connection onCreateIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
-    method public android.telecom.Connection onCreateOutgoingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
-    method public void onRemoteConferenceAdded(android.telecom.RemoteConference);
-    method public void onRemoteExistingConnectionAdded(android.telecom.RemoteConnection);
-    field public static final java.lang.String SERVICE_INTERFACE = "android.telecom.ConnectionService";
-  }
-
-  public final class DisconnectCause implements android.os.Parcelable {
-    ctor public DisconnectCause(int);
-    ctor public DisconnectCause(int, java.lang.String);
-    ctor public DisconnectCause(int, java.lang.CharSequence, java.lang.CharSequence, java.lang.String);
-    ctor public DisconnectCause(int, java.lang.CharSequence, java.lang.CharSequence, java.lang.String, int);
-    method public int describeContents();
-    method public int getCode();
-    method public java.lang.CharSequence getDescription();
-    method public java.lang.CharSequence getLabel();
-    method public java.lang.String getReason();
-    method public int getTone();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final int BUSY = 7; // 0x7
-    field public static final int CANCELED = 4; // 0x4
-    field public static final int CONNECTION_MANAGER_NOT_SUPPORTED = 10; // 0xa
-    field public static final android.os.Parcelable.Creator<android.telecom.DisconnectCause> CREATOR;
-    field public static final int ERROR = 1; // 0x1
-    field public static final int LOCAL = 2; // 0x2
-    field public static final int MISSED = 5; // 0x5
-    field public static final int OTHER = 9; // 0x9
-    field public static final int REJECTED = 6; // 0x6
-    field public static final int REMOTE = 3; // 0x3
-    field public static final int RESTRICTED = 8; // 0x8
-    field public static final int UNKNOWN = 0; // 0x0
-  }
-
-  public class GatewayInfo implements android.os.Parcelable {
-    method public int describeContents();
-    method public android.net.Uri getGatewayAddress();
-    method public java.lang.String getGatewayProviderPackageName();
-    method public android.net.Uri getOriginalAddress();
-    method public boolean isEmpty();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.telecom.GatewayInfo> CREATOR;
-  }
-
-  public class PhoneAccount implements android.os.Parcelable {
-    method public static android.telecom.PhoneAccount.Builder builder(android.telecom.PhoneAccountHandle, java.lang.CharSequence);
-    method public int describeContents();
-    method public android.telecom.PhoneAccountHandle getAccountHandle();
-    method public android.net.Uri getAddress();
-    method public int getCapabilities();
-    method public int getColor();
-    method public android.graphics.drawable.Drawable getIcon(android.content.Context);
-    method public android.graphics.Bitmap getIconBitmap();
-    method public java.lang.String getIconPackageName();
-    method public int getIconResId();
-    method public java.lang.CharSequence getLabel();
-    method public java.lang.CharSequence getShortDescription();
-    method public android.net.Uri getSubscriptionAddress();
-    method public java.util.List<java.lang.String> getSupportedUriSchemes();
-    method public boolean hasCapabilities(int);
-    method public boolean supportsUriScheme(java.lang.String);
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final int CAPABILITY_CONNECTION_MANAGER = 1; // 0x1
-    field public static final int CAPABILITY_PLACE_EMERGENCY_CALLS = 16; // 0x10
-    field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4
-    field public static final android.os.Parcelable.Creator<android.telecom.PhoneAccount> CREATOR;
-    field public static final int NO_COLOR = -1; // 0xffffffff
-    field public static final java.lang.String SCHEME_SIP = "sip";
-    field public static final java.lang.String SCHEME_TEL = "tel";
-    field public static final java.lang.String SCHEME_VOICEMAIL = "voicemail";
-  }
-
-  public static class PhoneAccount.Builder {
-    ctor public PhoneAccount.Builder(android.telecom.PhoneAccountHandle, java.lang.CharSequence);
-    ctor public PhoneAccount.Builder(android.telecom.PhoneAccount);
-    method public android.telecom.PhoneAccount build();
-    method public android.telecom.PhoneAccount.Builder setAddress(android.net.Uri);
-    method public android.telecom.PhoneAccount.Builder setCapabilities(int);
-    method public android.telecom.PhoneAccount.Builder setColor(int);
-    method public android.telecom.PhoneAccount.Builder setIconBitmap(android.graphics.Bitmap);
-    method public android.telecom.PhoneAccount.Builder setIconPackageName(java.lang.String);
-    method public android.telecom.PhoneAccount.Builder setIconResId(int);
-    method public android.telecom.PhoneAccount.Builder setShortDescription(java.lang.CharSequence);
-    method public android.telecom.PhoneAccount.Builder setSubscriptionAddress(android.net.Uri);
-    method public android.telecom.PhoneAccount.Builder setSupportedUriSchemes(java.util.List<java.lang.String>);
-  }
-
-  public class PhoneAccountHandle implements android.os.Parcelable {
-    ctor public PhoneAccountHandle(android.content.ComponentName, java.lang.String);
-    method public int describeContents();
-    method public android.content.ComponentName getComponentName();
-    method public java.lang.String getId();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.telecom.PhoneAccountHandle> CREATOR;
-  }
-
-  public final class PhoneCapabilities {
-    method public static java.lang.String toString(int);
-    field public static final int ALL = 12527; // 0x30ef
-    field public static final int DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
-    field public static final int HOLD = 1; // 0x1
-    field public static final int MANAGE_CONFERENCE = 128; // 0x80
-    field public static final int MERGE_CONFERENCE = 4; // 0x4
-    field public static final int MUTE = 64; // 0x40
-    field public static final int RESPOND_VIA_TEXT = 32; // 0x20
-    field public static final int SEPARATE_FROM_CONFERENCE = 4096; // 0x1000
-    field public static final int SUPPORT_HOLD = 2; // 0x2
-    field public static final int SWAP_CONFERENCE = 8; // 0x8
-  }
-
-  public final class RemoteConference {
-    method public void disconnect();
-    method public final int getCallCapabilities();
-    method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections();
-    method public final java.util.List<android.telecom.RemoteConnection> getConnections();
-    method public android.telecom.DisconnectCause getDisconnectCause();
-    method public final int getState();
-    method public void hold();
-    method public void merge();
-    method public void playDtmfTone(char);
-    method public final void registerCallback(android.telecom.RemoteConference.Callback);
-    method public void separate(android.telecom.RemoteConnection);
-    method public void setAudioState(android.telecom.AudioState);
-    method public void stopDtmfTone();
-    method public void swap();
-    method public void unhold();
-    method public final void unregisterCallback(android.telecom.RemoteConference.Callback);
-  }
-
-  public static abstract class RemoteConference.Callback {
-    ctor public RemoteConference.Callback();
-    method public void onCapabilitiesChanged(android.telecom.RemoteConference, int);
-    method public void onConferenceableConnectionsChanged(android.telecom.RemoteConference, java.util.List<android.telecom.RemoteConnection>);
-    method public void onConnectionAdded(android.telecom.RemoteConference, android.telecom.RemoteConnection);
-    method public void onConnectionRemoved(android.telecom.RemoteConference, android.telecom.RemoteConnection);
-    method public void onDestroyed(android.telecom.RemoteConference);
-    method public void onDisconnected(android.telecom.RemoteConference, android.telecom.DisconnectCause);
-    method public void onStateChanged(android.telecom.RemoteConference, int, int);
-  }
-
-  public final class RemoteConnection {
-    method public void abort();
-    method public void answer();
-    method public void disconnect();
-    method public android.net.Uri getAddress();
-    method public int getAddressPresentation();
-    method public int getCallCapabilities();
-    method public java.lang.CharSequence getCallerDisplayName();
-    method public int getCallerDisplayNamePresentation();
-    method public android.telecom.RemoteConference getConference();
-    method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections();
-    method public android.telecom.DisconnectCause getDisconnectCause();
-    method public int getState();
-    method public android.telecom.StatusHints getStatusHints();
-    method public void hold();
-    method public boolean isRingbackRequested();
-    method public boolean isVoipAudioMode();
-    method public void playDtmfTone(char);
-    method public void postDialContinue(boolean);
-    method public void registerCallback(android.telecom.RemoteConnection.Callback);
-    method public void reject();
-    method public void setAudioState(android.telecom.AudioState);
-    method public void stopDtmfTone();
-    method public void unhold();
-    method public void unregisterCallback(android.telecom.RemoteConnection.Callback);
-  }
-
-  public static abstract class RemoteConnection.Callback {
-    ctor public RemoteConnection.Callback();
-    method public void onAddressChanged(android.telecom.RemoteConnection, android.net.Uri, int);
-    method public void onCallCapabilitiesChanged(android.telecom.RemoteConnection, int);
-    method public void onCallerDisplayNameChanged(android.telecom.RemoteConnection, java.lang.String, int);
-    method public void onConferenceChanged(android.telecom.RemoteConnection, android.telecom.RemoteConference);
-    method public void onConferenceableConnectionsChanged(android.telecom.RemoteConnection, java.util.List<android.telecom.RemoteConnection>);
-    method public void onDestroyed(android.telecom.RemoteConnection);
-    method public void onDisconnected(android.telecom.RemoteConnection, android.telecom.DisconnectCause);
-    method public void onPostDialWait(android.telecom.RemoteConnection, java.lang.String);
-    method public void onRingbackRequested(android.telecom.RemoteConnection, boolean);
-    method public void onStateChanged(android.telecom.RemoteConnection, int);
-    method public void onStatusHintsChanged(android.telecom.RemoteConnection, android.telecom.StatusHints);
-    method public void onVoipAudioChanged(android.telecom.RemoteConnection, boolean);
-  }
-
-  public final class StatusHints implements android.os.Parcelable {
-    ctor public StatusHints(android.content.ComponentName, java.lang.CharSequence, int, android.os.Bundle);
-    method public int describeContents();
-    method public android.os.Bundle getExtras();
-    method public android.graphics.drawable.Drawable getIcon(android.content.Context);
-    method public int getIconResId();
-    method public java.lang.CharSequence getLabel();
-    method public android.content.ComponentName getPackageName();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator<android.telecom.StatusHints> CREATOR;
-  }
-
   public class TelecomManager {
-    method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
     method public void cancelMissedCallsNotification();
-    method public void clearAccounts();
-    method public android.net.Uri getAdnUriForPhoneAccount(android.telecom.PhoneAccountHandle);
-    method public android.telecom.PhoneAccountHandle getConnectionManager();
-    method public android.telecom.PhoneAccountHandle getDefaultOutgoingPhoneAccount(java.lang.String);
-    method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle);
-    method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsForPackage();
-    method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsSupportingScheme(java.lang.String);
     method public boolean handleMmi(java.lang.String);
-    method public boolean handleMmi(android.telecom.PhoneAccountHandle, java.lang.String);
-    method public boolean hasMultipleCallCapableAccounts();
     method public boolean isInCall();
-    method public void registerPhoneAccount(android.telecom.PhoneAccount);
     method public void showInCallScreen(boolean);
-    method public void unregisterPhoneAccount(android.telecom.PhoneAccountHandle);
-    field public static final java.lang.String ACTION_CHANGE_PHONE_ACCOUNTS = "android.telecom.action.CHANGE_PHONE_ACCOUNTS";
-    field public static final java.lang.String ACTION_CONNECTION_SERVICE_CONFIGURE = "android.telecom.action.CONNECTION_SERVICE_CONFIGURE";
     field public static final java.lang.String ACTION_SHOW_CALL_SETTINGS = "android.telecom.action.SHOW_CALL_SETTINGS";
     field public static final char DTMF_CHARACTER_PAUSE = 44; // 0x002c ','
     field public static final char DTMF_CHARACTER_WAIT = 59; // 0x003b ';'
-    field public static final java.lang.String EXTRA_CALL_BACK_NUMBER = "android.telecom.extra.CALL_BACK_NUMBER";
     field public static final java.lang.String EXTRA_CALL_DISCONNECT_CAUSE = "android.telecom.extra.CALL_DISCONNECT_CAUSE";
     field public static final java.lang.String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecom.extra.CALL_DISCONNECT_MESSAGE";
-    field public static final java.lang.String EXTRA_CONNECTION_SERVICE = "android.telecom.extra.CONNECTION_SERVICE";
-    field public static final java.lang.String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telecom.extra.PHONE_ACCOUNT_HANDLE";
     field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.telecom.extra.START_CALL_WITH_SPEAKERPHONE";
     field public static final java.lang.String GATEWAY_ORIGINAL_ADDRESS = "android.telecom.extra.GATEWAY_ORIGINAL_ADDRESS";
     field public static final java.lang.String GATEWAY_PROVIDER_PACKAGE = "android.telecom.extra.GATEWAY_PROVIDER_PACKAGE";
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index ffe2b60..216a901 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1269,26 +1269,31 @@
         android:description="@string/permdesc_use_sip"
         android:label="@string/permlab_use_sip" />
 
-    <!-- Protects the ability to register any PhoneAccount with
+    <!-- @SystemApi Protects the ability to register any PhoneAccount with
          PhoneAccount#CAPABILITY_SIM_SUBSCRIPTION. This capability indicates that the PhoneAccount
-         corresponds to a device SIM. -->
+         corresponds to a device SIM.
+         @hide -->
     <permission android:name="android.permission.REGISTER_SIM_SUBSCRIPTION"
         android:permissionGroup="android.permission-group.PHONE_CALLS"
         android:protectionLevel="system|signature"
         android:description="@string/permdesc_register_sim_subscription"
         android:label="@string/permlab_register_sim_subscription" />
 
-    <!-- Protects the ability to register any PhoneAccount with
-         PhoneAccount#CAPABILITY_CALL_PROVIDER. -->
+    <!-- @SystemApi Protects the ability to register any PhoneAccount with
+         PhoneAccount#CAPABILITY_CALL_PROVIDER.
+         @hide -->
     <permission android:name="android.permission.REGISTER_CALL_PROVIDER"
         android:permissionGroup="android.permission-group.PHONE_CALLS"
+        android:protectionLevel="system|signature"
         android:description="@string/permdesc_register_call_provider"
         android:label="@string/permlab_register_call_provider" />
 
-    <!-- Protects the ability to register any PhoneAccount with
-         PhoneAccount#CAPABILITY_CONNECTION_MANAGER -->
+    <!-- @SystemApi Protects the ability to register any PhoneAccount with
+         PhoneAccount#CAPABILITY_CONNECTION_MANAGER
+         @hide -->
     <permission android:name="android.permission.REGISTER_CONNECTION_MANAGER"
         android:permissionGroup="android.permission-group.PHONE_CALLS"
+        android:protectionLevel="system|signature"
         android:description="@string/permdesc_connection_manager"
         android:label="@string/permlab_connection_manager" />
 
diff --git a/telecomm/java/android/telecom/AudioState.java b/telecomm/java/android/telecom/AudioState.java
index 43da38f..f78ce29 100644
--- a/telecomm/java/android/telecom/AudioState.java
+++ b/telecomm/java/android/telecom/AudioState.java
@@ -16,6 +16,7 @@
 
 package android.telecom;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 
@@ -24,7 +25,9 @@
 /**
  *  Encapsulates the telecom audio state, including the current audio routing, supported audio
  *  routing and mute.
+ *  @hide
  */
+@SystemApi
 public final class AudioState implements Parcelable {
     /** Direct the audio stream through the device's earpiece. */
     public static final int ROUTE_EARPIECE      = 0x00000001;
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index 32bdbe0..215c682 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -16,6 +16,8 @@
 
 package android.telecom;
 
+import android.annotation.SystemApi;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -25,7 +27,9 @@
 
 /**
  * Represents a conference call which can contain any number of {@link Connection} objects.
+ * @hide
  */
+@SystemApi
 public abstract class Conference {
 
     /** @hide */
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 61b471c..63b44a6 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -19,6 +19,7 @@
 import com.android.internal.telecom.IVideoCallback;
 import com.android.internal.telecom.IVideoProvider;
 
+import android.annotation.SystemApi;
 import android.net.Uri;
 import android.os.Handler;
 import android.os.IBinder;
@@ -43,7 +44,9 @@
  * Implementations are then responsible for updating the state of the {@code Connection}, and
  * must call {@link #destroy()} to signal to the framework that the {@code Connection} is no
  * longer used and associated resources may be recovered.
+ * @hide
  */
+@SystemApi
 public abstract class Connection {
 
     public static final int STATE_INITIALIZING = 0;
diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java
index 71b481b..f691c17 100644
--- a/telecomm/java/android/telecom/ConnectionRequest.java
+++ b/telecomm/java/android/telecom/ConnectionRequest.java
@@ -16,6 +16,7 @@
 
 package android.telecom;
 
+import android.annotation.SystemApi;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.Parcel;
@@ -24,7 +25,9 @@
 /**
  * Simple data container encapsulating a request to some entity to
  * create a new {@link Connection}.
+ * @hide
  */
+@SystemApi
 public final class ConnectionRequest implements Parcelable {
 
     // TODO: Token to limit recursive invocations
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 65d48f1..48e6ff3 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -17,6 +17,7 @@
 package android.telecom;
 
 import android.annotation.SdkConstant;
+import android.annotation.SystemApi;
 import android.app.Service;
 import android.content.ComponentName;
 import android.content.Intent;
@@ -71,7 +72,9 @@
  * receives call-commands such as answer, reject, hold and disconnect.
  * <p>
  * When there are no more live calls, telecom will unbind from the {@code ConnectionService}.
+ * @hide
  */
+@SystemApi
 public abstract class ConnectionService extends Service {
     /**
      * The {@link Intent} that must be declared as handled by the service.
diff --git a/telecomm/java/android/telecom/DisconnectCause.java b/telecomm/java/android/telecom/DisconnectCause.java
index 73bcd0c..130d676 100644
--- a/telecomm/java/android/telecom/DisconnectCause.java
+++ b/telecomm/java/android/telecom/DisconnectCause.java
@@ -16,6 +16,7 @@
 
 package android.telecom;
 
+import android.annotation.SystemApi;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.media.ToneGenerator;
@@ -29,7 +30,9 @@
  * user. It is the responsibility of the {@link ConnectionService} to provide localized versions of
  * the label and description. It also may contain a reason for the disconnect, which is intended for
  * logging and not for display to the user.
+ * @hide
  */
+@SystemApi
 public final class DisconnectCause implements Parcelable {
 
     /** Disconnected because of an unknown or unspecified reason. */
diff --git a/telecomm/java/android/telecom/GatewayInfo.java b/telecomm/java/android/telecom/GatewayInfo.java
index 7105602..5b8e4ab 100644
--- a/telecomm/java/android/telecom/GatewayInfo.java
+++ b/telecomm/java/android/telecom/GatewayInfo.java
@@ -34,7 +34,9 @@
  * <li> Call the appropriate gateway address.
  * <li> Display information about how the call is being routed to the user.
  * </ol>
+ * @hide
  */
+@SystemApi
 public class GatewayInfo implements Parcelable {
 
     private final String mGatewayProviderPackageName;
diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java
index 3fc1d3d..f9ee5d2 100644
--- a/telecomm/java/android/telecom/PhoneAccount.java
+++ b/telecomm/java/android/telecom/PhoneAccount.java
@@ -16,6 +16,7 @@
 
 package android.telecom;
 
+import android.annotation.SystemApi;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.pm.PackageManager;
@@ -45,7 +46,9 @@
  * alternative options when placing a phone call. When building a {@link PhoneAccount}, the app
  * should supply a valid {@link PhoneAccountHandle} that references the {@link ConnectionService}
  * implementation Telecom will use to interact with the app.
+ * @hide
  */
+@SystemApi
 public class PhoneAccount implements Parcelable {
 
     /**
diff --git a/telecomm/java/android/telecom/PhoneAccountHandle.java b/telecomm/java/android/telecom/PhoneAccountHandle.java
index bc4cc8c..7bcf147 100644
--- a/telecomm/java/android/telecom/PhoneAccountHandle.java
+++ b/telecomm/java/android/telecom/PhoneAccountHandle.java
@@ -16,6 +16,7 @@
 
 package android.telecom;
 
+import android.annotation.SystemApi;
 import android.content.ComponentName;
 import android.os.Parcel;
 import android.os.Parcelable;
@@ -33,7 +34,9 @@
  *
  * See {@link PhoneAccount},
  * {@link TelecomManager#registerPhoneAccount TelecomManager.registerPhoneAccount}.
+ * @hide
  */
+@SystemApi
 public class PhoneAccountHandle implements Parcelable {
     private ComponentName mComponentName;
     private String mId;
diff --git a/telecomm/java/android/telecom/PhoneCapabilities.java b/telecomm/java/android/telecom/PhoneCapabilities.java
index f61d39c..feb7a95 100644
--- a/telecomm/java/android/telecom/PhoneCapabilities.java
+++ b/telecomm/java/android/telecom/PhoneCapabilities.java
@@ -16,10 +16,14 @@
 
 package android.telecom;
 
+import android.annotation.SystemApi;
+
 /**
  * Defines capabilities for {@link Connection}s and {@link Conference}s such as hold, swap, and
  * merge.
+ * @hide
  */
+@SystemApi
 public final class PhoneCapabilities {
     /** Call can currently be put on hold or unheld. */
     public static final int HOLD               = 0x00000001;
diff --git a/telecomm/java/android/telecom/RemoteConference.java b/telecomm/java/android/telecom/RemoteConference.java
index eba7580..b548274 100644
--- a/telecomm/java/android/telecom/RemoteConference.java
+++ b/telecomm/java/android/telecom/RemoteConference.java
@@ -18,6 +18,7 @@
 
 import com.android.internal.telecom.IConnectionService;
 
+import android.annotation.SystemApi;
 import android.os.RemoteException;
 
 import java.util.ArrayList;
@@ -29,7 +30,9 @@
 
 /**
  * Represents a conference call which can contain any number of {@link Connection} objects.
+ * @hide
  */
+@SystemApi
 public final class RemoteConference {
 
     public abstract static class Callback {
diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java
index 816e2bf..d70ddf6 100644
--- a/telecomm/java/android/telecom/RemoteConnection.java
+++ b/telecomm/java/android/telecom/RemoteConnection.java
@@ -20,6 +20,7 @@
 import com.android.internal.telecom.IVideoCallback;
 import com.android.internal.telecom.IVideoProvider;
 
+import android.annotation.SystemApi;
 import android.net.Uri;
 import android.os.IBinder;
 import android.os.RemoteException;
@@ -37,7 +38,9 @@
  *
  * @see ConnectionService#createRemoteOutgoingConnection(PhoneAccountHandle, ConnectionRequest)
  * @see ConnectionService#createRemoteIncomingConnection(PhoneAccountHandle, ConnectionRequest)
+ * @hide
  */
+@SystemApi
 public final class RemoteConnection {
 
     public static abstract class Callback {
diff --git a/telecomm/java/android/telecom/StatusHints.java b/telecomm/java/android/telecom/StatusHints.java
index a32eae7..dd3a639 100644
--- a/telecomm/java/android/telecom/StatusHints.java
+++ b/telecomm/java/android/telecom/StatusHints.java
@@ -16,6 +16,7 @@
 
 package android.telecom;
 
+import android.annotation.SystemApi;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.pm.PackageManager;
@@ -29,7 +30,9 @@
 
 /**
  * Contains status label and icon displayed in the in-call UI.
+ * @hide
  */
+@SystemApi
 public final class StatusHints implements Parcelable {
 
     private final ComponentName mPackageName;
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index ecf6005..05108c7 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -33,8 +33,7 @@
 
 /**
  * Provides access to information about active calls and registration/call-management functionality.
- * Apps can use methods in this class to determine the current call state. Apps can also register new
- * {@link PhoneAccount}s and get a listing of existing {@link PhoneAccount}s.
+ * Apps can use methods in this class to determine the current call state.
  * <p>
  * Apps do not instantiate this class directly; instead, they retrieve a reference to an instance
  * through {@link Context#getSystemService Context.getSystemService(Context.TELECOM_SERVICE)}.
@@ -71,7 +70,9 @@
     /**
      * The {@link android.content.Intent} action used to configure a
      * {@link android.telecom.ConnectionService}.
+     * @hide
      */
+    @SystemApi
     public static final String ACTION_CONNECTION_SERVICE_CONFIGURE =
             "android.telecom.action.CONNECTION_SERVICE_CONFIGURE";
 
@@ -84,7 +85,9 @@
     /**
      * The {@link android.content.Intent} action used to show the settings page used to configure
      * {@link PhoneAccount} preferences.
+     * @hide
      */
+    @SystemApi
     public static final String ACTION_CHANGE_PHONE_ACCOUNTS =
             "android.telecom.action.CHANGE_PHONE_ACCOUNTS";
 
@@ -114,7 +117,9 @@
      * {@link PhoneAccountHandle} to use when making the call.
      * <p class="note">
      * Retrieve with {@link android.content.Intent#getParcelableExtra(String)}.
+     * @hide
      */
+    @SystemApi
     public static final String EXTRA_PHONE_ACCOUNT_HANDLE =
             "android.telecom.extra.PHONE_ACCOUNT_HANDLE";
 
@@ -125,6 +130,7 @@
      *
      * @hide
      */
+    @SystemApi
     public static final String EXTRA_INCOMING_CALL_EXTRAS =
             "android.telecom.extra.INCOMING_CALL_EXTRAS";
 
@@ -136,6 +142,7 @@
      *
      * @hide
      */
+    @SystemApi
     public static final String EXTRA_OUTGOING_CALL_EXTRAS =
             "android.telecom.extra.OUTGOING_CALL_EXTRAS";
 
@@ -162,7 +169,9 @@
     /**
      * Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED}
      * containing the component name of the associated connection service.
+     * @hide
      */
+    @SystemApi
     public static final String EXTRA_CONNECTION_SERVICE =
             "android.telecom.extra.CONNECTION_SERVICE";
 
@@ -197,7 +206,9 @@
      * {@link ConnectionService}s which interact with {@link RemoteConnection}s should only populate
      * this if the {@link android.telephony.TelephonyManager#getLine1Number()} value, as that is the
      * user's expected caller ID.
+     * @hide
      */
+    @SystemApi
     public static final String EXTRA_CALL_BACK_NUMBER = "android.telecom.extra.CALL_BACK_NUMBER";
 
     /**
@@ -338,7 +349,9 @@
      * @param uriScheme The URI scheme.
      * @return The {@link PhoneAccountHandle} corresponding to the user-chosen default for outgoing
      * phone calls for a specified URI scheme.
+     * @hide
      */
+    @SystemApi
     public PhoneAccountHandle getDefaultOutgoingPhoneAccount(String uriScheme) {
         try {
             if (isServiceConnected()) {
@@ -441,7 +454,9 @@
      * {@code PhoneAccount}.
      *
      * @return The phone account handle of the current connection manager.
+     * @hide
      */
+    @SystemApi
     public PhoneAccountHandle getConnectionManager() {
         return getSimCallManager();
     }
@@ -457,7 +472,9 @@
      *
      * @param uriScheme The URI scheme.
      * @return A list of {@code PhoneAccountHandle} objects supporting the URI scheme.
+     * @hide
      */
+    @SystemApi
     public List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(String uriScheme) {
         try {
             if (isServiceConnected()) {
@@ -496,7 +513,9 @@
      *
      * @return {@code true} if the device has more than one account registered and {@code false}
      * otherwise.
+     * @hide
      */
+    @SystemApi
     public boolean hasMultipleCallCapableAccounts() {
         return getCallCapablePhoneAccounts().size() > 1;
     }
@@ -505,7 +524,9 @@
      *  Returns a list of all {@link PhoneAccount}s registered for the calling package.
      *
      * @return A list of {@code PhoneAccountHandle} objects.
+     * @hide
      */
+    @SystemApi
     public List<PhoneAccountHandle> getPhoneAccountsForPackage() {
         try {
             if (isServiceConnected()) {
@@ -523,7 +544,9 @@
      *
      * @param account The {@link PhoneAccountHandle}.
      * @return The {@link PhoneAccount} object.
+     * @hide
      */
+    @SystemApi
     public PhoneAccount getPhoneAccount(PhoneAccountHandle account) {
         try {
             if (isServiceConnected()) {
@@ -602,7 +625,10 @@
      * {@link PhoneAccountHandle#getComponentName()} does not match the package name of the app.
      *
      * @param account The complete {@link PhoneAccount}.
+     *
+     * @hide
      */
+    @SystemApi
     public void registerPhoneAccount(PhoneAccount account) {
         try {
             if (isServiceConnected()) {
@@ -617,7 +643,9 @@
      * Remove a {@link PhoneAccount} registration from the system.
      *
      * @param accountHandle A {@link PhoneAccountHandle} for the {@link PhoneAccount} to unregister.
+     * @hide
      */
+    @SystemApi
     public void unregisterPhoneAccount(PhoneAccountHandle accountHandle) {
         try {
             if (isServiceConnected()) {
@@ -630,7 +658,9 @@
 
     /**
      * Remove all Accounts that belong to the calling package from the system.
+     * @hide
      */
+    @SystemApi
     public void clearAccounts() {
         try {
             if (isServiceConnected()) {
@@ -853,7 +883,9 @@
      *            {@link #registerPhoneAccount}.
      * @param extras A bundle that will be passed through to
      *            {@link ConnectionService#onCreateIncomingConnection}.
+     * @hide
      */
+    @SystemApi
     public void addNewIncomingCall(PhoneAccountHandle phoneAccount, Bundle extras) {
         try {
             if (isServiceConnected()) {
@@ -923,7 +955,9 @@
      * @param accountHandle The handle for the account the MMI code should apply to.
      * @param dialString The digits to dial.
      * @return True if the digits were processed as an MMI code, false otherwise.
+     * @hide
      */
+    @SystemApi
     public boolean handleMmi(PhoneAccountHandle accountHandle, String dialString) {
         ITelecomService service = getTelecomService();
         if (service != null) {
@@ -941,7 +975,9 @@
      * {@code null} to return a URI which will use the default account.
      * @return The URI (with the content:// scheme) specific to the specified {@link PhoneAccount}
      * for the the content retrieve.
+     * @hide
      */
+    @SystemApi
     public Uri getAdnUriForPhoneAccount(PhoneAccountHandle accountHandle) {
         ITelecomService service = getTelecomService();
         if (service != null && accountHandle != null) {