Loading media/java/android/media/AudioSystem.java +3 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.Context; import android.content.pm.PackageManager; import android.media.audiofx.AudioEffect; import android.media.audiopolicy.AudioMix; import android.telephony.TelephonyManager; import android.util.Log; import java.lang.annotation.Retention; Loading Loading @@ -1239,7 +1240,8 @@ public class AudioSystem * </ul> */ public static int getPlatformType(Context context) { if (context.getResources().getBoolean(com.android.internal.R.bool.config_voice_capable)) { if (((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable()) { return PLATFORM_VOICE; } else if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)) { return PLATFORM_TELEVISION; Loading packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +7 −3 Original line number Diff line number Diff line Loading @@ -949,8 +949,7 @@ class DatabaseHelper extends SQLiteOpenHelper { (1 << AudioManager.STREAM_NOTIFICATION) | (1 << AudioManager.STREAM_SYSTEM) | (1 << AudioManager.STREAM_SYSTEM_ENFORCED); if (!mContext.getResources().getBoolean( com.android.internal.R.bool.config_voice_capable)) { if (!getTelephonyManager().isVoiceCapable()) { ringerModeAffectedStreams |= (1 << AudioManager.STREAM_MUSIC); } db.execSQL("DELETE FROM system WHERE name='" Loading Loading @@ -2579,7 +2578,7 @@ class DatabaseHelper extends SQLiteOpenHelper { String val = ""; String mode; for (int phoneId = 0; phoneId < TelephonyManager.getDefault().getPhoneCount(); phoneId++) { phoneId < getTelephonyManager().getPhoneCount(); phoneId++) { mode = TelephonyManager.getTelephonyProperty(phoneId, "ro.telephony.default_network", Integer.toString(RILConstants.PREFERRED_NETWORK_MODE)); Loading Loading @@ -2693,4 +2692,9 @@ class DatabaseHelper extends SQLiteOpenHelper { private String getDefaultDeviceName() { return mContext.getResources().getString(R.string.def_device_name_simple, Build.MODEL); } private TelephonyManager getTelephonyManager() { return (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); } } packages/SystemUI/src/com/android/keyguard/CarrierTextController.java +1 −2 Original line number Diff line number Diff line Loading @@ -163,8 +163,7 @@ public class CarrierTextController { public CarrierTextController(Context context, CharSequence separator, boolean showAirplaneMode, boolean showMissingSim) { mContext = context; mIsEmergencyCallCapable = context.getResources().getBoolean( com.android.internal.R.bool.config_voice_capable); mIsEmergencyCallCapable = getTelephonyManager().isVoiceCapable(); mShowAirplaneMode = showAirplaneMode; mShowMissingSim = showMissingSim; Loading packages/SystemUI/src/com/android/keyguard/EmergencyButton.java +6 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; import android.telecom.TelecomManager; import android.telephony.TelephonyManager; import android.util.AttributeSet; import android.util.Slog; import android.view.MotionEvent; Loading Loading @@ -92,13 +93,16 @@ public class EmergencyButton extends Button { public EmergencyButton(Context context, AttributeSet attrs) { super(context, attrs); mIsVoiceCapable = context.getResources().getBoolean( com.android.internal.R.bool.config_voice_capable); mIsVoiceCapable = getTelephonyManager().isVoiceCapable(); mEnableEmergencyCallWhileSimLocked = mContext.getResources().getBoolean( com.android.internal.R.bool.config_enable_emergency_call_while_sim_locked); mEmergencyAffordanceManager = new EmergencyAffordanceManager(context); } private TelephonyManager getTelephonyManager() { return (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); Loading Loading
media/java/android/media/AudioSystem.java +3 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.Context; import android.content.pm.PackageManager; import android.media.audiofx.AudioEffect; import android.media.audiopolicy.AudioMix; import android.telephony.TelephonyManager; import android.util.Log; import java.lang.annotation.Retention; Loading Loading @@ -1239,7 +1240,8 @@ public class AudioSystem * </ul> */ public static int getPlatformType(Context context) { if (context.getResources().getBoolean(com.android.internal.R.bool.config_voice_capable)) { if (((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable()) { return PLATFORM_VOICE; } else if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)) { return PLATFORM_TELEVISION; Loading
packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +7 −3 Original line number Diff line number Diff line Loading @@ -949,8 +949,7 @@ class DatabaseHelper extends SQLiteOpenHelper { (1 << AudioManager.STREAM_NOTIFICATION) | (1 << AudioManager.STREAM_SYSTEM) | (1 << AudioManager.STREAM_SYSTEM_ENFORCED); if (!mContext.getResources().getBoolean( com.android.internal.R.bool.config_voice_capable)) { if (!getTelephonyManager().isVoiceCapable()) { ringerModeAffectedStreams |= (1 << AudioManager.STREAM_MUSIC); } db.execSQL("DELETE FROM system WHERE name='" Loading Loading @@ -2579,7 +2578,7 @@ class DatabaseHelper extends SQLiteOpenHelper { String val = ""; String mode; for (int phoneId = 0; phoneId < TelephonyManager.getDefault().getPhoneCount(); phoneId++) { phoneId < getTelephonyManager().getPhoneCount(); phoneId++) { mode = TelephonyManager.getTelephonyProperty(phoneId, "ro.telephony.default_network", Integer.toString(RILConstants.PREFERRED_NETWORK_MODE)); Loading Loading @@ -2693,4 +2692,9 @@ class DatabaseHelper extends SQLiteOpenHelper { private String getDefaultDeviceName() { return mContext.getResources().getString(R.string.def_device_name_simple, Build.MODEL); } private TelephonyManager getTelephonyManager() { return (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); } }
packages/SystemUI/src/com/android/keyguard/CarrierTextController.java +1 −2 Original line number Diff line number Diff line Loading @@ -163,8 +163,7 @@ public class CarrierTextController { public CarrierTextController(Context context, CharSequence separator, boolean showAirplaneMode, boolean showMissingSim) { mContext = context; mIsEmergencyCallCapable = context.getResources().getBoolean( com.android.internal.R.bool.config_voice_capable); mIsEmergencyCallCapable = getTelephonyManager().isVoiceCapable(); mShowAirplaneMode = showAirplaneMode; mShowMissingSim = showMissingSim; Loading
packages/SystemUI/src/com/android/keyguard/EmergencyButton.java +6 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; import android.telecom.TelecomManager; import android.telephony.TelephonyManager; import android.util.AttributeSet; import android.util.Slog; import android.view.MotionEvent; Loading Loading @@ -92,13 +93,16 @@ public class EmergencyButton extends Button { public EmergencyButton(Context context, AttributeSet attrs) { super(context, attrs); mIsVoiceCapable = context.getResources().getBoolean( com.android.internal.R.bool.config_voice_capable); mIsVoiceCapable = getTelephonyManager().isVoiceCapable(); mEnableEmergencyCallWhileSimLocked = mContext.getResources().getBoolean( com.android.internal.R.bool.config_enable_emergency_call_while_sim_locked); mEmergencyAffordanceManager = new EmergencyAffordanceManager(context); } private TelephonyManager getTelephonyManager() { return (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); Loading