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

@@ -62,10 +62,15 @@ public final class ResourcesKey {
return false;
}
ResourcesKey peer = (ResourcesKey) obj;
if (mResDir != peer.mResDir) {
if (mResDir == null || peer.mResDir == null) {
return false;
} else if (!mResDir.equals(peer.mResDir)) {
if ((mResDir == null) && (peer.mResDir != null)) {
return false;
}
if ((mResDir != null) && (peer.mResDir == null)) {
return false;
}
if ((mResDir != null) && (peer.mResDir != null)) {
if (!mResDir.equals(peer.mResDir)) {
return false;
}
}

View File

@@ -271,6 +271,8 @@
<protected-broadcast android:name="android.intent.action.PHONE_STATE" />
<protected-broadcast android:name="android.intent.action.SUB_DEFAULT_CHANGED" />
<protected-broadcast android:name="android.location.GPS_ENABLED_CHANGE" />
<protected-broadcast android:name="android.location.PROVIDERS_CHANGED" />
<protected-broadcast android:name="android.location.MODE_CHANGED" />
@@ -291,6 +293,12 @@
<protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_PROGRESS" />
<protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_DONE" />
<protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.intent.action.ACTION_SUBINFO_CONTENT_CHANGE" />
<protected-broadcast android:name="android.intent.action.ACTION_SUBINFO_RECORD_UPDATED" />
<!-- ====================================== -->
<!-- Permissions for things that cost money -->

View File

@@ -36,7 +36,7 @@
android:id="@+id/sub_short_number"
android:layout_marginBottom="2dip"
android:layout_marginEnd="4dip"
android:layout_alignParentEnd="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:textSize="12sp"
android:singleLine="true"
@@ -54,8 +54,6 @@
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"
@@ -65,8 +63,7 @@
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>
</LinearLayout>

View File

@@ -1010,6 +1010,9 @@
device is data-only. -->
<bool name="config_voice_capable">true</bool>
<!-- Flag indicating if the user is notified when the mobile network access is restricted -->
<bool name="config_user_notification_of_restrictied_mobile_access">true</bool>
<!-- Flag indicating whether the current device allows sms service.
If true, this means that the device supports both sending and
receiving sms via the telephony network.

View File

@@ -1717,6 +1717,11 @@
<string name="permdesc_hardware_test">Allows the app to control
various peripherals for the purpose of hardware testing.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_fm">access FM radio</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_fm">Allows the app to access FM radio to listen to programs.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_callPhone">directly call phone numbers</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->

View File

@@ -267,6 +267,7 @@
<java-symbol type="bool" name="config_ui_enableFadingMarquee" />
<java-symbol type="bool" name="config_use_strict_phone_number_comparation" />
<java-symbol type="bool" name="config_voice_capable" />
<java-symbol type="bool" name="config_user_notification_of_restrictied_mobile_access" />
<java-symbol type="bool" name="config_wifiDisplaySupportsProtectedBuffers" />
<java-symbol type="bool" name="preferences_prefer_dual_pane" />
<java-symbol type="bool" name="skip_restoring_network_selection" />

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;