summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmds/idmap/create.cpp5
-rw-r--r--core/java/android/widget/OverScroller.java16
-rw-r--r--core/java/android/widget/Scroller.java9
-rw-r--r--core/jni/com_android_internal_app_ActivityTrigger.cpp2
-rw-r--r--core/jni/com_android_internal_content_NativeLibraryHelper.cpp36
-rw-r--r--core/res/res/drawable-hdpi/ic_lock_power_reboot_alpha.pngbin0 -> 1459 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_lock_power_reboot_alpha.pngbin0 -> 1307 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ic_lock_power_reboot_alpha.pngbin0 -> 1674 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ic_lock_power_reboot_alpha.pngbin0 -> 1921 bytes
-rw-r--r--core/res/res/drawable/ic_lock_power_reboot.xml33
-rw-r--r--core/res/res/values-zh-rCN/strings.xml4
-rwxr-xr-xcore/res/res/values/config.xml7
-rw-r--r--core/res/res/values/strings.xml11
-rwxr-xr-xcore/res/res/values/symbols.xml11
-rw-r--r--packages/Keyguard/res/values/strings.xml6
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java109
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java1
-rw-r--r--services/Android.mk5
-rw-r--r--services/core/java/com/android/server/Watchdog.java42
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java22
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java30
-rw-r--r--services/core/java/com/android/server/am/ProcessList.java2
-rw-r--r--services/core/java/com/android/server/policy/GlobalActions.java33
-rw-r--r--services/core/java/com/android/server/power/ShutdownThread.java18
-rw-r--r--services/core/jni/com_android_server_tv_TvInputHal.cpp60
-rw-r--r--services/libtvextensions/Android.mk21
-rw-r--r--services/libtvextensions/common/ExtensionsLoader.hpp91
-rw-r--r--services/libtvextensions/common/TvInputHalExtensionsCommon.h69
-rw-r--r--services/libtvextensions/jni/BufferProducerThread.h89
-rw-r--r--services/libtvextensions/jni/TvInputHalExtensions.h54
-rw-r--r--services/libtvextensions/jni/TvInputHalFactory.cpp56
-rw-r--r--telecomm/java/android/telecom/Call.java5
-rw-r--r--telecomm/java/android/telecom/InCallService.java9
-rw-r--r--telecomm/java/android/telecom/Phone.java6
-rw-r--r--telecomm/java/com/android/internal/telecom/IInCallService.aidl2
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java8
-rw-r--r--telephony/java/com/android/internal/telephony/IExtTelephony.aidl7
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl94
-rwxr-xr-xtelephony/java/com/android/internal/telephony/RILConstants.java3
39 files changed, 872 insertions, 104 deletions
diff --git a/cmds/idmap/create.cpp b/cmds/idmap/create.cpp
index 41395f1..929f047 100644
--- a/cmds/idmap/create.cpp
+++ b/cmds/idmap/create.cpp
@@ -33,6 +33,7 @@ namespace {
int open_idmap(const char *path)
{
int fd = TEMP_FAILURE_RETRY(open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644));
+ bool needUnlink = true;
if (fd == -1) {
ALOGD("error: open %s: %s\n", path, strerror(errno));
goto fail;
@@ -43,6 +44,8 @@ namespace {
}
if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX | LOCK_NB)) != 0) {
ALOGD("error: flock %s: %s\n", path, strerror(errno));
+ // If the file is locked by another process, then we needn't unlink the file.
+ needUnlink = false;
goto fail;
}
@@ -50,7 +53,7 @@ namespace {
fail:
if (fd != -1) {
close(fd);
- unlink(path);
+ if (needUnlink) unlink(path);
}
return -1;
}
diff --git a/core/java/android/widget/OverScroller.java b/core/java/android/widget/OverScroller.java
index 4cb1514..778b2dd 100644
--- a/core/java/android/widget/OverScroller.java
+++ b/core/java/android/widget/OverScroller.java
@@ -609,6 +609,7 @@ public class OverScroller {
private boolean mIsPerfLockAcquired = false;
private boolean mIsPerfBoostEnabled = false;
private int fBoostTimeOut = 0;
+ private int flingBoostTimeOut = 0;
private int fBoostParamVal[];
static {
@@ -664,6 +665,10 @@ public class OverScroller {
fBoostParamVal = context.getResources().getIntArray(
com.android.internal.R.array.flingboost_param_value);
}
+
+ if (mPerf == null && mIsPerfBoostEnabled) {
+ mPerf = new BoostFramework();
+ }
}
void updateScroll(float q) {
@@ -786,16 +791,17 @@ public class OverScroller {
if (velocity != 0) {
mDuration = mSplineDuration = getSplineFlingDuration(velocity);
totalDistance = getSplineFlingDistance(velocity);
- if (mPerf == null && mIsPerfBoostEnabled) {
- mPerf = new BoostFramework();
- }
if (mPerf != null) {
mIsPerfLockAcquired = true;
if (0 == fBoostTimeOut) {
- fBoostTimeOut = mDuration;
+ //config value is not defined
+ flingBoostTimeOut = mDuration;
+ } else {
+ //config value is present
+ flingBoostTimeOut = fBoostTimeOut;
}
- mPerf.perfLockAcquire(fBoostTimeOut, fBoostParamVal);
+ mPerf.perfLockAcquire(flingBoostTimeOut, fBoostParamVal);
}
}
diff --git a/core/java/android/widget/Scroller.java b/core/java/android/widget/Scroller.java
index 96e6b9d..d0ba9e6 100644
--- a/core/java/android/widget/Scroller.java
+++ b/core/java/android/widget/Scroller.java
@@ -117,6 +117,7 @@ public class Scroller {
private BoostFramework mPerf = null;
boolean bIsPerfBoostEnabled = false;
private int sBoostTimeOut = 0;
+ private int scrollBoostTimeOut = 0;
private int sBoostParamVal[];
// A context-specific coefficient adjusted to physical values.
@@ -422,9 +423,13 @@ public class Scroller {
if ((mPerf != null) && (duration != 0)) {
if (0 == sBoostTimeOut) {
- sBoostTimeOut = mDuration;
+ //config value is not defined
+ scrollBoostTimeOut = mDuration;
+ } else {
+ //config value is present
+ scrollBoostTimeOut = sBoostTimeOut;
}
- mPerf.perfLockAcquire(sBoostTimeOut, sBoostParamVal);
+ mPerf.perfLockAcquire(scrollBoostTimeOut, sBoostParamVal);
}
}
diff --git a/core/jni/com_android_internal_app_ActivityTrigger.cpp b/core/jni/com_android_internal_app_ActivityTrigger.cpp
index 27e63e0..8ba9e06d 100644
--- a/core/jni/com_android_internal_app_ActivityTrigger.cpp
+++ b/core/jni/com_android_internal_app_ActivityTrigger.cpp
@@ -68,6 +68,8 @@ static dlLibHandler mDlLibHandlers[] = {
"ro.vendor.at_library"},
{NULL, NULL, NULL, NULL, NULL,
"ro.vendor.gt_library"},
+ {NULL, NULL, NULL, NULL, NULL,
+ "ro.vendor.wl_library"}
};
// ----------------------------------------------------------------------------
diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
index daa6f82..f7f19b4 100644
--- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
+++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
@@ -36,7 +36,7 @@
#include <inttypes.h>
#include <sys/stat.h>
#include <sys/types.h>
-
+#include <dlfcn.h>
#define APK_LIB "lib/"
#define APK_LIB_LEN (sizeof(APK_LIB) - 1)
@@ -55,6 +55,10 @@
#define TMP_FILE_PATTERN "/tmp.XXXXXX"
#define TMP_FILE_PATTERN_LEN (sizeof(TMP_FILE_PATTERN) - 1)
+#define LIB_UNINIT 0
+#define LIB_INITED_AND_FAIL -1
+#define LIB_INITED_AND_SUCCESS 1
+
namespace android {
// These match PackageManager.java install codes
@@ -70,6 +74,24 @@ enum install_status_t {
typedef install_status_t (*iterFunc)(JNIEnv*, void*, ZipFileRO*, ZipEntryRO, const char*);
+typedef int (*PGetAssetsStatusFunc) (ZipFileRO*, Vector<ScopedUtfChars*>, const int);
+static PGetAssetsStatusFunc GetAssetsStatusFunc = NULL;
+static int g_assetLibInit = LIB_UNINIT;
+
+static int initAssetsVerifierLib() {
+ if (g_assetLibInit != LIB_UNINIT) return g_assetLibInit;
+ void* handle = dlopen("libassetsverifier.so", RTLD_NOW);
+ if (handle != NULL) {
+ GetAssetsStatusFunc = (PGetAssetsStatusFunc)dlsym(handle, "getAssetsStatus");
+ if (GetAssetsStatusFunc != NULL) {
+ g_assetLibInit = LIB_INITED_AND_SUCCESS;
+ } else {
+ g_assetLibInit = LIB_INITED_AND_FAIL;
+ }
+ }
+ return g_assetLibInit;
+}
+
// Equivalent to android.os.FileUtils.isFilenameSafe
static bool
isFilenameSafe(const char* filename)
@@ -477,6 +499,18 @@ static int findSupportedAbi(JNIEnv *env, jlong apkHandle, jobjectArray supported
}
}
}
+ int asset_status = NO_NATIVE_LIBRARIES;
+
+ int rc = initAssetsVerifierLib();
+ if (rc == LIB_INITED_AND_SUCCESS) {
+ asset_status = GetAssetsStatusFunc(zipFile, supportedAbis, numAbis);
+ } else {
+ ALOGE("Failed to load assets verifier: %d", rc);
+ }
+ if (asset_status == 1) {
+ // override the status if asset_status hints at 32-bit abi
+ status = 1;
+ }
for (int i = 0; i < numAbis; ++i) {
delete supportedAbis[i];
diff --git a/core/res/res/drawable-hdpi/ic_lock_power_reboot_alpha.png b/core/res/res/drawable-hdpi/ic_lock_power_reboot_alpha.png
new file mode 100644
index 0000000..17b4866
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_lock_power_reboot_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lock_power_reboot_alpha.png b/core/res/res/drawable-mdpi/ic_lock_power_reboot_alpha.png
new file mode 100644
index 0000000..471a41c
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_lock_power_reboot_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lock_power_reboot_alpha.png b/core/res/res/drawable-xhdpi/ic_lock_power_reboot_alpha.png
new file mode 100644
index 0000000..a786b40
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_lock_power_reboot_alpha.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_lock_power_reboot_alpha.png b/core/res/res/drawable-xxhdpi/ic_lock_power_reboot_alpha.png
new file mode 100644
index 0000000..6072387
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ic_lock_power_reboot_alpha.png
Binary files differ
diff --git a/core/res/res/drawable/ic_lock_power_reboot.xml b/core/res/res/drawable/ic_lock_power_reboot.xml
new file mode 100644
index 0000000..82c7927
--- /dev/null
+++ b/core/res/res/drawable/ic_lock_power_reboot.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2014, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_lock_power_reboot_alpha"
+ android:tint="?attr/colorControlNormal" />
+
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index 5f51235..fcfc1ff 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -201,6 +201,9 @@
<string name="shutdown_confirm_question" msgid="2906544768881136183">"您要关机吗?"</string>
<string name="reboot_safemode_title" msgid="7054509914500140361">"重新启动并进入安全模式"</string>
<string name="reboot_safemode_confirm" msgid="55293944502784668">"您要重新启动并进入安全模式吗?这样会停用您已安装的所有第三方应用。再次重新启动将恢复这些应用。"</string>
+ <string name="reboot_title">"重启"</string>
+ <string name="reboot_confirm" product="tablet">"您的平板电脑将会重启。"</string>
+ <string name="reboot_confirm" product="default">"您的手机将会重启。"</string>
<string name="recent_tasks_title" msgid="3691764623638127888">"近期任务"</string>
<string name="no_recent_tasks" msgid="8794906658732193473">"最近没有运行任何应用"</string>
<string name="global_actions" product="tablet" msgid="408477140088053665">"平板电脑选项"</string>
@@ -208,6 +211,7 @@
<string name="global_actions" product="default" msgid="2406416831541615258">"手机选项"</string>
<string name="global_action_lock" msgid="2844945191792119712">"屏幕锁定"</string>
<string name="global_action_power_off" msgid="4471879440839879722">"关机"</string>
+ <string name="global_action_reboot">"重启"</string>
<string name="global_action_bug_report" msgid="7934010578922304799">"错误报告"</string>
<string name="bugreport_title" msgid="2667494803742548533">"提交错误报告"</string>
<string name="bugreport_message" msgid="398447048750350456">"这会收集有关当前设备状态的信息,并以电子邮件的形式进行发送。从开始生成错误报告到准备好发送需要一点时间,请耐心等待。"</string>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 6a10f4c..0425288 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2346,11 +2346,14 @@
<!-- Whether cpu boost is enabled for AppLaunch -->
<bool name="config_enableCpuBoostForAppLaunch">false</bool>
- <integer name="disablepacking_timeout_param">0</integer>
- <integer-array name="launchboost_packing_param_value"/>
<integer name="launchboost_timeout_param">0</integer>
<integer-array name="launchboost_param_value"/>
+ <!-- Whether disablepacking is enabled or not -->
+ <bool name="config_disablePacking">false</bool>
+ <integer name="disablepacking_timeout_param">0</integer>
+ <integer-array name="launchboost_packing_param_value"/>
+
<!-- Whether cpu boost is enabled for animation. -->
<bool name="config_enablePerfBoostForAnimation">false</bool>
<integer name="animationboost_timeout_param">0</integer>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 0b73760..bec1600 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -457,6 +457,14 @@
This will disable all third party applications you have installed.
They will be restored when you reboot again.</string>
+ <!-- Title of dialog to confirm rebooting. -->
+ <string name="reboot_title">Reboot</string>
+
+ <!-- Reboot Confirmation Dialog. When the user chooses to reboot the device, there will
+ be a confirmation dialog. This is the message. -->
+ <string name="reboot_confirm" product="tablet">Your tablet will reboot.</string>
+ <string name="reboot_confirm" product="default">Your phone will reboot.</string>
+
<!-- Recent Tasks dialog: title
TODO: this should move to SystemUI.apk, but the code for the old
recent dialog is still in the framework
@@ -481,6 +489,9 @@
<!-- label for item that turns off power in phone options dialog -->
<string name="global_action_power_off">Power off</string>
+ <!-- label for item that reboots the phone in phone options dialog -->
+ <string name="global_action_reboot">Reboot</string>
+
<!-- label for item that generates a bug report in the phone options dialog -->
<string name="global_action_bug_report">Bug report</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index a281e67..7407e60 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -818,8 +818,10 @@
<java-symbol type="string" name="reboot_to_update_reboot" />
<java-symbol type="string" name="reboot_to_reset_title" />
<java-symbol type="string" name="reboot_to_reset_message" />
+ <java-symbol type="string" name="reboot_confirm" />
<java-symbol type="string" name="reboot_safemode_confirm" />
<java-symbol type="string" name="reboot_safemode_title" />
+ <java-symbol type="string" name="reboot_title" />
<java-symbol type="string" name="relationTypeAssistant" />
<java-symbol type="string" name="relationTypeBrother" />
<java-symbol type="string" name="relationTypeChild" />
@@ -1482,6 +1484,7 @@
<java-symbol type="drawable" name="ic_jog_dial_vibrate_on" />
<java-symbol type="drawable" name="ic_lock_airplane_mode" />
<java-symbol type="drawable" name="ic_lock_airplane_mode_off" />
+ <java-symbol type="drawable" name="ic_lock_power_reboot" />
<java-symbol type="drawable" name="ic_menu_cc" />
<java-symbol type="drawable" name="jog_tab_bar_left_unlock" />
<java-symbol type="drawable" name="jog_tab_bar_right_sound_off" />
@@ -1552,6 +1555,7 @@
<java-symbol type="string" name="bugreport_status" />
<java-symbol type="string" name="faceunlock_multiple_failures" />
<java-symbol type="string" name="global_action_power_off" />
+ <java-symbol type="string" name="global_action_reboot" />
<java-symbol type="string" name="global_actions_airplane_mode_off_status" />
<java-symbol type="string" name="global_actions_airplane_mode_on_status" />
<java-symbol type="string" name="global_actions_toggle_airplane_mode" />
@@ -2340,11 +2344,14 @@
<!-- cpu boost for AppLaunch -->
<java-symbol type="bool" name="config_enableCpuBoostForAppLaunch" />
- <java-symbol type="integer" name="disablepacking_timeout_param" />
- <java-symbol type="array" name="launchboost_packing_param_value"/>
<java-symbol type="integer" name="launchboost_timeout_param" />
<java-symbol type="array" name="launchboost_param_value" />
+ <!-- cpu boost for AppLaunch -->
+ <java-symbol type="bool" name="config_disablePacking" />
+ <java-symbol type="integer" name="disablepacking_timeout_param" />
+ <java-symbol type="array" name="launchboost_packing_param_value" />
+
<!-- cpu boost for Animationboost -->
<java-symbol type="bool" name="config_enablePerfBoostForAnimation" />
<java-symbol type="integer" name="animationboost_timeout_param" />
diff --git a/packages/Keyguard/res/values/strings.xml b/packages/Keyguard/res/values/strings.xml
index 4837911..45e2827 100644
--- a/packages/Keyguard/res/values/strings.xml
+++ b/packages/Keyguard/res/values/strings.xml
@@ -343,4 +343,10 @@
<!-- Fingerprint hint message when finger was not recognized.-->
<string name="fingerprint_not_recognized">Not recognized</string>
+ <!-- Instructions telling the user remaining times when enter SIM PIN view. -->
+ <plurals name="kg_password_default_pin_message">
+ <item quantity="one">Enter SIM PIN, you have <xliff:g id="number">%d</xliff:g> remaining attempt before you must contact your carrier to unlock your device.</item>
+ <item quantity="other">Enter SIM PIN, you have <xliff:g id="number">%d</xliff:g> remaining attempts.</item>
+ </plurals>
+
</resources>
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
index aeac912..9dcef3a 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
@@ -49,7 +49,8 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
private ProgressDialog mSimUnlockProgressDialog = null;
private CheckSimPin mCheckSimPinThread;
-
+ private boolean mShowDefaultMessage = true;
+ private int mRemainingAttempts = -1;
private AlertDialog mRemainingAttemptsDialog;
private int mSubId;
private ImageView mSimImageView;
@@ -58,7 +59,12 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
@Override
public void onSimStateChanged(int subId, int slotId, State simState) {
if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",state=" + simState + ")");
- resetState();
+ switch (simState) {
+ case NOT_READY:
+ case ABSENT:
+ closeKeyGuard();
+ break;
+ }
};
};
@@ -73,25 +79,8 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
public void resetState() {
super.resetState();
if (DEBUG) Log.v(TAG, "Resetting state");
- KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
- mSubId = monitor.getNextSubIdForState(IccCardConstants.State.PIN_REQUIRED);
- if (SubscriptionManager.isValidSubscriptionId(mSubId)) {
- int count = TelephonyManager.getDefault().getSimCount();
- Resources rez = getResources();
- final String msg;
- int color = Color.WHITE;
- if (count < 2) {
- msg = rez.getString(R.string.kg_sim_pin_instructions);
- } else {
- SubscriptionInfo info = monitor.getSubscriptionInfoForSubId(mSubId);
- CharSequence displayName = info != null ? info.getDisplayName() : ""; // don't crash
- msg = rez.getString(R.string.kg_sim_pin_instructions_multi, displayName);
- if (info != null) {
- color = info.getIconTint();
- }
- }
- mSecurityMessageDisplay.setMessage(msg, true);
- mSimImageView.setImageTintList(ColorStateList.valueOf(color));
+ if (mShowDefaultMessage) {
+ showDefaultMessage();
}
}
@@ -101,17 +90,19 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
return 0;
}
- private String getPinPasswordErrorMessage(int attemptsRemaining) {
+ private String getPinPasswordErrorMessage(int attemptsRemaining, boolean isDefault) {
String displayMessage;
-
+ int msgId;
if (attemptsRemaining == 0) {
displayMessage = getContext().getString(R.string.kg_password_wrong_pin_code_pukked);
} else if (attemptsRemaining > 0) {
+ msgId = isDefault ? R.plurals.kg_password_default_pin_message :
+ R.plurals.kg_password_wrong_pin_code;
displayMessage = getContext().getResources()
- .getQuantityString(R.plurals.kg_password_wrong_pin_code, attemptsRemaining,
- attemptsRemaining);
+ .getQuantityString(msgId, attemptsRemaining, attemptsRemaining);
} else {
- displayMessage = getContext().getString(R.string.kg_password_pin_failed);
+ msgId = isDefault ? R.string.kg_sim_pin_instructions : R.string.kg_password_pin_failed;
+ displayMessage = getContext().getString(msgId);
}
if (DEBUG) Log.d(LOG_TAG, "getPinPasswordErrorMessage:"
+ " attemptsRemaining=" + attemptsRemaining + " displayMessage=" + displayMessage);
@@ -143,6 +134,9 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
+ if (mShowDefaultMessage) {
+ showDefaultMessage();
+ }
KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mUpdateMonitorCallback);
}
@@ -221,7 +215,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
}
private Dialog getSimRemainingAttemptsDialog(int remaining) {
- String msg = getPinPasswordErrorMessage(remaining);
+ String msg = getPinPasswordErrorMessage(remaining, false);
if (mRemainingAttemptsDialog == null) {
Builder builder = new AlertDialog.Builder(mContext);
builder.setMessage(msg);
@@ -255,15 +249,15 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
void onSimCheckResponse(final int result, final int attemptsRemaining) {
post(new Runnable() {
public void run() {
+ mRemainingAttempts = attemptsRemaining;
if (mSimUnlockProgressDialog != null) {
mSimUnlockProgressDialog.hide();
}
resetPasswordText(true /* animate */);
if (result == PhoneConstants.PIN_RESULT_SUCCESS) {
- KeyguardUpdateMonitor.getInstance(getContext())
- .reportSimUnlocked(mSubId);
- mCallback.dismiss(true);
+ closeKeyGuard();
} else {
+ mShowDefaultMessage = false;
if (result == PhoneConstants.PIN_PASSWORD_INCORRECT) {
if (attemptsRemaining <= 2) {
// this is getting critical - show dialog
@@ -271,7 +265,8 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
} else {
// show message
mSecurityMessageDisplay.setMessage(
- getPinPasswordErrorMessage(attemptsRemaining), true);
+ getPinPasswordErrorMessage(
+ attemptsRemaining, false), true);
}
} else {
// "PIN operation failed!" - no idea what this was and no way to
@@ -302,5 +297,57 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
public boolean startDisappearAnimation(Runnable finishRunnable) {
return false;
}
+
+ private void closeKeyGuard() {
+ if (DEBUG) Log.d(TAG, "closeKeyGuard: Verification Completed, closing Keyguard.");
+ mRemainingAttempts = -1;
+ KeyguardUpdateMonitor.getInstance(getContext())
+ .reportSimUnlocked(mSubId);
+ mCallback.dismiss(true);
+ mShowDefaultMessage = true;
+ reset();
+ }
+
+ private void showDefaultMessage() {
+ KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
+ mSubId = monitor.getNextSubIdForState(IccCardConstants.State.PIN_REQUIRED);
+ if (!SubscriptionManager.isValidSubscriptionId(mSubId)) {
+ return;
+ }
+ if (mRemainingAttempts >= 0) {
+ mSecurityMessageDisplay.setMessage(getPinPasswordErrorMessage(
+ mRemainingAttempts, true), true);
+ return;
+ }
+
+ int count = TelephonyManager.getDefault().getSimCount();
+ Resources rez = getResources();
+ final String msg;
+ int color = Color.WHITE;
+ if (count < 2) {
+ msg = rez.getString(R.string.kg_sim_pin_instructions);
+ } else {
+ SubscriptionInfo info = monitor.getSubscriptionInfoForSubId(mSubId);
+ CharSequence displayName = info != null ? info.getDisplayName() : ""; // don't crash
+ msg = rez.getString(R.string.kg_sim_pin_instructions_multi, displayName);
+ if (info != null) {
+ color = info.getIconTint();
+ }
+ }
+ mSecurityMessageDisplay.setMessage(msg, true);
+ mSimImageView.setImageTintList(ColorStateList.valueOf(color));
+
+ new CheckSimPin("", mSubId) {
+ void onSimCheckResponse(final int result, final int attemptsRemaining) {
+ Log.d(LOG_TAG, "onSimCheckResponse " + " dummy One result" + result +
+ " attemptsRemaining=" + attemptsRemaining);
+ if (attemptsRemaining >= 0) {
+ mRemainingAttempts = attemptsRemaining;
+ mSecurityMessageDisplay.setMessage(
+ getPinPasswordErrorMessage(attemptsRemaining, true), true);
+ }
+ }
+ }.start();
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index f7c3c67..cc30882 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -250,6 +250,7 @@ public class SignalClusterView
@Override
public void setNoSims(boolean show) {
mNoSimsVisible = show && !mBlockMobile;
+ apply();
}
@Override
diff --git a/services/Android.mk b/services/Android.mk
index 1918db5..ecbddaa 100644
--- a/services/Android.mk
+++ b/services/Android.mk
@@ -48,6 +48,11 @@ LOCAL_SHARED_LIBRARIES :=
# include all the jni subdirs to collect their sources
include $(wildcard $(LOCAL_PATH)/*/jni/Android.mk)
+LOCAL_C_INCLUDES += \
+ $(TOP)/frameworks/base/services/libtvextensions \
+
+LOCAL_WHOLE_STATIC_LIBRARIES := libTvInputHalExtensions
+
LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
LOCAL_MODULE:= libandroid_servers
diff --git a/services/core/java/com/android/server/Watchdog.java b/services/core/java/com/android/server/Watchdog.java
index 772a15c..22529a3 100644
--- a/services/core/java/com/android/server/Watchdog.java
+++ b/services/core/java/com/android/server/Watchdog.java
@@ -42,6 +42,8 @@ import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Date;
+import java.text.SimpleDateFormat;
/** This class calls its monitor every minute. Killing this process if they don't return **/
public class Watchdog extends Thread {
@@ -80,6 +82,7 @@ public class Watchdog extends Thread {
int mPhonePid;
IActivityController mController;
boolean mAllowRestart = true;
+ SimpleDateFormat mTraceDateFormat = new SimpleDateFormat("dd_MMM_HH_mm_ss.SSS");
/**
* Used for checking status of handle threads and scheduling monitor callbacks.
@@ -428,9 +431,22 @@ public class Watchdog extends Thread {
dumpKernelStackTraces();
}
- // Trigger the kernel to dump all blocked threads, and backtraces on all CPUs to the kernel log
- doSysRq('w');
- doSysRq('l');
+ String tracesPath = SystemProperties.get("dalvik.vm.stack-trace-file", null);
+ String traceFileNameAmendment = "_SystemServer_WDT" + mTraceDateFormat.format(new Date());
+
+ if (tracesPath != null && tracesPath.length() != 0) {
+ File traceRenameFile = new File(tracesPath);
+ String newTracesPath;
+ int lpos = tracesPath.lastIndexOf (".");
+ if (-1 != lpos)
+ newTracesPath = tracesPath.substring (0, lpos) + traceFileNameAmendment + tracesPath.substring (lpos);
+ else
+ newTracesPath = tracesPath + traceFileNameAmendment;
+ traceRenameFile.renameTo(new File(newTracesPath));
+ tracesPath = newTracesPath;
+ }
+
+ final File newFd = new File(tracesPath);
// Try to add the error to the dropbox, but assuming that the ActivityManager
// itself may be deadlocked. (which has happened, causing this statement to
@@ -439,7 +455,7 @@ public class Watchdog extends Thread {
public void run() {
mActivity.addErrorToDropBox(
"watchdog", null, "system_server", null, null,
- subject, null, stack, null);
+ subject, null, newFd, null);
}
};
dropboxThread.start();
@@ -447,6 +463,24 @@ public class Watchdog extends Thread {
dropboxThread.join(2000); // wait up to 2 seconds for it to return.
} catch (InterruptedException ignored) {}
+ // Trigger the kernel to dump all blocked threads, and backtraces on all CPUs to the kernel log
+ Slog.e(TAG, "Triggering SysRq for system_server watchdog");
+ doSysRq('w');
+ doSysRq('l');
+
+ // At times, when user space watchdog traces don't give an indication on
+ // which component held a lock, because of which other threads are blocked,
+ // (thereby causing Watchdog), crash the device to analyze RAM dumps
+ boolean crashOnWatchdog = SystemProperties
+ .getBoolean("persist.sys.crashOnWatchdog", false);
+ if (crashOnWatchdog) {
+ // wait until the above blocked threads be dumped into kernel log
+ SystemClock.sleep(3000);
+
+ // now try to crash the target
+ doSysRq('c');
+ }
+
IActivityController controller;
synchronized (this) {
controller = mController;
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 19b5830..2f3cdf7 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -260,6 +260,8 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
+import java.util.Date;
+import java.text.SimpleDateFormat;
public final class ActivityManagerService extends ActivityManagerNative
implements Watchdog.Monitor, BatteryStatsImpl.BatteryCallback {
@@ -481,6 +483,8 @@ public final class ActivityManagerService extends ActivityManagerNative
*/
String mDeviceOwnerName;
+ SimpleDateFormat mTraceDateFormat = new SimpleDateFormat("dd_MMM_HH_mm_ss.SSS");
+
public class PendingAssistExtras extends Binder implements Runnable {
public final ActivityRecord activity;
public final Bundle extras;
@@ -5071,6 +5075,24 @@ public final class ActivityManagerService extends ActivityManagerNative
annotation != null ? "ANR " + annotation : "ANR",
info.toString());
+ //Set the trace file name to app name + current date format to avoid overrinding trace file
+ String tracesPath = SystemProperties.get("dalvik.vm.stack-trace-file", null);
+ if (tracesPath != null && tracesPath.length() != 0) {
+ File traceRenameFile = new File(tracesPath);
+ String newTracesPath;
+ int lpos = tracesPath.lastIndexOf (".");
+ if (-1 != lpos)
+ newTracesPath = tracesPath.substring (0, lpos) + "_" + app.processName + "_" + mTraceDateFormat.format(new Date()) + tracesPath.substring (lpos);
+ else
+ newTracesPath = tracesPath + "_" + app.processName;
+
+ traceRenameFile.renameTo(new File(newTracesPath));
+ Process.sendSignal(app.pid, 6);
+ SystemClock.sleep(1000);
+ Process.sendSignal(app.pid, 6);
+ SystemClock.sleep(1000);
+ }
+
// Bring up the infamous App Not Responding dialog
Message msg = Message.obtain();
HashMap<String, Object> map = new HashMap<String, Object>();
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 332d75e..a4c8882 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -161,9 +161,11 @@ public final class ActivityStackSupervisor implements DisplayListener {
static final int RESUME_TOP_ACTIVITY_MSG = FIRST_SUPERVISOR_STACK_MSG + 2;
static final int SLEEP_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 3;
static final int LAUNCH_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 4;
- public BoostFramework mPerf = null;
public BoostFramework mPerf_iop = null;
+ public BoostFramework mPerfBoost = null;
+ public BoostFramework mPerfPack = null;
public boolean mIsPerfBoostEnabled = false;
+ public boolean mIsperfDisablepackingEnable = false;
public int lBoostTimeOut = 0;
public int lDisPackTimeOut = 0;
public int lBoostCpuParamVal[];
@@ -352,13 +354,19 @@ public final class ActivityStackSupervisor implements DisplayListener {
/* Is perf lock for cpu-boost enabled during App 1st launch */
mIsPerfBoostEnabled = mService.mContext.getResources().getBoolean(
com.android.internal.R.bool.config_enableCpuBoostForAppLaunch);
+ mIsperfDisablepackingEnable = mService.mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_disablePacking);
+
if(mIsPerfBoostEnabled) {
lBoostTimeOut = mService.mContext.getResources().getInteger(
com.android.internal.R.integer.launchboost_timeout_param);
+ lBoostCpuParamVal = mService.mContext.getResources().getIntArray(
+ com.android.internal.R.array.launchboost_param_value);
+ }
+
+ if(mIsperfDisablepackingEnable) {
lDisPackTimeOut = mService.mContext.getResources().getInteger(
com.android.internal.R.integer.disablepacking_timeout_param);
- lBoostCpuParamVal = mService.mContext.getResources().getIntArray(
- com.android.internal.R.array.launchboost_param_value);
lBoostPackParamVal = mService.mContext.getResources().getIntArray(
com.android.internal.R.array.launchboost_packing_param_value);
}
@@ -3063,12 +3071,18 @@ public final class ActivityStackSupervisor implements DisplayListener {
void acquireAppLaunchPerfLock() {
/* Acquire perf lock during new app launch */
- if (mIsPerfBoostEnabled == true && mPerf == null) {
- mPerf = new BoostFramework();
+ if (mIsperfDisablepackingEnable == true && mPerfPack == null) {
+ mPerfPack = new BoostFramework();
+ }
+ if (mPerfPack != null) {
+ mPerfPack.perfLockAcquire(lDisPackTimeOut, lBoostPackParamVal);
+ }
+
+ if (mIsPerfBoostEnabled == true && mPerfBoost == null) {
+ mPerfBoost = new BoostFramework();
}
- if (mPerf != null) {
- mPerf.perfLockAcquire(lDisPackTimeOut, lBoostPackParamVal);
- mPerf.perfLockAcquire(lBoostTimeOut, lBoostCpuParamVal);
+ if (mPerfBoost != null) {
+ mPerfBoost.perfLockAcquire(lBoostTimeOut, lBoostCpuParamVal);
}
}
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index de706e7..8630f00 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -136,7 +136,7 @@ final class ProcessList {
// process limit.
static final int MAX_CACHED_APPS = SystemProperties.getInt("ro.sys.fw.bg_apps_limit",32);
static final boolean USE_TRIM_SETTINGS =
- SystemProperties.getBoolean("ro.sys.fw.use_trim_settings",true);
+ SystemProperties.getBoolean("ro.sys.fw.use_trim_settings",false);
static final int EMPTY_APP_PERCENT = SystemProperties.getInt("ro.sys.fw.empty_app_percent",50);
static final int TRIM_EMPTY_PERCENT =
SystemProperties.getInt("ro.sys.fw.trim_empty_percent",100);
diff --git a/services/core/java/com/android/server/policy/GlobalActions.java b/services/core/java/com/android/server/policy/GlobalActions.java
index 3cee927..8e73495 100644
--- a/services/core/java/com/android/server/policy/GlobalActions.java
+++ b/services/core/java/com/android/server/policy/GlobalActions.java
@@ -40,6 +40,7 @@ import android.net.ConnectivityManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
+import android.os.IPowerManager;
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -93,6 +94,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
/* Valid settings for global actions keys.
* see config.xml config_globalActionList */
private static final String GLOBAL_ACTION_KEY_POWER = "power";
+ private static final String GLOBAL_ACTION_KEY_REBOOT = "reboot";
private static final String GLOBAL_ACTION_KEY_AIRPLANE = "airplane";
private static final String GLOBAL_ACTION_KEY_BUGREPORT = "bugreport";
private static final String GLOBAL_ACTION_KEY_SILENT = "silent";
@@ -273,6 +275,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
}
if (GLOBAL_ACTION_KEY_POWER.equals(actionKey)) {
mItems.add(new PowerAction());
+ } else if (GLOBAL_ACTION_KEY_REBOOT.equals(actionKey)) {
+ mItems.add(new RebootAction());
} else if (GLOBAL_ACTION_KEY_AIRPLANE.equals(actionKey)) {
mItems.add(mAirplaneModeOn);
} else if (GLOBAL_ACTION_KEY_BUGREPORT.equals(actionKey)) {
@@ -367,6 +371,35 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
}
}
+ private final class RebootAction extends SinglePressAction {
+ private RebootAction() {
+ super(com.android.internal.R.drawable.ic_lock_power_reboot,
+ R.string.global_action_reboot);
+ }
+
+ @Override
+ public boolean showDuringKeyguard() {
+ return true;
+ }
+
+ @Override
+ public boolean showBeforeProvisioning() {
+ return true;
+ }
+
+ @Override
+ public void onPress() {
+ try {
+ IPowerManager pm = IPowerManager.Stub.asInterface(ServiceManager
+ .getService(Context.POWER_SERVICE));
+ pm.reboot(true, null, false);
+ } catch (RemoteException e) {
+ Log.e(TAG, "PowerManager service died!", e);
+ return;
+ }
+ }
+ }
+
private Action getBugReportAction() {
return new SinglePressAction(com.android.internal.R.drawable.ic_lock_bugreport,
R.string.bugreport_title) {
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index a3b1840..d5ad30c 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -144,13 +144,25 @@ public final class ShutdownThread extends Thread {
}
}
+ boolean showRebootOption = false;
+ String[] defaultActions = context.getResources().getStringArray(
+ com.android.internal.R.array.config_globalActionsList);
+ for (int i = 0; i < defaultActions.length; i++) {
+ if (defaultActions[i].equals("reboot")) {
+ showRebootOption = true;
+ break;
+ }
+ }
final int longPressBehavior = context.getResources().getInteger(
com.android.internal.R.integer.config_longPressOnPowerBehavior);
- final int resourceId = mRebootSafeMode
+ int resourceId = mRebootSafeMode
? com.android.internal.R.string.reboot_safemode_confirm
: (longPressBehavior == 2
? com.android.internal.R.string.shutdown_confirm_question
: com.android.internal.R.string.shutdown_confirm);
+ if (showRebootOption && !mRebootSafeMode) {
+ resourceId = com.android.internal.R.string.reboot_confirm;
+ }
Log.d(TAG, "Notifying thread to start shutdown longPressBehavior=" + longPressBehavior);
@@ -162,7 +174,9 @@ public final class ShutdownThread extends Thread {
sConfirmDialog = new AlertDialog.Builder(context)
.setTitle(mRebootSafeMode
? com.android.internal.R.string.reboot_safemode_title
- : com.android.internal.R.string.power_off)
+ : showRebootOption
+ ? com.android.internal.R.string.reboot_title
+ : com.android.internal.R.string.power_off)
.setMessage(resourceId)
.setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
diff --git a/services/core/jni/com_android_server_tv_TvInputHal.cpp b/services/core/jni/com_android_server_tv_TvInputHal.cpp
index bba4bbe..b7c19db 100644
--- a/services/core/jni/com_android_server_tv_TvInputHal.cpp
+++ b/services/core/jni/com_android_server_tv_TvInputHal.cpp
@@ -32,6 +32,8 @@
#include <utils/NativeHandle.h>
#include <hardware/tv_input.h>
+#include <jni/TvInputHalExtensions.h>
+
namespace android {
static struct {
@@ -71,37 +73,6 @@ static struct {
////////////////////////////////////////////////////////////////////////////////
-class BufferProducerThread : public Thread {
-public:
- BufferProducerThread(tv_input_device_t* device, int deviceId, const tv_stream_t* stream);
-
- virtual status_t readyToRun();
-
- void setSurface(const sp<Surface>& surface);
- void onCaptured(uint32_t seq, bool succeeded);
- void shutdown();
-
-private:
- Mutex mLock;
- Condition mCondition;
- sp<Surface> mSurface;
- tv_input_device_t* mDevice;
- int mDeviceId;
- tv_stream_t mStream;
- sp<ANativeWindowBuffer_t> mBuffer;
- enum {
- CAPTURING,
- CAPTURED,
- RELEASED,
- } mBufferState;
- uint32_t mSeq;
- bool mShutdown;
-
- virtual bool threadLoop();
-
- void setSurfaceLocked(const sp<Surface>& surface);
-};
-
BufferProducerThread::BufferProducerThread(
tv_input_device_t* device, int deviceId, const tv_stream_t* stream)
: Thread(false),
@@ -132,14 +103,14 @@ status_t BufferProducerThread::readyToRun() {
return NO_ERROR;
}
-void BufferProducerThread::setSurface(const sp<Surface>& surface) {
+int BufferProducerThread::setSurface(const sp<Surface>& surface) {
Mutex::Autolock autoLock(&mLock);
- setSurfaceLocked(surface);
+ return setSurfaceLocked(surface);
}
-void BufferProducerThread::setSurfaceLocked(const sp<Surface>& surface) {
+int BufferProducerThread::setSurfaceLocked(const sp<Surface>& surface) {
if (surface == mSurface) {
- return;
+ return NO_ERROR;
}
if (mBufferState == CAPTURING) {
@@ -157,6 +128,8 @@ void BufferProducerThread::setSurfaceLocked(const sp<Surface>& surface) {
mSurface = surface;
mCondition.broadcast();
+
+ return NO_ERROR;
}
void BufferProducerThread::onCaptured(uint32_t seq, bool succeeded) {
@@ -390,7 +363,8 @@ int JTvInputHal::addOrUpdateStream(int deviceId, int streamId, const sp<Surface>
if (connection.mThread != NULL) {
connection.mThread->shutdown();
}
- connection.mThread = new BufferProducerThread(mDevice, deviceId, &stream);
+
+ connection.mThread = TvInputHalFactory::get()->createBufferProducerThread(mDevice, deviceId, &stream);
if (connection.mThread == NULL) {
ALOGE("No memory for BufferProducerThread");
@@ -406,7 +380,19 @@ int JTvInputHal::addOrUpdateStream(int deviceId, int streamId, const sp<Surface>
if (connection.mStreamType == TV_STREAM_TYPE_INDEPENDENT_VIDEO_SOURCE) {
connection.mSurface->setSidebandStream(connection.mSourceHandle);
} else if (connection.mStreamType == TV_STREAM_TYPE_BUFFER_PRODUCER) {
- connection.mThread->setSurface(surface);
+ if (NO_ERROR != connection.mThread->setSurface(surface))
+ {
+ ALOGE("failed to setSurface");
+ // clean up
+ connection.mThread.clear();
+ if (mDevice->close_stream(mDevice, deviceId, streamId) != 0) {
+ ALOGE("Couldn't remove stream");
+ }
+ if (connection.mSurface != NULL) {
+ connection.mSurface.clear();
+ }
+ return UNKNOWN_ERROR;
+ }
connection.mThread->run();
}
return NO_ERROR;
diff --git a/services/libtvextensions/Android.mk b/services/libtvextensions/Android.mk
new file mode 100644
index 0000000..0a9e9bf
--- /dev/null
+++ b/services/libtvextensions/Android.mk
@@ -0,0 +1,21 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+ jni/TvInputHalFactory.cpp \
+
+LOCAL_C_INCLUDES:= \
+ $(TOP)/frameworks/base/services/libtvextensions \
+
+LOCAL_CFLAGS += -Wno-multichar
+
+ifeq ($(TARGET_ENABLE_QC_TVINPUT_HAL_EXTENSIONS),true)
+ LOCAL_CFLAGS += -DENABLE_TVINPUT_HAL_EXTENSIONS
+endif
+
+LOCAL_MODULE:= libTvInputHalExtensions
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_STATIC_LIBRARY)
+
diff --git a/services/libtvextensions/common/ExtensionsLoader.hpp b/services/libtvextensions/common/ExtensionsLoader.hpp
new file mode 100644
index 0000000..010e614
--- /dev/null
+++ b/services/libtvextensions/common/ExtensionsLoader.hpp
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <dlfcn.h>
+#include <common/TvInputHalExtensionsCommon.h>
+
+namespace android {
+
+/*
+ * Create strongly-typed objects of type T
+ * If the customization library exists and does contain a "named" constructor,
+ * invoke and create an instance
+ * Else create the object of type T itself
+ *
+ * Contains a static instance to dlopen'd library, But may end up
+ * opening the library mutiple times. Following snip from dlopen man page is
+ * reassuring "...Only a single copy of an object file is brought into the
+ * address space, even if dlopen() is invoked multiple times in reference to
+ * the file, and even if different pathnames are used to reference the file.."
+ */
+
+template <typename T>
+T *ExtensionsLoader<T>::createInstance(const char *createFunctionName) {
+ ALOGV("createInstance(%dbit) : %s", sizeof(intptr_t)*8, createFunctionName);
+ // create extended object if extensions-lib is available and
+ // TVINPUT_HAL_EXTENSIONS is enabled
+#if ENABLE_TVINPUT_HAL_EXTENSIONS
+ createFunction_t createFunc = loadCreateFunction(createFunctionName);
+ if (createFunc) {
+ return reinterpret_cast<T *>((*createFunc)());
+ }
+#endif
+ // Else, create the default object
+ return new T;
+}
+
+template <typename T>
+void ExtensionsLoader<T>::loadLib() {
+ if (!mLibHandle) {
+ mLibHandle = ::dlopen(CUSTOMIZATION_LIB_NAME, RTLD_LAZY);
+ if (!mLibHandle) {
+ ALOGV("%s", dlerror());
+ return;
+ }
+ ALOGV("Opened %s", CUSTOMIZATION_LIB_NAME);
+ }
+}
+
+template <typename T>
+createFunction_t ExtensionsLoader<T>::loadCreateFunction(const char *createFunctionName) {
+ loadLib();
+ if (!mLibHandle) {
+ return NULL;
+ }
+ createFunction_t func = (createFunction_t)dlsym(mLibHandle, createFunctionName);
+ if (!func) {
+ ALOGW("symbol %s not found: %s",createFunctionName, dlerror());
+ }
+ return func;
+}
+
+//static
+template <typename T>
+void *ExtensionsLoader<T>::mLibHandle = NULL;
+
+} //namespace android
diff --git a/services/libtvextensions/common/TvInputHalExtensionsCommon.h b/services/libtvextensions/common/TvInputHalExtensionsCommon.h
new file mode 100644
index 0000000..3db4c7b
--- /dev/null
+++ b/services/libtvextensions/common/TvInputHalExtensionsCommon.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _TVINPUTHAL_EXTENSIONS_COMMON_H_
+#define _TVINPUTHAL_EXTENSIONS_COMMON_H_
+
+namespace android {
+
+static const char * CUSTOMIZATION_LIB_NAME = "libTvInputHalEnhancements.so";
+
+typedef void *(*createFunction_t)(void);
+
+template <typename T>
+struct ExtensionsLoader {
+
+ static T *createInstance(const char *createFunctionName);
+
+private:
+ static void loadLib();
+ static createFunction_t loadCreateFunction(const char *createFunctionName);
+ static void *mLibHandle;
+};
+
+/*
+ * Boiler-plate to declare the class as a singleton (with a static getter)
+ * which can be loaded (dlopen'd) via ExtensionsLoader
+ */
+#define DECLARE_LOADABLE_SINGLETON(className) \
+protected: \
+ className(); \
+ virtual ~className(); \
+ static className *sInst; \
+private: \
+ className(const className&); \
+ className &operator=(className &); \
+public: \
+ static className *get() { \
+ return sInst; \
+ } \
+ friend struct ExtensionsLoader<className>;
+
+} //namespace android
+
+#endif // _TVINPUTHAL_EXTENSIONS_COMMON_H_
diff --git a/services/libtvextensions/jni/BufferProducerThread.h b/services/libtvextensions/jni/BufferProducerThread.h
new file mode 100644
index 0000000..6699edc
--- /dev/null
+++ b/services/libtvextensions/jni/BufferProducerThread.h
@@ -0,0 +1,89 @@
+/* Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Not a contribution.
+ */
+/*
+ * Copyright 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.
+ */
+
+#ifndef TVINPUT_HAL_INTERFACE_H_
+#define TVINPUT_HAL_INTERFACE_H_
+
+#include "jni.h"
+
+#include <gui/Surface.h>
+#include <hardware/tv_input.h>
+
+namespace android {
+
+class BufferProducerThread : public Thread {
+public:
+ BufferProducerThread(tv_input_device_t* device, int deviceId, const tv_stream_t* stream);
+
+ virtual status_t readyToRun();
+
+ virtual int setSurface(const sp<Surface>& surface);
+ virtual void onCaptured(uint32_t seq, bool succeeded);
+ virtual void shutdown();
+
+protected:
+ Mutex mLock;
+ Condition mCondition;
+ sp<Surface> mSurface;
+ tv_input_device_t* mDevice;
+ int mDeviceId;
+ tv_stream_t mStream;
+ sp<ANativeWindowBuffer_t> mBuffer;
+ enum {
+ CAPTURING,
+ CAPTURED,
+ RELEASED,
+ } mBufferState;
+ uint32_t mSeq;
+ bool mShutdown;
+
+ virtual bool threadLoop();
+
+ virtual int setSurfaceLocked(const sp<Surface>& surface);
+};
+
+} // namespace android
+
+#endif // TVINPUT_HAL_INTERFACE_H_
diff --git a/services/libtvextensions/jni/TvInputHalExtensions.h b/services/libtvextensions/jni/TvInputHalExtensions.h
new file mode 100644
index 0000000..479e544
--- /dev/null
+++ b/services/libtvextensions/jni/TvInputHalExtensions.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _TVINPUTHAL_EXTENSIONS_H_
+#define _TVINPUTHAL_EXTENSIONS_H_
+
+#include <utils/RefBase.h>
+#include <common/TvInputHalExtensionsCommon.h>
+#include <jni/BufferProducerThread.h>
+
+namespace android {
+
+class BufferProducerThread;
+
+/*
+ * Factory to create objects of base-classes in libstagefright
+ */
+struct TvInputHalFactory {
+ virtual sp<BufferProducerThread> createBufferProducerThread(tv_input_device_t* device,
+ int deviceId,
+ const tv_stream_t* stream);
+
+ // ----- NO TRESSPASSING BEYOND THIS LINE ------
+ DECLARE_LOADABLE_SINGLETON(TvInputHalFactory);
+};
+
+}
+
+#endif // _TVINPUTHAL_EXTENSIONS_H_
diff --git a/services/libtvextensions/jni/TvInputHalFactory.cpp b/services/libtvextensions/jni/TvInputHalFactory.cpp
new file mode 100644
index 0000000..b752066
--- /dev/null
+++ b/services/libtvextensions/jni/TvInputHalFactory.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define LOG_TAG "TvInputHalFactory"
+#include <utils/Log.h>
+
+#include "common/ExtensionsLoader.hpp"
+#include "jni/TvInputHalExtensions.h"
+
+namespace android {
+
+ sp<BufferProducerThread> TvInputHalFactory::createBufferProducerThread(tv_input_device_t* device,
+ int deviceId,
+ const tv_stream_t* stream) {
+ return new BufferProducerThread(device, deviceId, stream);
+}
+
+// ----- NO TRESSPASSING BEYOND THIS LINE ------
+TvInputHalFactory::TvInputHalFactory() {
+}
+
+TvInputHalFactory::~TvInputHalFactory() {
+}
+
+//static
+TvInputHalFactory *TvInputHalFactory::sInst =
+ ExtensionsLoader<TvInputHalFactory>::createInstance("createExtendedFactory");
+
+} //namespace android
+
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index 29f3061..7633daf 100644
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -1169,6 +1169,11 @@ public final class Call {
}
}
+ /** {@hide} */
+ final void onMergeFailed() {
+ fireStateChanged(mState);
+ }
+
private void fireStateChanged(final int newState) {
for (CallbackRecord<Callback> record : mCallbackRecords) {
final Call call = this;
diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java
index b89490e..1b6a98f 100644
--- a/telecomm/java/android/telecom/InCallService.java
+++ b/telecomm/java/android/telecom/InCallService.java
@@ -73,6 +73,7 @@ public abstract class InCallService extends Service {
private static final int MSG_ON_CALL_AUDIO_STATE_CHANGED = 5;
private static final int MSG_BRING_TO_FOREGROUND = 6;
private static final int MSG_ON_CAN_ADD_CALL_CHANGED = 7;
+ private static final int MSG_ON_MERGE_FAILED = 8;
/** Default Handler used to consolidate binder method calls onto a single thread. */
private final Handler mHandler = new Handler(Looper.getMainLooper()) {
@@ -91,6 +92,9 @@ public abstract class InCallService extends Service {
case MSG_ADD_CALL:
mPhone.internalAddCall((ParcelableCall) msg.obj);
break;
+ case MSG_ON_MERGE_FAILED:
+ mPhone.onMergeFailed((ParcelableCall) msg.obj);
+ break;
case MSG_UPDATE_CALL:
mPhone.internalUpdateCall((ParcelableCall) msg.obj);
break;
@@ -156,6 +160,11 @@ public abstract class InCallService extends Service {
}
@Override
+ public void onMergeFailed(ParcelableCall call) {
+ mHandler.obtainMessage(MSG_ON_MERGE_FAILED, call).sendToTarget();
+ }
+
+ @Override
public void bringToForeground(boolean showDialpad) {
mHandler.obtainMessage(MSG_BRING_TO_FOREGROUND, showDialpad ? 1 : 0, 0).sendToTarget();
}
diff --git a/telecomm/java/android/telecom/Phone.java b/telecomm/java/android/telecom/Phone.java
index 2ec6c91..0fd124d 100644
--- a/telecomm/java/android/telecom/Phone.java
+++ b/telecomm/java/android/telecom/Phone.java
@@ -179,6 +179,12 @@ public final class Phone {
}
}
+ final void onMergeFailed(ParcelableCall parcelableCall) {
+ Call call = mCallByTelecomCallId.get(parcelableCall.getId());
+ if (call != null) {
+ call.onMergeFailed();
+ }
+ }
/**
* Called to destroy the phone and cleanup any lingering calls.
*/
diff --git a/telecomm/java/com/android/internal/telecom/IInCallService.aidl b/telecomm/java/com/android/internal/telecom/IInCallService.aidl
index ded47d5..f4ba9a0 100644
--- a/telecomm/java/com/android/internal/telecom/IInCallService.aidl
+++ b/telecomm/java/com/android/internal/telecom/IInCallService.aidl
@@ -45,4 +45,6 @@ oneway interface IInCallService {
void bringToForeground(boolean showDialpad);
void onCanAddCallChanged(boolean canAddCall);
+
+ void onMergeFailed(in ParcelableCall call);
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 97ffb70..4799753 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -3383,13 +3383,7 @@ public class TelephonyManager {
/** @hide */
public int getSimCount() {
- // FIXME Need to get it from Telephony Dev Controller when that gets implemented!
- // and then this method shouldn't be used at all!
- if(isMultiSimEnabled()) {
- return 2;
- } else {
- return 1;
- }
+ return getPhoneCount();
}
/**
diff --git a/telephony/java/com/android/internal/telephony/IExtTelephony.aidl b/telephony/java/com/android/internal/telephony/IExtTelephony.aidl
index c489f4d..063308d 100644
--- a/telephony/java/com/android/internal/telephony/IExtTelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/IExtTelephony.aidl
@@ -109,4 +109,11 @@ interface IExtTelephony {
* Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE
*/
void setSMSPromptEnabled(boolean enabled);
+
+ /**
+ * Get logical phone id for Emergency call.
+ * @param - void
+ * @return phone id
+ */
+ int getPhoneIdForECall();
}
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 40940b5..2ea2be5 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -554,6 +554,18 @@ interface ITelephony {
*/
IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID);
+
+ /**
+ * Opens a logical channel to the ICC card for a particular subId.
+ *
+ * Input parameters equivalent to TS 27.007 AT+CCHO command.
+ *
+ * @param subId user preferred subId.
+ * @param AID Application id. See ETSI 102.221 and 101.220.
+ * @return an IccOpenLogicalChannelResponse object.
+ */
+ IccOpenLogicalChannelResponse iccOpenLogicalChannelUsingSubId(int subId, String AID);
+
/**
* Closes a previously opened logical channel to the ICC card.
*
@@ -566,6 +578,19 @@ interface ITelephony {
boolean iccCloseLogicalChannel(int channel);
/**
+ * Closes a previously opened logical channel to the ICC card for a
+ * particular subId.
+ *
+ * Input parameters equivalent to TS 27.007 AT+CCHC command.
+ *
+ * @param subId user preferred subId.
+ * @param channel is the channel id to be closed as retruned by a
+ * successful iccOpenLogicalChannel.
+ * @return true if the channel was closed successfully.
+ */
+ boolean iccCloseLogicalChannelUsingSubId(int subId, int channel);
+
+ /**
* Transmit an APDU to the ICC card over a logical channel.
*
* Input parameters equivalent to TS 27.007 AT+CGLA command.
@@ -586,6 +611,28 @@ interface ITelephony {
int p1, int p2, int p3, String data);
/**
+ * Transmit an APDU to the ICC card over a logical channel for a
+ * particular subId.
+ *
+ * Input parameters equivalent to TS 27.007 AT+CGLA command.
+ *
+ * @param subId user preferred subId.
+ * @param channel is the channel id to be closed as retruned by a
+ * successful iccOpenLogicalChannel.
+ * @param cla Class of the APDU command.
+ * @param instruction Instruction of the APDU command.
+ * @param p1 P1 value of the APDU command.
+ * @param p2 P2 value of the APDU command.
+ * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
+ * is sent to the SIM.
+ * @param data Data to be sent with the APDU.
+ * @return The APDU response from the ICC card with the status appended at
+ * the end.
+ */
+ String iccTransmitApduLogicalChannelUsingSubId(int subId, int channel, int cla,
+ int instruction, int p1, int p2, int p3, String data);
+
+ /**
* Transmit an APDU to the ICC card over the basic channel.
*
* Input parameters equivalent to TS 27.007 AT+CSIM command.
@@ -604,6 +651,26 @@ interface ITelephony {
int p1, int p2, int p3, String data);
/**
+ * Transmit an APDU to the ICC card over the basic channel for a particular
+ * subId.
+ *
+ * Input parameters equivalent to TS 27.007 AT+CSIM command.
+ *
+ * @param subId user preferred subId.
+ * @param cla Class of the APDU command.
+ * @param instruction Instruction of the APDU command.
+ * @param p1 P1 value of the APDU command.
+ * @param p2 P2 value of the APDU command.
+ * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
+ * is sent to the SIM.
+ * @param data Data to be sent with the APDU.
+ * @return The APDU response from the ICC card with the status appended at
+ * the end.
+ */
+ String iccTransmitApduBasicChannelUsingSubId(int subId, int cla, int instruction,
+ int p1, int p2, int p3, String data);
+
+ /**
* Returns the response APDU for a command APDU sent through SIM_IO.
*
* @param fileID
@@ -618,6 +685,22 @@ interface ITelephony {
String filePath);
/**
+ * Returns the response APDU for a command APDU sent through SIM_IO
+ * for a particular subId.
+ *
+ * @param subId user preferred subId.
+ * @param fileID
+ * @param command
+ * @param p1 P1 value of the APDU command.
+ * @param p2 P2 value of the APDU command.
+ * @param p3 P3 value of the APDU command.
+ * @param filePath
+ * @return The APDU response.
+ */
+ byte[] iccExchangeSimIOUsingSubId(int subId, int fileID, int command, int p1, int p2,
+ int p3, String filePath);
+
+ /**
* Send ENVELOPE to the SIM and returns the response.
*
* @param contents String containing SAT/USAT response in hexadecimal
@@ -1005,4 +1088,15 @@ interface ITelephony {
*@hide
*/
ModemActivityInfo getModemActivityInfo();
+
+ /**
+ * Get ATR (Answer To Reset; as per ISO/IEC 7816-4) from SIM card
+ */
+ byte[] getAtr();
+
+ /**
+ * Get ATR (Answer To Reset; as per ISO/IEC 7816-4) from SIM card
+ * for a particular subId.
+ */
+ byte[] getAtrUsingSubId(int subId);
}
diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java
index 90857db..6154969 100755
--- a/telephony/java/com/android/internal/telephony/RILConstants.java
+++ b/telephony/java/com/android/internal/telephony/RILConstants.java
@@ -77,7 +77,7 @@ public interface RILConstants {
int SIM_SAP_MSG_SIZE_TOO_SMALL = 34;
int SIM_SAP_CONNECT_OK_CALL_ONGOING = 35;
int LCE_NOT_SUPPORTED = 36; /* Link Capacity Estimation (LCE) not supported */
-
+ int INVALID_PARAMETER = 37;
/* NETWORK_MODE_* See ril.h RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE */
int NETWORK_MODE_WCDMA_PREF = 0; /* GSM/WCDMA (WCDMA preferred) */
@@ -335,6 +335,7 @@ cat include/telephony/ril.h | \
int RIL_REQUEST_STOP_LCE = 133;
int RIL_REQUEST_PULL_LCEDATA = 134;
int RIL_REQUEST_GET_ACTIVITY_INFO = 135;
+ int RIL_REQUEST_SIM_GET_ATR = 136;
int RIL_UNSOL_RESPONSE_BASE = 1000;
int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000;