From 127217a340681c6cae53667d9514631c5812dd16 Mon Sep 17 00:00:00 2001 From: Pierre Vandwalle Date: Tue, 14 Apr 2015 15:33:22 -0700 Subject: [PATCH 01/11] add disconnected scan parameter, add bytes[] container to scanResults Change-Id: I201b52064ea764ddd406c25c86f41887029ff225 --- core/res/res/values/config.xml | 3 +++ core/res/res/values/symbols.xml | 1 + wifi/java/android/net/wifi/ScanResult.java | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index f1da2f9623697..4b28aab86105c 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -437,6 +437,9 @@ point on the move. A value of 0 means no periodic scans will be used in the framework. --> 300000 + + 15000 + 20000 diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index b274c15cba270..76556ad645269 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -371,6 +371,7 @@ + diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java index e8a51e336f7d8..5dc70bd49baf0 100644 --- a/wifi/java/android/net/wifi/ScanResult.java +++ b/wifi/java/android/net/wifi/ScanResult.java @@ -261,6 +261,12 @@ public class ScanResult implements Parcelable { return freq > 4900 && freq < 5900; } + /** + * @hide + * storing the raw bytes of full result IEs + **/ + public byte[] bytes; + /** information element from beacon * @hide */ From d05bd467ba191833522e5b78da54bc5eab7bab2c Mon Sep 17 00:00:00 2001 From: Casper Bonde Date: Thu, 19 Mar 2015 10:36:45 +0100 Subject: [PATCH 02/11] Add support for Bluetooth Sim Access Profile (2/4) Change-Id: I6c634aa38d31a7b5a98c9089840557257fd58209 --- Android.mk | 1 + api/current.txt | 20 + api/system-current.txt | 20 + .../android/bluetooth/BluetoothAdapter.java | 7 + .../android/bluetooth/BluetoothDevice.java | 41 ++ .../android/bluetooth/BluetoothProfile.java | 10 +- core/java/android/bluetooth/BluetoothSap.java | 389 ++++++++++++++++++ .../java/android/bluetooth/BluetoothUuid.java | 9 +- core/java/android/bluetooth/IBluetooth.aidl | 2 + .../java/android/bluetooth/IBluetoothSap.aidl | 37 ++ core/java/android/provider/Settings.java | 12 + .../internal/telephony/RILConstants.java | 10 + 12 files changed, 554 insertions(+), 4 deletions(-) create mode 100644 core/java/android/bluetooth/BluetoothSap.java create mode 100644 core/java/android/bluetooth/IBluetoothSap.aidl diff --git a/Android.mk b/Android.mk index 81113f791bee3..35bb81a9c68ad 100644 --- a/Android.mk +++ b/Android.mk @@ -111,6 +111,7 @@ LOCAL_SRC_FILES += \ core/java/android/bluetooth/IBluetoothManagerCallback.aidl \ core/java/android/bluetooth/IBluetoothPbap.aidl \ core/java/android/bluetooth/IBluetoothMap.aidl \ + core/java/android/bluetooth/IBluetoothSap.aidl \ core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl \ core/java/android/bluetooth/IBluetoothHeadsetClient.aidl \ core/java/android/bluetooth/IBluetoothGatt.aidl \ diff --git a/api/current.txt b/api/current.txt index fe76c22159a47..175225c4cc04d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -6485,6 +6485,7 @@ package android.bluetooth { field public static final int GATT_SERVER = 8; // 0x8 field public static final int HEADSET = 1; // 0x1 field public static final int HEALTH = 3; // 0x3 + field public static final int SAP = 10; // 0xa field public static final int STATE_CONNECTED = 2; // 0x2 field public static final int STATE_CONNECTING = 1; // 0x1 field public static final int STATE_DISCONNECTED = 0; // 0x0 @@ -6496,6 +6497,25 @@ package android.bluetooth { method public abstract void onServiceDisconnected(int); } + public final class BluetoothSap implements android.bluetooth.BluetoothProfile { + method public synchronized void close(); + method public boolean connect(android.bluetooth.BluetoothDevice); + method public boolean disconnect(android.bluetooth.BluetoothDevice); + method public android.bluetooth.BluetoothDevice getClient(); + method public java.util.List getConnectedDevices(); + method public int getConnectionState(android.bluetooth.BluetoothDevice); + method public java.util.List getDevicesMatchingConnectionStates(int[]); + method public int getPriority(android.bluetooth.BluetoothDevice); + method public int getState(); + method public boolean isConnected(android.bluetooth.BluetoothDevice); + method public boolean setPriority(android.bluetooth.BluetoothDevice, int); + field public static final java.lang.String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.sap.profile.action.CONNECTION_STATE_CHANGED"; + field public static final int RESULT_CANCELED = 2; // 0x2 + field public static final int RESULT_FAILURE = 0; // 0x0 + field public static final int RESULT_SUCCESS = 1; // 0x1 + field public static final int STATE_ERROR = -1; // 0xffffffff + } + public final class BluetoothServerSocket implements java.io.Closeable { method public android.bluetooth.BluetoothSocket accept() throws java.io.IOException; method public android.bluetooth.BluetoothSocket accept(int) throws java.io.IOException; diff --git a/api/system-current.txt b/api/system-current.txt index e7ba3b7ad761a..d29f77779273f 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6701,6 +6701,7 @@ package android.bluetooth { field public static final int GATT_SERVER = 8; // 0x8 field public static final int HEADSET = 1; // 0x1 field public static final int HEALTH = 3; // 0x3 + field public static final int SAP = 10; // 0xa field public static final int STATE_CONNECTED = 2; // 0x2 field public static final int STATE_CONNECTING = 1; // 0x1 field public static final int STATE_DISCONNECTED = 0; // 0x0 @@ -6712,6 +6713,25 @@ package android.bluetooth { method public abstract void onServiceDisconnected(int); } + public final class BluetoothSap implements android.bluetooth.BluetoothProfile { + method public synchronized void close(); + method public boolean connect(android.bluetooth.BluetoothDevice); + method public boolean disconnect(android.bluetooth.BluetoothDevice); + method public android.bluetooth.BluetoothDevice getClient(); + method public java.util.List getConnectedDevices(); + method public int getConnectionState(android.bluetooth.BluetoothDevice); + method public java.util.List getDevicesMatchingConnectionStates(int[]); + method public int getPriority(android.bluetooth.BluetoothDevice); + method public int getState(); + method public boolean isConnected(android.bluetooth.BluetoothDevice); + method public boolean setPriority(android.bluetooth.BluetoothDevice, int); + field public static final java.lang.String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.sap.profile.action.CONNECTION_STATE_CHANGED"; + field public static final int RESULT_CANCELED = 2; // 0x2 + field public static final int RESULT_FAILURE = 0; // 0x0 + field public static final int RESULT_SUCCESS = 1; // 0x1 + field public static final int STATE_ERROR = -1; // 0xffffffff + } + public final class BluetoothServerSocket implements java.io.Closeable { method public android.bluetooth.BluetoothSocket accept() throws java.io.IOException; method public android.bluetooth.BluetoothSocket accept(int) throws java.io.IOException; diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 88bb626bfd7e5..d7705a4026cc0 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -1746,6 +1746,9 @@ public final class BluetoothAdapter { } else if (profile == BluetoothProfile.HEADSET_CLIENT) { BluetoothHeadsetClient headsetClient = new BluetoothHeadsetClient(context, listener); return true; + } else if (profile == BluetoothProfile.SAP) { + BluetoothSap sap = new BluetoothSap(context, listener); + return true; } else { return false; } @@ -1810,6 +1813,10 @@ public final class BluetoothAdapter { BluetoothHeadsetClient headsetClient = (BluetoothHeadsetClient)proxy; headsetClient.close(); break; + case BluetoothProfile.SAP: + BluetoothSap sap = (BluetoothSap)proxy; + sap.close(); + break; } } diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 1e82c032bf040..bfc374fb913cb 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -382,6 +382,9 @@ public final class BluetoothDevice implements Parcelable { /**@hide*/ public static final int REQUEST_TYPE_MESSAGE_ACCESS = 3; + /**@hide*/ + public static final int REQUEST_TYPE_SIM_ACCESS = 4; + /** * Used as an extra field in {@link #ACTION_CONNECTION_ACCESS_REQUEST} intents, * Contains package name to return reply intent to. @@ -1269,6 +1272,44 @@ public final class BluetoothDevice implements Parcelable { return false; } + /** + * Requires {@link android.Manifest.permission#BLUETOOTH}. + * @return Whether the Sim access is allowed to this device. Can be + * {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}. + * @hide + */ + public int getSimAccessPermission() { + if (sService == null) { + return ACCESS_UNKNOWN; + } + try { + return sService.getSimAccessPermission(this); + } catch (RemoteException e) { + Log.e(TAG, "", e); + } + return ACCESS_UNKNOWN; + } + + /** + * Sets whether the Sim access is allowed to this device. + *

Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}. + * @param value Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or + * {@link #ACCESS_REJECTED}. + * @return Whether the value has been successfully set. + * @hide + */ + public boolean setSimAccessPermission(int value) { + if (sService == null) { + return false; + } + try { + return sService.setSimAccessPermission(this, value); + } catch (RemoteException e) { + Log.e(TAG, "", e); + } + return false; + } + /** * Create an RFCOMM {@link BluetoothSocket} ready to start a secure * outgoing connection to this remote device on given channel. diff --git a/core/java/android/bluetooth/BluetoothProfile.java b/core/java/android/bluetooth/BluetoothProfile.java index 136740505a4a5..eecb07396572e 100644 --- a/core/java/android/bluetooth/BluetoothProfile.java +++ b/core/java/android/bluetooth/BluetoothProfile.java @@ -103,17 +103,23 @@ public interface BluetoothProfile { */ public static final int MAP = 9; + /* + * SAP Profile + * @hide + */ + public static final int SAP = 10; + /** * A2DP Sink Profile * @hide */ - public static final int A2DP_SINK = 10; + public static final int A2DP_SINK = 11; /** * AVRCP Controller Profile * @hide */ - public static final int AVRCP_CONTROLLER = 11; + public static final int AVRCP_CONTROLLER = 12; /** * Headset Client - HFP HF Role diff --git a/core/java/android/bluetooth/BluetoothSap.java b/core/java/android/bluetooth/BluetoothSap.java new file mode 100644 index 0000000000000..60528849a0109 --- /dev/null +++ b/core/java/android/bluetooth/BluetoothSap.java @@ -0,0 +1,389 @@ +/* + * Copyright (C) 2008 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.bluetooth; + +import java.util.ArrayList; +import java.util.List; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.RemoteException; +import android.os.IBinder; +import android.os.ServiceManager; +import android.util.Log; + + +public final class BluetoothSap implements BluetoothProfile { + + private static final String TAG = "BluetoothSap"; + private static final boolean DBG = true; + private static final boolean VDBG = false; + + public static final String ACTION_CONNECTION_STATE_CHANGED = + "android.bluetooth.sap.profile.action.CONNECTION_STATE_CHANGED"; + + private IBluetoothSap mService; + private final Context mContext; + private ServiceListener mServiceListener; + private BluetoothAdapter mAdapter; + + /** There was an error trying to obtain the state */ + public static final int STATE_ERROR = -1; + + public static final int RESULT_FAILURE = 0; + public static final int RESULT_SUCCESS = 1; + /** Connection canceled before completion. */ + public static final int RESULT_CANCELED = 2; + + final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback = + new IBluetoothStateChangeCallback.Stub() { + public void onBluetoothStateChange(boolean up) { + if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); + if (!up) { + if (VDBG) Log.d(TAG,"Unbinding service..."); + synchronized (mConnection) { + try { + mService = null; + mContext.unbindService(mConnection); + } catch (Exception re) { + Log.e(TAG,"",re); + } + } + } else { + synchronized (mConnection) { + try { + if (mService == null) { + if (VDBG) Log.d(TAG,"Binding service..."); + doBind(); + } + } catch (Exception re) { + Log.e(TAG,"",re); + } + } + } + } + }; + + /** + * Create a BluetoothSap proxy object. + */ + /*package*/ BluetoothSap(Context context, ServiceListener l) { + if (DBG) Log.d(TAG, "Create BluetoothSap proxy object"); + mContext = context; + mServiceListener = l; + mAdapter = BluetoothAdapter.getDefaultAdapter(); + IBluetoothManager mgr = mAdapter.getBluetoothManager(); + if (mgr != null) { + try { + mgr.registerStateChangeCallback(mBluetoothStateChangeCallback); + } catch (RemoteException e) { + Log.e(TAG,"",e); + } + } + doBind(); + } + + boolean doBind() { + Intent intent = new Intent(IBluetoothMap.class.getName()); + ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); + intent.setComponent(comp); + if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, + android.os.Process.myUserHandle())) { + Log.e(TAG, "Could not bind to Bluetooth SAP Service with " + intent); + return false; + } + return true; + } + + protected void finalize() throws Throwable { + try { + close(); + } finally { + super.finalize(); + } + } + + /** + * Close the connection to the backing service. + * Other public functions of BluetoothSap will return default error + * results once close() has been called. Multiple invocations of close() + * are ok. + */ + public synchronized void close() { + IBluetoothManager mgr = mAdapter.getBluetoothManager(); + if (mgr != null) { + try { + mgr.unregisterStateChangeCallback(mBluetoothStateChangeCallback); + } catch (Exception e) { + Log.e(TAG,"",e); + } + } + + synchronized (mConnection) { + if (mService != null) { + try { + mService = null; + mContext.unbindService(mConnection); + } catch (Exception re) { + Log.e(TAG,"",re); + } + } + } + mServiceListener = null; + } + + /** + * Get the current state of the BluetoothSap service. + * @return One of the STATE_ return codes, or STATE_ERROR if this proxy + * object is currently not connected to the Sap service. + */ + public int getState() { + if (VDBG) log("getState()"); + if (mService != null) { + try { + return mService.getState(); + } catch (RemoteException e) {Log.e(TAG, e.toString());} + } else { + Log.w(TAG, "Proxy not attached to service"); + if (DBG) log(Log.getStackTraceString(new Throwable())); + } + return BluetoothSap.STATE_ERROR; + } + + /** + * Get the currently connected remote Bluetooth device (PCE). + * @return The remote Bluetooth device, or null if not in connected or + * connecting state, or if this proxy object is not connected to + * the Sap service. + */ + public BluetoothDevice getClient() { + if (VDBG) log("getClient()"); + if (mService != null) { + try { + return mService.getClient(); + } catch (RemoteException e) {Log.e(TAG, e.toString());} + } else { + Log.w(TAG, "Proxy not attached to service"); + if (DBG) log(Log.getStackTraceString(new Throwable())); + } + return null; + } + + /** + * Returns true if the specified Bluetooth device is connected. + * Returns false if not connected, or if this proxy object is not + * currently connected to the Sap service. + */ + public boolean isConnected(BluetoothDevice device) { + if (VDBG) log("isConnected(" + device + ")"); + if (mService != null) { + try { + return mService.isConnected(device); + } catch (RemoteException e) {Log.e(TAG, e.toString());} + } else { + Log.w(TAG, "Proxy not attached to service"); + if (DBG) log(Log.getStackTraceString(new Throwable())); + } + return false; + } + + /** + * Initiate connection. Initiation of outgoing connections is not + * supported for SAP server. + */ + public boolean connect(BluetoothDevice device) { + if (DBG) log("connect(" + device + ")" + "not supported for SAPS"); + return false; + } + + /** + * Initiate disconnect. + * + * @param device Remote Bluetooth Device + * @return false on error, + * true otherwise + */ + public boolean disconnect(BluetoothDevice device) { + if (DBG) log("disconnect(" + device + ")"); + if (mService != null && isEnabled() && + isValidDevice(device)) { + try { + return mService.disconnect(device); + } catch (RemoteException e) { + Log.e(TAG, Log.getStackTraceString(new Throwable())); + return false; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return false; + } + + /** + * Get the list of connected devices. Currently at most one. + * + * @return list of connected devices + */ + public List getConnectedDevices() { + if (DBG) log("getConnectedDevices()"); + if (mService != null && isEnabled()) { + try { + return mService.getConnectedDevices(); + } catch (RemoteException e) { + Log.e(TAG, Log.getStackTraceString(new Throwable())); + return new ArrayList(); + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return new ArrayList(); + } + + /** + * Get the list of devices matching specified states. Currently at most one. + * + * @return list of matching devices + */ + public List getDevicesMatchingConnectionStates(int[] states) { + if (DBG) log("getDevicesMatchingStates()"); + if (mService != null && isEnabled()) { + try { + return mService.getDevicesMatchingConnectionStates(states); + } catch (RemoteException e) { + Log.e(TAG, Log.getStackTraceString(new Throwable())); + return new ArrayList(); + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return new ArrayList(); + } + + /** + * Get connection state of device + * + * @return device connection state + */ + public int getConnectionState(BluetoothDevice device) { + if (DBG) log("getConnectionState(" + device + ")"); + if (mService != null && isEnabled() && + isValidDevice(device)) { + try { + return mService.getConnectionState(device); + } catch (RemoteException e) { + Log.e(TAG, Log.getStackTraceString(new Throwable())); + return BluetoothProfile.STATE_DISCONNECTED; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return BluetoothProfile.STATE_DISCONNECTED; + } + + /** + * Set priority of the profile + * + *

The device should already be paired. + * Priority can be one of {@link #PRIORITY_ON} or + * {@link #PRIORITY_OFF}, + * + * @param device Paired bluetooth device + * @param priority + * @return true if priority is set, false on error + */ + public boolean setPriority(BluetoothDevice device, int priority) { + if (DBG) log("setPriority(" + device + ", " + priority + ")"); + if (mService != null && isEnabled() && + isValidDevice(device)) { + if (priority != BluetoothProfile.PRIORITY_OFF && + priority != BluetoothProfile.PRIORITY_ON) { + return false; + } + try { + return mService.setPriority(device, priority); + } catch (RemoteException e) { + Log.e(TAG, Log.getStackTraceString(new Throwable())); + return false; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return false; + } + + /** + * Get the priority of the profile. + * + *

The priority can be any of: + * {@link #PRIORITY_AUTO_CONNECT}, {@link #PRIORITY_OFF}, + * {@link #PRIORITY_ON}, {@link #PRIORITY_UNDEFINED} + * + * @param device Bluetooth device + * @return priority of the device + */ + public int getPriority(BluetoothDevice device) { + if (VDBG) log("getPriority(" + device + ")"); + if (mService != null && isEnabled() && + isValidDevice(device)) { + try { + return mService.getPriority(device); + } catch (RemoteException e) { + Log.e(TAG, Log.getStackTraceString(new Throwable())); + return PRIORITY_OFF; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return PRIORITY_OFF; + } + + private ServiceConnection mConnection = new ServiceConnection() { + public void onServiceConnected(ComponentName className, IBinder service) { + if (DBG) log("Proxy object connected"); + mService = IBluetoothSap.Stub.asInterface(service); + if (mServiceListener != null) { + mServiceListener.onServiceConnected(BluetoothProfile.SAP, BluetoothSap.this); + } + } + public void onServiceDisconnected(ComponentName className) { + if (DBG) log("Proxy object disconnected"); + mService = null; + if (mServiceListener != null) { + mServiceListener.onServiceDisconnected(BluetoothProfile.SAP); + } + } + }; + + private static void log(String msg) { + Log.d(TAG, msg); + } + + private boolean isEnabled() { + BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); + + if (adapter != null && adapter.getState() == BluetoothAdapter.STATE_ON) + return true; + log("Bluetooth is Not enabled"); + return false; + } + + private boolean isValidDevice(BluetoothDevice device) { + if (device == null) + return false; + + if (BluetoothAdapter.checkBluetoothAddress(device.getAddress())) + return true; + return false; + } + +} diff --git a/core/java/android/bluetooth/BluetoothUuid.java b/core/java/android/bluetooth/BluetoothUuid.java index 194a53e0f6cbf..2ded4c8fea32c 100644 --- a/core/java/android/bluetooth/BluetoothUuid.java +++ b/core/java/android/bluetooth/BluetoothUuid.java @@ -76,7 +76,9 @@ public final class BluetoothUuid { ParcelUuid.fromString("00001133-0000-1000-8000-00805F9B34FB"); public static final ParcelUuid MAS = ParcelUuid.fromString("00001132-0000-1000-8000-00805F9B34FB"); - + public static final ParcelUuid SAP = + ParcelUuid.fromString("0000112D-0000-1000-8000-00805F9B34FB"); + public static final ParcelUuid BASE_UUID = ParcelUuid.fromString("00000000-0000-1000-8000-00805F9B34FB"); @@ -89,7 +91,7 @@ public final class BluetoothUuid { public static final ParcelUuid[] RESERVED_UUIDS = { AudioSink, AudioSource, AdvAudioDist, HSP, Handsfree, AvrcpController, AvrcpTarget, - ObexObjectPush, PANU, NAP, MAP, MNS, MAS}; + ObexObjectPush, PANU, NAP, MAP, MNS, MAS, SAP}; public static boolean isAudioSource(ParcelUuid uuid) { return uuid.equals(AudioSource); @@ -143,6 +145,9 @@ public final class BluetoothUuid { public static boolean isMas(ParcelUuid uuid) { return uuid.equals(MAS); } + public static boolean isSap(ParcelUuid uuid) { + return uuid.equals(SAP); + } /** * Returns true if ParcelUuid is present in uuidArray diff --git a/core/java/android/bluetooth/IBluetooth.aidl b/core/java/android/bluetooth/IBluetooth.aidl index 90df19828f627..f6001bfffedd0 100644 --- a/core/java/android/bluetooth/IBluetooth.aidl +++ b/core/java/android/bluetooth/IBluetooth.aidl @@ -79,6 +79,8 @@ interface IBluetooth boolean setPhonebookAccessPermission(in BluetoothDevice device, int value); int getMessageAccessPermission(in BluetoothDevice device); boolean setMessageAccessPermission(in BluetoothDevice device, int value); + int getSimAccessPermission(in BluetoothDevice device); + boolean setSimAccessPermission(in BluetoothDevice device, int value); void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState); diff --git a/core/java/android/bluetooth/IBluetoothSap.aidl b/core/java/android/bluetooth/IBluetoothSap.aidl new file mode 100644 index 0000000000000..8970639467c02 --- /dev/null +++ b/core/java/android/bluetooth/IBluetoothSap.aidl @@ -0,0 +1,37 @@ +/* + * 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.bluetooth; + +import android.bluetooth.BluetoothDevice; + +/** + * System private API for Bluetooth SAP service + * + * {@hide} + */ +interface IBluetoothSap { + int getState(); + BluetoothDevice getClient(); + boolean connect(in BluetoothDevice device); + boolean disconnect(in BluetoothDevice device); + boolean isConnected(in BluetoothDevice device); + List getConnectedDevices(); + List getDevicesMatchingConnectionStates(in int[] states); + int getConnectionState(in BluetoothDevice device); + boolean setPriority(in BluetoothDevice device, int priority); + int getPriority(in BluetoothDevice device); +} diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index eeef2c22065e6..73ce9dcb10291 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -6309,6 +6309,9 @@ public final class Settings { /** {@hide} */ public static final String BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; + /** {@hide} */ + public static final String + BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; /** * Get the key that retrieves a bluetooth headset's priority. @@ -6341,6 +6344,15 @@ public final class Settings { public static final String getBluetoothMapPriorityKey(String address) { return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); } + + /** + * Get the key that retrieves a bluetooth map priority. + * @hide + */ + public static final String getBluetoothSapPriorityKey(String address) { + return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); + } + /** * Scaling factor for normal window animations. Setting to 0 will * disable window animations. diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index 082e8bbb3ff90..9280311a6b615 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -69,6 +69,16 @@ public interface RILConstants { int SS_MODIFIED_TO_USSD = 25; /* SS request modified to USSD */ int SUBSCRIPTION_NOT_SUPPORTED = 26; /* Subscription not supported */ int SS_MODIFIED_TO_SS = 27; /* SS request modified to different SS request */ + + int SIM_NOT_READY = 28; + + int SIM_ALREADY_POWERED_OFF = 29; /* SAP: 0x03, Error card aleready powered off */ + int SIM_ALREADY_POWERED_ON = 30; /* SAP: 0x05, Error card already powered on */ + int SIM_DATA_NOT_AVAILABLE = 31; /* SAP: 0x06, Error data not available */ + int SIM_SAP_CONNECT_FAILURE = 32; + int SIM_SAP_MSG_SIZE_TOO_LARGE = 33; + int SIM_SAP_MSG_SIZE_TOO_SMALL = 34; + int SIM_SAP_CONNECT_OK_CALL_ONGOING = 35; /* NETWORK_MODE_* See ril.h RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE */ From 193de667edf016965cf8c2a9c8e16433d0d0307b Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Tue, 14 Apr 2015 18:16:10 -0700 Subject: [PATCH 03/11] DO NOT MERGE Remove deprecated telecom APIs. Mark others final. Bug: Change-Id: I8a04903052a964f3997b5bb36730b8b200c8e472 --- api/system-current.txt | 12 +++--------- telecomm/java/android/telecom/AudioState.java | 11 +++-------- telecomm/java/android/telecom/Call.java | 2 +- telecomm/java/android/telecom/Conference.java | 14 ++------------ telecomm/java/android/telecom/Connection.java | 10 ---------- telecomm/java/android/telecom/InCallService.java | 2 +- .../java/android/telecom/RemoteConference.java | 5 ----- .../java/android/telecom/RemoteConnection.java | 6 ------ 8 files changed, 10 insertions(+), 52 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index d29f77779273f..0307d98504fb4 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -30107,9 +30107,6 @@ package android.telecom { 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 class AuthenticatorService extends android.app.Service { @@ -30169,7 +30166,7 @@ package android.telecom { method public int getCallProperties(); method public java.lang.String getCallerDisplayName(); method public int getCallerDisplayNamePresentation(); - method public long getConnectTimeMillis(); + method public final long getConnectTimeMillis(); method public android.telecom.DisconnectCause getDisconnectCause(); method public android.os.Bundle getExtras(); method public android.telecom.GatewayInfo getGatewayInfo(); @@ -30245,8 +30242,7 @@ package android.telecom { method public final void setConnectionCapabilities(int); method public final void setDisconnected(android.telecom.DisconnectCause); method public final void setOnHold(); - field public static long CONNECT_TIME_NOT_SPECIFIED; - field protected android.telecom.PhoneAccountHandle mPhoneAccount; + field public static final long CONNECT_TIME_NOT_SPECIFIED = 0L; // 0x0L } public abstract class Connection implements android.telecom.IConferenceable { @@ -30259,7 +30255,6 @@ package android.telecom { method public final int getAddressPresentation(); method public final boolean getAudioModeIsVoip(); method public final android.telecom.AudioState getAudioState(); - method public final deprecated int getCallCapabilities(); method public final java.lang.String getCallerDisplayName(); method public final int getCallerDisplayNamePresentation(); method public final android.telecom.Conference getConference(); @@ -30285,7 +30280,6 @@ package android.telecom { method public final void setActive(); method public final void setAddress(android.net.Uri, int); method public final void setAudioModeIsVoip(boolean); - method public final deprecated void setCallCapabilities(int); method public final void setCallerDisplayName(java.lang.String, int); method public final void setConferenceableConnections(java.util.List); method public final void setConferenceables(java.util.List); @@ -30388,7 +30382,7 @@ package android.telecom { public abstract class InCallService extends android.app.Service { ctor public InCallService(); - method public android.telecom.Phone getPhone(); + method public final android.telecom.Phone getPhone(); method public android.os.IBinder onBind(android.content.Intent); method public void onPhoneCreated(android.telecom.Phone); method public void onPhoneDestroyed(android.telecom.Phone); diff --git a/telecomm/java/android/telecom/AudioState.java b/telecomm/java/android/telecom/AudioState.java index 9c0331958cebc..0720df37f60f4 100644 --- a/telecomm/java/android/telecom/AudioState.java +++ b/telecomm/java/android/telecom/AudioState.java @@ -54,14 +54,9 @@ public final class AudioState implements Parcelable { public static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET | ROUTE_SPEAKER; - /** Note: Deprecated, please do not use if possible. */ - @SystemApi public final boolean isMuted; - - /** Note: Deprecated, please do not use if possible. */ - @SystemApi public final int route; - - /** Note: Deprecated, please do not use if possible. */ - @SystemApi public final int supportedRouteMask; + private final boolean isMuted; + private final int route; + private final int supportedRouteMask; public AudioState(boolean muted, int route, int supportedRouteMask) { this.isMuted = muted; diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index 5c891dc2575bc..5c2a2e0702500 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -417,7 +417,7 @@ public final class Call { * periodically, but user interfaces should not rely on this to display any "call time * clock". */ - public long getConnectTimeMillis() { + public final long getConnectTimeMillis() { return mConnectTimeMillis; } diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index ddaedcdbc366c..c37460be0ab25 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -38,7 +38,7 @@ public abstract class Conference implements IConferenceable { * Used to indicate that the conference connection time is not specified. If not specified, * Telecom will set the connect time. */ - public static long CONNECT_TIME_NOT_SPECIFIED = 0; + public static final long CONNECT_TIME_NOT_SPECIFIED = 0; /** @hide */ public abstract static class Listener { @@ -63,7 +63,7 @@ public abstract class Conference implements IConferenceable { private final List mUnmodifiableConferenceableConnections = Collections.unmodifiableList(mConferenceableConnections); - protected PhoneAccountHandle mPhoneAccount; + private PhoneAccountHandle mPhoneAccount; private AudioState mAudioState; private int mState = Connection.STATE_NEW; private DisconnectCause mDisconnectCause; @@ -116,11 +116,6 @@ public abstract class Conference implements IConferenceable { return mState; } - /** @hide */ - @Deprecated public final int getCapabilities() { - return getConnectionCapabilities(); - } - /** * Returns the capabilities of a conference. See {@code CAPABILITY_*} constants in class * {@link Connection} for valid values. @@ -301,11 +296,6 @@ public abstract class Conference implements IConferenceable { return mDisconnectCause; } - /** @hide */ - @Deprecated public final void setCapabilities(int connectionCapabilities) { - setConnectionCapabilities(connectionCapabilities); - } - /** * Sets the capabilities of a conference. See {@code CAPABILITY_*} constants of class * {@link Connection} for valid values. diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 26f5043367942..6f0c0f1b4ad5b 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -1004,11 +1004,6 @@ public abstract class Connection implements IConferenceable { return mConnectionCapabilities; } - /** @hide */ - @SystemApi @Deprecated public final int getCallCapabilities() { - return getConnectionCapabilities(); - } - /** * Sets the value of the {@link #getAddress()} property. * @@ -1215,11 +1210,6 @@ public abstract class Connection implements IConferenceable { } } - /** @hide */ - @SystemApi @Deprecated public final void setCallCapabilities(int connectionCapabilities) { - setConnectionCapabilities(connectionCapabilities); - } - /** * Sets the connection's capabilities as a bit mask of the {@code CAPABILITY_*} constants. * diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java index c0c59fa29c1bf..1f7547df88ffe 100644 --- a/telecomm/java/android/telecom/InCallService.java +++ b/telecomm/java/android/telecom/InCallService.java @@ -177,7 +177,7 @@ public abstract class InCallService extends Service { * if the {@code InCallService} is not in a state where it has an associated * {@code Phone}. */ - public Phone getPhone() { + public final Phone getPhone() { return mPhone; } diff --git a/telecomm/java/android/telecom/RemoteConference.java b/telecomm/java/android/telecom/RemoteConference.java index a8879ae8aff45..3c6416b939613 100644 --- a/telecomm/java/android/telecom/RemoteConference.java +++ b/telecomm/java/android/telecom/RemoteConference.java @@ -164,11 +164,6 @@ public final class RemoteConference { return mState; } - /** @hide */ - @Deprecated public final int getCallCapabilities() { - return getConnectionCapabilities(); - } - public final int getConnectionCapabilities() { return mConnectionCapabilities; } diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java index be7a0a04d7ac7..917fa77de66d3 100644 --- a/telecomm/java/android/telecom/RemoteConnection.java +++ b/telecomm/java/android/telecom/RemoteConnection.java @@ -73,11 +73,6 @@ public final class RemoteConnection { */ public void onRingbackRequested(RemoteConnection connection, boolean ringback) {} - /** @hide */ - @Deprecated public void onCallCapabilitiesChanged( - RemoteConnection connection, - int callCapabilities) {} - /** * Indicates that the call capabilities of this {@code RemoteConnection} have changed. * See {@link #getConnectionCapabilities()}. @@ -870,7 +865,6 @@ public final class RemoteConnection { mConnectionCapabilities = connectionCapabilities; for (Callback c : mCallbacks) { c.onConnectionCapabilitiesChanged(this, connectionCapabilities); - c.onCallCapabilitiesChanged(this, connectionCapabilities); } } From b67927126f793dabf0b61acf4aa0ac4c2470ddd6 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Wed, 15 Apr 2015 11:55:20 -0700 Subject: [PATCH 04/11] Fix make update-api Change-Id: Iaee002c64096fbd6ba05d6484cc50840146a4af0 --- core/java/android/bluetooth/BluetoothAdapter.java | 6 ------ core/java/android/bluetooth/BluetoothSap.java | 6 ------ 2 files changed, 12 deletions(-) diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index d7705a4026cc0..875aef6264fb2 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -124,9 +124,6 @@ public final class BluetoothAdapter { * {@link #STATE_TURNING_ON}, * {@link #STATE_ON}, * {@link #STATE_TURNING_OFF}, - * {@link #STATE_BLE_TURNING_ON}, - * {@link #STATE_BLE_ON}, - * {@link #STATE_BLE_TURNING_OFF}, */ public static final String EXTRA_STATE = "android.bluetooth.adapter.extra.STATE"; @@ -137,9 +134,6 @@ public final class BluetoothAdapter { * {@link #STATE_TURNING_ON}, * {@link #STATE_ON}, * {@link #STATE_TURNING_OFF}, - * {@link #STATE_BLE_TURNING_ON}, - * {@link #STATE_BLE_ON}, - * {@link #STATE_BLE_TURNING_OFF}, */ public static final String EXTRA_PREVIOUS_STATE = "android.bluetooth.adapter.extra.PREVIOUS_STATE"; diff --git a/core/java/android/bluetooth/BluetoothSap.java b/core/java/android/bluetooth/BluetoothSap.java index 60528849a0109..7b4c6f923ffc1 100644 --- a/core/java/android/bluetooth/BluetoothSap.java +++ b/core/java/android/bluetooth/BluetoothSap.java @@ -296,8 +296,6 @@ public final class BluetoothSap implements BluetoothProfile { * Set priority of the profile * *

The device should already be paired. - * Priority can be one of {@link #PRIORITY_ON} or - * {@link #PRIORITY_OFF}, * * @param device Paired bluetooth device * @param priority @@ -325,10 +323,6 @@ public final class BluetoothSap implements BluetoothProfile { /** * Get the priority of the profile. * - *

The priority can be any of: - * {@link #PRIORITY_AUTO_CONNECT}, {@link #PRIORITY_OFF}, - * {@link #PRIORITY_ON}, {@link #PRIORITY_UNDEFINED} - * * @param device Bluetooth device * @return priority of the device */ From 62ad27e8649af674de1594eaf99e176c3e6d0c73 Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Sat, 11 Apr 2015 19:51:36 -0700 Subject: [PATCH 05/11] DO NOT MERGE Hide Voicemails.{insert, deleteAll, setStatus} Bug:20162722 Change-Id: Idbd9a643c4870b48ee1230e344717f50507936d8 --- api/current.txt | 4 ---- api/system-current.txt | 4 ---- core/java/android/provider/VoicemailContract.java | 8 ++++++++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/current.txt b/api/current.txt index 175225c4cc04d..3b6ad8fadbcb5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -25963,7 +25963,6 @@ package android.provider { public static final class VoicemailContract.Status implements android.provider.BaseColumns { method public static android.net.Uri buildSourceUri(java.lang.String); - method public static void setStatus(android.content.Context, android.telecom.PhoneAccountHandle, int, int, int); field public static final java.lang.String CONFIGURATION_STATE = "configuration_state"; field public static final int CONFIGURATION_STATE_CAN_BE_CONFIGURED = 2; // 0x2 field public static final int CONFIGURATION_STATE_NOT_CONFIGURED = 1; // 0x1 @@ -25987,9 +25986,6 @@ package android.provider { public static final class VoicemailContract.Voicemails implements android.provider.BaseColumns android.provider.OpenableColumns { method public static android.net.Uri buildSourceUri(java.lang.String); - method public static int deleteAll(android.content.Context); - method public static android.net.Uri insert(android.content.Context, android.telecom.Voicemail); - method public static int insert(android.content.Context, java.util.List); field public static final android.net.Uri CONTENT_URI; field public static final java.lang.String DATE = "date"; field public static final java.lang.String DELETED = "deleted"; diff --git a/api/system-current.txt b/api/system-current.txt index 0307d98504fb4..fabc287f4d402 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -27660,7 +27660,6 @@ package android.provider { public static final class VoicemailContract.Status implements android.provider.BaseColumns { method public static android.net.Uri buildSourceUri(java.lang.String); - method public static void setStatus(android.content.Context, android.telecom.PhoneAccountHandle, int, int, int); field public static final java.lang.String CONFIGURATION_STATE = "configuration_state"; field public static final int CONFIGURATION_STATE_CAN_BE_CONFIGURED = 2; // 0x2 field public static final int CONFIGURATION_STATE_NOT_CONFIGURED = 1; // 0x1 @@ -27684,9 +27683,6 @@ package android.provider { public static final class VoicemailContract.Voicemails implements android.provider.BaseColumns android.provider.OpenableColumns { method public static android.net.Uri buildSourceUri(java.lang.String); - method public static int deleteAll(android.content.Context); - method public static android.net.Uri insert(android.content.Context, android.telecom.Voicemail); - method public static int insert(android.content.Context, java.util.List); field public static final android.net.Uri CONTENT_URI; field public static final java.lang.String DATE = "date"; field public static final java.lang.String DELETED = "deleted"; diff --git a/core/java/android/provider/VoicemailContract.java b/core/java/android/provider/VoicemailContract.java index 0da4fd5ec276a..92119b9e39a2f 100644 --- a/core/java/android/provider/VoicemailContract.java +++ b/core/java/android/provider/VoicemailContract.java @@ -254,6 +254,8 @@ public class VoicemailContract { * @param context The context of the app doing the inserting * @param voicemail Data to be inserted * @return {@link Uri} of the newly inserted {@link Voicemail} + * + * @hide */ public static Uri insert(Context context, Voicemail voicemail) { ContentResolver contentResolver = context.getContentResolver(); @@ -267,6 +269,8 @@ public class VoicemailContract { * @param context The context of the app doing the inserting * @param voicemails Data to be inserted * @return the number of voicemails inserted + * + * @hide */ public static int insert(Context context, List voicemails) { ContentResolver contentResolver = context.getContentResolver(); @@ -283,6 +287,8 @@ public class VoicemailContract { * package. By default, a package only has permission to delete voicemails it inserted. * * @return the number of voicemails deleted + * + * @hide */ public static int deleteAll(Context context) { return context.getContentResolver().delete( @@ -439,6 +445,8 @@ public class VoicemailContract { * @param configurationState See {@link Status#CONFIGURATION_STATE} * @param dataChannelState See {@link Status#DATA_CHANNEL_STATE} * @param notificationChannelState See {@link Status#NOTIFICATION_CHANNEL_STATE} + * + * @hide */ public static void setStatus(Context context, PhoneAccountHandle accountHandle, int configurationState, int dataChannelState, int notificationChannelState) { From e268f4c28ece283c8c9707b21c0ef7f940b907a8 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 15 Apr 2015 12:23:42 -0700 Subject: [PATCH 06/11] DO NOT MERGE Suffix VT_LOCAL/REMOTE with BIDIRECTIONAL. Bug: 20160395 Change-Id: Ib343fde5088f3a5823c73de6ab77564b4be0d12c --- telecomm/java/android/telecom/Call.java | 14 +++++++------- telecomm/java/android/telecom/Connection.java | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index 5c2a2e0702500..62af28667f290 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -156,7 +156,7 @@ public final class Call { * Local device supports bidirectional video calling. * @hide */ - public static final int CAPABILITY_SUPPORTS_VT_LOCAL = + public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_LOCAL_RX | CAPABILITY_SUPPORTS_VT_LOCAL_TX; /** @@ -175,7 +175,7 @@ public final class Call { * Remote device supports bidirectional video calling. * @hide */ - public static final int CAPABILITY_SUPPORTS_VT_REMOTE = + public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_REMOTE_RX | CAPABILITY_SUPPORTS_VT_REMOTE_TX; /** @@ -187,7 +187,7 @@ public final class Call { * Call is able to be individually disconnected when in a {@code Conference}. */ public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 0x00002000; - + /** * Whether the call is a generic conference, where we do not know the precise state of * participants in the conference (eg. on CDMA). @@ -312,8 +312,8 @@ public final class Call { if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_TX"); } - if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL)) { - builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL"); + if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)) { + builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL"); } if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_RX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_RX"); @@ -321,8 +321,8 @@ public final class Call { if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_TX"); } - if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE)) { - builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE"); + if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL)) { + builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL"); } if (can(capabilities, CAPABILITY_HIGH_DEF_AUDIO)) { builder.append(" CAPABILITY_HIGH_DEF_AUDIO"); diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 6f0c0f1b4ad5b..0da8f868a1f5c 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -121,7 +121,7 @@ public abstract class Connection implements IConferenceable { * Local device supports bidirectional video calling. * @hide */ - public static final int CAPABILITY_SUPPORTS_VT_LOCAL = + public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_LOCAL_RX | CAPABILITY_SUPPORTS_VT_LOCAL_TX; /** @@ -140,7 +140,7 @@ public abstract class Connection implements IConferenceable { * Remote device supports bidirectional video calling. * @hide */ - public static final int CAPABILITY_SUPPORTS_VT_REMOTE = + public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_REMOTE_RX | CAPABILITY_SUPPORTS_VT_REMOTE_TX; /** @@ -322,8 +322,8 @@ public abstract class Connection implements IConferenceable { if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_TX"); } - if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL)) { - builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL"); + if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)) { + builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL"); } if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_RX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_RX"); @@ -331,8 +331,8 @@ public abstract class Connection implements IConferenceable { if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_TX"); } - if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE)) { - builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE"); + if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL)) { + builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL"); } if (can(capabilities, CAPABILITY_HIGH_DEF_AUDIO)) { builder.append(" CAPABILITY_HIGH_DEF_AUDIO"); From 870edddcbe2f39cf24e7528ee2494652d2f82ad6 Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Tue, 14 Apr 2015 23:31:13 -0700 Subject: [PATCH 07/11] DO NOT MERGE Hide Voicemail APIs Bug:20162722 Change-Id: Ie405b077a9598f16ff19adfa09df3217f342cc1e --- api/current.txt | 45 ------------------- api/system-current.txt | 45 ------------------- .../android/telecom/AuthenticatorService.java | 2 + telecomm/java/android/telecom/Voicemail.java | 4 +- 4 files changed, 5 insertions(+), 91 deletions(-) diff --git a/api/current.txt b/api/current.txt index 3b6ad8fadbcb5..e493620ec28aa 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28273,22 +28273,6 @@ package android.system { package android.telecom { - public class AuthenticatorService extends android.app.Service { - ctor public AuthenticatorService(); - method public android.os.IBinder onBind(android.content.Intent); - } - - public class AuthenticatorService.Authenticator extends android.accounts.AbstractAccountAuthenticator { - ctor public AuthenticatorService.Authenticator(android.content.Context); - method public android.os.Bundle addAccount(android.accounts.AccountAuthenticatorResponse, java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle) throws android.accounts.NetworkErrorException; - method public android.os.Bundle confirmCredentials(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, android.os.Bundle) throws android.accounts.NetworkErrorException; - method public android.os.Bundle editProperties(android.accounts.AccountAuthenticatorResponse, java.lang.String); - method public android.os.Bundle getAuthToken(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String, android.os.Bundle) throws android.accounts.NetworkErrorException; - method public java.lang.String getAuthTokenLabel(java.lang.String); - method public android.os.Bundle hasFeatures(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String[]) throws android.accounts.NetworkErrorException; - method public android.os.Bundle updateCredentials(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String, android.os.Bundle) throws android.accounts.NetworkErrorException; - } - public class PhoneAccount implements android.os.Parcelable { method public static android.telecom.PhoneAccount.Builder builder(android.telecom.PhoneAccountHandle, java.lang.CharSequence); method public android.graphics.drawable.Drawable createIconDrawable(android.content.Context); @@ -28397,35 +28381,6 @@ package android.telecom { field public static final int TX_ENABLED = 1; // 0x1 } - public class Voicemail implements android.os.Parcelable { - method public static android.telecom.Voicemail.Builder createForInsertion(long, java.lang.String); - method public int describeContents(); - method public long getDuration(); - method public long getId(); - method public java.lang.String getNumber(); - method public java.lang.String getSourceData(); - method public java.lang.String getSourcePackage(); - method public long getTimestampMillis(); - method public android.net.Uri getUri(); - method public boolean hasContent(); - method public boolean isRead(); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - - public static class Voicemail.Builder { - method public android.telecom.Voicemail build(); - method public android.telecom.Voicemail.Builder setDuration(long); - method public android.telecom.Voicemail.Builder setHasContent(boolean); - method public android.telecom.Voicemail.Builder setId(long); - method public android.telecom.Voicemail.Builder setIsRead(boolean); - method public android.telecom.Voicemail.Builder setNumber(java.lang.String); - method public android.telecom.Voicemail.Builder setSourceData(java.lang.String); - method public android.telecom.Voicemail.Builder setSourcePackage(java.lang.String); - method public android.telecom.Voicemail.Builder setTimestamp(long); - method public android.telecom.Voicemail.Builder setUri(android.net.Uri); - } - } package android.telephony { diff --git a/api/system-current.txt b/api/system-current.txt index fabc287f4d402..6a37142ff0678 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -30105,22 +30105,6 @@ package android.telecom { field public static final int ROUTE_WIRED_OR_EARPIECE = 5; // 0x5 } - public class AuthenticatorService extends android.app.Service { - ctor public AuthenticatorService(); - method public android.os.IBinder onBind(android.content.Intent); - } - - public class AuthenticatorService.Authenticator extends android.accounts.AbstractAccountAuthenticator { - ctor public AuthenticatorService.Authenticator(android.content.Context); - method public android.os.Bundle addAccount(android.accounts.AccountAuthenticatorResponse, java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle) throws android.accounts.NetworkErrorException; - method public android.os.Bundle confirmCredentials(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, android.os.Bundle) throws android.accounts.NetworkErrorException; - method public android.os.Bundle editProperties(android.accounts.AccountAuthenticatorResponse, java.lang.String); - method public android.os.Bundle getAuthToken(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String, android.os.Bundle) throws android.accounts.NetworkErrorException; - method public java.lang.String getAuthTokenLabel(java.lang.String); - method public android.os.Bundle hasFeatures(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String[]) throws android.accounts.NetworkErrorException; - method public android.os.Bundle updateCredentials(android.accounts.AccountAuthenticatorResponse, android.accounts.Account, java.lang.String, android.os.Bundle) throws android.accounts.NetworkErrorException; - } - public final class Call { method public void addListener(android.telecom.Call.Listener); method public void answer(int); @@ -30638,35 +30622,6 @@ package android.telecom { field public static final int TX_ENABLED = 1; // 0x1 } - public class Voicemail implements android.os.Parcelable { - method public static android.telecom.Voicemail.Builder createForInsertion(long, java.lang.String); - method public int describeContents(); - method public long getDuration(); - method public long getId(); - method public java.lang.String getNumber(); - method public java.lang.String getSourceData(); - method public java.lang.String getSourcePackage(); - method public long getTimestampMillis(); - method public android.net.Uri getUri(); - method public boolean hasContent(); - method public boolean isRead(); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - - public static class Voicemail.Builder { - method public android.telecom.Voicemail build(); - method public android.telecom.Voicemail.Builder setDuration(long); - method public android.telecom.Voicemail.Builder setHasContent(boolean); - method public android.telecom.Voicemail.Builder setId(long); - method public android.telecom.Voicemail.Builder setIsRead(boolean); - method public android.telecom.Voicemail.Builder setNumber(java.lang.String); - method public android.telecom.Voicemail.Builder setSourceData(java.lang.String); - method public android.telecom.Voicemail.Builder setSourcePackage(java.lang.String); - method public android.telecom.Voicemail.Builder setTimestamp(long); - method public android.telecom.Voicemail.Builder setUri(android.net.Uri); - } - } package android.telephony { diff --git a/telecomm/java/android/telecom/AuthenticatorService.java b/telecomm/java/android/telecom/AuthenticatorService.java index 39717c3e0fc2b..1e43c71575802 100644 --- a/telecomm/java/android/telecom/AuthenticatorService.java +++ b/telecomm/java/android/telecom/AuthenticatorService.java @@ -28,6 +28,8 @@ import android.os.IBinder; /** * A generic stub account authenticator service often used for sync adapters that do not directly * involve accounts. + * + * @hide */ public class AuthenticatorService extends Service { private static Authenticator mAuthenticator; diff --git a/telecomm/java/android/telecom/Voicemail.java b/telecomm/java/android/telecom/Voicemail.java index 864c6b1765e5a..dbec2ad30888e 100644 --- a/telecomm/java/android/telecom/Voicemail.java +++ b/telecomm/java/android/telecom/Voicemail.java @@ -22,6 +22,8 @@ import android.os.Parcelable; /** * Represents a single voicemail stored in the voicemail content provider. + * + * @hide */ public class Voicemail implements Parcelable { private final Long mTimestamp; @@ -263,4 +265,4 @@ public class Voicemail implements Parcelable { mIsRead = in.readInt() > 0 ? true : false; mHasContent = in.readInt() > 0 ? true : false; } -} \ No newline at end of file +} From 383932ad8ee756d01f0a12aeca7adaf4b3e542fa Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Wed, 15 Apr 2015 12:07:34 -0700 Subject: [PATCH 08/11] DO NOT MERGE Make defaultOutgoingPhoneAccount public Bug: 20224972 Change-Id: Ided1aab01d5014bd608d0d139975f933f64341c5 --- api/current.txt | 1 + telecomm/java/android/telecom/TelecomManager.java | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/api/current.txt b/api/current.txt index e493620ec28aa..142d2a62ac01e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28331,6 +28331,7 @@ package android.telecom { public class TelecomManager { method public void cancelMissedCallsNotification(); + method public android.telecom.PhoneAccountHandle getDefaultOutgoingPhoneAccount(java.lang.String); method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle); method public boolean handleMmi(java.lang.String); method public boolean handleMmi(java.lang.String, android.telecom.PhoneAccountHandle); diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 7989bc87be547..cc03b5cfb977e 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -352,9 +352,7 @@ public class TelecomManager { * @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()) { From 1cf9b6bec12c027a0d551540a6e01f3ac2d0a9d4 Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Thu, 9 Apr 2015 15:15:43 -0700 Subject: [PATCH 09/11] DO NOT MERGE Make Telecom/InCallUI APIs public Bug:20260870 Change-Id: Ie3a2db0685664f2f1ceea8f40b1249d01e9385b8 --- api/current.txt | 499 ++++++++++++++++++ api/system-current.txt | 102 +++- core/java/android/provider/Settings.java | 4 - telecomm/java/android/telecom/AudioState.java | 11 +- telecomm/java/android/telecom/Call.java | 22 - .../java/android/telecom/CallProperties.java | 1 - telecomm/java/android/telecom/CallState.java | 5 - .../android/telecom/CameraCapabilities.java | 6 +- telecomm/java/android/telecom/Conference.java | 5 +- telecomm/java/android/telecom/Connection.java | 6 +- .../android/telecom/ConnectionRequest.java | 3 - .../android/telecom/ConnectionService.java | 3 - .../java/android/telecom/DisconnectCause.java | 3 - .../java/android/telecom/GatewayInfo.java | 5 - .../java/android/telecom/IConferenceable.java | 5 - .../java/android/telecom/InCallService.java | 6 - telecomm/java/android/telecom/Phone.java | 4 - .../java/android/telecom/PhoneAccount.java | 15 - .../android/telecom/PhoneAccountHandle.java | 5 - .../android/telecom/RemoteConference.java | 3 - .../android/telecom/RemoteConnection.java | 3 - .../java/android/telecom/StatusHints.java | 3 - .../java/android/telecom/TelecomManager.java | 34 -- .../android/telephony/TelephonyManager.java | 2 - 24 files changed, 605 insertions(+), 150 deletions(-) diff --git a/api/current.txt b/api/current.txt index 142d2a62ac01e..a5febe93a9ba3 100644 --- a/api/current.txt +++ b/api/current.txt @@ -25370,6 +25370,7 @@ package android.provider { field public static final java.lang.String DEBUG_APP = "debug_app"; field public static final java.lang.String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; field public static final java.lang.String DEVICE_PROVISIONED = "device_provisioned"; + field public static final java.lang.String HIDE_CARRIER_NETWORK_SETTINGS = "hide_carrier_network_settings"; field public static final java.lang.String HTTP_PROXY = "http_proxy"; field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; field public static final java.lang.String MODE_RINGER = "mode_ringer"; @@ -25536,6 +25537,7 @@ package android.provider { field public static final android.net.Uri DEFAULT_RINGTONE_URI; field public static final deprecated java.lang.String DEVICE_PROVISIONED = "device_provisioned"; field public static final deprecated java.lang.String DIM_SCREEN = "dim_screen"; + field public static final java.lang.String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; field public static final java.lang.String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; field public static final java.lang.String END_BUTTON_BEHAVIOR = "end_button_behavior"; field public static final java.lang.String FONT_SCALE = "font_scale"; @@ -25584,6 +25586,7 @@ package android.provider { field public static final java.lang.String USER_ROTATION = "user_rotation"; field public static final deprecated java.lang.String USE_GOOGLE_MAIL = "use_google_mail"; field public static final java.lang.String VIBRATE_ON = "vibrate_on"; + field public static final java.lang.String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; field public static final java.lang.String VOLUME_ALARM = "volume_alarm"; field public static final java.lang.String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; field public static final java.lang.String VOLUME_MUSIC = "volume_music"; @@ -28273,6 +28276,393 @@ package android.system { 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 static java.lang.String audioRouteToString(int); + method public int describeContents(); + method public int getRoute(); + method public int getSupportedRouteMask(); + method public boolean isMuted(); + method public void writeToParcel(android.os.Parcel, int); + field public static final android.os.Parcelable.Creator 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 + } + + public final class Call { + method public void addListener(android.telecom.Call.Listener); + method public void answer(int); + method public void conference(android.telecom.Call); + method public void disconnect(); + method public java.util.List getCannedTextResponses(); + method public java.util.List getChildren(); + method public java.util.List getConferenceableCalls(); + method public android.telecom.Call.Details getDetails(); + method public android.telecom.Call getParent(); + method public java.lang.String getRemainingPostDialSequence(); + method public int getState(); + method public android.telecom.InCallService.VideoCall getVideoCall(); + method public void hold(); + method public void mergeConference(); + method public void phoneAccountSelected(android.telecom.PhoneAccountHandle, boolean); + method public void playDtmfTone(char); + method public void postDialContinue(boolean); + method public void reject(boolean, java.lang.String); + method public void removeListener(android.telecom.Call.Listener); + method public void splitFromConference(); + method public void stopDtmfTone(); + method public void swapConference(); + method public void unhold(); + field public static final java.lang.String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts"; + field public static final int STATE_ACTIVE = 4; // 0x4 + field public static final int STATE_CONNECTING = 9; // 0x9 + field public static final int STATE_DIALING = 1; // 0x1 + field public static final int STATE_DISCONNECTED = 7; // 0x7 + field public static final int STATE_DISCONNECTING = 10; // 0xa + field public static final int STATE_HOLDING = 3; // 0x3 + field public static final int STATE_NEW = 0; // 0x0 + field public static final int STATE_PRE_DIAL_WAIT = 8; // 0x8 + field public static final int STATE_RINGING = 2; // 0x2 + } + + public static class Call.Details { + method public static boolean can(int, int); + method public boolean can(int); + method public static java.lang.String capabilitiesToString(int); + method public android.telecom.PhoneAccountHandle getAccountHandle(); + method public int getCallCapabilities(); + method public int getCallProperties(); + method public java.lang.String getCallerDisplayName(); + method public int getCallerDisplayNamePresentation(); + method public final long getConnectTimeMillis(); + method public android.telecom.DisconnectCause getDisconnectCause(); + method public android.os.Bundle getExtras(); + method public android.telecom.GatewayInfo getGatewayInfo(); + method public android.net.Uri getHandle(); + method public int getHandlePresentation(); + method public android.telecom.StatusHints getStatusHints(); + method public int getVideoState(); + field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000 + field public static final int CAPABILITY_GENERIC_CONFERENCE = 16384; // 0x4000 + field public static final int CAPABILITY_HIGH_DEF_AUDIO = 32768; // 0x8000 + field public static final int CAPABILITY_HOLD = 1; // 0x1 + field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80 + field public static final int CAPABILITY_MERGE_CONFERENCE = 4; // 0x4 + field public static final int CAPABILITY_MUTE = 64; // 0x40 + field public static final int CAPABILITY_RESPOND_VIA_TEXT = 32; // 0x20 + field public static final int CAPABILITY_SEPARATE_FROM_CONFERENCE = 4096; // 0x1000 + field public static final int CAPABILITY_SHOW_CALLBACK_NUMBER = 131072; // 0x20000 + field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = 768; // 0x300 + field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 256; // 0x100 + field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 512; // 0x200 + field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = 3072; // 0xc00 + field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 1024; // 0x400 + field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 2048; // 0x800 + field public static final int CAPABILITY_SUPPORT_HOLD = 2; // 0x2 + field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8 + field public static final int CAPABILITY_WIFI = 65536; // 0x10000 + } + + public static abstract class Call.Listener { + ctor public Call.Listener(); + method public void onCallDestroyed(android.telecom.Call); + method public void onCannedTextResponsesLoaded(android.telecom.Call, java.util.List); + method public void onChildrenChanged(android.telecom.Call, java.util.List); + method public void onConferenceableCallsChanged(android.telecom.Call, java.util.List); + method public void onDetailsChanged(android.telecom.Call, android.telecom.Call.Details); + method public void onParentChanged(android.telecom.Call, android.telecom.Call); + method public void onPostDialWait(android.telecom.Call, java.lang.String); + method public void onStateChanged(android.telecom.Call, int); + method public void onVideoCallChanged(android.telecom.Call, android.telecom.InCallService.VideoCall); + } + + public class CallProperties { + ctor public CallProperties(); + field public static final int CONFERENCE = 1; // 0x1 + } + + public final class CallState { + method public static java.lang.String toString(int); + field public static final int ABORTED = 8; // 0x8 + field public static final int ACTIVE = 5; // 0x5 + field public static final int CONNECTING = 1; // 0x1 + field public static final int DIALING = 3; // 0x3 + field public static final int DISCONNECTED = 7; // 0x7 + field public static final int DISCONNECTING = 9; // 0x9 + field public static final int NEW = 0; // 0x0 + field public static final int ON_HOLD = 6; // 0x6 + field public static final int PRE_DIAL_WAIT = 2; // 0x2 + field public static final int RINGING = 4; // 0x4 + } + + public final class CameraCapabilities implements android.os.Parcelable { + ctor public CameraCapabilities(int, int); + method public int describeContents(); + method public int getHeight(); + method public int getWidth(); + method public void writeToParcel(android.os.Parcel, int); + field public static final android.os.Parcelable.Creator CREATOR; + } + + public abstract class Conference implements android.telecom.IConferenceable { + 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 java.util.List getConferenceableConnections(); + method public final long getConnectTimeMillis(); + method public final int getConnectionCapabilities(); + method public final java.util.List 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 setConferenceableConnections(java.util.List); + method public void setConnectTimeMillis(long); + method public final void setConnectionCapabilities(int); + method public final void setDisconnected(android.telecom.DisconnectCause); + method public final void setOnHold(); + field public static final long CONNECT_TIME_NOT_SPECIFIED = 0L; // 0x0L + } + + public abstract class Connection implements android.telecom.IConferenceable { + ctor public Connection(); + method public static java.lang.String capabilitiesToString(int); + 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 java.lang.String getCallerDisplayName(); + method public final int getCallerDisplayNamePresentation(); + method public final android.telecom.Conference getConference(); + method public final java.util.List getConferenceables(); + method public final int getConnectionCapabilities(); + method public final android.telecom.DisconnectCause getDisconnectCause(); + method public final int getState(); + method public final android.telecom.StatusHints getStatusHints(); + method public final android.telecom.Connection.VideoProvider getVideoProvider(); + 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 setCallerDisplayName(java.lang.String, int); + method public final void setConferenceableConnections(java.util.List); + method public final void setConferenceables(java.util.List); + method public final void setConnectionCapabilities(int); + 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 CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000 + field public static final int CAPABILITY_HOLD = 1; // 0x1 + field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80 + field public static final int CAPABILITY_MERGE_CONFERENCE = 4; // 0x4 + field public static final int CAPABILITY_MUTE = 64; // 0x40 + field public static final int CAPABILITY_RESPOND_VIA_TEXT = 32; // 0x20 + field public static final int CAPABILITY_SEPARATE_FROM_CONFERENCE = 4096; // 0x1000 + field public static final int CAPABILITY_SUPPORT_HOLD = 2; // 0x2 + field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8 + 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 static abstract class Connection.VideoProvider { + ctor public Connection.VideoProvider(); + method public void changeCallDataUsage(long); + method public void changeCameraCapabilities(android.telecom.CameraCapabilities); + method public void changePeerDimensions(int, int); + method public void changeVideoQuality(int); + method public void handleCallSessionEvent(int); + method public abstract void onRequestCameraCapabilities(); + method public abstract void onRequestConnectionDataUsage(); + method public abstract void onSendSessionModifyRequest(android.telecom.VideoProfile); + method public abstract void onSendSessionModifyResponse(android.telecom.VideoProfile); + method public abstract void onSetCamera(java.lang.String); + method public abstract void onSetDeviceOrientation(int); + method public abstract void onSetDisplaySurface(android.view.Surface); + method public abstract void onSetPauseImage(java.lang.String); + method public abstract void onSetPreviewSurface(android.view.Surface); + method public abstract void onSetZoom(float); + method public void receiveSessionModifyRequest(android.telecom.VideoProfile); + method public void receiveSessionModifyResponse(int, android.telecom.VideoProfile, android.telecom.VideoProfile); + field public static final int SESSION_EVENT_CAMERA_FAILURE = 5; // 0x5 + field public static final int SESSION_EVENT_CAMERA_READY = 6; // 0x6 + field public static final int SESSION_EVENT_RX_PAUSE = 1; // 0x1 + field public static final int SESSION_EVENT_RX_RESUME = 2; // 0x2 + field public static final int SESSION_EVENT_TX_START = 3; // 0x3 + field public static final int SESSION_EVENT_TX_STOP = 4; // 0x4 + field public static final int SESSION_MODIFY_REQUEST_FAIL = 2; // 0x2 + field public static final int SESSION_MODIFY_REQUEST_INVALID = 3; // 0x3 + field public static final int SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE = 5; // 0x5 + field public static final int SESSION_MODIFY_REQUEST_SUCCESS = 1; // 0x1 + field public static final int SESSION_MODIFY_REQUEST_TIMED_OUT = 4; // 0x4 + } + + 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 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 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 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 { + ctor public GatewayInfo(java.lang.String, android.net.Uri, android.net.Uri); + 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 CREATOR; + } + + public abstract interface IConferenceable { + } + + public abstract class InCallService extends android.app.Service { + ctor public InCallService(); + method public final android.telecom.Phone getPhone(); + method public android.os.IBinder onBind(android.content.Intent); + method public void onPhoneCreated(android.telecom.Phone); + method public void onPhoneDestroyed(android.telecom.Phone); + field public static final java.lang.String SERVICE_INTERFACE = "android.telecom.InCallService"; + } + + public static abstract class InCallService.VideoCall { + ctor public InCallService.VideoCall(); + method public abstract void requestCallDataUsage(); + method public abstract void requestCameraCapabilities(); + method public abstract void sendSessionModifyRequest(android.telecom.VideoProfile); + method public abstract void sendSessionModifyResponse(android.telecom.VideoProfile); + method public abstract void setCamera(java.lang.String); + method public abstract void setDeviceOrientation(int); + method public abstract void setDisplaySurface(android.view.Surface); + method public abstract void setPauseImage(java.lang.String); + method public abstract void setPreviewSurface(android.view.Surface); + method public abstract void setVideoCallListener(android.telecom.InCallService.VideoCall.Listener); + method public abstract void setZoom(float); + } + + public static abstract class InCallService.VideoCall.Listener { + ctor public InCallService.VideoCall.Listener(); + method public abstract void onCallDataUsageChanged(long); + method public abstract void onCallSessionEvent(int); + method public abstract void onCameraCapabilitiesChanged(android.telecom.CameraCapabilities); + method public abstract void onPeerDimensionsChanged(int, int); + method public abstract void onSessionModifyRequestReceived(android.telecom.VideoProfile); + method public abstract void onSessionModifyResponseReceived(int, android.telecom.VideoProfile, android.telecom.VideoProfile); + method public abstract void onVideoQualityChanged(int); + } + + public final class Phone { + method public final void addListener(android.telecom.Phone.Listener); + method public final boolean canAddCall(); + method public final android.telecom.AudioState getAudioState(); + method public final java.util.List getCalls(); + method public final void removeListener(android.telecom.Phone.Listener); + method public final void setAudioRoute(int); + method public final void setMuted(boolean); + } + + public static abstract class Phone.Listener { + ctor public Phone.Listener(); + method public void onAudioStateChanged(android.telecom.Phone, android.telecom.AudioState); + method public void onBringToForeground(android.telecom.Phone, boolean); + method public void onCallAdded(android.telecom.Phone, android.telecom.Call); + method public void onCallRemoved(android.telecom.Phone, android.telecom.Call); + method public void onCanAddCallChanged(android.telecom.Phone, boolean); + } + public class PhoneAccount implements android.os.Parcelable { method public static android.telecom.PhoneAccount.Builder builder(android.telecom.PhoneAccountHandle, java.lang.CharSequence); method public android.graphics.drawable.Drawable createIconDrawable(android.content.Context); @@ -28291,7 +28681,10 @@ package android.telecom { method public java.util.List getSupportedUriSchemes(); method public boolean hasCapabilities(int); method public boolean supportsUriScheme(java.lang.String); + method public android.telecom.PhoneAccount.Builder toBuilder(); method public void writeToParcel(android.os.Parcel, int); + field public static final int CAPABILITY_CALL_PROVIDER = 2; // 0x2 + 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 CREATOR; @@ -28306,6 +28699,7 @@ package android.telecom { 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.Builder addSupportedUriScheme(java.lang.String); method public android.telecom.PhoneAccount build(); method public android.telecom.PhoneAccount.Builder setAddress(android.net.Uri); method public android.telecom.PhoneAccount.Builder setCapabilities(int); @@ -28322,26 +28716,129 @@ package android.telecom { public class PhoneAccountHandle implements android.os.Parcelable { ctor public PhoneAccountHandle(android.content.ComponentName, java.lang.String); + ctor public PhoneAccountHandle(android.content.ComponentName, java.lang.String, android.os.UserHandle); method public int describeContents(); method public android.content.ComponentName getComponentName(); method public java.lang.String getId(); + method public android.os.UserHandle getUserHandle(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } + public final class RemoteConference { + method public void disconnect(); + method public java.util.List getConferenceableConnections(); + method public final int getConnectionCapabilities(); + method public final java.util.List 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 onConferenceableConnectionsChanged(android.telecom.RemoteConference, java.util.List); + method public void onConnectionAdded(android.telecom.RemoteConference, android.telecom.RemoteConnection); + method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConference, int); + 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 java.lang.CharSequence getCallerDisplayName(); + method public int getCallerDisplayNamePresentation(); + method public android.telecom.RemoteConference getConference(); + method public java.util.List getConferenceableConnections(); + method public int getConnectionCapabilities(); + 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 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); + method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConnection, int); + method public void onDestroyed(android.telecom.RemoteConnection); + method public void onDisconnected(android.telecom.RemoteConnection, android.telecom.DisconnectCause); + method public void onPostDialChar(android.telecom.RemoteConnection, char); + 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 CREATOR; + } + public class TelecomManager { + method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle); method public void cancelMissedCallsNotification(); + method public android.net.Uri getAdnUriForPhoneAccount(android.telecom.PhoneAccountHandle); + method public java.util.List getCallCapablePhoneAccounts(); method public android.telecom.PhoneAccountHandle getDefaultOutgoingPhoneAccount(java.lang.String); + method public java.lang.String getLine1Number(android.telecom.PhoneAccountHandle); method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle); + method public android.telecom.PhoneAccountHandle getSimCallManager(); + method public android.telecom.PhoneAccountHandle getUserSelectedOutgoingPhoneAccount(); method public boolean handleMmi(java.lang.String); method public boolean handleMmi(java.lang.String, android.telecom.PhoneAccountHandle); + method public boolean hasVoiceMailNumber(android.telecom.PhoneAccountHandle); method public boolean isInCall(); + method public boolean isVoiceMailNumber(android.telecom.PhoneAccountHandle, java.lang.String); + method public void registerPhoneAccount(android.telecom.PhoneAccount); method public void showInCallScreen(boolean); + method public void silenceRinger(); + 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_INCOMING_CALL = "android.telecom.action.INCOMING_CALL"; 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_INCOMING_CALL_EXTRAS = "android.telecom.extra.INCOMING_CALL_EXTRAS"; field public static final java.lang.String EXTRA_OUTGOING_CALL_EXTRAS = "android.telecom.extra.OUTGOING_CALL_EXTRAS"; 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"; @@ -28856,6 +29353,7 @@ package android.telephony { method public int getDataActivity(); method public int getDataState(); method public java.lang.String getDeviceId(); + method public java.lang.String getDeviceId(int); method public java.lang.String getDeviceSoftwareVersion(); method public java.lang.String getGroupIdLevel1(); method public java.lang.String getLine1Number(); @@ -28866,6 +29364,7 @@ package android.telephony { method public java.lang.String getNetworkOperator(); method public java.lang.String getNetworkOperatorName(); method public int getNetworkType(); + method public int getPhoneCount(); method public int getPhoneType(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); diff --git a/api/system-current.txt b/api/system-current.txt index 6a37142ff0678..9a85f95f7514d 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -27067,6 +27067,7 @@ package android.provider { field public static final java.lang.String DEBUG_APP = "debug_app"; field public static final java.lang.String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; field public static final java.lang.String DEVICE_PROVISIONED = "device_provisioned"; + field public static final java.lang.String HIDE_CARRIER_NETWORK_SETTINGS = "hide_carrier_network_settings"; field public static final java.lang.String HTTP_PROXY = "http_proxy"; field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; field public static final java.lang.String MODE_RINGER = "mode_ringer"; @@ -27233,6 +27234,7 @@ package android.provider { field public static final android.net.Uri DEFAULT_RINGTONE_URI; field public static final deprecated java.lang.String DEVICE_PROVISIONED = "device_provisioned"; field public static final deprecated java.lang.String DIM_SCREEN = "dim_screen"; + field public static final java.lang.String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; field public static final java.lang.String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; field public static final java.lang.String END_BUTTON_BEHAVIOR = "end_button_behavior"; field public static final java.lang.String FONT_SCALE = "font_scale"; @@ -27281,6 +27283,7 @@ package android.provider { field public static final java.lang.String USER_ROTATION = "user_rotation"; field public static final deprecated java.lang.String USE_GOOGLE_MAIL = "use_google_mail"; field public static final java.lang.String VIBRATE_ON = "vibrate_on"; + field public static final java.lang.String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; field public static final java.lang.String VOLUME_ALARM = "volume_alarm"; field public static final java.lang.String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; field public static final java.lang.String VOLUME_MUSIC = "volume_music"; @@ -30092,6 +30095,7 @@ 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 static java.lang.String audioRouteToString(int); method public int describeContents(); method public int getRoute(); method public int getSupportedRouteMask(); @@ -30117,6 +30121,7 @@ package android.telecom { method public android.telecom.Call getParent(); method public java.lang.String getRemainingPostDialSequence(); method public int getState(); + method public android.telecom.InCallService.VideoCall getVideoCall(); method public void hold(); method public void mergeConference(); method public void phoneAccountSelected(android.telecom.PhoneAccountHandle, boolean); @@ -30128,6 +30133,7 @@ package android.telecom { method public void stopDtmfTone(); method public void swapConference(); method public void unhold(); + field public static final java.lang.String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts"; field public static final int STATE_ACTIVE = 4; // 0x4 field public static final int STATE_CONNECTING = 9; // 0x9 field public static final int STATE_DIALING = 1; // 0x1 @@ -30140,6 +30146,8 @@ package android.telecom { } public static class Call.Details { + method public static boolean can(int, int); + method public boolean can(int); method public static java.lang.String capabilitiesToString(int); method public android.telecom.PhoneAccountHandle getAccountHandle(); method public int getCallCapabilities(); @@ -30155,14 +30163,24 @@ package android.telecom { method public android.telecom.StatusHints getStatusHints(); method public int getVideoState(); field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000 + field public static final int CAPABILITY_GENERIC_CONFERENCE = 16384; // 0x4000 + field public static final int CAPABILITY_HIGH_DEF_AUDIO = 32768; // 0x8000 field public static final int CAPABILITY_HOLD = 1; // 0x1 field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80 field public static final int CAPABILITY_MERGE_CONFERENCE = 4; // 0x4 field public static final int CAPABILITY_MUTE = 64; // 0x40 field public static final int CAPABILITY_RESPOND_VIA_TEXT = 32; // 0x20 field public static final int CAPABILITY_SEPARATE_FROM_CONFERENCE = 4096; // 0x1000 + field public static final int CAPABILITY_SHOW_CALLBACK_NUMBER = 131072; // 0x20000 + field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = 768; // 0x300 + field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 256; // 0x100 + field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 512; // 0x200 + field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = 3072; // 0xc00 + field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 1024; // 0x400 + field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 2048; // 0x800 field public static final int CAPABILITY_SUPPORT_HOLD = 2; // 0x2 field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8 + field public static final int CAPABILITY_WIFI = 65536; // 0x10000 } public static abstract class Call.Listener { @@ -30175,6 +30193,12 @@ package android.telecom { method public void onParentChanged(android.telecom.Call, android.telecom.Call); method public void onPostDialWait(android.telecom.Call, java.lang.String); method public void onStateChanged(android.telecom.Call, int); + method public void onVideoCallChanged(android.telecom.Call, android.telecom.InCallService.VideoCall); + } + + public class CallProperties { + ctor public CallProperties(); + field public static final int CONFERENCE = 1; // 0x1 } public final class CallState { @@ -30191,13 +30215,22 @@ package android.telecom { field public static final int RINGING = 4; // 0x4 } + public final class CameraCapabilities implements android.os.Parcelable { + ctor public CameraCapabilities(int, int); + method public int describeContents(); + method public int getHeight(); + method public int getWidth(); + method public void writeToParcel(android.os.Parcel, int); + field public static final android.os.Parcelable.Creator CREATOR; + } + public abstract class Conference implements android.telecom.IConferenceable { 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 java.util.List getConferenceableConnections(); - method public long getConnectTimeMillis(); + method public final long getConnectTimeMillis(); method public final int getConnectionCapabilities(); method public final java.util.List getConnections(); method public final android.telecom.DisconnectCause getDisconnectCause(); @@ -30243,8 +30276,8 @@ package android.telecom { method public final android.telecom.DisconnectCause getDisconnectCause(); method public final int getState(); method public final android.telecom.StatusHints getStatusHints(); + method public final android.telecom.Connection.VideoProvider getVideoProvider(); method public final boolean isRingbackRequested(); - method protected void notifyConferenceStarted(); method public void onAbort(); method public void onAnswer(); method public void onAudioStateChanged(android.telecom.AudioState); @@ -30293,6 +30326,38 @@ package android.telecom { field public static final int STATE_RINGING = 2; // 0x2 } + public static abstract class Connection.VideoProvider { + ctor public Connection.VideoProvider(); + method public void changeCallDataUsage(long); + method public void changeCameraCapabilities(android.telecom.CameraCapabilities); + method public void changePeerDimensions(int, int); + method public void changeVideoQuality(int); + method public void handleCallSessionEvent(int); + method public abstract void onRequestCameraCapabilities(); + method public abstract void onRequestConnectionDataUsage(); + method public abstract void onSendSessionModifyRequest(android.telecom.VideoProfile); + method public abstract void onSendSessionModifyResponse(android.telecom.VideoProfile); + method public abstract void onSetCamera(java.lang.String); + method public abstract void onSetDeviceOrientation(int); + method public abstract void onSetDisplaySurface(android.view.Surface); + method public abstract void onSetPauseImage(java.lang.String); + method public abstract void onSetPreviewSurface(android.view.Surface); + method public abstract void onSetZoom(float); + method public void receiveSessionModifyRequest(android.telecom.VideoProfile); + method public void receiveSessionModifyResponse(int, android.telecom.VideoProfile, android.telecom.VideoProfile); + field public static final int SESSION_EVENT_CAMERA_FAILURE = 5; // 0x5 + field public static final int SESSION_EVENT_CAMERA_READY = 6; // 0x6 + field public static final int SESSION_EVENT_RX_PAUSE = 1; // 0x1 + field public static final int SESSION_EVENT_RX_RESUME = 2; // 0x2 + field public static final int SESSION_EVENT_TX_START = 3; // 0x3 + field public static final int SESSION_EVENT_TX_STOP = 4; // 0x4 + field public static final int SESSION_MODIFY_REQUEST_FAIL = 2; // 0x2 + field public static final int SESSION_MODIFY_REQUEST_INVALID = 3; // 0x3 + field public static final int SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE = 5; // 0x5 + field public static final int SESSION_MODIFY_REQUEST_SUCCESS = 1; // 0x1 + field public static final int SESSION_MODIFY_REQUEST_TIMED_OUT = 4; // 0x4 + } + public final class ConnectionRequest implements android.os.Parcelable { ctor public ConnectionRequest(android.telecom.PhoneAccountHandle, android.net.Uri, android.os.Bundle); method public int describeContents(); @@ -30369,6 +30434,32 @@ package android.telecom { field public static final java.lang.String SERVICE_INTERFACE = "android.telecom.InCallService"; } + public static abstract class InCallService.VideoCall { + ctor public InCallService.VideoCall(); + method public abstract void requestCallDataUsage(); + method public abstract void requestCameraCapabilities(); + method public abstract void sendSessionModifyRequest(android.telecom.VideoProfile); + method public abstract void sendSessionModifyResponse(android.telecom.VideoProfile); + method public abstract void setCamera(java.lang.String); + method public abstract void setDeviceOrientation(int); + method public abstract void setDisplaySurface(android.view.Surface); + method public abstract void setPauseImage(java.lang.String); + method public abstract void setPreviewSurface(android.view.Surface); + method public abstract void setVideoCallListener(android.telecom.InCallService.VideoCall.Listener); + method public abstract void setZoom(float); + } + + public static abstract class InCallService.VideoCall.Listener { + ctor public InCallService.VideoCall.Listener(); + method public abstract void onCallDataUsageChanged(long); + method public abstract void onCallSessionEvent(int); + method public abstract void onCameraCapabilitiesChanged(android.telecom.CameraCapabilities); + method public abstract void onPeerDimensionsChanged(int, int); + method public abstract void onSessionModifyRequestReceived(android.telecom.VideoProfile); + method public abstract void onSessionModifyResponseReceived(int, android.telecom.VideoProfile, android.telecom.VideoProfile); + method public abstract void onVideoQualityChanged(int); + } + public final class Phone { method public final void addListener(android.telecom.Phone.Listener); method public final boolean canAddCall(); @@ -30428,7 +30519,6 @@ package android.telecom { ctor public PhoneAccount.Builder(android.telecom.PhoneAccount); method public android.telecom.PhoneAccount.Builder addSupportedUriScheme(java.lang.String); method public android.telecom.PhoneAccount build(); - method public android.telecom.PhoneAccount.Builder setAccountHandle(android.telecom.PhoneAccountHandle); method public android.telecom.PhoneAccount.Builder setAddress(android.net.Uri); method public android.telecom.PhoneAccount.Builder setCapabilities(int); method public android.telecom.PhoneAccount.Builder setHighlightColor(int); @@ -30551,6 +30641,7 @@ package android.telecom { method public java.util.List getAllPhoneAccountHandles(); method public java.util.List getAllPhoneAccounts(); method public int getAllPhoneAccountsCount(); + method public java.util.List getCallCapablePhoneAccounts(); method public int getCallState(); method public android.telecom.PhoneAccountHandle getConnectionManager(); method public android.telecom.PhoneAccountHandle getDefaultOutgoingPhoneAccount(java.lang.String); @@ -30560,6 +30651,8 @@ package android.telecom { method public java.util.List getPhoneAccountsForPackage(); method public java.util.List getPhoneAccountsSupportingScheme(java.lang.String); method public java.util.List getRegisteredConnectionManagers(); + method public android.telecom.PhoneAccountHandle getSimCallManager(); + method public android.telecom.PhoneAccountHandle getUserSelectedOutgoingPhoneAccount(); method public boolean handleMmi(java.lang.String); method public boolean handleMmi(java.lang.String, android.telecom.PhoneAccountHandle); method public boolean hasVoiceMailNumber(android.telecom.PhoneAccountHandle); @@ -30573,6 +30666,7 @@ package android.telecom { 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_INCOMING_CALL = "android.telecom.action.INCOMING_CALL"; field public static final java.lang.String ACTION_PHONE_ACCOUNT_REGISTERED = "android.telecom.action.PHONE_ACCOUNT_REGISTERED"; 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 ',' @@ -31113,6 +31207,7 @@ package android.telephony { method public boolean getDataEnabled(int); method public int getDataState(); method public java.lang.String getDeviceId(); + method public java.lang.String getDeviceId(int); method public java.lang.String getDeviceSoftwareVersion(); method public java.lang.String getGroupIdLevel1(); method public java.lang.String getLine1Number(); @@ -31123,6 +31218,7 @@ package android.telephony { method public java.lang.String getNetworkOperator(); method public java.lang.String getNetworkOperatorName(); method public int getNetworkType(); + method public int getPhoneCount(); method public int getPhoneType(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 73ce9dcb10291..7819c736893f2 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2395,8 +2395,6 @@ public final class Settings { * It was about AudioManager's setting and thus affected all the applications which * relied on the setting, while this is purely about the vibration setting for incoming * calls. - * - * @hide */ public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; @@ -2411,7 +2409,6 @@ public final class Settings { * DTMF tone type played by the dialer when dialing. * 0 = Normal * 1 = Long - * @hide */ public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; @@ -6422,7 +6419,6 @@ public final class Settings { /** * Setting to 1 will hide carrier network settings. * Default is 0. - * @hide */ public static final String HIDE_CARRIER_NETWORK_SETTINGS = "hide_carrier_network_settings"; diff --git a/telecomm/java/android/telecom/AudioState.java b/telecomm/java/android/telecom/AudioState.java index 0720df37f60f4..465c5f41a2977 100644 --- a/telecomm/java/android/telecom/AudioState.java +++ b/telecomm/java/android/telecom/AudioState.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; @@ -25,9 +24,7 @@ import java.util.Locale; /** * 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; @@ -47,11 +44,8 @@ public final class AudioState implements Parcelable { */ public static final int ROUTE_WIRED_OR_EARPIECE = ROUTE_EARPIECE | ROUTE_WIRED_HEADSET; - /** Bit mask of all possible audio routes. - * - * @hide - */ - public static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET | + /** Bit mask of all possible audio routes. */ + private static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET | ROUTE_SPEAKER; private final boolean isMuted; @@ -92,7 +86,6 @@ public final class AudioState implements Parcelable { audioRouteToString(supportedRouteMask)); } - /** @hide */ public static String audioRouteToString(int route) { if (route == 0 || (route & ~ROUTE_ALL) != 0x0) { return "UNKNOWN"; diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index 62af28667f290..33a7fe10b0bc9 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.net.Uri; import android.os.Bundle; @@ -30,10 +29,7 @@ import java.util.concurrent.CopyOnWriteArrayList; /** * Represents an ongoing phone call that the in-call app should present to the user. - * - * {@hide} */ -@SystemApi public final class Call { /** * The state of a {@code Call} when newly created. @@ -91,8 +87,6 @@ public final class Call { * The key to retrieve the optional {@code PhoneAccount}s Telecom can bundle with its Call * extras. Used to pass the phone accounts to display on the front end to the user in order to * select phone accounts to (for example) place a call. - * - * @hide */ public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts"; @@ -142,38 +136,32 @@ public final class Call { /** * Local device supports receiving video. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 0x00000100; /** * Local device supports transmitting video. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 0x00000200; /** * Local device supports bidirectional video calling. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_LOCAL_RX | CAPABILITY_SUPPORTS_VT_LOCAL_TX; /** * Remote device supports receiving video. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 0x00000400; /** * Remote device supports transmitting video. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 0x00000800; /** * Remote device supports bidirectional video calling. - * @hide */ public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = CAPABILITY_SUPPORTS_VT_REMOTE_RX | CAPABILITY_SUPPORTS_VT_REMOTE_TX; @@ -191,27 +179,21 @@ public final class Call { /** * Whether the call is a generic conference, where we do not know the precise state of * participants in the conference (eg. on CDMA). - * - * @hide */ public static final int CAPABILITY_GENERIC_CONFERENCE = 0x00004000; /** * Call is using high definition audio. - * @hide */ public static final int CAPABILITY_HIGH_DEF_AUDIO = 0x00008000; /** * Call is using WIFI. - * @hide */ public static final int CAPABILITY_WIFI = 0x00010000; /** * Indicates that the current device callback number should be shown. - * - * @hide */ public static final int CAPABILITY_SHOW_CALLBACK_NUMBER = 0x00020000; @@ -259,7 +241,6 @@ public final class Call { * @param capabilities A bit field of capabilities. * @param capability The capability to check capabilities for. * @return Whether the specified capability is supported. - * @hide */ public static boolean can(int capabilities, int capability) { return (capabilities & capability) != 0; @@ -270,7 +251,6 @@ public final class Call { * * @param capability The capability to check capabilities for. * @return Whether the specified capability is supported. - * @hide */ public boolean can(int capability) { return can(mCallCapabilities, capability); @@ -593,7 +573,6 @@ public final class Call { * * @param call The {@code Call} invoking this method. * @param videoCall The {@code Call.VideoCall} associated with the {@code Call}. - * @hide */ public void onVideoCallChanged(Call call, InCallService.VideoCall videoCall) {} @@ -846,7 +825,6 @@ public final class Call { * Obtains an object that can be used to display video from this {@code Call}. * * @return An {@code Call.VideoCall}. - * @hide */ public InCallService.VideoCall getVideoCall() { return mVideoCall; diff --git a/telecomm/java/android/telecom/CallProperties.java b/telecomm/java/android/telecom/CallProperties.java index b1b82e2338823..1721a392eff8a 100644 --- a/telecomm/java/android/telecom/CallProperties.java +++ b/telecomm/java/android/telecom/CallProperties.java @@ -18,7 +18,6 @@ package android.telecom; /** * Defines properties of a phone call which may be affected by changes to the call. - * @hide */ public class CallProperties { /** Call is currently in a conference call. */ diff --git a/telecomm/java/android/telecom/CallState.java b/telecomm/java/android/telecom/CallState.java index bd9223affbff1..558422622a066 100644 --- a/telecomm/java/android/telecom/CallState.java +++ b/telecomm/java/android/telecom/CallState.java @@ -16,17 +16,12 @@ package android.telecom; -import android.annotation.SystemApi; - /** * Defines call-state constants of the different states in which a call can exist. Although states * have the notion of normal transitions, due to the volatile nature of telephony systems, code * that uses these states should be resilient to unexpected state changes outside of what is * considered traditional. - * - * {@hide} */ -@SystemApi public final class CallState { private CallState() {} diff --git a/telecomm/java/android/telecom/CameraCapabilities.java b/telecomm/java/android/telecom/CameraCapabilities.java index 6eaf6a2cb5431..62429569c71ef 100644 --- a/telecomm/java/android/telecom/CameraCapabilities.java +++ b/telecomm/java/android/telecom/CameraCapabilities.java @@ -21,7 +21,6 @@ import android.os.Parcelable; /** * Represents the camera capabilities important to a Video Telephony provider. - * @hide */ public final class CameraCapabilities implements Parcelable { @@ -46,7 +45,7 @@ public final class CameraCapabilities implements Parcelable { private final float mMaxZoom; /** - * Create a call camera capabilities instance that doesn't support zoom. + * Create a call camera capabilities instance. * * @param width The width of the camera video (in pixels). * @param height The height of the camera video (in pixels). @@ -56,7 +55,8 @@ public final class CameraCapabilities implements Parcelable { } /** - * Create a call camera capabilities instance. + * Create a call camera capabilities instance that optionally + * supports zoom. * * @param width The width of the camera video (in pixels). * @param height The height of the camera video (in pixels). diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index c37460be0ab25..15a1da114cdf4 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.telecom.Connection.VideoProvider; import java.util.ArrayList; @@ -29,9 +28,7 @@ import java.util.concurrent.CopyOnWriteArraySet; /** * Represents a conference call which can contain any number of {@link Connection} objects. - * @hide */ -@SystemApi public abstract class Conference implements IConferenceable { /** @@ -487,7 +484,7 @@ public abstract class Conference implements IConferenceable { * * @return The time the {@code Conference} has been connected. */ - public long getConnectTimeMillis() { + public final long getConnectTimeMillis() { return mConnectTimeMillis; } diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 0da8f868a1f5c..d4274b90d96fc 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -19,7 +19,6 @@ package android.telecom; 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; @@ -44,9 +43,7 @@ import java.util.concurrent.ConcurrentHashMap; * 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 implements IConferenceable { public static final int STATE_INITIALIZING = 0; @@ -386,7 +383,6 @@ public abstract class Connection implements IConferenceable { public void onCallSubstateChanged(Connection c, int substate) {} } - /** @hide */ public static abstract class VideoProvider { /** @@ -1139,7 +1135,6 @@ public abstract class Connection implements IConferenceable { } } - /** @hide */ public final VideoProvider getVideoProvider() { return mVideoProvider; } @@ -1599,6 +1594,7 @@ public abstract class Connection implements IConferenceable { /** * Notifies listeners that a conference call has been started. + * @hide */ protected void notifyConferenceStarted() { for (Listener l : mListeners) { diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java index f691c179af53b..71b481b89c771 100644 --- a/telecomm/java/android/telecom/ConnectionRequest.java +++ b/telecomm/java/android/telecom/ConnectionRequest.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.net.Uri; import android.os.Bundle; import android.os.Parcel; @@ -25,9 +24,7 @@ import android.os.Parcelable; /** * 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 0c719cd083834..e36d32b52743b 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -17,7 +17,6 @@ package android.telecom; import android.annotation.SdkConstant; -import android.annotation.SystemApi; import android.app.Service; import android.content.ComponentName; import android.content.Intent; @@ -72,9 +71,7 @@ import java.util.concurrent.ConcurrentHashMap; * receives call-commands such as answer, reject, hold and disconnect. *

* 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 130d6762a213c..73bcd0c422cb7 100644 --- a/telecomm/java/android/telecom/DisconnectCause.java +++ b/telecomm/java/android/telecom/DisconnectCause.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; import android.media.ToneGenerator; @@ -30,9 +29,7 @@ import java.util.Objects; * 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 5b8e4ab3d5337..928570e2ec692 100644 --- a/telecomm/java/android/telecom/GatewayInfo.java +++ b/telecomm/java/android/telecom/GatewayInfo.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; @@ -34,17 +33,13 @@ import android.text.TextUtils; *

  • Call the appropriate gateway address. *
  • Display information about how the call is being routed to the user. * - * @hide */ -@SystemApi public class GatewayInfo implements Parcelable { private final String mGatewayProviderPackageName; private final Uri mGatewayAddress; private final Uri mOriginalAddress; - /** @hide */ - @SystemApi public GatewayInfo(String packageName, Uri gatewayUri, Uri originalAddress) { mGatewayProviderPackageName = packageName; mGatewayAddress = gatewayUri; diff --git a/telecomm/java/android/telecom/IConferenceable.java b/telecomm/java/android/telecom/IConferenceable.java index 095d7cbac545c..a9be20b6ea8fd 100644 --- a/telecomm/java/android/telecom/IConferenceable.java +++ b/telecomm/java/android/telecom/IConferenceable.java @@ -16,16 +16,11 @@ package android.telecom; -import android.annotation.SystemApi; - /** * Interface used to identify entities with which another entity can participate in a conference * call with. The {@link ConnectionService} implementation will only recognize * {@link IConferenceable}s which are {@link Connection}s or {@link Conference}s. - * - * @hide */ -@SystemApi public interface IConferenceable { } diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java index 1f7547df88ffe..66072dab2d02a 100644 --- a/telecomm/java/android/telecom/InCallService.java +++ b/telecomm/java/android/telecom/InCallService.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.annotation.SdkConstant; import android.app.Service; import android.content.Intent; @@ -36,10 +35,7 @@ import java.lang.String; * This service is implemented by any app that wishes to provide the user-interface for managing * phone calls. Telecom binds to this service while there exists a live (active or incoming) call, * and uses it to notify the in-call app of any live and and recently disconnected calls. - * - * {@hide} */ -@SystemApi public abstract class InCallService extends Service { /** @@ -205,7 +201,6 @@ public abstract class InCallService extends Service { /** * Class to invoke functionality related to video calls. - * @hide */ public static abstract class VideoCall { @@ -302,7 +297,6 @@ public abstract class InCallService extends Service { /** * Listener class which invokes callbacks after video call actions occur. - * @hide */ public static abstract class Listener { /** diff --git a/telecomm/java/android/telecom/Phone.java b/telecomm/java/android/telecom/Phone.java index cc731095f9c07..d9a9cdf84da38 100644 --- a/telecomm/java/android/telecom/Phone.java +++ b/telecomm/java/android/telecom/Phone.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.util.ArrayMap; import java.util.Collections; @@ -27,10 +26,7 @@ import java.util.concurrent.CopyOnWriteArrayList; /** * A unified virtual device providing a means of voice (and other) communication on a device. - * - * {@hide} */ -@SystemApi public final class Phone { public abstract static class Listener { diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index a94c2f6487a47..00d170fb98ba7 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -60,9 +60,7 @@ public class PhoneAccount implements Parcelable { * if the user has explicitly selected it to be used as the default connection manager. *

    * See {@link #getCapabilities} - * @hide */ - @SystemApi public static final int CAPABILITY_CONNECTION_MANAGER = 0x1; /** @@ -74,9 +72,7 @@ public class PhoneAccount implements Parcelable { *

    * See {@link #getCapabilities} *

    - * {@hide} */ - @SystemApi public static final int CAPABILITY_CALL_PROVIDER = 0x2; /** @@ -205,13 +201,6 @@ public class PhoneAccount implements Parcelable { mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes()); } - /** @hide */ - @SystemApi - public Builder setAccountHandle(PhoneAccountHandle accountHandle) { - mAccountHandle = accountHandle; - return this; - } - /** * Sets the address. See {@link PhoneAccount#getAddress}. * @@ -335,9 +324,7 @@ public class PhoneAccount implements Parcelable { * * @param uriScheme The URI scheme. * @return The builder. - * @hide */ - @SystemApi public Builder addSupportedUriScheme(String uriScheme) { if (!TextUtils.isEmpty(uriScheme) && !mSupportedUriSchemes.contains(uriScheme)) { this.mSupportedUriSchemes.add(uriScheme); @@ -426,9 +413,7 @@ public class PhoneAccount implements Parcelable { * Returns a builder initialized with the current {@link PhoneAccount} instance. * * @return The builder. - * @hide */ - @SystemApi public Builder toBuilder() { return new Builder(this); } /** diff --git a/telecomm/java/android/telecom/PhoneAccountHandle.java b/telecomm/java/android/telecom/PhoneAccountHandle.java index 4600b724e3ef8..60917b2dc568e 100644 --- a/telecomm/java/android/telecom/PhoneAccountHandle.java +++ b/telecomm/java/android/telecom/PhoneAccountHandle.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.content.ComponentName; import android.os.Parcel; import android.os.Parcelable; @@ -47,8 +46,6 @@ public class PhoneAccountHandle implements Parcelable { this(componentName, id, Process.myUserHandle()); } - /** @hide */ - @SystemApi public PhoneAccountHandle( ComponentName componentName, String id, @@ -91,9 +88,7 @@ public class PhoneAccountHandle implements Parcelable { /** * @return the {@link UserHandle} to use when connecting to this PhoneAccount. - * @hide */ - @SystemApi public UserHandle getUserHandle() { return mUserHandle; } diff --git a/telecomm/java/android/telecom/RemoteConference.java b/telecomm/java/android/telecom/RemoteConference.java index 3c6416b939613..fba3ee3265f90 100644 --- a/telecomm/java/android/telecom/RemoteConference.java +++ b/telecomm/java/android/telecom/RemoteConference.java @@ -18,7 +18,6 @@ package android.telecom; import com.android.internal.telecom.IConnectionService; -import android.annotation.SystemApi; import android.os.RemoteException; import java.util.ArrayList; @@ -30,9 +29,7 @@ import java.util.concurrent.CopyOnWriteArraySet; /** * 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 917fa77de66d3..009ec5b49811d 100644 --- a/telecomm/java/android/telecom/RemoteConnection.java +++ b/telecomm/java/android/telecom/RemoteConnection.java @@ -20,7 +20,6 @@ import com.android.internal.telecom.IConnectionService; 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; @@ -38,9 +37,7 @@ import java.util.concurrent.ConcurrentHashMap; * * @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 dd3a639e6bf37..a32eae76dcea7 100644 --- a/telecomm/java/android/telecom/StatusHints.java +++ b/telecomm/java/android/telecom/StatusHints.java @@ -16,7 +16,6 @@ package android.telecom; -import android.annotation.SystemApi; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; @@ -30,9 +29,7 @@ import java.util.Objects; /** * 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 cc03b5cfb977e..9069ec01cfb14 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -55,8 +55,6 @@ public class TelecomManager { * Input: get*Extra field {@link #EXTRA_PHONE_ACCOUNT_HANDLE} contains the component name of the * {@link android.telecom.ConnectionService} that Telecom should bind to. Telecom will then * ask the connection service for more information about the call prior to showing any UI. - * - * @hide */ public static final String ACTION_INCOMING_CALL = "android.telecom.action.INCOMING_CALL"; @@ -85,9 +83,7 @@ public class TelecomManager { /** * 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"; @@ -133,10 +129,7 @@ public class TelecomManager { * Optional extra for {@link #ACTION_INCOMING_CALL} containing a {@link Bundle} which contains * metadata about the call. This {@link Bundle} will be returned to the * {@link ConnectionService}. - * - * @hide */ - @SystemApi public static final String EXTRA_INCOMING_CALL_EXTRAS = "android.telecom.extra.INCOMING_CALL_EXTRAS"; @@ -209,9 +202,7 @@ public class TelecomManager { * {@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"; /** @@ -373,7 +364,6 @@ public class TelecomManager { * exists no user-chosen default {@code PhoneAccount}. * * @return The user outgoing phone account selected by the user. - * @hide */ public PhoneAccountHandle getUserSelectedOutgoingPhoneAccount() { try { @@ -405,7 +395,6 @@ public class TelecomManager { * {@code null}, indicating that there currently exists no user-chosen default * {@code PhoneAccount}. * @return The phone account handle of the current sim call manager. - * @hide */ public PhoneAccountHandle getSimCallManager() { try { @@ -504,8 +493,6 @@ public class TelecomManager { * * @see #EXTRA_PHONE_ACCOUNT_HANDLE * @return A list of {@code PhoneAccountHandle} objects. - * - * @hide */ public List getCallCapablePhoneAccounts() { try { @@ -621,10 +608,7 @@ public class TelecomManager { * {@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()) { @@ -639,9 +623,7 @@ public class TelecomManager { * 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()) { @@ -711,10 +693,7 @@ public class TelecomManager { * * @param accountHandle The handle for the account to check the voicemail number against * @param number The number to look up. - * - * @hide */ - @SystemApi public boolean isVoiceMailNumber(PhoneAccountHandle accountHandle, String number) { try { if (isServiceConnected()) { @@ -731,10 +710,7 @@ public class TelecomManager { * * @param accountHandle The handle for the account to check for a voicemail number. * @return {@code true} If the given phone account has a voicemail number. - * - * @hide */ - @SystemApi public boolean hasVoiceMailNumber(PhoneAccountHandle accountHandle) { try { if (isServiceConnected()) { @@ -751,10 +727,7 @@ public class TelecomManager { * * @param accountHandle The handle for the account retrieve a number for. * @return A string representation of the line 1 phone number. - * - * @hide */ - @SystemApi public String getLine1Number(PhoneAccountHandle accountHandle) { try { if (isServiceConnected()) { @@ -864,10 +837,7 @@ public class TelecomManager { /** * Silences the ringer if a ringing call exists. - * - * @hide */ - @SystemApi public void silenceRinger() { try { if (isServiceConnected()) { @@ -928,9 +898,7 @@ public class TelecomManager { * {@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()) { @@ -1018,9 +986,7 @@ public class TelecomManager { * {@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) { diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index e1a3de7b7f6e2..d0a1dc23bfb2c 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -162,7 +162,6 @@ public class TelephonyManager { * Returns 1 for Single standby mode (Single SIM functionality) * Returns 2 for Dual standby mode.(Dual SIM functionality) */ - /** {@hide} */ public int getPhoneCount() { int phoneCount = 1; switch (getMultiSimConfiguration()) { @@ -639,7 +638,6 @@ public class TelephonyManager { * * @param slotId of which deviceID is returned */ - /** {@hide} */ public String getDeviceId(int slotId) { // FIXME this assumes phoneId == slotId try { From 3031bf961103ecc1caa32449a3cdb95575042278 Mon Sep 17 00:00:00 2001 From: Jonathan Basseri Date: Wed, 25 Feb 2015 13:01:52 -0800 Subject: [PATCH 10/11] Adding Carrier Config API. UICC privileged carrier apps will extend CarrierConfigService to provide carrier-specific configuration. Apps/services will use CarrierConfigManager to read the current configuration. CarrierConfigManager also defines the set of configuration variables and their default values. Bug: b/19483786 Change-Id: I027211b43276afd6fe893ae50048c52f2aed5cf5 --- Android.mk | 11 +- api/current.txt | 35 ++++ api/system-current.txt | 37 ++++ core/java/android/app/ContextImpl.java | 7 + core/java/android/content/Context.java | 12 ++ .../service/carrier/CarrierConfigService.java | 104 ++++++++++ .../service/carrier/CarrierIdentifier.aidl | 19 ++ .../service/carrier/CarrierIdentifier.java | 117 ++++++++++++ .../carrier/ICarrierConfigService.aidl | 32 ++++ core/res/AndroidManifest.xml | 9 + core/res/res/values/strings.xml | 5 + .../telephony/CarrierConfigManager.java | 178 ++++++++++++++++++ .../telephony/ICarrierConfigLoader.aidl | 31 +++ 13 files changed, 593 insertions(+), 4 deletions(-) create mode 100644 core/java/android/service/carrier/CarrierConfigService.java create mode 100644 core/java/android/service/carrier/CarrierIdentifier.aidl create mode 100644 core/java/android/service/carrier/CarrierIdentifier.java create mode 100644 core/java/android/service/carrier/ICarrierConfigService.aidl create mode 100644 telephony/java/android/telephony/CarrierConfigManager.java create mode 100644 telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl diff --git a/Android.mk b/Android.mk index 35bb81a9c68ad..8acd3967b1eee 100644 --- a/Android.mk +++ b/Android.mk @@ -206,6 +206,7 @@ LOCAL_SRC_FILES += \ core/java/android/os/IUpdateLock.aidl \ core/java/android/os/IUserManager.aidl \ core/java/android/os/IVibratorService.aidl \ + core/java/android/service/carrier/ICarrierConfigService.aidl \ core/java/android/service/carrier/ICarrierMessagingCallback.aidl \ core/java/android/service/carrier/ICarrierMessagingService.aidl \ core/java/android/service/notification/INotificationListener.aidl \ @@ -374,15 +375,16 @@ LOCAL_SRC_FILES += \ telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl \ telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl \ telephony/java/com/android/ims/ImsConfigListener.aidl \ + telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl \ + telephony/java/com/android/internal/telephony/IMms.aidl \ + telephony/java/com/android/internal/telephony/IOnSubscriptionsChangedListener.aidl \ telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \ telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \ + telephony/java/com/android/internal/telephony/ISms.aidl \ + telephony/java/com/android/internal/telephony/ISub.aidl \ telephony/java/com/android/internal/telephony/ITelephony.aidl \ telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \ - telephony/java/com/android/internal/telephony/IOnSubscriptionsChangedListener.aidl \ - telephony/java/com/android/internal/telephony/ISms.aidl \ telephony/java/com/android/internal/telephony/IWapPushManager.aidl \ - telephony/java/com/android/internal/telephony/ISub.aidl \ - telephony/java/com/android/internal/telephony/IMms.aidl \ wifi/java/android/net/wifi/IWifiManager.aidl \ wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \ wifi/java/android/net/wifi/IWifiScanner.aidl \ @@ -529,6 +531,7 @@ aidl_files := \ frameworks/base/core/java/android/view/textservice/SpellCheckerInfo.aidl \ frameworks/base/core/java/android/view/textservice/SentenceSuggestionsInfo.aidl \ frameworks/base/core/java/android/view/textservice/SuggestionsInfo.aidl \ + frameworks/base/core/java/android/service/carrier/CarrierIdentifier.aidl \ frameworks/base/core/java/android/service/carrier/MessagePdu.aidl \ frameworks/base/core/java/android/service/notification/StatusBarNotification.aidl \ frameworks/base/core/java/android/speech/tts/Voice.aidl \ diff --git a/api/current.txt b/api/current.txt index a5febe93a9ba3..42f0f6d89cbe4 100644 --- a/api/current.txt +++ b/api/current.txt @@ -20,6 +20,7 @@ package android { field public static final java.lang.String BATTERY_STATS = "android.permission.BATTERY_STATS"; field public static final java.lang.String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE"; field public static final java.lang.String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET"; + field public static final java.lang.String BIND_CARRIER_CONFIG_SERVICE = "android.permission.BIND_CARRIER_CONFIG_SERVICE"; field public static final java.lang.String BIND_CARRIER_MESSAGING_SERVICE = "android.permission.BIND_CARRIER_MESSAGING_SERVICE"; field public static final java.lang.String BIND_DEVICE_ADMIN = "android.permission.BIND_DEVICE_ADMIN"; field public static final java.lang.String BIND_DREAM_SERVICE = "android.permission.BIND_DREAM_SERVICE"; @@ -7263,6 +7264,7 @@ package android.content { field public static final java.lang.String BLUETOOTH_SERVICE = "bluetooth"; field public static final java.lang.String CAMERA_SERVICE = "camera"; field public static final java.lang.String CAPTIONING_SERVICE = "captioning"; + field public static final java.lang.String CARRIER_CONFIG_SERVICE = "carrier_config"; field public static final java.lang.String CLIPBOARD_SERVICE = "clipboard"; field public static final java.lang.String CONNECTIVITY_SERVICE = "connectivity"; field public static final java.lang.String CONSUMER_IR_SERVICE = "consumer_ir"; @@ -27019,6 +27021,26 @@ package android.security { package android.service.carrier { + public abstract class CarrierConfigService extends android.app.Service { + ctor public CarrierConfigService(); + method public final android.os.IBinder onBind(android.content.Intent); + method public abstract android.os.Bundle onLoadConfig(android.service.carrier.CarrierIdentifier); + field public static final java.lang.String SERVICE_INTERFACE = "android.service.carrier.CarrierConfigService"; + } + + public class CarrierIdentifier implements android.os.Parcelable { + ctor public CarrierIdentifier(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String); + method public int describeContents(); + method public java.lang.String getGid1(); + method public java.lang.String getGid2(); + method public java.lang.String getImsi(); + method public java.lang.String getMcc(); + method public java.lang.String getMnc(); + method public java.lang.String getSpn(); + method public void writeToParcel(android.os.Parcel, int); + field public static final android.os.Parcelable.Creator CREATOR; + } + public abstract class CarrierMessagingService extends android.app.Service { ctor public CarrierMessagingService(); method public android.os.IBinder onBind(android.content.Intent); @@ -28883,6 +28905,19 @@ package android.telecom { package android.telephony { + public class CarrierConfigManager { + ctor public CarrierConfigManager(); + method public android.os.Bundle getConfig(); + method public android.os.Bundle getConfigForSubId(int); + method public void reloadCarrierConfigForSubId(int); + field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.intent.action.carrier_config_changed"; + field public static final java.lang.String BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available"; + field public static final java.lang.String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned"; + field public static final java.lang.String BOOL_CARRIER_VOLTE_TTY_SUPPORTED = "bool_carrier_volte_tty_supported"; + field public static final java.lang.String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma"; + field public static final java.lang.String INT_VOLTE_REPLACEMENT_RAT = "int_volte_replacement_rat"; + } + public final class CellIdentityCdma implements android.os.Parcelable { method public int describeContents(); method public int getBasestationId(); diff --git a/api/system-current.txt b/api/system-current.txt index 9a85f95f7514d..6f9238e9f7d0a 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -28,6 +28,7 @@ package android { field public static final java.lang.String BATTERY_STATS = "android.permission.BATTERY_STATS"; field public static final java.lang.String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE"; field public static final java.lang.String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET"; + field public static final java.lang.String BIND_CARRIER_CONFIG_SERVICE = "android.permission.BIND_CARRIER_CONFIG_SERVICE"; field public static final java.lang.String BIND_CARRIER_MESSAGING_SERVICE = "android.permission.BIND_CARRIER_MESSAGING_SERVICE"; field public static final java.lang.String BIND_CONDITION_PROVIDER_SERVICE = "android.permission.BIND_CONDITION_PROVIDER_SERVICE"; field public static final java.lang.String BIND_CONNECTION_SERVICE = "android.permission.BIND_CONNECTION_SERVICE"; @@ -7504,6 +7505,7 @@ package android.content { field public static final java.lang.String BLUETOOTH_SERVICE = "bluetooth"; field public static final java.lang.String CAMERA_SERVICE = "camera"; field public static final java.lang.String CAPTIONING_SERVICE = "captioning"; + field public static final java.lang.String CARRIER_CONFIG_SERVICE = "carrier_config"; field public static final java.lang.String CLIPBOARD_SERVICE = "clipboard"; field public static final java.lang.String CONNECTIVITY_SERVICE = "connectivity"; field public static final java.lang.String CONSUMER_IR_SERVICE = "consumer_ir"; @@ -28716,6 +28718,26 @@ package android.security { package android.service.carrier { + public abstract class CarrierConfigService extends android.app.Service { + ctor public CarrierConfigService(); + method public final android.os.IBinder onBind(android.content.Intent); + method public abstract android.os.Bundle onLoadConfig(android.service.carrier.CarrierIdentifier); + field public static final java.lang.String SERVICE_INTERFACE = "android.service.carrier.CarrierConfigService"; + } + + public class CarrierIdentifier implements android.os.Parcelable { + ctor public CarrierIdentifier(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String); + method public int describeContents(); + method public java.lang.String getGid1(); + method public java.lang.String getGid2(); + method public java.lang.String getImsi(); + method public java.lang.String getMcc(); + method public java.lang.String getMnc(); + method public java.lang.String getSpn(); + method public void writeToParcel(android.os.Parcel, int); + field public static final android.os.Parcelable.Creator CREATOR; + } + public abstract class CarrierMessagingService extends android.app.Service { ctor public CarrierMessagingService(); method public android.os.IBinder onBind(android.content.Intent); @@ -30720,6 +30742,21 @@ package android.telecom { package android.telephony { + public class CarrierConfigManager { + ctor public CarrierConfigManager(); + method public android.os.Bundle getConfig(); + method public android.os.Bundle getConfigForSubId(int); + method public static android.os.Bundle getDefaultConfig(); + method public void reloadCarrierConfigForSubId(int); + method public void updateConfigForPhoneId(int, java.lang.String); + field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.intent.action.carrier_config_changed"; + field public static final java.lang.String BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available"; + field public static final java.lang.String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned"; + field public static final java.lang.String BOOL_CARRIER_VOLTE_TTY_SUPPORTED = "bool_carrier_volte_tty_supported"; + field public static final java.lang.String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma"; + field public static final java.lang.String INT_VOLTE_REPLACEMENT_RAT = "int_volte_replacement_rat"; + } + public final class CellIdentityCdma implements android.os.Parcelable { method public int describeContents(); method public int getBasestationId(); diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 2ef046d8e1fa3..641f5d223378d 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -125,6 +125,7 @@ import android.print.PrintManager; import android.service.fingerprint.IFingerprintService; import android.service.fingerprint.FingerprintManager; import android.telecom.TelecomManager; +import android.telephony.CarrierConfigManager; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.content.ClipboardManager; @@ -768,6 +769,12 @@ class ContextImpl extends Context { IBinder b = ServiceManager.getService(APPWIDGET_SERVICE); return new AppWidgetManager(ctx, IAppWidgetService.Stub.asInterface(b)); }}); + + registerService(CARRIER_CONFIG_SERVICE, new ServiceFetcher() { + public Object createService(ContextImpl ctx) { + return new CarrierConfigManager(); + } + }); } static ContextImpl getImpl(Context context) { diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 26735a6c6a6c5..d689ce94f8254 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -2116,6 +2116,7 @@ public abstract class Context { AUDIO_SERVICE, MEDIA_ROUTER_SERVICE, TELEPHONY_SERVICE, + CARRIER_CONFIG_SERVICE, TELECOM_SERVICE, CLIPBOARD_SERVICE, INPUT_METHOD_SERVICE, @@ -2248,6 +2249,8 @@ public abstract class Context { * @see android.telephony.TelephonyManager * @see #TELEPHONY_SUBSCRIPTION_SERVICE * @see android.telephony.SubscriptionManager + * @see #CARRIER_CONFIG_SERVICE + * @see android.telephony.CarrierConfigManager * @see #INPUT_METHOD_SERVICE * @see android.view.inputmethod.InputMethodManager * @see #UI_MODE_SERVICE @@ -2610,6 +2613,15 @@ public abstract class Context { */ public static final String TELECOM_SERVICE = "telecom"; + /** + * Use with {@link #getSystemService} to retrieve a + * {@link android.telephony.CarrierConfigManager} for reading carrier configuration values. + * + * @see #getSystemService + * @see android.telephony.CarrierConfigManager + */ + public static final String CARRIER_CONFIG_SERVICE = "carrier_config"; + /** * Use with {@link #getSystemService} to retrieve a * {@link android.text.ClipboardManager} for accessing and modifying diff --git a/core/java/android/service/carrier/CarrierConfigService.java b/core/java/android/service/carrier/CarrierConfigService.java new file mode 100644 index 0000000000000..1880d16fb15ed --- /dev/null +++ b/core/java/android/service/carrier/CarrierConfigService.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2015 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.service.carrier; + +import android.app.Service; +import android.content.Intent; +import android.os.Bundle; +import android.os.IBinder; + +/** + * A service that sets carrier configuration for telephony services. + *

    + * To extend this class, you must declare the service in your manifest file to require the + * {@link android.Manifest.permission#BIND_CARRIER_CONFIG_SERVICE} permission and include an intent + * filter with the {@link #SERVICE_INTERFACE} action. For example: + *

    + * + *
    {@code
    + * 
    + *  
    + *      
    + *  
    + * 
    + * }
    + */ +public abstract class CarrierConfigService extends Service { + + public static final String SERVICE_INTERFACE = "android.service.carrier.CarrierConfigService"; + + private final ICarrierConfigService.Stub mStubWrapper; + + public CarrierConfigService() { + mStubWrapper = new ICarrierConfigServiceWrapper(); + } + + /** + * Override this method to set carrier configuration. + *

    + * This method will be called by telephony services to get carrier-specific configuration + * values. The returned config will be saved by the system until, + *

      + *
    1. The carrier app package is updated, or
    2. + *
    3. The carrier app requests a reload with + * {@link android.telephony.CarrierConfigManager#reloadCarrierConfigForSubId + * reloadCarrierConfigForSubId}.
    4. + *
    + * This method can be called after a SIM card loads, which may be before or after boot. + *

    + *

    + * This method should not block for a long time. If expensive operations (e.g. network access) + * are required, this method can schedule the work and return null. Then, use + * {@link android.telephony.CarrierConfigManager#reloadCarrierConfigForSubId + * reloadCarrierConfigForSubId} to trigger a reload when the config is ready. + *

    + *

    + * Implementations should use the keys defined in {@link android.telephony.CarrierConfigManager + * CarrierConfigManager}. Any configuration values not set in the returned {@link Bundle} may be + * overridden by the system's default configuration service. + *

    + * + * @param id contains details about the current carrier that can be used do decide what + * configuration values to return. + * @return a {@link Bundle} object containing the configuration or null if default values should + * be used. + */ + public abstract Bundle onLoadConfig(CarrierIdentifier id); + + /** @hide */ + @Override + public final IBinder onBind(Intent intent) { + if (!SERVICE_INTERFACE.equals(intent.getAction())) { + return null; + } + return mStubWrapper; + } + + /** + * A wrapper around ICarrierConfigService that forwards calls to implementations of + * {@link CarrierConfigService}. + * + * @hide + */ + private class ICarrierConfigServiceWrapper extends ICarrierConfigService.Stub { + + @Override + public Bundle getCarrierConfig(CarrierIdentifier id) { + return CarrierConfigService.this.onLoadConfig(id); + } + } +} diff --git a/core/java/android/service/carrier/CarrierIdentifier.aidl b/core/java/android/service/carrier/CarrierIdentifier.aidl new file mode 100644 index 0000000000000..48b13983050d6 --- /dev/null +++ b/core/java/android/service/carrier/CarrierIdentifier.aidl @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2015, 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.service.carrier; + +parcelable CarrierIdentifier; diff --git a/core/java/android/service/carrier/CarrierIdentifier.java b/core/java/android/service/carrier/CarrierIdentifier.java new file mode 100644 index 0000000000000..495fea657b4ea --- /dev/null +++ b/core/java/android/service/carrier/CarrierIdentifier.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2015, 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.service.carrier; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Used to pass info to CarrierConfigService implementations so they can decide what values to + * return. + */ +public class CarrierIdentifier implements Parcelable { + + /** Used to create a {@link CarrierIdentifier} from a {@link Parcel}. */ + public static final Creator CREATOR = new Creator() { + @Override + public CarrierIdentifier createFromParcel(Parcel parcel) { + return new CarrierIdentifier(parcel); + } + + @Override + public CarrierIdentifier[] newArray(int i) { + return new CarrierIdentifier[i]; + } + }; + + private String mMcc; + private String mMnc; + private String mSpn; + private String mImsi; + private String mGid1; + private String mGid2; + + public CarrierIdentifier(String mcc, String mnc, String spn, String imsi, String gid1, + String gid2) { + mMcc = mcc; + mMnc = mnc; + mSpn = spn; + mImsi = imsi; + mGid1 = gid1; + mGid2 = gid2; + } + + /** @hide */ + public CarrierIdentifier(Parcel parcel) { + readFromParcel(parcel); + } + + /** Get the mobile country code. */ + public String getMcc() { + return mMcc; + } + + /** Get the mobile network code. */ + public String getMnc() { + return mMnc; + } + + /** Get the service provider name. */ + public String getSpn() { + return mSpn; + } + + /** Get the international mobile subscriber identity. */ + public String getImsi() { + return mImsi; + } + + /** Get the group identifier level 1. */ + public String getGid1() { + return mGid1; + } + + /** Get the group identifier level 2. */ + public String getGid2() { + return mGid2; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(mMcc); + out.writeString(mMnc); + out.writeString(mSpn); + out.writeString(mImsi); + out.writeString(mGid1); + out.writeString(mGid2); + } + + /** @hide */ + public void readFromParcel(Parcel in) { + mMcc = in.readString(); + mMnc = in.readString(); + mSpn = in.readString(); + mImsi = in.readString(); + mGid1 = in.readString(); + mGid2 = in.readString(); + } +} diff --git a/core/java/android/service/carrier/ICarrierConfigService.aidl b/core/java/android/service/carrier/ICarrierConfigService.aidl new file mode 100644 index 0000000000000..d8390b66a04b4 --- /dev/null +++ b/core/java/android/service/carrier/ICarrierConfigService.aidl @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2015, 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.service.carrier; + +import android.os.Bundle; +import android.service.carrier.CarrierIdentifier; + +/** + * Service used to get carrier config from carrier apps. + * + * @see android.service.carrier.CarrierConfigService + * @hide + */ +interface ICarrierConfigService { + + /** @see android.service.carrier.CarrierConfigService#onLoadConfig */ + Bundle getCarrierConfig(in CarrierIdentifier id); +} \ No newline at end of file diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index ccdb5db3d6475..b1213b3d73098 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -2923,6 +2923,15 @@ android:description="@string/permdesc_bindCarrierMessagingService" android:protectionLevel="signature|system" /> + + + diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 48bc2dcfca4a2..072d6333d1c86 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -2397,6 +2397,11 @@ Allows the holder to bind to the top-level interface of a carrier messaging service. Should never be needed for normal apps. + + bind to a carrier config service + + Allows the holder to bind to a carrier config service. Should never be needed for normal apps. + diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java new file mode 100644 index 0000000000000..004398eef3e26 --- /dev/null +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2015 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.telephony; + +import com.android.internal.telephony.ICarrierConfigLoader; + +import android.annotation.SystemApi; +import android.content.Context; +import android.os.Bundle; +import android.os.RemoteException; +import android.os.ServiceManager; + +/** + * Provides access to telephony configuration values that are carrier-specific. + *

    + * Users should obtain an instance of this class by calling + * {@code mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);} + *

    + * + * @see Context#getSystemService + * @see Context#CARRIER_CONFIG_SERVICE + */ +public class CarrierConfigManager { + + /** + * This intent is broadcast by the system when carrier config changes. + */ + public static final String + ACTION_CARRIER_CONFIG_CHANGED = "android.intent.action.carrier_config_changed"; + + /** + * Flag specifying whether VoLTE should be available for carrier, independent of carrier + * provisioning. If false: hard disabled. If true: then depends on carrier provisioning, + * availability, etc. + */ + public static final String BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available"; + + /** + * Flag specifying whether VoLTE availability is based on provisioning. + */ + public static final String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned"; + + /** + * Flag specifying whether VoLTE TTY is supported. + */ + public static final String BOOL_CARRIER_VOLTE_TTY_SUPPORTED + = "bool_carrier_volte_tty_supported"; + + /** + * Show APN Settings for some CDMA carriers. + */ + public static final String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma"; + + /** + * If Voice Radio Technology is RIL_RADIO_TECHNOLOGY_LTE:14 or RIL_RADIO_TECHNOLOGY_UNKNOWN:0 + * this is the value that should be used instead. A configuration value of + * RIL_RADIO_TECHNOLOGY_UNKNOWN:0 means there is no replacement value and that the default + * assumption for phone type (GSM) should be used. + */ + public static final String INT_VOLTE_REPLACEMENT_RAT = "int_volte_replacement_rat"; + + private final static String TAG = "CarrierConfigManager"; + + /** The default value for every variable. */ + private final static Bundle sDefaults; + + static { + sDefaults = new Bundle(); + sDefaults.putBoolean(BOOL_CARRIER_VOLTE_AVAILABLE, false); + sDefaults.putBoolean(BOOL_CARRIER_VOLTE_PROVISIONED, false); + sDefaults.putBoolean(BOOL_CARRIER_VOLTE_TTY_SUPPORTED, true); + sDefaults.putBoolean(BOOL_SHOW_APN_SETTING_CDMA, false); + + sDefaults.putInt(INT_VOLTE_REPLACEMENT_RAT, 0); + } + + /** + * Gets the configuration values for a particular subscription, which is associated with a + * specific SIM card. If an invalid subId is used, the returned config will contain default + * values. + * + * @param subId the subscription ID, normally obtained from {@link SubscriptionManager}. + * @return A {@link Bundle} containing the config for the given subId, or default values for an + * invalid subId. + */ + public Bundle getConfigForSubId(int subId) { + try { + return getICarrierConfigLoader().getConfigForSubId(subId); + } catch (RemoteException ex) { + Rlog.e(TAG, "Error getting config for subId " + Integer.toString(subId) + ": " + + ex.toString()); + } catch (NullPointerException ex) { + Rlog.e(TAG, "Error getting config for subId " + Integer.toString(subId) + ": " + + ex.toString()); + } + return null; + } + + /** + * Gets the configuration values for the default subscription. + * + * @see #getConfigForSubId + */ + public Bundle getConfig() { + return getConfigForSubId(SubscriptionManager.getDefaultSubId()); + } + + /** + * Calling this method triggers telephony services to fetch the current carrier configuration. + *

    + * Normally this does not need to be called because the platform reloads config on its own. Call + * this method if your app wants to update config at an arbitrary moment. + *

    + *

    + * This method returns before the reload has completed, and + * {@link android.service.carrier.CarrierConfigService#onLoadConfig} will be called from an + * arbitrary thread. + *

    + */ + public void reloadCarrierConfigForSubId(int subId) { + try { + getICarrierConfigLoader().reloadCarrierConfigForSubId(subId); + } catch (RemoteException ex) { + Rlog.e(TAG, "Error reloading config for subId=" + subId + ": " + ex.toString()); + } catch (NullPointerException ex) { + Rlog.e(TAG, "Error reloading config for subId=" + subId + ": " + ex.toString()); + } + } + + /** + * Request the carrier config loader to update the cofig for phoneId. + * + * Depending on simState, the config may be cleared or loaded from config app. + * This is only used by SubscriptionInfoUpdater. + * + * @hide + */ + @SystemApi + public void updateConfigForPhoneId(int phoneId, String simState) { + try { + getICarrierConfigLoader().updateConfigForPhoneId(phoneId, simState); + } catch (RemoteException ex) { + Rlog.e(TAG, "Error updating config for phoneId=" + phoneId + ": " + ex.toString()); + } catch (NullPointerException ex) { + Rlog.e(TAG, "Error updating config for phoneId=" + phoneId + ": " + ex.toString()); + } + } + + /** + * Returns a bundle with the default value for every supported configuration variable. + * + * @hide + */ + @SystemApi + public static Bundle getDefaultConfig() { + return sDefaults; + } + + /** @hide */ + private ICarrierConfigLoader getICarrierConfigLoader() { + return ICarrierConfigLoader.Stub + .asInterface(ServiceManager.getService(Context.CARRIER_CONFIG_SERVICE)); + } +} diff --git a/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl b/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl new file mode 100644 index 0000000000000..b5cdd9a250d1f --- /dev/null +++ b/telephony/java/com/android/internal/telephony/ICarrierConfigLoader.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2015 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 android.os.Bundle; + +/** + * Interface used to interact with the CarrierConfigLoader + */ +interface ICarrierConfigLoader { + + Bundle getConfigForSubId(int subId); + + void reloadCarrierConfigForSubId(int subId); + + void updateConfigForPhoneId(int phoneId, String simState); +} From 3876fb57283a482d7dbd6b78b9a7ee12c4e847dd Mon Sep 17 00:00:00 2001 From: Pierre Vandwalle Date: Wed, 15 Apr 2015 15:26:30 -0700 Subject: [PATCH 11/11] add HAL PNO config parameter Change-Id: I847ec3a9cbd9f0036a4de7b88667f26f7880d7b1 --- core/res/res/values/config.xml | 3 +++ core/res/res/values/symbols.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 4b28aab86105c..c22a1cbc663a2 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -489,6 +489,9 @@ false + + false + 1 diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 76556ad645269..d33f667f5d0ec 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -373,6 +373,7 @@ +