Merge "DO NOT MERGE Re-restrict phone ops on user addition" into sc-v2-dev
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index d78bce9..5743e0d 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -50,8 +50,8 @@
<string name="outgoing_call_not_allowed_no_permission" msgid="8590468836581488679">"このアプリは、電話権限がないため発信できません。"</string>
<string name="outgoing_call_error_no_phone_number_supplied" msgid="7665135102566099778">"発信するには、有効な番号を入力してください。"</string>
<string name="duplicate_video_call_not_allowed" msgid="5754746140185781159">"通話は現在追加できません。"</string>
- <string name="no_vm_number" msgid="2179959110602180844">"ボイスメール番号がありません"</string>
- <string name="no_vm_number_msg" msgid="1339245731058529388">"SIMカードにボイスメールの番号がありません。"</string>
+ <string name="no_vm_number" msgid="2179959110602180844">"留守番電話の番号がありません"</string>
+ <string name="no_vm_number_msg" msgid="1339245731058529388">"SIMカードに留守番電話の番号がありません。"</string>
<string name="add_vm_number_str" msgid="5179510133063168998">"番号を追加"</string>
<string name="change_default_dialer_dialog_title" msgid="5861469279421508060">"<xliff:g id="NEW_APP">%s</xliff:g> をデフォルトの電話アプリにしますか?"</string>
<string name="change_default_dialer_dialog_affirmative" msgid="8604665314757739550">"デフォルトに設定"</string>
diff --git a/src/com/android/server/telecom/ServiceBinder.java b/src/com/android/server/telecom/ServiceBinder.java
index 2fcd2f5..7274993 100644
--- a/src/com/android/server/telecom/ServiceBinder.java
+++ b/src/com/android/server/telecom/ServiceBinder.java
@@ -87,7 +87,8 @@
ServiceConnection connection = new ServiceBinderConnection(call);
Log.addEvent(call, LogUtils.Events.BIND_CS, mComponentName);
- final int bindingFlags = Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE;
+ final int bindingFlags = Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE
+ | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS;
final boolean isBound;
if (mUserHandle != null) {
isBound = mContext.bindServiceAsUser(serviceIntent, connection, bindingFlags,
@@ -149,7 +150,6 @@
Log.i(this, "Service bound %s", componentName);
Log.addEvent(mCall, LogUtils.Events.CS_BOUND, componentName);
- mCall = null;
// Unbind request was queued so unbind immediately.
if (mIsBindingAborted) {
@@ -191,6 +191,30 @@
Log.endSession();
}
}
+
+ /**
+ * Handles the case where the {@link ConnectionService} we bound to returned a null binding.
+ * We want to unbind from the service and cleanup and call resources at this time.
+ * @param componentName The component of the {@link ConnectionService}.
+ */
+ @Override
+ public void onNullBinding(ComponentName componentName) {
+ try {
+ Log.startSession("SBC.oNB");
+ synchronized (mLock) {
+ Log.w(this, "Null binding %s", componentName);
+ Log.addEvent(mCall, "NULL_BINDING", componentName);
+ String componentStr = componentName == null ? "null" : componentName.toString();
+ android.util.EventLog.writeEvent(0x534e4554, "211114016", -1, componentStr);
+ logServiceDisconnected("onNullBinding");
+ mContext.unbindService(this);
+ clearAbort();
+ handleFailedConnection();
+ }
+ } finally {
+ Log.endSession();
+ }
+ }
}
private void handleDisconnect() {