Loading src/java/com/android/internal/telephony/CallManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -2354,7 +2354,8 @@ public final class CallManager { if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_NEW_RINGING_CONNECTION)"); Connection c = (Connection) ((AsyncResult) msg.obj).result; int subId = c.getCall().getPhone().getSubId(); if (getActiveFgCallState(subId).isDialing() || hasMoreThanOneRingingCall()) { if (getActiveFgCallState(subId).isDialing() || hasMoreThanOneRingingCall(subId)) { try { Rlog.d(LOG_TAG, "silently drop incoming call: " + c.getCall()); c.getCall().hangup(); Loading src/java/com/android/internal/telephony/Connection.java +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import java.util.concurrent.CopyOnWriteArraySet; public abstract class Connection { public interface PostDialListener { void onPostDialWait(); //void onPostDialChar(char c); void onPostDialChar(char c); } /** Loading Loading @@ -397,7 +397,7 @@ public abstract class Connection { protected final void notifyPostDialListenersNextChar(char c) { for (PostDialListener listener : new ArrayList<>(mPostDialListeners)) { //listener.onPostDialChar(c); listener.onPostDialChar(c); } } Loading src/java/com/android/internal/telephony/DefaultPhoneNotifier.java 100644 → 100755 +1 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ public class DefaultPhoneNotifier implements PhoneNotifier { private void doNotifyDataConnection(Phone sender, String reason, String apnType, PhoneConstants.DataState state) { int subId = sender.getSubId(); long dds = SubscriptionManager.getDefaultDataSubId(); int dds = SubscriptionManager.getDefaultDataSubId(); if (DBG) log("subId = " + subId + ", DDS = " + dds); // TODO Loading src/java/com/android/internal/telephony/InboundSmsHandler.java 100644 → 100755 +1 −1 Original line number Diff line number Diff line Loading @@ -1244,7 +1244,7 @@ public abstract class InboundSmsHandler extends StateMachine { if (cr.acquireProvider(FIREWALL_PROVIDER_URI) != null && null != address) { Bundle extras = new Bundle(); extras.putString(EXTRA_NUMBER, address); extras.putLong(PhoneConstants.SUBSCRIPTION_KEY, mPhone.getSubId()); extras.putInt(PhoneConstants.SUBSCRIPTION_KEY, mPhone.getSubId()); extras = cr.call(FIREWALL_PROVIDER_URI, IS_FORBIDDEN, null, extras); if (extras != null) { isForbidden = extras.getBoolean(IS_FORBIDDEN); Loading src/java/com/android/internal/telephony/MccTable.java +38 −14 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.net.wifi.WifiManager; import android.os.Build; import android.os.RemoteException; import android.os.SystemProperties; import android.provider.Settings; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Slog; Loading Loading @@ -223,6 +224,29 @@ public final class MccTable { } } // Bug 19232829: It is possible to get through provisioning without setting up a persistent // locale value. We don't modify the locale if the device has completed "provisioning" because // we don't want to change the locale if the user inserts a new SIM or a new version of Android // is better at recognizing MCC values than an older version. private static boolean canUpdateLocale(Context context) { return !(userHasPersistedLocale() || isDeviceProvisioned(context)); } private static boolean userHasPersistedLocale() { String persistSysLanguage = SystemProperties.get("persist.sys.language", ""); String persistSysCountry = SystemProperties.get("persist.sys.country", ""); return !(persistSysLanguage.isEmpty() && persistSysCountry.isEmpty()); } private static boolean isDeviceProvisioned(Context context) { try { return Settings.Global.getInt( context.getContentResolver(), Settings.Global.DEVICE_PROVISIONED) != 0; } catch (Settings.SettingNotFoundException e) { return false; } } /** * Return Locale for the language and country or null if no good match. * Loading @@ -243,23 +267,13 @@ public final class MccTable { } // Check whether a developer is trying to test an arbitrary MCC. boolean debuggingMccOverride = false; if (Build.IS_DEBUGGABLE) { String overrideMcc = SystemProperties.get("persist.sys.override_mcc", ""); if (!overrideMcc.isEmpty()) { debuggingMccOverride = true; } } boolean debuggingMccOverride = isDebuggingMccOverride(); // If this is a regular user and they already have a persisted locale, we're done. if (!debuggingMccOverride) { String persistSysLanguage = SystemProperties.get("persist.sys.language", ""); String persistSysCountry = SystemProperties.get("persist.sys.country", ""); if (!(persistSysLanguage.isEmpty() && persistSysCountry.isEmpty())) { Slog.d(LOG_TAG, "getLocaleForLanguageCountry: skipping already persisted"); if (!(debuggingMccOverride || canUpdateLocale(context))) { Slog.d(LOG_TAG, "getLocaleForLanguageCountry: not permitted to update locale"); return null; } } // Find the best match we actually have a localization for. // TODO: this should really follow the CLDR chain of parent locales! Loading Loading @@ -315,6 +329,16 @@ public final class MccTable { return null; } private static boolean isDebuggingMccOverride() { if (Build.IS_DEBUGGABLE) { String overrideMcc = SystemProperties.get("persist.sys.override_mcc", ""); if (!overrideMcc.isEmpty()) { return true; } } return false; } /** * Utility code to set the system locale if it's not set already * @param context Context to act on. Loading Loading
src/java/com/android/internal/telephony/CallManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -2354,7 +2354,8 @@ public final class CallManager { if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_NEW_RINGING_CONNECTION)"); Connection c = (Connection) ((AsyncResult) msg.obj).result; int subId = c.getCall().getPhone().getSubId(); if (getActiveFgCallState(subId).isDialing() || hasMoreThanOneRingingCall()) { if (getActiveFgCallState(subId).isDialing() || hasMoreThanOneRingingCall(subId)) { try { Rlog.d(LOG_TAG, "silently drop incoming call: " + c.getCall()); c.getCall().hangup(); Loading
src/java/com/android/internal/telephony/Connection.java +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import java.util.concurrent.CopyOnWriteArraySet; public abstract class Connection { public interface PostDialListener { void onPostDialWait(); //void onPostDialChar(char c); void onPostDialChar(char c); } /** Loading Loading @@ -397,7 +397,7 @@ public abstract class Connection { protected final void notifyPostDialListenersNextChar(char c) { for (PostDialListener listener : new ArrayList<>(mPostDialListeners)) { //listener.onPostDialChar(c); listener.onPostDialChar(c); } } Loading
src/java/com/android/internal/telephony/DefaultPhoneNotifier.java 100644 → 100755 +1 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ public class DefaultPhoneNotifier implements PhoneNotifier { private void doNotifyDataConnection(Phone sender, String reason, String apnType, PhoneConstants.DataState state) { int subId = sender.getSubId(); long dds = SubscriptionManager.getDefaultDataSubId(); int dds = SubscriptionManager.getDefaultDataSubId(); if (DBG) log("subId = " + subId + ", DDS = " + dds); // TODO Loading
src/java/com/android/internal/telephony/InboundSmsHandler.java 100644 → 100755 +1 −1 Original line number Diff line number Diff line Loading @@ -1244,7 +1244,7 @@ public abstract class InboundSmsHandler extends StateMachine { if (cr.acquireProvider(FIREWALL_PROVIDER_URI) != null && null != address) { Bundle extras = new Bundle(); extras.putString(EXTRA_NUMBER, address); extras.putLong(PhoneConstants.SUBSCRIPTION_KEY, mPhone.getSubId()); extras.putInt(PhoneConstants.SUBSCRIPTION_KEY, mPhone.getSubId()); extras = cr.call(FIREWALL_PROVIDER_URI, IS_FORBIDDEN, null, extras); if (extras != null) { isForbidden = extras.getBoolean(IS_FORBIDDEN); Loading
src/java/com/android/internal/telephony/MccTable.java +38 −14 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.net.wifi.WifiManager; import android.os.Build; import android.os.RemoteException; import android.os.SystemProperties; import android.provider.Settings; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Slog; Loading Loading @@ -223,6 +224,29 @@ public final class MccTable { } } // Bug 19232829: It is possible to get through provisioning without setting up a persistent // locale value. We don't modify the locale if the device has completed "provisioning" because // we don't want to change the locale if the user inserts a new SIM or a new version of Android // is better at recognizing MCC values than an older version. private static boolean canUpdateLocale(Context context) { return !(userHasPersistedLocale() || isDeviceProvisioned(context)); } private static boolean userHasPersistedLocale() { String persistSysLanguage = SystemProperties.get("persist.sys.language", ""); String persistSysCountry = SystemProperties.get("persist.sys.country", ""); return !(persistSysLanguage.isEmpty() && persistSysCountry.isEmpty()); } private static boolean isDeviceProvisioned(Context context) { try { return Settings.Global.getInt( context.getContentResolver(), Settings.Global.DEVICE_PROVISIONED) != 0; } catch (Settings.SettingNotFoundException e) { return false; } } /** * Return Locale for the language and country or null if no good match. * Loading @@ -243,23 +267,13 @@ public final class MccTable { } // Check whether a developer is trying to test an arbitrary MCC. boolean debuggingMccOverride = false; if (Build.IS_DEBUGGABLE) { String overrideMcc = SystemProperties.get("persist.sys.override_mcc", ""); if (!overrideMcc.isEmpty()) { debuggingMccOverride = true; } } boolean debuggingMccOverride = isDebuggingMccOverride(); // If this is a regular user and they already have a persisted locale, we're done. if (!debuggingMccOverride) { String persistSysLanguage = SystemProperties.get("persist.sys.language", ""); String persistSysCountry = SystemProperties.get("persist.sys.country", ""); if (!(persistSysLanguage.isEmpty() && persistSysCountry.isEmpty())) { Slog.d(LOG_TAG, "getLocaleForLanguageCountry: skipping already persisted"); if (!(debuggingMccOverride || canUpdateLocale(context))) { Slog.d(LOG_TAG, "getLocaleForLanguageCountry: not permitted to update locale"); return null; } } // Find the best match we actually have a localization for. // TODO: this should really follow the CLDR chain of parent locales! Loading Loading @@ -315,6 +329,16 @@ public final class MccTable { return null; } private static boolean isDebuggingMccOverride() { if (Build.IS_DEBUGGABLE) { String overrideMcc = SystemProperties.get("persist.sys.override_mcc", ""); if (!overrideMcc.isEmpty()) { return true; } } return false; } /** * Utility code to set the system locale if it's not set already * @param context Context to act on. Loading