Merge commit 'e58e59cc' into fix-merge-conflict

* commit 'e58e59cc':
  ksd to lmp-sprout-dev

Conflicts:
	core/java/android/provider/CallLog.java
	telephony/java/android/telephony/SubInfoRecord.java
	telephony/java/android/telephony/SubscriptionManager.java
	telephony/java/android/telephony/TelephonyManager.java
	telephony/java/com/android/internal/telephony/ISub.aidl
	telephony/java/com/android/internal/telephony/TelephonyIntents.java

Change-Id: I2b892b692743a7ccde55185a2b90135bf28408cd
This commit is contained in:
Wink Saville
2014-09-15 12:40:02 -07:00
14 changed files with 158 additions and 30 deletions

View File

@@ -976,6 +976,8 @@ public class PhoneNumberUtils
return 0xc;
} else if (c == WILD) {
return 0xd;
} else if (c == WAIT) {
return 0xe;
} else {
throw new RuntimeException ("invalid char for BCD " + c);
}
@@ -1813,23 +1815,31 @@ public class PhoneNumberUtils
// to the list.
number = extractNetworkPortionAlt(number);
String numbers = "";
Rlog.d(LOG_TAG, "subId:" + subId + ", number: " + number + ", defaultCountryIso:" +
((defaultCountryIso == null) ? "NULL" : defaultCountryIso));
String emergencyNumbers = "";
int slotId = SubscriptionManager.getSlotId(subId);
// retrieve the list of emergency numbers
// check read-write ecclist property first
String ecclist = (slotId <= 0) ? "ril.ecclist" : ("ril.ecclist" + slotId);
numbers = SystemProperties.get(ecclist);
if (slotId >= 0) {
// retrieve the list of emergency numbers
// check read-write ecclist property first
String ecclist = (slotId == 0) ? "ril.ecclist" : ("ril.ecclist" + slotId);
if (TextUtils.isEmpty(numbers)) {
// then read-only ecclist property since old RIL only uses this
numbers = SystemProperties.get("ro.ril.ecclist");
emergencyNumbers = SystemProperties.get(ecclist, "");
}
if (!TextUtils.isEmpty(numbers)) {
Rlog.d(LOG_TAG, "slotId:" + slotId + ", emergencyNumbers: " + emergencyNumbers);
if (TextUtils.isEmpty(emergencyNumbers)) {
// then read-only ecclist property since old RIL only uses this
emergencyNumbers = SystemProperties.get("ro.ril.ecclist");
}
if (!TextUtils.isEmpty(emergencyNumbers)) {
// searches through the comma-separated list for a match,
// return true if one is found.
for (String emergencyNum : numbers.split(",")) {
for (String emergencyNum : emergencyNumbers.split(",")) {
// It is not possible to append additional digits to an emergency number to dial
// the number in Brazil - it won't connect.
if (useExactMatch || "BR".equalsIgnoreCase(defaultCountryIso)) {
@@ -1849,6 +1859,23 @@ public class PhoneNumberUtils
Rlog.d(LOG_TAG, "System property doesn't provide any emergency numbers."
+ " Use embedded logic for determining ones.");
// If slot id is invalid, means that there is no sim card.
// According spec 3GPP TS22.101, the following numbers should be
// ECC numbers when SIM/USIM is not present.
emergencyNumbers = ((slotId < 0) ? "112,911,000,08,110,118,119,999" : "112,911");
for (String emergencyNum : emergencyNumbers.split(",")) {
if (useExactMatch) {
if (number.equals(emergencyNum)) {
return true;
}
} else {
if (number.startsWith(emergencyNum)) {
return true;
}
}
}
// No ecclist system property, so use our own list.
if (defaultCountryIso != null) {
ShortNumberUtil util = new ShortNumberUtil();
@@ -1857,13 +1884,9 @@ public class PhoneNumberUtils
} else {
return util.connectsToEmergencyNumber(number, defaultCountryIso);
}
} else {
if (useExactMatch) {
return (number.equals("112") || number.equals("911"));
} else {
return (number.startsWith("112") || number.startsWith("911"));
}
}
return false;
}
/**

View File

@@ -20,6 +20,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.telephony.SubscriptionManager;
import android.telephony.CellLocation;
import android.telephony.CellInfo;
import android.telephony.VoLteServiceState;
@@ -31,6 +32,7 @@ import android.telephony.PreciseCallState;
import android.telephony.PreciseDataConnectionState;
import com.android.internal.telephony.IPhoneStateListener;
import com.android.internal.telephony.PhoneConstants;
import java.util.List;
@@ -217,7 +219,7 @@ public class PhoneStateListener {
* @hide
*/
/** @hide */
protected long mSubId = 0;
protected long mSubId = SubscriptionManager.INVALID_SUB_ID;
private final Handler mHandler;
@@ -227,7 +229,7 @@ public class PhoneStateListener {
* own non-null looper use PhoneStateListener(Looper looper) below.
*/
public PhoneStateListener() {
this(SubscriptionManager.DEFAULT_SUB_ID, Looper.myLooper());
this(SubscriptionManager.getDefaultSubId(), Looper.myLooper());
}
/**

View File

@@ -0,0 +1,58 @@
/*
* 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.
*/
package com.android.internal.telephony;
import android.os.Parcelable;
import android.os.Parcel;
public class DcParamObject implements Parcelable {
private long mSubId;
public DcParamObject(long subId) {
mSubId = subId;
}
public DcParamObject(Parcel in) {
readFromParcel(in);
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(mSubId);
}
private void readFromParcel(Parcel in) {
mSubId = in.readLong();
}
public static final Parcelable.Creator<DcParamObject> CREATOR = new Parcelable.Creator<DcParamObject>() {
public DcParamObject createFromParcel(Parcel in) {
return new DcParamObject(in);
}
public DcParamObject[] newArray(int size) {
return new DcParamObject[size];
}
};
public long getSubId() {
return mSubId;
}
}

View File

@@ -115,6 +115,7 @@ public class DctConstants {
public static final int APN_EMERGENCY_ID = 9;
public static final int APN_NUM_TYPES = 10;
public static final int INVALID = -1;
public static final int DISABLED = 0;
public static final int ENABLED = 1;

View File

@@ -44,6 +44,12 @@ interface IPhoneSubInfo {
*/
String getDeviceSvn();
/**
* Retrieves the software version number of a subId for the device, e.g., IMEI/SV
* for GSM phones.
*/
String getDeviceSvnUsingSubId(long subId);
/**
* Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones.
*/

View File

@@ -78,6 +78,23 @@ interface ITelephony {
*/
void answerRingingCall();
/**
* Answer the currently-ringing call on particular subId .
*
* If there's already a current active call, that call will be
* automatically put on hold. If both lines are currently in use, the
* current active call will be ended.
*
* TODO: provide a flag to let the caller specify what policy to use
* if both lines are in use. (The current behavior is hardwired to
* "answer incoming, end ongoing", which is how the CALL button
* is specced to behave.)
*
* TODO: this should be a oneway call (especially since it's called
* directly from the key queue thread).
*/
void answerRingingCallUsingSubId(long subId);
/**
* Silence the ringer if an incoming call is currently ringing.
* (If vibrating, stop the vibrator also.)

View File

@@ -160,9 +160,6 @@ public class PhoneConstants {
public static final int SUB2 = 1;
public static final int SUB3 = 2;
public static final int EVENT_SUBSCRIPTION_ACTIVATED = 500;
public static final int EVENT_SUBSCRIPTION_DEACTIVATED = 501;
// TODO: Remove these constants and use an int instead.
public static final int SIM_ID_1 = 0;
public static final int SIM_ID_2 = 1;
@@ -186,4 +183,7 @@ public class PhoneConstants {
// Initial MTU value.
public static final int UNSET_MTU = 0;
//FIXME maybe this shouldn't be here - sprout only
public static final int CAPABILITY_3G = 1;
}

View File

@@ -291,6 +291,8 @@ cat include/telephony/ril.h | \
int RIL_REQUEST_SET_DC_RT_INFO_RATE = 127;
int RIL_REQUEST_SET_DATA_PROFILE = 128;
int RIL_REQUEST_SHUTDOWN = 129;
int RIL_REQUEST_GET_3G_CAPABILITY = 130;
int RIL_REQUEST_SET_3G_CAPABILITY = 131;
int RIL_UNSOL_RESPONSE_BASE = 1000;
int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000;