media/java/android/media/tv/ITvInputServiceCallback.aidl \
media/java/android/media/tv/ITvInputSession.aidl \
media/java/android/media/tv/ITvInputSessionCallback.aidl \
- telecomm/java/com/android/internal/telecomm/ICallServiceLookupResponse.aidl \
- telecomm/java/com/android/internal/telecomm/ICallServiceProvider.aidl \
telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl \
telecomm/java/com/android/internal/telecomm/ICallVideoClient.aidl \
telecomm/java/com/android/internal/telecomm/IConnectionService.aidl \
telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \
telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
telephony/java/com/android/internal/telephony/ITelephony.aidl \
- telephony/java/com/android/internal/telephony/IThirdPartyCallListener.aidl \
- telephony/java/com/android/internal/telephony/IThirdPartyCallProvider.aidl \
- telephony/java/com/android/internal/telephony/IThirdPartyCallSendDtmfCallback.aidl \
- telephony/java/com/android/internal/telephony/IThirdPartyCallService.aidl \
telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \
telephony/java/com/android/internal/telephony/ISms.aidl \
telephony/java/com/android/internal/telephony/IWapPushManager.aidl \
field public static final int windowContentTransitions = 16843794; // 0x1010412
field public static final int windowDisablePreview = 16843298; // 0x1010222
field public static final int windowDrawsSystemBarBackgrounds = 16843858; // 0x1010452
+ field public static final int windowElevation = 16843922; // 0x1010492
field public static final int windowEnableSplitTouch = 16843543; // 0x1010317
field public static final int windowEnterAnimation = 16842932; // 0x10100b4
field public static final int windowEnterTransition = 16843833; // 0x1010439
field public static final java.lang.String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape";
field public static final java.lang.String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait";
field public static final java.lang.String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer";
+ field public static final java.lang.String FEATURE_SENSOR_AMBIENT_TEMPERATURE = "android.hardware.sensor.ambient_temperature";
field public static final java.lang.String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer";
field public static final java.lang.String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass";
field public static final java.lang.String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope";
field public static final java.lang.String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate";
field public static final java.lang.String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light";
field public static final java.lang.String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity";
+ field public static final java.lang.String FEATURE_SENSOR_RELATIVE_HUMIDITY = "android.hardware.sensor.relative_humidity";
field public static final java.lang.String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter";
field public static final java.lang.String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector";
field public static final java.lang.String FEATURE_SIP = "android.software.sip";
field public static final int UNKNOWN = 2; // 0x2
}
- public final class CallServiceDescriptor implements android.os.Parcelable {
- method public int describeContents();
- method public java.lang.String getConnectionServiceId();
- method public int getNetworkType();
- method public android.content.ComponentName getServiceComponent();
- method public static android.telecomm.CallServiceDescriptor.Builder newBuilder(android.content.Context);
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator CREATOR;
- field public static final int FLAG_MOBILE = 4; // 0x4
- field public static final int FLAG_PSTN = 2; // 0x2
- field public static final int FLAG_WIFI = 1; // 0x1
- }
-
- public static class CallServiceDescriptor.Builder {
- method public android.telecomm.CallServiceDescriptor build();
- method public android.telecomm.CallServiceDescriptor.Builder setConnectionService(java.lang.Class<? extends android.telecomm.ConnectionService>);
- method public android.telecomm.CallServiceDescriptor.Builder setNetworkType(int);
- }
-
- public final class CallServiceLookupResponse {
- method public void setCallServiceDescriptors(java.util.List<android.telecomm.CallServiceDescriptor>);
- }
-
- public abstract class CallServiceProvider extends android.app.Service {
- ctor protected CallServiceProvider();
- method public abstract void lookupCallServices(android.telecomm.CallServiceLookupResponse);
- method public android.os.IBinder onBind(android.content.Intent);
- }
-
public final class CallState extends java.lang.Enum {
method public static android.telecomm.CallState valueOf(java.lang.String);
method public static final android.telecomm.CallState[] values();
method public java.util.List<java.lang.String> getCannedSmsResponses();
method public int getCapabilities();
method public long getConnectTimeMillis();
- method public android.telecomm.CallServiceDescriptor getCurrentCallServiceDescriptor();
method public int getDisconnectCauseCode();
method public java.lang.String getDisconnectCauseMsg();
method public android.telecomm.GatewayInfo getGatewayInfo();
method public void onCallRemoved(android.telecomm.Phone, android.telecomm.Call);
}
- public final class PhoneAccount implements android.os.Parcelable {
- ctor public PhoneAccount(android.content.ComponentName, java.lang.String, android.net.Uri, java.lang.String, java.lang.String, boolean, boolean);
+ public class PhoneAccount implements android.os.Parcelable {
+ ctor public PhoneAccount(android.content.ComponentName, java.lang.String, android.net.Uri, int);
method public int describeContents();
+ method public int getCapabilities();
method public android.content.ComponentName getComponentName();
method public android.net.Uri getHandle();
- method public android.graphics.drawable.Drawable getIcon(android.content.Context);
- method public android.graphics.drawable.Drawable getIcon(android.content.Context, int);
method public java.lang.String getId();
- method public java.lang.String getLabel(android.content.Context);
- method public java.lang.String getShortDescription(android.content.Context);
- method public boolean isEnabled();
- method public boolean isSystemDefault();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CAPABILITY_CALL_PROVIDER = 2; // 0x2
+ field public static final int CAPABILITY_SIM_CALL_MANAGER = 1; // 0x1
+ field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4
+ field public static final android.os.Parcelable.Creator CREATOR;
+ }
+
+ public class PhoneAccountMetadata implements android.os.Parcelable {
+ ctor public PhoneAccountMetadata(android.telecomm.PhoneAccount, int, java.lang.String, java.lang.String);
+ method public int describeContents();
+ method public android.telecomm.PhoneAccount getAccount();
+ method public android.graphics.drawable.Drawable getIcon(android.content.Context);
+ method public java.lang.String getLabel();
+ method public java.lang.String getShortDescription();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator CREATOR;
}
public final class TelecommConstants {
ctor public TelecommConstants();
- field public static final java.lang.String ACTION_CALL_SERVICE_PROVIDER;
field public static final java.lang.String ACTION_CONNECTION_SERVICE;
field public static final java.lang.String ACTION_CONNECTION_SERVICE_CONFIGURE = "android.intent.action.CONNECTION_SERVICE_CONFIGURE";
field public static final java.lang.String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL";
field public static final char DTMF_CHARACTER_WAIT = 59; // 0x003b ';'
field public static final java.lang.String EXTRA_CALL_DISCONNECT_CAUSE = "android.telecomm.extra.CALL_DISCONNECT_CAUSE";
field public static final java.lang.String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecomm.extra.CALL_DISCONNECT_MESSAGE";
- field public static final java.lang.String EXTRA_CALL_SERVICE_DESCRIPTOR = "android.intent.extra.CALL_SERVICE_DESCRIPTOR";
field public static final java.lang.String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE";
field public static final java.lang.String EXTRA_INCOMING_CALL_EXTRAS = "android.intent.extra.INCOMING_CALL_EXTRAS";
+ field public static final java.lang.String EXTRA_PHONE_ACCOUNT = "android.intent.extra.PHONE_ACCOUNT";
field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.intent.extra.START_CALL_WITH_SPEAKERPHONE";
field public static final java.lang.String EXTRA_START_CALL_WITH_VIDEO_STATE = "android.intent.extra.START_CALL_WITH_VIDEO_STATE";
}
}
public class TelephonyManager {
- method public java.util.List<android.telecomm.PhoneAccount> getAccounts();
method public java.util.List<android.telephony.CellInfo> getAllCellInfo();
method public int getCallState();
method public android.telephony.CellLocation getCellLocation();
field public static final int DATA_CONNECTING = 1; // 0x1
field public static final int DATA_DISCONNECTED = 0; // 0x0
field public static final int DATA_SUSPENDED = 3; // 0x3
- field public static final java.lang.String EXTRA_ACCOUNT = "account";
field public static final java.lang.String EXTRA_INCOMING_NUMBER = "incoming_number";
field public static final java.lang.String EXTRA_STATE = "state";
field public static final java.lang.String EXTRA_STATE_IDLE;
registerService(TELECOMM_SERVICE, new ServiceFetcher() {
public Object createService(ContextImpl ctx) {
- IBinder b = ServiceManager.getService(TELECOMM_SERVICE);
- return new TelecommManager(ctx.getOuterContext(),
- ITelecommService.Stub.asInterface(b));
+ return new TelecommManager(ctx.getOuterContext());
}});
registerService(PHONE_SERVICE, new ServiceFetcher() {
/**
* Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device includes a relative humidity sensor.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_SENSOR_RELATIVE_HUMIDITY =
+ "android.hardware.sensor.relative_humidity";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature}: The device includes an ambient temperature sensor.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_SENSOR_AMBIENT_TEMPERATURE =
+ "android.hardware.sensor.ambient_temperature";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device has a telephony radio with data
* communication support.
*/
}
}
+ // Compute surface insets required to draw at specified Z value.
+ // TODO: Use real shadow insets for a constant max Z.
+ final int surfaceInset = (int) Math.ceil(view.getZ() * 2);
+ attrs.surfaceInsets.set(surfaceInset, surfaceInset, surfaceInset, surfaceInset);
+
CompatibilityInfo compatibilityInfo = mDisplayAdjustments.getCompatibilityInfo();
mTranslator = compatibilityInfo.getTranslator();
mDisplayAdjustments.setActivityToken(attrs.token);
if (hwInitialized ||
mWidth != mAttachInfo.mHardwareRenderer.getWidth() ||
mHeight != mAttachInfo.mHardwareRenderer.getHeight()) {
- final Rect shadowInsets = params != null ? params.shadowInsets : null;
- mAttachInfo.mHardwareRenderer.setup(mWidth, mHeight, shadowInsets);
+ final Rect surfaceInsets = params != null ? params.surfaceInsets : null;
+ mAttachInfo.mHardwareRenderer.setup(mWidth, mHeight, surfaceInsets);
if (!hwInitialized) {
mAttachInfo.mHardwareRenderer.invalidate(mSurface);
mFullRedrawNeeded = true;
}
final WindowManager.LayoutParams params = mWindowAttributes;
- final Rect surfaceInsets = params != null ? params.shadowInsets : null;
+ final Rect surfaceInsets = params != null ? params.surfaceInsets : null;
boolean animating = mScroller != null && mScroller.computeScrollOffset();
final int curScrollY;
if (animating) {
mFullRedrawNeeded = true;
try {
final WindowManager.LayoutParams lp = mWindowAttributes;
- final Rect surfaceInsets = lp != null ? lp.shadowInsets : null;
+ final Rect surfaceInsets = lp != null ? lp.surfaceInsets : null;
mAttachInfo.mHardwareRenderer.initializeIfNeeded(
mWidth, mHeight, mSurface, surfaceInsets);
} catch (OutOfResourcesException e) {
*
* @hide
*/
- public Rect shadowInsets = new Rect();
+ public Rect surfaceInsets = new Rect();
/**
* The desired bitmap format. May be one of the constants in
out.writeInt(hasSystemUiListeners ? 1 : 0);
out.writeInt(inputFeatures);
out.writeLong(userActivityTimeout);
- out.writeInt(shadowInsets.left);
- out.writeInt(shadowInsets.top);
- out.writeInt(shadowInsets.right);
- out.writeInt(shadowInsets.bottom);
+ out.writeInt(surfaceInsets.left);
+ out.writeInt(surfaceInsets.top);
+ out.writeInt(surfaceInsets.right);
+ out.writeInt(surfaceInsets.bottom);
}
public static final Parcelable.Creator<LayoutParams> CREATOR
hasSystemUiListeners = in.readInt() != 0;
inputFeatures = in.readInt();
userActivityTimeout = in.readLong();
- shadowInsets.set(in.readInt(), in.readInt(), in.readInt(), in.readInt());
+ surfaceInsets.left = in.readInt();
+ surfaceInsets.top = in.readInt();
+ surfaceInsets.right = in.readInt();
+ surfaceInsets.bottom = in.readInt();
}
@SuppressWarnings({"PointlessBitwiseExpression"})
/** {@hide} */
public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19;
/** {@hide} */
- public static final int SHADOW_INSETS_CHANGED = 1<<20;
+ public static final int SURFACE_INSETS_CHANGED = 1<<20;
/** {@hide} */
public static final int EVERYTHING_CHANGED = 0xffffffff;
changes |= USER_ACTIVITY_TIMEOUT_CHANGED;
}
- if (!shadowInsets.equals(o.shadowInsets)) {
- shadowInsets.set(o.shadowInsets);
- changes |= SHADOW_INSETS_CHANGED;
+ if (!surfaceInsets.equals(o.surfaceInsets)) {
+ surfaceInsets.set(o.surfaceInsets);
+ changes |= SURFACE_INSETS_CHANGED;
}
return changes;
if (userActivityTimeout >= 0) {
sb.append(" userActivityTimeout=").append(userActivityTimeout);
}
- if (!shadowInsets.equals(Insets.NONE)) {
- sb.append(" shadowInsets=").append(shadowInsets);
+ if (!surfaceInsets.equals(Insets.NONE)) {
+ sb.append(" surfaceInsets=").append(surfaceInsets);
}
sb.append('}');
return sb.toString();
p.softInputMode = mSoftInputMode;
p.setTitle("PopupWindow:" + Integer.toHexString(hashCode()));
- // TODO: Use real shadow insets once that algorithm is finalized.
- final int shadowInset = (int) Math.ceil(mElevation * 2);
- p.shadowInsets.set(shadowInset, shadowInset, shadowInset, shadowInset);
-
return p;
}
android:id="@+id/parentPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:background="@drawable/dialog_background_material"
- android:translationZ="@dimen/floating_window_z"
- android:layout_marginLeft="@dimen/floating_window_margin_left"
- android:layout_marginTop="@dimen/floating_window_margin_top"
- android:layout_marginRight="@dimen/floating_window_margin_right"
- android:layout_marginBottom="@dimen/floating_window_margin_bottom">
+ android:orientation="vertical">
<LinearLayout android:id="@+id/topPanel"
android:layout_width="match_parent"
Activity Transition. Corresponds to
{@link android.view.Window#setTransitionBackgroundFadeDuration(long)}. -->
<attr name="windowTransitionBackgroundFadeDuration" />
+
+ <!-- Elevation to use for the window. -->
+ <attr name="windowElevation" format="dimension" />
</declare-styleable>
<!-- The set of attributes that describe a AlertDialog's theme. -->
<public type="attr" name="buttonBarNegativeButtonStyle" />
<public type="attr" name="popupElevation" />
<public type="attr" name="actionBarPopupTheme" />
+ <public type="attr" name="multiArch" />
+ <public type="attr" name="touchscreenBlocksFocus" />
+ <public type="attr" name="windowElevation" />
<public-padding type="dimen" name="l_resource_pad" end="0x01050010" />
<!-- A transition that moves views in or out of the scene to or from the left edge when
a view visibility changes. -->
<public type="transition" name="slide_left"/>
- <public type="attr" name="multiArch" />
- <public type="attr" name="touchscreenBlocksFocus" />
</resources>
<item name="textColorLink">?textColorLinkInverse</item>
</style>
- <style name="TextAppearance.Theme.Dialog" parent="TextAppearance.Theme">
- </style>
-
- <style name="TextAppearance.Theme.Dialog.AppError">
- <item name="textColor">#ffffc0c0</item>
- </style>
+ <style name="TextAppearance.Theme.Dialog" parent="TextAppearance.Theme" />
- <style name="TextAppearance.Widget">
- </style>
+ <style name="TextAppearance.Widget" />
<style name="TextAppearance.Widget.Button" parent="TextAppearance.Small.Inverse">
<item name="textColor">@color/primary_text_light_nodisable</item>
<eat-comment />
<!-- Theme for the dialog shown when an app crashes or ANRs. -->
- <style name="Theme.Dialog.AppError" parent="Theme.DeviceDefault.Light.Dialog">
- <item name="windowFrame">@null</item>
- <item name="windowTitleStyle">@style/DialogWindowTitle</item>
- <item name="windowBackground">@color/transparent</item>
- <item name="windowIsFloating">true</item>
- <item name="windowContentOverlay">@null</item>
+ <style name="Theme.Dialog.AppError" parent="Theme.DeviceDefault.Light.Dialog.Alert">
<item name="windowContentTransitions">false</item>
- <item name="textAppearance">@style/TextAppearance.Theme.Dialog.AppError</item>
<item name="windowCloseOnTouchOutside">false</item>
</style>
<!-- Special theme for the recent apps dialog, to allow customization
with overlays. -->
<style name="Theme.Dialog.RecentApplications" parent="Theme.DeviceDefault.Light.Dialog">
- <item name="windowFrame">@null</item>
<item name="windowBackground">@color/transparent</item>
<item name="windowAnimationStyle">@style/Animation.RecentApplications</item>
<item name="textColor">@color/secondary_text_nofocus</item>
<style name="Theme.Material.Dialog">
<item name="windowFrame">@null</item>
<item name="windowTitleStyle">@style/DialogWindowTitle.Material</item>
- <item name="windowBackground">@drawable/dialog_background_shadow_material</item>
+ <item name="windowBackground">@drawable/dialog_background_material</item>
+ <item name="windowElevation">@dimen/floating_window_z</item>
<item name="windowIsFloating">true</item>
<item name="windowContentOverlay">@null</item>
<item name="windowAnimationStyle">@style/Animation.Material.Dialog</item>
its pixels. -->
<style name="Theme.Material.Dialog.NoFrame">
<item name="windowBackground">@color/transparent</item>
+ <item name="windowElevation">0dp</item>
<item name="windowAnimationStyle">@null</item>
<item name="backgroundDimEnabled">false</item>
<item name="windowIsTranslucent">true</item>
</style>
<style name="Theme.Material.Dialog.BaseAlert">
- <item name="windowBackground">@color/transparent</item>
<item name="windowTitleStyle">@style/DialogWindowTitle.Material</item>
<item name="windowMinWidthMajor">@dimen/dialog_min_width_major</item>
<item name="windowMinWidthMinor">@dimen/dialog_min_width_minor</item>
<style name="Theme.Material.Dialog.BaseTimePicker">
<item name="windowBackground">@color/transparent</item>
+ <item name="windowElevation">0dp</item>
<item name="windowTitleStyle">@style/DialogWindowTitle.Material</item>
<item name="windowContentOverlay">@null</item>
</style>
<style name="Theme.Material.Light.Dialog">
<item name="windowFrame">@null</item>
<item name="windowTitleStyle">@style/DialogWindowTitle.Material.Light</item>
- <item name="windowBackground">@drawable/dialog_background_shadow_material</item>
+ <item name="windowBackground">@drawable/dialog_background_material</item>
+ <item name="windowElevation">@dimen/floating_window_z</item>
<item name="windowIsFloating">true</item>
<item name="windowContentOverlay">@null</item>
<item name="windowAnimationStyle">@style/Animation.Material.Dialog</item>
<style name="Theme.Material.Light.DialogWhenLarge.NoActionBar" parent="@style/Theme.Material.Light.NoActionBar" />
<style name="Theme.Material.Light.Dialog.BaseAlert">
- <item name="windowBackground">@color/transparent</item>
<item name="windowTitleStyle">@style/DialogWindowTitle.Material.Light</item>
<item name="windowMinWidthMajor">@dimen/dialog_min_width_major</item>
<item name="windowMinWidthMinor">@dimen/dialog_min_width_minor</item>
<style name="Theme.Material.Light.Dialog.BaseTimePicker">
<item name="windowBackground">@color/transparent</item>
+ <item name="windowElevation">0dp</item>
<item name="windowTitleStyle">@style/DialogWindowTitle.Material.Light</item>
</style>
private Drawable mBackgroundDrawable;
+ private float mElevation;
+
private int mFrameResource = 0;
private int mTextColor = 0;
+ Integer.toHexString(mFrameResource));
}
}
+ mElevation = a.getDimension(com.android.internal.R.styleable.Window_windowElevation, 0);
mTextColor = a.getColor(com.android.internal.R.styleable.Window_textColor, 0xFF000000);
}
// Remaining setup -- of background and title -- that only applies
// to top-level windows.
if (getContainer() == null) {
- Drawable drawable = mBackgroundDrawable;
+ final Drawable background;
if (mBackgroundResource != 0) {
- drawable = getContext().getDrawable(mBackgroundResource);
+ background = getContext().getDrawable(mBackgroundResource);
+ } else {
+ background = mBackgroundDrawable;
}
- mDecor.setWindowBackground(drawable);
- drawable = null;
+ mDecor.setWindowBackground(background);
+
+ final Drawable frame;
if (mFrameResource != 0) {
- drawable = getContext().getDrawable(mFrameResource);
+ frame = getContext().getDrawable(mFrameResource);
+ } else {
+ frame = null;
}
- mDecor.setWindowFrame(drawable);
-
- // System.out.println("Text=" + Integer.toHexString(mTextColor) +
- // " Sel=" + Integer.toHexString(mTextSelectedColor) +
- // " Title=" + Integer.toHexString(mTitleColor));
+ mDecor.setWindowFrame(frame);
- if (mTitleColor == 0) {
- mTitleColor = mTextColor;
- }
+ mDecor.setElevation(mElevation);
if (mTitle != null) {
setTitle(mTitle);
}
+
+ if (mTitleColor == 0) {
+ mTitleColor = mTextColor;
+ }
setTitleColor(mTitleColor);
}
float top = w.mFrame.top + w.mYOffset;
// Adjust for surface insets.
- width += attrs.shadowInsets.left + attrs.shadowInsets.right;
- height += attrs.shadowInsets.top + attrs.shadowInsets.bottom;
- left -= attrs.shadowInsets.left;
- top -= attrs.shadowInsets.top;
+ width += attrs.surfaceInsets.left + attrs.surfaceInsets.right;
+ height += attrs.surfaceInsets.top + attrs.surfaceInsets.bottom;
+ left -= attrs.surfaceInsets.left;
+ top -= attrs.surfaceInsets.top;
if (DEBUG_VISIBILITY) {
Slog.v(TAG, "Creating surface in session "
void applyDecorRect(final Rect decorRect) {
final WindowState w = mWin;
- int width = w.mFrame.width();
- int height = w.mFrame.height();
+ final int width = w.mFrame.width();
+ final int height = w.mFrame.height();
// Compute the offset of the window in relation to the decor rect.
- int left = w.mXOffset + w.mFrame.left;
- int top = w.mYOffset + w.mFrame.top;
-
- // Adjust for surface insets.
- final WindowManager.LayoutParams attrs = w.mAttrs;
- width += attrs.shadowInsets.left + attrs.shadowInsets.right;
- height += attrs.shadowInsets.top + attrs.shadowInsets.bottom;
- left -= attrs.shadowInsets.left;
- top -= attrs.shadowInsets.top;
+ final int left = w.mXOffset + w.mFrame.left;
+ final int top = w.mYOffset + w.mFrame.top;
// Initialize the decor rect to the entire frame.
w.mSystemDecorRect.set(0, 0, width, height);
if (displayContent == null) {
return;
}
- DisplayInfo displayInfo = displayContent.getDisplayInfo();
// Need to recompute a new system decor rect each time.
if ((w.mAttrs.flags & LayoutParams.FLAG_SCALED) != 0) {
} else if (!w.isDefaultDisplay()) {
// On a different display there is no system decor. Crop the window
// by the screen boundaries.
+ final DisplayInfo displayInfo = displayContent.getDisplayInfo();
w.mSystemDecorRect.set(0, 0, w.mCompatFrame.width(), w.mCompatFrame.height());
w.mSystemDecorRect.intersect(-w.mCompatFrame.left, -w.mCompatFrame.top,
displayInfo.logicalWidth - w.mCompatFrame.left,
// windows need to be cropped by the screen, so they don't cover
// the universe background.
if (mAnimator.mUniverseBackground == null) {
- w.mSystemDecorRect.set(0, 0, w.mCompatFrame.width(),
- w.mCompatFrame.height());
+ w.mSystemDecorRect.set(0, 0, w.mCompatFrame.width(), w.mCompatFrame.height());
} else {
applyDecorRect(mService.mScreenRect);
}
} else if (w.mAttrs.type == WindowManager.LayoutParams.TYPE_UNIVERSE_BACKGROUND
|| w.mDecorFrame.isEmpty()) {
// The universe background isn't cropped, nor windows without policy decor.
- w.mSystemDecorRect.set(0, 0, w.mCompatFrame.width(),
- w.mCompatFrame.height());
+ w.mSystemDecorRect.set(0, 0, w.mCompatFrame.width(), w.mCompatFrame.height());
} else {
// Crop to the system decor specified by policy.
applyDecorRect(w.mDecorFrame);
}
- // By default, the clip rect is the system decor rect
- Rect clipRect = w.mSystemDecorRect;
- if (mHasClipRect) {
+ // By default, the clip rect is the system decor.
+ final Rect clipRect = mTmpClipRect;
+ clipRect.set(w.mSystemDecorRect);
- // If we have an animated clip rect, intersect it with the system decor rect
- // NOTE: We are adding a temporary workaround due to the status bar not always reporting
- // the correct system decor rect. In such cases, we take into account the specified
- // content insets as well.
- int offsetTop = Math.max(w.mSystemDecorRect.top, w.mContentInsets.top);
- mTmpClipRect.set(w.mSystemDecorRect);
- // Don't apply the workaround to apps explicitly requesting fullscreen layout.
+ // Expand the clip rect for surface insets.
+ final WindowManager.LayoutParams attrs = w.mAttrs;
+ clipRect.left -= attrs.surfaceInsets.left;
+ clipRect.top -= attrs.surfaceInsets.top;
+ clipRect.right += attrs.surfaceInsets.right;
+ clipRect.bottom += attrs.surfaceInsets.bottom;
+
+ // If we have an animated clip rect, intersect it with the clip rect.
+ if (mHasClipRect) {
+ // NOTE: We are adding a temporary workaround due to the status bar
+ // not always reporting the correct system decor rect. In such
+ // cases, we take into account the specified content insets as well.
if ((w.mSystemUiVisibility & SYSTEM_UI_FLAGS_LAYOUT_STABLE_FULLSCREEN)
== SYSTEM_UI_FLAGS_LAYOUT_STABLE_FULLSCREEN) {
- mTmpClipRect.intersect(mClipRect);
+ // Don't apply the workaround to apps explicitly requesting
+ // fullscreen layout.
+ clipRect.intersect(mClipRect);
} else {
- mTmpClipRect.offset(0, -offsetTop);
- mTmpClipRect.intersect(mClipRect);
- mTmpClipRect.offset(0, offsetTop);
+ final int offsetTop = Math.max(clipRect.top, w.mContentInsets.top);
+ clipRect.offset(0, -offsetTop);
+ clipRect.intersect(mClipRect);
+ clipRect.offset(0, offsetTop);
}
- clipRect = mTmpClipRect;
-
}
+ // The clip rect was generated assuming (0,0) as the window origin,
+ // so we need to translate to match the actual surface coordinates.
+ clipRect.offset(attrs.surfaceInsets.left, attrs.surfaceInsets.top);
+
if (!clipRect.equals(mLastClipRect)) {
mLastClipRect.set(clipRect);
try {
// Adjust for surface insets.
final LayoutParams attrs = w.getAttrs();
- width += attrs.shadowInsets.left + attrs.shadowInsets.right;
- height += attrs.shadowInsets.top + attrs.shadowInsets.bottom;
- left -= attrs.shadowInsets.left;
- top -= attrs.shadowInsets.top;
+ width += attrs.surfaceInsets.left + attrs.surfaceInsets.right;
+ height += attrs.surfaceInsets.top + attrs.surfaceInsets.bottom;
+ left -= attrs.surfaceInsets.left;
+ top -= attrs.surfaceInsets.top;
final boolean surfaceMoved = mSurfaceX != left || mSurfaceY != top;
if (surfaceMoved) {
+++ /dev/null
-/*
- * Copyright 2014, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.telecomm;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.util.Log;
-
-import java.util.Locale;
-import java.util.UUID;
-
-/**
- * An immutable object containing information about a given {@link ConnectionService}. Instances are
- * created using the enclosed {@link Builder}.
- */
-public final class CallServiceDescriptor implements Parcelable {
- private static final String TAG = CallServiceDescriptor.class.getSimpleName();
-
- /**
- * A placeholder value indicating an invalid network type.
- * @hide
- */
- private static final int FLAG_INVALID = 0;
-
- /**
- * Indicates that the device must be connected to a Wi-Fi network in order for the backing
- * {@link ConnectionService} to be used.
- */
- public static final int FLAG_WIFI = 0x01;
-
- /**
- * Indicates that the device must be connected to a cellular PSTN network in order for the
- * backing {@link ConnectionService} to be used.
- */
- public static final int FLAG_PSTN = 0x02;
-
- /**
- * Indicates that the device must be connected to a cellular data network in order for the
- * backing {@link ConnectionService} to be used.
- */
- public static final int FLAG_MOBILE = 0x04;
-
- /**
- * Represents all of the defined FLAG_ constants so validity can be easily checked.
- * @hide
- */
- public static final int FLAG_ALL = FLAG_WIFI | FLAG_PSTN | FLAG_MOBILE;
-
- /**
- * A unique ID used to identify a given instance.
- */
- private final String mConnectionServiceId;
-
- /**
- * The {@link ComponentName} of the {@link ConnectionService} implementation which this is
- * describing.
- */
- private final ComponentName mComponentName;
-
- /**
- * The type of connection that the {@link ConnectionService} requires; will be one of the FLAG_*
- * constants defined in this class.
- */
- private final int mNetworkType;
-
- private CallServiceDescriptor(
- String connectionServiceId,
- ComponentName componentName,
- int networkType) {
-
- mConnectionServiceId = connectionServiceId;
- mComponentName = componentName;
- mNetworkType = networkType;
- }
-
- /**
- * @return The ID used to identify this {@link ConnectionService}.
- */
- public String getConnectionServiceId() {
- return mConnectionServiceId;
- }
-
- /**
- * @return The {@link ComponentName} of the {@link ConnectionService}.
- */
- public ComponentName getServiceComponent() {
- return mComponentName;
- }
-
- /**
- * @return The network type required by the {@link ConnectionService} to place a call.
- */
- public int getNetworkType() {
- return mNetworkType;
- }
-
- /** {@inheritDoc} */
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof CallServiceDescriptor)) {
- return false;
- }
- CallServiceDescriptor descriptor = (CallServiceDescriptor) obj;
- return mConnectionServiceId.equals(descriptor.mConnectionServiceId) &&
- mComponentName.equals(descriptor.mComponentName) &&
- mNetworkType == descriptor.mNetworkType;
- }
-
- @Override
- public String toString() {
- return String.format(Locale.US, "[%s, component: %s]",
- CallServiceDescriptor.class.getSimpleName(),
- mComponentName == null ? "null" : mComponentName.flattenToShortString());
- }
-
- /**
- * @param context {@link Context} to use for the construction of the {@link Builder}.
- * @return A new {@link Builder} instance.
- */
- public static Builder newBuilder(Context context) {
- return new Builder(context);
- }
-
- /**
- * Creates {@link CallServiceDescriptor} instances. Builders should be created with the
- * {@link CallServiceDescriptor#newBuilder(Context)} method.
- */
- public static class Builder {
- /** The {@link Context} to use to verify {@link ComponentName} ownership. */
- private Context mContext;
-
- /** The {@link ComponentName} pointing to the backing {@link ConnectionService}. */
- private ComponentName mComponentName;
-
- /** The required network type that the {@link ConnectionService} needs. */
- private int mNetworkType = FLAG_INVALID;
-
- private Builder(Context context) {
- mContext = context;
- }
-
- /**
- * Set which {@link ConnectionService} this {@link CallServiceDescriptor} is describing.
- *
- * @param serviceClass The {@link ConnectionService} class
- * @return This {@link Builder} for method chaining.
- */
- public Builder setConnectionService(Class<? extends ConnectionService> serviceClass) {
- mComponentName = new ComponentName(mContext, serviceClass);
- return this;
- }
-
- /**
- * Which network type the backing {@link ConnectionService} requires. This must be one of
- * the {@link CallServiceDescriptor}.TYPE_* fields.
- *
- * @param networkType Which network type the backing {@link ConnectionService} requires.
- * @return This {@link Builder} for method chaining.
- */
- public Builder setNetworkType(int networkType) {
- mNetworkType = networkType;
- return this;
- }
-
- /**
- * @return A constructed {@link CallServiceDescriptor} object.
- */
- public CallServiceDescriptor build() {
- // STOPSHIP: Verify validity of ComponentName (permissions, intents, etc)
-
- // Make sure that they passed in a valid network flag combination
- if (mNetworkType == FLAG_INVALID || ((mNetworkType & FLAG_ALL) == 0)) {
-
- Log.wtf(TAG, "Invalid network type for " + mComponentName);
- // Revert them back to TYPE_INVALID so it won't be considered.
- mNetworkType = FLAG_INVALID;
- }
-
- // TODO: Should we use a sha1 of the ComponentName? Would prevent duplicates.
- return new CallServiceDescriptor(
- UUID.randomUUID().toString(), mComponentName, mNetworkType);
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(mConnectionServiceId);
- dest.writeParcelable(mComponentName, 0);
- dest.writeInt(mNetworkType);
- }
-
- public static final Creator<CallServiceDescriptor> CREATOR =
- new Creator<CallServiceDescriptor>() {
- @Override
- public CallServiceDescriptor createFromParcel(Parcel source) {
- String id = source.readString();
- ComponentName componentName = source.readParcelable(
- CallServiceDescriptor.class.getClassLoader());
- int networkType = source.readInt();
-
- return new CallServiceDescriptor(id, componentName, networkType);
- }
-
- @Override
- public CallServiceDescriptor[] newArray(int size) {
- return new CallServiceDescriptor[size];
- }
- };
-}
+++ /dev/null
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.telecomm;
-
-import android.os.RemoteException;
-
-import com.android.internal.telecomm.ICallServiceLookupResponse;
-
-import java.util.List;
-
-/**
- * Used by {@link CallServiceProvider} to return a list of {@link CallServiceDescriptor}s.
- */
-public final class CallServiceLookupResponse {
- private final ICallServiceLookupResponse mResponse;
-
- /**
- * {@hide}
- */
- public CallServiceLookupResponse(ICallServiceLookupResponse response) {
- mResponse = response;
- }
-
- /**
- * Passes the sorted list of preferred {@link CallServiceDescriptor}s back to Telecomm. Used
- * in the context of attempting to place a pending outgoing call.
- *
- * @param callServiceDescriptors The set of call-service descriptors from
- * {@link CallServiceProvider}.
- */
- public void setCallServiceDescriptors(List<CallServiceDescriptor> callServiceDescriptors) {
- try {
- mResponse.setCallServiceDescriptors(callServiceDescriptors);
- } catch (RemoteException e) {
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.telecomm;
-
-import android.app.Service;
-import android.content.Intent;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-
-import com.android.internal.telecomm.ICallServiceLookupResponse;
-import com.android.internal.telecomm.ICallServiceProvider;
-
-/**
- * Base implementation of a call service provider which extends {@link Service}. This class
- * should be extended by an app that wants to supply phone calls to be handled and managed by
- * the device's in-call interface. All method-calls from the framework to the call service provider
- * are passed through to the main thread for before executing the overriden methods of
- * CallServiceProvider.
- *
- * TODO(santoscordon): Improve paragraph above once the final design is in place. Needs more
- * about how this can be used.
- */
-public abstract class CallServiceProvider extends Service {
-
- /**
- * Default Handler used to consolidate binder method calls onto a single thread.
- */
- private final class CallServiceProviderMessageHandler extends Handler {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_LOOKUP_CALL_SERVICES:
- CallServiceLookupResponse response =
- new CallServiceLookupResponse((ICallServiceLookupResponse) msg.obj);
- lookupCallServices(response);
- break;
- }
- }
- }
-
- /**
- * Default ICallServiceProvider implementation provided to CallsManager via {@link #onBind}.
- */
- private final class CallServiceProviderWrapper extends ICallServiceProvider.Stub {
- /** {@inheritDoc} */
- @Override
- public void lookupCallServices(ICallServiceLookupResponse callServiceLookupResponse) {
- Message message = mMessageHandler.obtainMessage(
- MSG_LOOKUP_CALL_SERVICES, callServiceLookupResponse);
- message.sendToTarget();
- }
- }
-
- // Only used internally by this class.
- // Binder method calls on this service can occur on multiple threads. These messages are used
- // in conjunction with {@link #mMessageHandler} to ensure that all callbacks are handled on a
- // single thread. Keeping it on a single thread allows CallService implementations to avoid
- // needing multi-threaded code in their own callback routines.
- private static final int MSG_LOOKUP_CALL_SERVICES = 1;
-
- /**
- * Message handler for consolidating binder callbacks onto a single thread.
- * See {@link CallServiceProviderMessageHandler}.
- */
- private final CallServiceProviderMessageHandler mMessageHandler;
-
- /**
- * Default binder implementation of {@link ICallServiceProvider} interface.
- */
- private final CallServiceProviderWrapper mBinder;
-
- /**
- * Protected constructor called only by subclasses creates the binder interface and
- * single-threaded message handler.
- */
- protected CallServiceProvider() {
- mMessageHandler = new CallServiceProviderMessageHandler();
- mBinder = new CallServiceProviderWrapper();
- }
-
- /** {@inheritDoc} */
- @Override
- public IBinder onBind(Intent intent) {
- return mBinder;
- }
-
- /**
- * Initiates the process to retrieve the list of {@link CallServiceDescriptor}s implemented by
- * this provider.
- *
- * @param response The response object through which the list of call services is sent.
- */
- public abstract void lookupCallServices(CallServiceLookupResponse response);
-}
private final int mCallerDisplayNamePresentation;
private final GatewayInfo mGatewayInfo;
private final PhoneAccount mAccount;
- private final CallServiceDescriptor mCurrentCallServiceDescriptor;
private final ICallVideoProvider mCallVideoProvider;
private RemoteCallVideoProvider mRemoteCallVideoProvider;
private final String mParentCallId;
int callerDisplayNamePresentation,
GatewayInfo gatewayInfo,
PhoneAccount account,
- CallServiceDescriptor descriptor,
ICallVideoProvider callVideoProvider,
String parentCallId,
List<String> childCallIds,
mCallerDisplayNamePresentation = callerDisplayNamePresentation;
mGatewayInfo = gatewayInfo;
mAccount = account;
- mCurrentCallServiceDescriptor = descriptor;
mCallVideoProvider = callVideoProvider;
mParentCallId = parentCallId;
mChildCallIds = childCallIds;
return mAccount;
}
- /** The descriptor for the call service currently routing this call. */
- public CallServiceDescriptor getCurrentCallServiceDescriptor() {
- return mCurrentCallServiceDescriptor;
- }
-
/**
* Returns an object for remotely communicating through the call video provider's binder.
* @return The call video provider.
int callerDisplayNamePresentation = source.readInt();
GatewayInfo gatewayInfo = source.readParcelable(classLoader);
PhoneAccount account = source.readParcelable(classLoader);
- CallServiceDescriptor descriptor = source.readParcelable(classLoader);
ICallVideoProvider callVideoProvider =
ICallVideoProvider.Stub.asInterface(source.readStrongBinder());
String parentCallId = source.readString();
return new InCallCall(id, state, disconnectCauseCode, disconnectCauseMsg,
cannedSmsResponses, capabilities, connectTimeMillis, handle, handlePresentation,
callerDisplayName, callerDisplayNamePresentation, gatewayInfo,
- account, descriptor, callVideoProvider, parentCallId, childCallIds,
- statusHints);
+ account, callVideoProvider, parentCallId, childCallIds, statusHints);
}
@Override
destination.writeInt(mCallerDisplayNamePresentation);
destination.writeParcelable(mGatewayInfo, 0);
destination.writeParcelable(mAccount, 0);
- destination.writeParcelable(mCurrentCallServiceDescriptor, 0);
destination.writeStrongBinder(
mCallVideoProvider != null ? mCallVideoProvider.asBinder() : null);
destination.writeString(mParentCallId);
package android.telecomm;
import android.content.ComponentName;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
-import android.telephony.Rlog;
-import android.util.DisplayMetrics;
-import android.util.Log;
-import java.util.MissingResourceException;
import java.util.Objects;
/**
* Represents a distinct account, line of service or call placement method that
* the system can use to place phone calls.
*/
-public final class PhoneAccount implements Parcelable {
+public class PhoneAccount implements Parcelable {
- private static final int NO_DENSITY = -1;
- private static final String LOG_TAG = "Account";
+ /**
+ * Flag indicating that this {@code PhoneAccount} can act as a call manager for traditional
+ * SIM-based telephony calls. The {@link ConnectionService} associated with this phone-account
+ * will be allowed to manage SIM-based phone calls including using its own proprietary
+ * phone-call implementation (like VoIP calling) to make calls instead of the telephony stack.
+ * When a user opts to place a call using the SIM-based telephony stack, the connection-service
+ * associated with this phone-account will be attempted first if the user has explicitly
+ * selected it to be used as the default call-manager.
+ * <p>
+ * See {@link #getCapabilities}
+ */
+ public static final int CAPABILITY_SIM_CALL_MANAGER = 0x1;
+
+ /**
+ * Flag indicating that this {@code PhoneAccount} can make phone calls in place of traditional
+ * SIM-based telephony calls. This account will be treated as a distinct method for placing
+ * calls alongside the traditional SIM-based telephony stack. This flag is distinct from
+ * {@link #CAPABILITY_SIM_CALL_MANAGER} in that it is not allowed to manage calls from or use
+ * the built-in telephony stack to place its calls.
+ * <p>
+ * See {@link #getCapabilities}
+ */
+ public static final int CAPABILITY_CALL_PROVIDER = 0x2;
+
+ /**
+ * Flag indicating that this {@code PhoneAccount} represents a built-in PSTN SIM subscription.
+ * <p>
+ * Only the android framework can set this capability on a phone-account.
+ */
+ public static final int CAPABILITY_SIM_SUBSCRIPTION = 0x4;
- private final ComponentName mComponentName;
- private final String mId;
- private final Uri mHandle;
- private final String mLabel;
- private final String mShortDescription;
- private final boolean mIsEnabled;
- private final boolean mIsSystemDefault;
+ private ComponentName mComponentName;
+ private String mId;
+ private Uri mHandle;
+ private int mCapabilities;
public PhoneAccount(
ComponentName componentName,
String id,
Uri handle,
- String label,
- String shortDescription,
- boolean isEnabled,
- boolean isSystemDefault) {
+ int capabilities) {
mComponentName = componentName;
mId = id;
mHandle = handle;
- mLabel = label;
- mShortDescription = shortDescription;
- mIsSystemDefault = isSystemDefault;
- mIsEnabled = isEnabled;
+ mCapabilities = capabilities;
}
/**
/**
* The handle (e.g., a phone number) associated with this {@code PhoneAccount}. This represents
- * the destination from which outgoing calls using this {@code PhoneAccount} will appear to come
- * from, if applicable, and the destination to which incoming calls using this
+ * the destination from which outgoing calls using this {@code PhoneAccount} will appear to
+ * come, if applicable, and the destination to which incoming calls using this
* {@code PhoneAccount} may be addressed.
*
* @return A handle expressed as a {@code Uri}, for example, a phone number.
}
/**
- * A short string label describing this {@code PhoneAccount}.
- *
- * @param context The invoking {@code Context}, used for retrieving resources.
+ * The capabilities of this {@code PhoneAccount}.
*
- * TODO(ihab): If don't need context, remove param
- *
- * @return A label for this {@code PhoneAccount}.
+ * @return A bit field of flags describing this {@code PhoneAccount}'s capabilities.
*/
- public String getLabel(Context context) {
- return mLabel;
+ public int getCapabilities() {
+ return mCapabilities;
}
- /**
- * A short paragraph describing this {@code PhoneAccount}.
- *
- * @param context The invoking {@code Context}, used for retrieving resources.
- *
- * TODO(ihab): If don't need context, remove param
- *
- * @return A description for this {@code PhoneAccount}.
- */
- public String getShortDescription(Context context) {
- return mShortDescription;
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(mComponentName) + Objects.hashCode(mId) +
+ Objects.hashCode(mHandle) + mCapabilities;
}
- // TODO(ihab): Representation of the icons
//
- // Refactor to pass a Bitmap (scale it at runtime), but if they don't pass one, fall
- // back to the android:icon attr in the manifest (<service /> first, <application /> second)
-
- /**
- * An icon to represent this {@code PhoneAccount} in a user interface.
- *
- * @param context The invoking {@code Context}, used for retrieving resources.
- *
- * @return An icon for this {@code PhoneAccount}.
- */
- public Drawable getIcon(Context context) {
- return null; // TODO(ihab): See above
- }
-
- /**
- * An icon to represent this {@code PhoneAccount} in a user interface.
- *
- * @param context The invoking {@code Context}, used for retrieving resources.
- * @param density A display density from {@link DisplayMetrics}.
- *
- * @return An icon for this {@code PhoneAccount}.
- */
- public Drawable getIcon(Context context, int density) {
- return null; // TODO(ihab): See above
- }
-
- /**
- * Whether this {@code PhoneAccount} is enabled for use.
- *
- * @return {@code true} if this {@code PhoneAccount} is enabled.
- */
- public boolean isEnabled() {
- return mIsEnabled;
- }
-
- /**
- * Whether this {@code PhoneAccount} is the system default.
- *
- * @return {@code true} if this {@code PhoneAccount} is the system default.
- */
- public boolean isSystemDefault() {
- return mIsSystemDefault;
- }
+ // Parcelable implementation.
+ //
@Override
public int describeContents() {
out.writeParcelable(mComponentName, flags);
out.writeString(mId);
out.writeString(mHandle != null ? mHandle.toString() : "");
- out.writeString(mLabel);
- out.writeString(mShortDescription);
- out.writeInt(mIsEnabled ? 1 : 0);
- out.writeInt(mIsSystemDefault ? 1 : 0);
+ out.writeInt(mCapabilities);
}
- public static final Creator<PhoneAccount> CREATOR
- = new Creator<PhoneAccount>() {
+ public static final Creator<PhoneAccount> CREATOR = new Creator<PhoneAccount>() {
+ @Override
public PhoneAccount createFromParcel(Parcel in) {
return new PhoneAccount(in);
}
+ @Override
public PhoneAccount[] newArray(int size) {
return new PhoneAccount[size];
}
mId = in.readString();
String uriString = in.readString();
mHandle = uriString.length() > 0 ? Uri.parse(uriString) : null;
- mLabel = in.readString();
- mShortDescription = in.readString();
- mIsEnabled = in.readInt() == 1;
- mIsSystemDefault = in.readInt() == 1;
- }
-
- @Override
- public boolean equals(Object other) {
- return
- other instanceof PhoneAccount &&
- Objects.equals(mComponentName, ((PhoneAccount) other).mComponentName) &&
- Objects.equals(mId, ((PhoneAccount) other).mId);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(mComponentName) + Objects.hashCode(mId);
+ mCapabilities = in.readInt();
}
}
/*
- * Copyright 2014, The Android Open Source Project
+ * Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
package android.telecomm;
-parcelable CallServiceDescriptor;
+/**
+ * {@hide}
+ */
+parcelable PhoneAccountMetadata;
--- /dev/null
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.telecomm;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.graphics.drawable.Drawable;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.io.IOException;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+import java.util.MissingResourceException;
+
+/**
+ * Provides user interface description information for a {@code PhoneAccount}.
+ */
+public class PhoneAccountMetadata implements Parcelable {
+ private PhoneAccount mAccount;
+ private int mIconResId;
+ private String mLabel;
+ private String mShortDescription;
+
+ public PhoneAccountMetadata(
+ PhoneAccount account,
+ int iconResId,
+ String label,
+ String shortDescription) {
+ mAccount = account;
+ mIconResId = iconResId;
+ mLabel = label;
+ mShortDescription = shortDescription;
+ }
+
+ /**
+ * The {@code PhoneAccount} to which this metadata pertains.
+ *
+ * @return A {@code PhoneAccount}.
+ */
+ public PhoneAccount getAccount() {
+ return mAccount;
+ }
+
+ /**
+ * A short string label describing a {@code PhoneAccount}.
+ *
+ * @return A label for this {@code PhoneAccount}.
+ */
+ public String getLabel() {
+ return mLabel;
+ }
+
+ /**
+ * A short paragraph describing a {@code PhoneAccount}.
+ *
+ * @return A description for this {@code PhoneAccount}.
+ */
+ public String getShortDescription() {
+ return mShortDescription;
+ }
+
+ /**
+ * An icon to represent this {@code PhoneAccount} in a user interface.
+ *
+ * @return An icon for this {@code PhoneAccount}.
+ */
+ public Drawable getIcon(Context context) {
+ return getIcon(context, mIconResId);
+ }
+
+ private Drawable getIcon(Context context, int resId) {
+ Context packageContext;
+ try {
+ packageContext = context.createPackageContext(
+ mAccount.getComponentName().getPackageName(), 0);
+ } catch (PackageManager.NameNotFoundException e) {
+ Log.w(this, "Cannot find package %s", mAccount.getComponentName().getPackageName());
+ return null;
+ }
+ try {
+ return packageContext.getResources().getDrawable(resId);
+ } catch (MissingResourceException e) {
+ Log.e(this, e, "Cannot find icon %d in package %s",
+ resId, mAccount.getComponentName().getPackageName());
+ return null;
+ }
+ }
+
+ //
+ // Parcelable implementation
+ //
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeParcelable(mAccount, 0);
+ out.writeInt(mIconResId);
+ out.writeString(mLabel);
+ out.writeString(mShortDescription);
+ }
+
+ public static final Creator<PhoneAccountMetadata> CREATOR
+ = new Creator<PhoneAccountMetadata>() {
+ @Override
+ public PhoneAccountMetadata createFromParcel(Parcel in) {
+ return new PhoneAccountMetadata(in);
+ }
+
+ @Override
+ public PhoneAccountMetadata[] newArray(int size) {
+ return new PhoneAccountMetadata[size];
+ }
+ };
+
+ private PhoneAccountMetadata(Parcel in) {
+ mAccount = in.readParcelable(getClass().getClassLoader());
+ mIconResId = in.readInt();
+ mLabel = in.readString();
+ mShortDescription = in.readString();
+ }
+}
mComponentName,
null /* id */,
null /* handle */,
- "" /* label */,
- "" /* shortDescription */,
- true /* isEnabled */,
- false /* isSystemDefault */));
+ 0 /* capabilities */));
return accounts;
}
package android.telecomm;
+import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.TelephonyManager;
* to find and bind to the appropriate {@link android.telecomm.ConnectionService} which
* Telecomm will ultimately use to control and get information about the call.</p>
*
- * <p>Input: get*Extra field {@link #EXTRA_CALL_SERVICE_DESCRIPTOR} contains the component name
- * of the {@link android.telecomm.ConnectionService} that Telecomm should bind to. Telecomm
- * will then ask the call service for more information about the call prior to showing any UI.
+ * <p>Input: get*Extra field {@link #EXTRA_PHONE_ACCOUNT} contains the component name of the
+ * {@link android.telecomm.ConnectionService} that Telecomm should bind to. Telecomm will then
+ * ask the connection service for more information about the call prior to showing any UI.
*
* TODO(santoscordon): Needs permissions.
* TODO(santoscordon): Consider moving this into a simple method call on a system service.
public static final String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL";
/**
- * The service action used to bind to {@link CallServiceProvider} implementations.
- */
- public static final String ACTION_CALL_SERVICE_PROVIDER = CallServiceProvider.class.getName();
-
- /**
* The service action used to bind to {@link ConnectionService} implementations.
*/
public static final String ACTION_CONNECTION_SERVICE = ConnectionService.class.getName();
"android.intent.extra.START_CALL_WITH_VIDEO_STATE";
/**
- * Extra for {@link #ACTION_INCOMING_CALL} containing the {@link CallServiceDescriptor} that
- * describes the call service to use for the incoming call.
+ * The extra used with an {@link android.content.Intent#ACTION_CALL},
+ * {@link #ACTION_INCOMING_CALL}, {@link android.content.Intent#ACTION_DIAL} {@code Intent} to
+ * specify a {@link PhoneAccount} to use when making the call.
+ *
+ * <p class="note">
+ * Retrieve with
+ * {@link android.content.Intent#getParcelableExtra(String)}.
*/
- public static final String EXTRA_CALL_SERVICE_DESCRIPTOR =
- "android.intent.extra.CALL_SERVICE_DESCRIPTOR";
+ public static final String EXTRA_PHONE_ACCOUNT = "android.intent.extra.PHONE_ACCOUNT";
/**
* Optional extra for {@link #ACTION_INCOMING_CALL} containing a {@link Bundle} which contains
import com.android.internal.telecomm.ITelecommService;
+import java.util.List;
+
/**
* Provides access to Telecomm-related functionality.
* TODO(santoscordon): Move this all into PhoneManager.
* @hide
*/
public class TelecommManager {
+
+ /**
+ * The extra used with an {@link android.content.Intent#ACTION_CALL} or
+ * {@link android.content.Intent#ACTION_DIAL} {@code Intent} to specify a {@link PhoneAccount}
+ * to use when making the call.
+ *
+ * <p class="note">
+ * Retrieve with
+ * {@link android.content.Intent#getParcelableExtra(String)}.
+ */
+ public static final String EXTRA_PHONE_ACCOUNT = "account";
+
private static final String TAG = "TelecommManager";
private static final String TELECOMM_SERVICE_NAME = "telecomm";
private final Context mContext;
- private final ITelecommService mService;
/**
* @hide
*/
- public TelecommManager(Context context, ITelecommService service) {
+ public static TelecommManager from(Context context) {
+ return (TelecommManager) context.getSystemService(Context.TELECOMM_SERVICE);
+ }
+
+ /**
+ * @hide
+ */
+ public TelecommManager(Context context) {
Context appContext = context.getApplicationContext();
if (appContext != null) {
mContext = appContext;
} else {
mContext = context;
}
+ }
- mService = service;
+ /**
+ * Return a list of {@link PhoneAccount}s which can be used to make and receive phone calls.
+ *
+ * @see #EXTRA_PHONE_ACCOUNT
+ * @return A list of {@code PhoneAccount} objects.
+ */
+ public List<PhoneAccount> getEnabledPhoneAccounts() {
+ try {
+ if (isServiceConnected()) {
+ return getTelecommService().getEnabledPhoneAccounts();
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecommService#getEnabledPhoneAccounts", e);
+ }
+ return null;
}
/**
+ * Return the metadata for a specified {@link PhoneAccount}. Metadata includes resources which
+ * can be used in a user interface.
+ *
+ * @param account The {@link PhoneAccount}.
+ *
+ * @return The metadata for the account.
+ */
+ public PhoneAccountMetadata getPhoneAccountMetadata(PhoneAccount account) {
+ try {
+ if (isServiceConnected()) {
+ return getTelecommService().getPhoneAccountMetadata(account);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecommService#getPhoneAccountMetadata", e);
+ }
+ return null;
+ }
+
+ /**
+ * Register a {@link PhoneAccount} for use by the system.
+ *
+ * @param account The {@link PhoneAccount}.
+ * @param metadata The metadata for the account.
+ */
+ public void registerPhoneAccount(PhoneAccount account, PhoneAccountMetadata metadata) {
+ try {
+ if (isServiceConnected()) {
+ getTelecommService().registerPhoneAccount(account, metadata);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecommService#registerPhoneAccount", e);
+ }
+ }
+
+ /**
+ * Remove a {@link PhoneAccount} registration from the system.
+ *
+ * @param account An Account.
+ */
+ public void unregisterPhoneAccount(PhoneAccount account) {
+ try {
+ if (isServiceConnected()) {
+ getTelecommService().unregisterPhoneAccount(account);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecommService#unregisterPhoneAccount", e);
+ }
+ }
+
+ /**
+ * Remove all Accounts for a given package from the system.
+ *
+ * @param packageName A package name that may have registered Accounts.
+ *
* @hide
*/
- public static TelecommManager from(Context context) {
- return (TelecommManager) context.getSystemService(Context.TELECOMM_SERVICE);
+ @SystemApi
+ public void clearAccounts(String packageName) {
+ try {
+ if (isServiceConnected()) {
+ getTelecommService().clearAccounts(packageName);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecommService#clearAccounts", e);
+ }
}
/**
/**
* Ends an ongoing call. TODO(santoscordon): L-release - need to convert all invocations of
- * ITelephony#endCall to use this method (clockwork & gearhead).
+ * ITelecommService#endCall to use this method (clockwork & gearhead).
*
* @hide
*/
/**
* If there is a ringing incoming call, this method accepts the call on behalf of the user.
* TODO(santoscordon): L-release - need to convert all invocation of
- * ITelephony#answerRingingCall to use this method (clockwork & gearhead).
+ * ITelecommService#answerRingingCall to use this method (clockwork & gearhead).
*
* @hide
*/
+++ /dev/null
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.telecomm;
-
-import android.os.IBinder;
-import android.telecomm.CallServiceDescriptor;
-import java.util.List;
-
-/**
- * Internal remote interface for call service lookup response.
- *
- * @see android.telecomm.CallServiceLookupResponse
- *
- * @hide
- */
-oneway interface ICallServiceLookupResponse {
- void setCallServiceDescriptors(in List<CallServiceDescriptor> callServiceDescriptors);
-}
+++ /dev/null
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.telecomm;
-
-import android.telecomm.CallServiceDescriptor;
-
-import com.android.internal.telecomm.ICallServiceLookupResponse;
-
-/**
- * Internal remote interface for call service providers.
- *
- * @see android.telecomm.CallServiceProvider
- *
- * @hide
- */
-oneway interface ICallServiceProvider {
- void lookupCallServices(in ICallServiceLookupResponse response);
-}
import android.content.ComponentName;
import android.telecomm.PhoneAccount;
+import android.telecomm.PhoneAccountMetadata;
/**
* Interface used to interact with Telecomm. Mostly this is used by TelephonyManager for passing
void showCallScreen(boolean showDialpad);
/**
- * Gets a list of accounts.
+ * @see TelecommManager#getEnabledPhoneAccounts
*/
- List<PhoneAccount> getAccounts();
+ List<PhoneAccount> getEnabledPhoneAccounts();
/**
- * Sets the enabled state of a given account.
+ * @see TelecommManager#getPhoneAccountMetadata
*/
- void setEnabled(in PhoneAccount account, boolean enabled);
+ PhoneAccountMetadata getPhoneAccountMetadata(in PhoneAccount account);
/**
- * Sets a given account as the system default.
+ * @see TelecommManager#registerPhoneAccount
*/
- void setSystemDefault(in PhoneAccount account);
+ void registerPhoneAccount(in PhoneAccount account, in PhoneAccountMetadata metadata);
/**
- * Returns the component name of the default phone application.
+ * @see TelecommManager#unregisterPhoneAccount
+ */
+ void unregisterPhoneAccount(in PhoneAccount account);
+
+ /**
+ * @see TelecommManager#clearAccounts
+ */
+ void clearAccounts(String packageName);
+
+ /**
+ * @see TelecommManager#getDefaultPhoneApp
*/
ComponentName getDefaultPhoneApp();
public static final String EXTRA_INCOMING_NUMBER = "incoming_number";
/**
- * The lookup key used with an {@link android.content.Intent#ACTION_CALL} or
- * {@link android.content.Intent#ACTION_DIAL} {@code Intent} for a {@link PhoneAccount}
- * object indicating a preference when making a phone connection.
- *
- * <p class="note">
- * Retrieve with
- * {@link android.content.Intent#getParcelableExtra(String)}.
- */
- public static final String EXTRA_ACCOUNT = "account";
-
- /**
* Broadcast intent action indicating that a precise call state
* (cellular) on the device has changed.
*
}
/**
- * Return a list of Accounts that can be used to indicate a preference when making
- * a phone call.
- *
- * @see #EXTRA_ACCOUNT
- * @return A list of {@code Accouint} objects.
- */
- public List<PhoneAccount> getAccounts() {
- try {
- return getTelecommService().getAccounts();
- } catch (RemoteException e) {
- Log.e(TAG, "Error calling ITelephony#getAccounts", e);
- }
- return null;
- }
-
- /** @hide */
- @SystemApi
- public void setEnabled(PhoneAccount account, boolean enabled) {
- try {
- getTelecommService().setEnabled(account, enabled);
- } catch (RemoteException e) {
- Log.e(TAG, "Error calling ITelephony#setEnabled", e);
- }
- }
-
- /** @hide */
- @SystemApi
- public void setSystemDefault(PhoneAccount account) {
- try {
- getTelecommService().setSystemDefault(account);
- } catch (RemoteException e) {
- Log.e(TAG, "Error calling ITelephony#setSystemDefault", e);
- }
- }
-
- /**
* Set whether Android should display a simplified Mobile Network Settings UI.
* The setting won't be persisted during power cycle.
* <p>
*
* TODO: Add a link to documentation.
*
- * @return carrier privelege status defined in TelephonyManager.
+ * @return carrier privilege status defined in TelephonyManager.
*/
int hasCarrierPrivileges();
+++ /dev/null
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.telephony;
-
-import com.android.internal.telephony.IThirdPartyCallProvider;
-
-/**
- * Interface provided to ThirdPartyCallService. The service can use this to notify the listener of
- * changes to the call state.
- */
-oneway interface IThirdPartyCallListener {
- /**
- * Called by the service when a call provider is available to perform the outgoing or incoming
- * call.
- */
- void onCallProviderAttached(IThirdPartyCallProvider callProvider);
-
- /**
- * Notifies the listener that ringing has started for this call.
- */
- void onRingingStarted();
-
- /**
- * Notifies the listener that the call has been successfully established.
- */
- void onCallEstablished();
-
- /**
- * Notifies the listener that the call has ended.
- */
- void onCallEnded(int reason);
-}
+++ /dev/null
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.telephony;
-
-import com.android.internal.telephony.IThirdPartyCallListener;
-import com.android.internal.telephony.IThirdPartyCallSendDtmfCallback;
-
-/**
- * Interface sent to ThirdPartyCallListener.onCallProviderAttached. This is used to control an
- * outgoing or incoming call.
- */
-oneway interface IThirdPartyCallProvider {
- /**
- * Mutes or unmutes the call.
- */
- void mute(boolean shouldMute);
-
- /**
- * Ends the current call. If this is an unanswered incoming call then the call is rejected (for
- * example, a notification is sent to a server that the user declined the call).
- */
- void hangup();
-
- /**
- * Accepts the incoming call.
- */
- void incomingCallAccept();
-
- /**
- * Sends the given DTMF code. The code can be '0'-'9', 'A'-'D', '#', or '*'.
- */
- void sendDtmf(char c, IThirdPartyCallSendDtmfCallback callback);
-}
+++ /dev/null
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.telephony;
-
-/**
- * Callback interface for when DTMF has been sent.
- */
-oneway interface IThirdPartyCallSendDtmfCallback {
- /**
- * Called when the DTMF code has been sent.
- */
- void onSendDtmfCompleted();
-}
+++ /dev/null
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.telephony;
-
-import com.android.internal.telephony.IThirdPartyCallListener;
-
-/**
- * Interface provided by a service to start outgoing calls and attach to incoming calls.
- */
-oneway interface IThirdPartyCallService {
- /**
- * Call to start a new outgoing call.
- */
- void outgoingCallInitiate(IThirdPartyCallListener listener, String number);
-
- /**
- * Call to attach to an incoming call. This is in response to a call to
- * TelephonyManager.newIncomingThirdPartyCall.
- */
- void incomingCallAttach(IThirdPartyCallListener listener, String callId);
-}