diff options
author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-03-03 22:09:19 +0300 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-03-03 22:09:19 +0300 |
commit | aa0ff72b1691cc105f32b893e0c626435438f071 (patch) | |
tree | 6cce4d108b5e8a875b0cd1b1d59aabb60c266210 | |
parent | 74478b165b13e905d5711aa15bc0086561eee11f (diff) | |
parent | 7d2bb077b3f8fbe26bfc623975e6bd6d2ce3188b (diff) | |
download | frameworks_base-aa0ff72b1691cc105f32b893e0c626435438f071.zip frameworks_base-aa0ff72b1691cc105f32b893e0c626435438f071.tar.gz frameworks_base-aa0ff72b1691cc105f32b893e0c626435438f071.tar.bz2 |
Merge "Add Motorola Wrigley 3G RIL." into gingerbread
-rw-r--r-- | telephony/java/com/android/internal/telephony/MotoWrigley3GRIL.java | 69 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/PhoneFactory.java | 3 |
2 files changed, 72 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/MotoWrigley3GRIL.java b/telephony/java/com/android/internal/telephony/MotoWrigley3GRIL.java new file mode 100644 index 0000000..2bf724a --- /dev/null +++ b/telephony/java/com/android/internal/telephony/MotoWrigley3GRIL.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2012 The CyanogenMod 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.content.Context; +import android.os.Parcel; +import android.util.Log; + +import com.android.internal.telephony.gsm.NetworkInfo; +import com.android.internal.telephony.gsm.SuppServiceNotification; + +import java.util.ArrayList; + +/** + * RIL class for Motorola Wrigley 3G RILs which need + * supplementary service notification post-processing + * + * {@hide} + */ +public class MotoWrigley3GRIL extends RIL { + public MotoWrigley3GRIL(Context context) { + super(context); + } + + public MotoWrigley3GRIL(Context context, int networkMode, int cdmaSubscription) { + super(context, networkMode, cdmaSubscription); + } + + @Override + protected Object + responseSuppServiceNotification(Parcel p) { + SuppServiceNotification notification = new SuppServiceNotification(); + + notification.notificationType = p.readInt(); + notification.code = p.readInt(); + notification.index = p.readInt(); + notification.type = p.readInt(); + notification.number = p.readString(); + + /** + * Moto's RIL seems to confuse code2 0 ('forwarded call') and + * 10 ('additional incoming call forwarded') and sends 10 when an + * incoming call is forwarded and _no_ call is currently active. + * It never sends 10 where it would be appropriate, so it's safe + * to just convert every occurence of 10 to 0. + */ + if (notification.notificationType == SuppServiceNotification.NOTIFICATION_TYPE_MT) { + if (notification.code == SuppServiceNotification.MT_CODE_ADDITIONAL_CALL_FORWARDED) { + notification.code = SuppServiceNotification.MT_CODE_FORWARDED_CALL; + } + } + + return notification; + } +} diff --git a/telephony/java/com/android/internal/telephony/PhoneFactory.java b/telephony/java/com/android/internal/telephony/PhoneFactory.java index 80e15d0..72c1aed 100644 --- a/telephony/java/com/android/internal/telephony/PhoneFactory.java +++ b/telephony/java/com/android/internal/telephony/PhoneFactory.java @@ -131,6 +131,9 @@ public class PhoneFactory { } else if ("mototegra".equals(sRILClassname)) { Log.i(LOG_TAG, "Using Motorola Tegra2 RIL"); sCommandsInterface = new MotoTegraRIL(context, networkMode, cdmaSubscription); + } else if ("motow3g".equals(sRILClassname)) { + Log.i(LOG_TAG, "Using Motorola Wrigley 3G RIL"); + sCommandsInterface = new MotoWrigley3GRIL(context, networkMode, cdmaSubscription); } else { sCommandsInterface = new RIL(context, networkMode, cdmaSubscription); } |