Commit fb40dd4d authored by Wink Saville's avatar Wink Saville

Merge kwd to master

Add initial IMS and MSIM support from klp-wireless-dev-mirror

Change-Id: Idb607c0aa32f80fe4fe1539aedea7a221e9e7f04
parent 6dfa6e2a
......@@ -341,6 +341,7 @@ LOCAL_SRC_FILES += \
telephony/java/com/android/internal/telephony/ITelephonyRegistry.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 \
wifi/java/android/net/wifi/IWifiManager.aidl \
wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl \
wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \
......
......@@ -193,6 +193,7 @@ $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framew
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java/android/app)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/android/app/wearable)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java/android/tv/ITv*)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
......
......@@ -6547,6 +6547,53 @@ public final class Settings {
public static boolean putFloat(ContentResolver cr, String name, float value) {
return putString(cr, name, Float.toString(value));
}
/**
* Subscription to be used for voice call on a multi sim device. The supported values
* are 0 = SUB1, 1 = SUB2 and etc.
* @hide
*/
public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
/**
* Used to provide option to user to select subscription during dial.
* The supported values are 0 = disable or 1 = enable prompt.
* @hide
*/
public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
/**
* Subscription to be used for data call on a multi sim device. The supported values
* are 0 = SUB1, 1 = SUB2 and etc.
* @hide
*/
public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
/**
* Subscription to be used for SMS on a multi sim device. The supported values
* are 0 = SUB1, 1 = SUB2 and etc.
* @hide
*/
public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
/**
* Used to provide option to user to select subscription during send SMS.
* The value 1 - enable, 0 - disable
* @hide
*/
public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
/** User preferred subscriptions setting.
* This holds the details of the user selected subscription from the card and
* the activation status. Each settings string have the coma separated values
* iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
* @hide
*/
public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
"user_preferred_sub2","user_preferred_sub3"};
}
/**
......
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright (C) 2014 MediaTek Inc.
**
** 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.
*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" >
<RelativeLayout
android:layout_width="48dip"
android:layout_height="32dip"
android:id="@+id/sub_color"
android:layout_marginEnd="6dip"
android:layout_centerVertical="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/sub_short_number"
android:layout_marginBottom="2dip"
android:layout_marginEnd="4dip"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:textSize="12sp"
android:singleLine="true"
android:textColor="@android:color/white"
android:includeFontPadding="false"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_centerVertical="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/sub_name"
android:singleLine="true"
android:ellipsize="none"
android:requiresFadingEdge="horizontal"
android:scrollHorizontally="true"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/sub_number"
android:layout_below="@+id/sub_name"
android:layout_alignStart="@+id/sub_name"
android:singleLine="true"
android:ellipsize="none"
android:requiresFadingEdge="horizontal"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"/>
</RelativeLayout>
</LinearLayout>
......@@ -1574,4 +1574,28 @@
<item>users</item>
</string-array>
<!-- default telephony hardware configuration for this platform.
-->
<!-- this string array should be overridden by the device to present a list
telephony hardware resource. this is used by the telephony device controller
(TDC) to offer the basic capabilities of the hardware to the telephony
framework
-->
<!-- an array of "[hardware type],[hardware-uuid],[state],[[hardware-type specific]]"
with, [[hardware-type specific]] in:
- "[[ril-model],[rat],[max-active-voice],[max-active-data],[max-active-standby]]"
for 'modem' hardware
- "[[associated-modem-uuid]]"
for 'sim' hardware.
refer to HardwareConfig in com.android.internal.telephony for specific details/values
those elements can carry.
-->
<string-array translatable="false" name="config_telephonyHardware">
<!-- modem -->
<item>"0,modem,0,0,0,1,1,1"</item>
<!-- sim -->
<item>"1,sim,0,modem"</item>
</string-array>
</resources>
......@@ -999,6 +999,7 @@
<java-symbol type="array" name="config_sameNamedOperatorConsideredRoaming" />
<java-symbol type="array" name="config_callBarringMMI" />
<java-symbol type="array" name="config_globalActionsList" />
<java-symbol type="array" name="config_telephonyHardware" />
<java-symbol type="drawable" name="default_wallpaper" />
<java-symbol type="drawable" name="indicator_input_error" />
......@@ -1122,6 +1123,15 @@
<java-symbol type="drawable" name="ic_corp_badge" />
<java-symbol type="drawable" name="ic_corp_icon_badge" />
<java-symbol type="drawable" name="sim_light_blue" />
<java-symbol type="drawable" name="sim_light_green" />
<java-symbol type="drawable" name="sim_light_orange" />
<java-symbol type="drawable" name="sim_light_purple" />
<java-symbol type="drawable" name="sim_dark_blue" />
<java-symbol type="drawable" name="sim_dark_green" />
<java-symbol type="drawable" name="sim_dark_orange" />
<java-symbol type="drawable" name="sim_dark_purple" />
<java-symbol type="layout" name="action_bar_home" />
<java-symbol type="layout" name="action_bar_title_item" />
<java-symbol type="layout" name="action_menu_item_layout" />
......
......@@ -61,6 +61,7 @@ import android.os.SystemClock;
import android.os.SystemProperties;
import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.PhoneStateListener;
import android.telephony.SubscriptionManager;
import android.util.Log;
import android.util.Slog;
import android.util.SparseBooleanArray;
......@@ -237,7 +238,9 @@ public class NetworkManagementService extends INetworkManagementService.Stub
mThread = new Thread(mConnector, NETD_TAG);
mDaemonHandler = new Handler(FgThread.get().getLooper());
mPhoneStateListener = new PhoneStateListener(mDaemonHandler.getLooper()) {
mPhoneStateListener = new PhoneStateListener(
SubscriptionManager.DEFAULT_SUB_ID, // FIXME: What Subscription should be used??
mDaemonHandler.getLooper()) {
public void onDataConnectionRealTimeInfoChanged(
DataConnectionRealTimeInfo dcRtInfo) {
notifyInterfaceClassActivity(ConnectivityManager.TYPE_MOBILE,
......
......@@ -20,11 +20,13 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.CellLocation;
import android.telephony.CellInfo;
import android.telephony.VoLteServiceState;
import android.telephony.Rlog;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionManager;
import android.telephony.PreciseCallState;
import android.telephony.PreciseDataConnectionState;
......@@ -48,6 +50,7 @@ import java.util.List;
* appropriate LISTEN_ flags.
*/
public class PhoneStateListener {
private static final String TAG = "PhoneStateListener";
/**
* Stop listening for updates.
......@@ -200,18 +203,42 @@ public class PhoneStateListener {
*/
public static final int LISTEN_DATA_CONNECTION_REAL_TIME_INFO = 0x00002000;
/**
* Listen for changes to LTE network state
*
* @see #onLteNetworkStateChanged
* @hide
*/
public static final int LISTEN_VOLTE_STATE = 0x00004000;
/*
* Subscription used to listen to the phone state changes
* @hide
*/
/** @hide */
protected long mSubId = 0;
private final Handler mHandler;
public PhoneStateListener() {
this(Looper.myLooper());
this(SubscriptionManager.DEFAULT_SUB_ID, Looper.myLooper());
}
/**
* @hide
*/
public PhoneStateListener(long subId) {
this(subId, Looper.myLooper());
}
/** @hide */
public PhoneStateListener(Looper looper) {
public PhoneStateListener(long subId, Looper looper) {
Rlog.d(TAG, "ctor: subId=" + subId + " looper=" + looper);
mSubId = subId;
mHandler = new Handler(looper) {
public void handleMessage(Message msg) {
//Rlog.d("TelephonyRegistry", "what=0x" + Integer.toHexString(msg.what)
// + " msg=" + msg);
Rlog.d(TAG, "mSubId=" + mSubId + " what=0x" + Integer.toHexString(msg.what)
+ " msg=" + msg);
switch (msg.what) {
case LISTEN_SERVICE_STATE:
PhoneStateListener.this.onServiceStateChanged((ServiceState)msg.obj);
......@@ -258,6 +285,9 @@ public class PhoneStateListener {
PhoneStateListener.this.onDataConnectionRealTimeInfoChanged(
(DataConnectionRealTimeInfo)msg.obj);
break;
case LISTEN_VOLTE_STATE:
PhoneStateListener.this.onVoLteServiceStateChanged((VoLteServiceState)msg.obj);
break;
}
}
};
......@@ -416,6 +446,15 @@ public class PhoneStateListener {
// default implementation empty
}
/**
* Callback invoked when the service state of LTE network
* related to the VoLTE service has changed.
* @param stateInfo is the current LTE network information
* @hide
*/
public void onVoLteServiceStateChanged(VoLteServiceState stateInfo) {
}
/**
* The callback methods need to be called on the handler thread where
* this object was created. If the binder did that for us it'd be nice.
......@@ -484,5 +523,9 @@ public class PhoneStateListener {
Message.obtain(mHandler, LISTEN_DATA_CONNECTION_REAL_TIME_INFO, 0, 0,
dcRtInfo).sendToTarget();
}
public void onVoLteServiceStateChanged(VoLteServiceState lteState) {
Message.obtain(mHandler, LISTEN_VOLTE_STATE, 0, 0, lteState).sendToTarget();
}
};
}
/*
* Copyright (C) 2011-2014 MediaTek Inc.
*
* 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;
parcelable SubInfoRecord;
/*
* Copyright (C) 2011-2014 MediaTek Inc.
*
* 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 android.os.Parcel;
import android.os.Parcelable;
/**
* A parcelable holder class of byte[] for ISms aidl implementation
* @hide
*/
public class SubInfoRecord implements Parcelable {
public long mSubId;
public String mIccId;
public int mSlotId;
public String mDisplayName;
public int mNameSource;
public int mColor;
public String mNumber;
public int mDispalyNumberFormat;
public int mDataRoaming;
public int[] mSimIconRes;
public SubInfoRecord() {
this.mSubId = -1;
this.mIccId = "";
this.mSlotId = -1;
this.mDisplayName = "";
this.mNameSource = 0;
this.mColor = 0;
this.mNumber = "";
this.mDispalyNumberFormat = 0;
this.mDataRoaming = 0;
this.mSimIconRes = new int[2];
}
public SubInfoRecord(long subId, String iccId, int slotId, String displayname, int nameSource,
int mColor, String mNumber, int displayFormat, int roaming, int[] iconRes) {
this.mSubId = subId;
this.mIccId = iccId;
this.mSlotId = slotId;
this.mDisplayName = displayname;
this.mNameSource = nameSource;
this.mColor = mColor;
this.mNumber = mNumber;
this.mDispalyNumberFormat = displayFormat;
this.mDataRoaming = roaming;
this.mSimIconRes = iconRes;
}
public static final Parcelable.Creator<SubInfoRecord> CREATOR = new Parcelable.Creator<SubInfoRecord>() {
public SubInfoRecord createFromParcel(Parcel source) {
long mSubId = source.readLong();
String mIccId = source.readString();
int mSlotId = source.readInt();
String mDisplayName = source.readString();
int mNameSource = source.readInt();
int mColor = source.readInt();
String mNumber = source.readString();
int mDispalyNumberFormat = source.readInt();
int mDataRoaming = source.readInt();
int[] iconRes = new int[2];
source.readIntArray(iconRes);
return new SubInfoRecord(mSubId, mIccId, mSlotId, mDisplayName, mNameSource, mColor, mNumber,
mDispalyNumberFormat, mDataRoaming, iconRes);
}
public SubInfoRecord[] newArray(int size) {
return new SubInfoRecord[size];
}
};
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(mSubId);
dest.writeString(mIccId);
dest.writeInt(mSlotId);
dest.writeString(mDisplayName);
dest.writeInt(mNameSource);
dest.writeInt(mColor);
dest.writeString(mNumber);
dest.writeInt(mDispalyNumberFormat);
dest.writeInt(mDataRoaming);
dest.writeIntArray(mSimIconRes);
}
public int describeContents() {
return 0;
}
}
This diff is collapsed.
/*
**
** Copyright (C) 2014 The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
package android.telephony;
parcelable VoLteServiceState;
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.telephony;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.Rlog;
/**
* Contains LTE network state related information.
*
* @hide
*/
public final class VoLteServiceState implements Parcelable {
private static final String LOG_TAG = "VoLteServiceState";
private static final boolean DBG = false;
//Use int max, as -1 is a valid value in signal strength
public static final int INVALID = 0x7FFFFFFF;
public static final int NOT_SUPPORTED = 0;
public static final int SUPPORTED = 1;
// Single Radio Voice Call Continuity(SRVCC) progress state
public static final int HANDOVER_STARTED = 0;
public static final int HANDOVER_COMPLETED = 1;
public static final int HANDOVER_FAILED = 2;
public static final int HANDOVER_CANCELED = 3;
private int mSrvccState;
/**
* Create a new VoLteServiceState from a intent notifier Bundle
*
* This method is used by PhoneStateIntentReceiver and maybe by
* external applications.
*
* @param m Bundle from intent notifier
* @return newly created VoLteServiceState
*
* @hide
*/
public static VoLteServiceState newFromBundle(Bundle m) {
VoLteServiceState ret;
ret = new VoLteServiceState();
ret.setFromNotifierBundle(m);
return ret;
}
/**
* Empty constructor
*
* @hide
*/
public VoLteServiceState() {
initialize();
}
/**
* Constructor
*
* @hide
*/
public VoLteServiceState(int srvccState) {
initialize();
mSrvccState = srvccState;
}
/**
* Copy constructors
*
* @param s Source VoLteServiceState
*
* @hide
*/
public VoLteServiceState(VoLteServiceState s) {
copyFrom(s);
}
/**
* Initialize values to defaults.
*
* @hide
*/
private void initialize() {
mSrvccState = INVALID;
}
/**
* @hide
*/
protected void copyFrom(VoLteServiceState s) {
mSrvccState = s.mSrvccState;
}
/**
* Construct a VoLteServiceState object from the given parcel.
*
* @hide
*/
public VoLteServiceState(Parcel in) {
if (DBG) log("Size of VoLteServiceState parcel:" + in.dataSize());
mSrvccState = in.readInt();
}
/**
* {@link Parcelable#writeToParcel}
*/
public void writeToParcel(Parcel out, int flags) {
out.writeInt(mSrvccState);
}
/**
* {@link Parcelable#describeContents}
*/
public int describeContents() {
return 0;
}
/**
* {@link Parcelable.Creator}
*
* @hide
*/
public static final Parcelable.Creator<VoLteServiceState> CREATOR = new Parcelable.Creator() {
public VoLteServiceState createFromParcel(Parcel in) {
return new VoLteServiceState(in);
}
public VoLteServiceState[] newArray(int size) {
return new VoLteServiceState[size];
}
};
/**
* Validate the individual fields as per the range
* specified in ril.h
* Set to invalid any field that is not in the valid range
*
* @return
* Valid values for all fields
* @hide
*/
public void validateInput() {
}
public int hashCode() {
int primeNum = 31;
return ((mSrvccState * primeNum));
}
/**
* @return true if the LTE network states are the same
*/
@Override
public boolean equals (Object o) {
VoLteServiceState s;
try {
s = (VoLteServiceState) o;
} catch (ClassCastException ex) {
return false;
}
if (o == null) {
return false;
}