Loading src/java/com/android/internal/telephony/SubscriptionController.java +10 −46 Original line number Diff line number Diff line Loading @@ -81,8 +81,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; /** * SubscriptionController to provide an inter-process communication to * access Sms in Icc. * Implementation of the ISub interface. * * Any setters which take subId, slotIndex or phoneId as a parameter will throw an exception if the * parameter equals the corresponding INVALID_XXX_ID or DEFAULT_XXX_ID. Loading Loading @@ -163,17 +162,6 @@ public class SubscriptionController extends ISub.Stub { SubscriptionManager.DISPLAY_NAME, SubscriptionManager.DATA_ENABLED_OVERRIDE_RULES)); public static SubscriptionController init(Phone phone) { synchronized (SubscriptionController.class) { if (sInstance == null) { sInstance = new SubscriptionController(phone); } else { Log.wtf(LOG_TAG, "init() called multiple times! sInstance = " + sInstance); } return sInstance; } } public static SubscriptionController init(Context c) { synchronized (SubscriptionController.class) { if (sInstance == null) { Loading @@ -187,8 +175,7 @@ public class SubscriptionController extends ISub.Stub { @UnsupportedAppUsage public static SubscriptionController getInstance() { if (sInstance == null) { if (sInstance == null) { Log.wtf(LOG_TAG, "getInstance null"); } Loading @@ -201,7 +188,6 @@ public class SubscriptionController extends ISub.Stub { } protected void internalInit(Context c) { mContext = c; mTelephonyManager = TelephonyManager.from(mContext); Loading Loading @@ -257,22 +243,6 @@ public class SubscriptionController extends ISub.Stub { mContext.getContentResolver().update(SubscriptionManager.CONTENT_URI, value, null, null); } private SubscriptionController(Phone phone) { mContext = phone.getContext(); mAppOps = mContext.getSystemService(AppOpsManager.class); if(ServiceManager.getService("isub") == null) { ServiceManager.addService("isub", this); } migrateImsSettings(); // clear SLOT_INDEX for all subs clearSlotIndexForSubInfoRecords(); if (DBG) logdl("[SubscriptionController] init by Phone"); } @UnsupportedAppUsage private void enforceModifyPhoneState(String message) { mContext.enforceCallingOrSelfPermission( Loading Loading @@ -447,10 +417,8 @@ public class SubscriptionController extends ISub.Stub { if (cursor != null) { while (cursor.moveToNext()) { SubscriptionInfo subInfo = getSubInfoRecord(cursor); if (subInfo != null) { if (subList == null) { if (subInfo != null) { if (subList == null) { subList = new ArrayList<SubscriptionInfo>(); } subList.add(subInfo); Loading Loading @@ -2121,10 +2089,6 @@ public class SubscriptionController extends ISub.Stub { mLocalLog.log(msg); } private static void slogd(String msg) { Rlog.d(LOG_TAG, msg); } @UnsupportedAppUsage private void logd(String msg) { Rlog.d(LOG_TAG, msg); Loading Loading @@ -2254,7 +2218,7 @@ public class SubscriptionController extends ISub.Stub { int subId = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.MULTI_SIM_VOICE_CALL_SUBSCRIPTION, SubscriptionManager.INVALID_SUBSCRIPTION_ID); if (VDBG) slogd("[getDefaultVoiceSubId] subId=" + subId); if (VDBG) logd("[getDefaultVoiceSubId] subId=" + subId); return subId; } Loading Loading @@ -2647,7 +2611,7 @@ public class SubscriptionController extends ISub.Stub { value.put(propKey, Integer.parseInt(propValue)); break; default: if (DBG) slogd("Invalid column name"); if (DBG) logd("Invalid column name"); break; } Loading Loading @@ -2735,16 +2699,16 @@ public class SubscriptionController extends ISub.Stub { return resultValue; } private static void printStackTrace(String msg) { private void printStackTrace(String msg) { RuntimeException re = new RuntimeException(); slogd("StackTrace - " + msg); logd("StackTrace - " + msg); StackTraceElement[] st = re.getStackTrace(); boolean first = true; for (StackTraceElement ste : st) { if (first) { first = false; } else { slogd(ste.toString()); logd(ste.toString()); } } } Loading tests/telephonytests/src/com/android/internal/telephony/mocks/SubscriptionControllerMock.java +0 −3 Original line number Diff line number Diff line Loading @@ -44,9 +44,6 @@ public class SubscriptionControllerMock extends SubscriptionController { final ITelephonyRegistry.Stub mTelephonyRegistry; final int[][] mSlotIndexToSubId; public static SubscriptionController init(Phone phone) { throw new RuntimeException("not implemented"); } public static SubscriptionController init(Context c) { throw new RuntimeException("not implemented"); } Loading Loading
src/java/com/android/internal/telephony/SubscriptionController.java +10 −46 Original line number Diff line number Diff line Loading @@ -81,8 +81,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; /** * SubscriptionController to provide an inter-process communication to * access Sms in Icc. * Implementation of the ISub interface. * * Any setters which take subId, slotIndex or phoneId as a parameter will throw an exception if the * parameter equals the corresponding INVALID_XXX_ID or DEFAULT_XXX_ID. Loading Loading @@ -163,17 +162,6 @@ public class SubscriptionController extends ISub.Stub { SubscriptionManager.DISPLAY_NAME, SubscriptionManager.DATA_ENABLED_OVERRIDE_RULES)); public static SubscriptionController init(Phone phone) { synchronized (SubscriptionController.class) { if (sInstance == null) { sInstance = new SubscriptionController(phone); } else { Log.wtf(LOG_TAG, "init() called multiple times! sInstance = " + sInstance); } return sInstance; } } public static SubscriptionController init(Context c) { synchronized (SubscriptionController.class) { if (sInstance == null) { Loading @@ -187,8 +175,7 @@ public class SubscriptionController extends ISub.Stub { @UnsupportedAppUsage public static SubscriptionController getInstance() { if (sInstance == null) { if (sInstance == null) { Log.wtf(LOG_TAG, "getInstance null"); } Loading @@ -201,7 +188,6 @@ public class SubscriptionController extends ISub.Stub { } protected void internalInit(Context c) { mContext = c; mTelephonyManager = TelephonyManager.from(mContext); Loading Loading @@ -257,22 +243,6 @@ public class SubscriptionController extends ISub.Stub { mContext.getContentResolver().update(SubscriptionManager.CONTENT_URI, value, null, null); } private SubscriptionController(Phone phone) { mContext = phone.getContext(); mAppOps = mContext.getSystemService(AppOpsManager.class); if(ServiceManager.getService("isub") == null) { ServiceManager.addService("isub", this); } migrateImsSettings(); // clear SLOT_INDEX for all subs clearSlotIndexForSubInfoRecords(); if (DBG) logdl("[SubscriptionController] init by Phone"); } @UnsupportedAppUsage private void enforceModifyPhoneState(String message) { mContext.enforceCallingOrSelfPermission( Loading Loading @@ -447,10 +417,8 @@ public class SubscriptionController extends ISub.Stub { if (cursor != null) { while (cursor.moveToNext()) { SubscriptionInfo subInfo = getSubInfoRecord(cursor); if (subInfo != null) { if (subList == null) { if (subInfo != null) { if (subList == null) { subList = new ArrayList<SubscriptionInfo>(); } subList.add(subInfo); Loading Loading @@ -2121,10 +2089,6 @@ public class SubscriptionController extends ISub.Stub { mLocalLog.log(msg); } private static void slogd(String msg) { Rlog.d(LOG_TAG, msg); } @UnsupportedAppUsage private void logd(String msg) { Rlog.d(LOG_TAG, msg); Loading Loading @@ -2254,7 +2218,7 @@ public class SubscriptionController extends ISub.Stub { int subId = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.MULTI_SIM_VOICE_CALL_SUBSCRIPTION, SubscriptionManager.INVALID_SUBSCRIPTION_ID); if (VDBG) slogd("[getDefaultVoiceSubId] subId=" + subId); if (VDBG) logd("[getDefaultVoiceSubId] subId=" + subId); return subId; } Loading Loading @@ -2647,7 +2611,7 @@ public class SubscriptionController extends ISub.Stub { value.put(propKey, Integer.parseInt(propValue)); break; default: if (DBG) slogd("Invalid column name"); if (DBG) logd("Invalid column name"); break; } Loading Loading @@ -2735,16 +2699,16 @@ public class SubscriptionController extends ISub.Stub { return resultValue; } private static void printStackTrace(String msg) { private void printStackTrace(String msg) { RuntimeException re = new RuntimeException(); slogd("StackTrace - " + msg); logd("StackTrace - " + msg); StackTraceElement[] st = re.getStackTrace(); boolean first = true; for (StackTraceElement ste : st) { if (first) { first = false; } else { slogd(ste.toString()); logd(ste.toString()); } } } Loading
tests/telephonytests/src/com/android/internal/telephony/mocks/SubscriptionControllerMock.java +0 −3 Original line number Diff line number Diff line Loading @@ -44,9 +44,6 @@ public class SubscriptionControllerMock extends SubscriptionController { final ITelephonyRegistry.Stub mTelephonyRegistry; final int[][] mSlotIndexToSubId; public static SubscriptionController init(Phone phone) { throw new RuntimeException("not implemented"); } public static SubscriptionController init(Context c) { throw new RuntimeException("not implemented"); } Loading