Lines Matching refs:phoneId

190             final int phoneId = msg.arg1;  in handleMessage()  local
191 logdWithLocalLog("mHandler: " + msg.what + " phoneId: " + phoneId); in handleMessage()
192 if (!SubscriptionManager.isValidPhoneId(phoneId) in handleMessage()
198 clearConfigForPhone(phoneId, true); in handleMessage()
236 mPlatformCarrierConfigPackage, OVERRIDE_PACKAGE_ADDITION, phoneId); in handleMessage()
240 + " phoneId=" + phoneId); in handleMessage()
241 mPersistentOverrideConfigs[phoneId] = config; in handleMessage()
244 config = restoreConfigFromXml(mPlatformCarrierConfigPackage, "", phoneId); in handleMessage()
250 + phoneId); in handleMessage()
251 mConfigFromDefaultApp[phoneId] = config; in handleMessage()
252 Message newMsg = obtainMessage(EVENT_FETCH_DEFAULT_DONE, phoneId, -1); in handleMessage()
259 phoneId, in handleMessage()
262 obtainMessage(EVENT_BIND_DEFAULT_TIMEOUT, phoneId, -1), in handleMessage()
266 notifySubscriptionInfoUpdater(phoneId); in handleMessage()
280 if (mServiceConnection[phoneId] != conn || conn.service == null) { in handleMessage()
281 unbindIfBound(mContext, conn, phoneId); in handleMessage()
284 final CarrierIdentifier carrierId = getCarrierIdentifierForPhoneId(phoneId); in handleMessage()
290 unbindIfBound(mContext, conn, phoneId); in handleMessage()
292 if (mServiceConnection[phoneId] != conn) { in handleMessage()
300 notifySubscriptionInfoUpdater(phoneId); in handleMessage()
305 saveConfigToXml(mPlatformCarrierConfigPackage, "", phoneId, in handleMessage()
307 mConfigFromDefaultApp[phoneId] = config; in handleMessage()
310 EVENT_FETCH_DEFAULT_DONE, phoneId, -1)); in handleMessage()
324 unbindIfBound(mContext, conn, phoneId); in handleMessage()
328 obtainMessage(EVENT_FETCH_DEFAULT_TIMEOUT, phoneId, -1), in handleMessage()
340 if (mServiceConnection[phoneId] != null) { in handleMessage()
343 unbindIfBound(mContext, mServiceConnection[phoneId], phoneId); in handleMessage()
344 broadcastConfigChangedIntent(phoneId); in handleMessage()
346 notifySubscriptionInfoUpdater(phoneId); in handleMessage()
354 && mServiceConnection[phoneId] == null) { in handleMessage()
357 final String carrierPackageName = getCarrierPackageForPhoneId(phoneId); in handleMessage()
360 sendMessage(obtainMessage(EVENT_DO_FETCH_CARRIER, phoneId, -1)); in handleMessage()
362 notifySubscriptionInfoUpdater(phoneId); in handleMessage()
368 final String carrierPackageName = getCarrierPackageForPhoneId(phoneId); in handleMessage()
370 restoreConfigFromXml(carrierPackageName, "", phoneId); in handleMessage()
376 + phoneId); in handleMessage()
377 mConfigFromCarrierApp[phoneId] = config; in handleMessage()
378 Message newMsg = obtainMessage(EVENT_FETCH_CARRIER_DONE, phoneId, -1); in handleMessage()
384 phoneId, EVENT_CONNECTED_TO_CARRIER)) { in handleMessage()
386 obtainMessage(EVENT_BIND_CARRIER_TIMEOUT, phoneId, -1), in handleMessage()
390 broadcastConfigChangedIntent(phoneId); in handleMessage()
392 notifySubscriptionInfoUpdater(phoneId); in handleMessage()
402 if (mServiceConnection[phoneId] != conn || conn.service == null) { in handleMessage()
403 unbindIfBound(mContext, conn, phoneId); in handleMessage()
406 final CarrierIdentifier carrierId = getCarrierIdentifierForPhoneId(phoneId); in handleMessage()
412 unbindIfBound(mContext, conn, phoneId); in handleMessage()
414 if (mServiceConnection[phoneId] != conn) { in handleMessage()
422 + getCarrierPackageForPhoneId(phoneId)); in handleMessage()
423 broadcastConfigChangedIntent(phoneId); in handleMessage()
424 notifySubscriptionInfoUpdater(phoneId); in handleMessage()
429 saveConfigToXml(getCarrierPackageForPhoneId(phoneId), "", in handleMessage()
430 phoneId, carrierId, config); in handleMessage()
431 mConfigFromCarrierApp[phoneId] = config; in handleMessage()
434 EVENT_FETCH_CARRIER_DONE, phoneId, -1)); in handleMessage()
443 + getCarrierPackageForPhoneId(phoneId) in handleMessage()
447 unbindIfBound(mContext, conn, phoneId); in handleMessage()
451 obtainMessage(EVENT_FETCH_CARRIER_TIMEOUT, phoneId, -1), in handleMessage()
463 if (mServiceConnection[phoneId] != null) { in handleMessage()
466 unbindIfBound(mContext, mServiceConnection[phoneId], phoneId); in handleMessage()
467 broadcastConfigChangedIntent(phoneId); in handleMessage()
469 notifySubscriptionInfoUpdater(phoneId); in handleMessage()
476 && mServiceConnection[phoneId] == null) { in handleMessage()
479 notifySubscriptionInfoUpdater(phoneId); in handleMessage()
503 broadcastConfigChangedIntent(phoneId); in handleMessage()
571 private void clearConfigForPhone(int phoneId, boolean sendBroadcast) { in clearConfigForPhone() argument
573 Phone phone = PhoneFactory.getPhone(phoneId); in clearConfigForPhone()
580 mConfigFromDefaultApp[phoneId] = null; in clearConfigForPhone()
581 mConfigFromCarrierApp[phoneId] = null; in clearConfigForPhone()
582 mServiceConnection[phoneId] = null; in clearConfigForPhone()
583 mHasSentConfigChange[phoneId] = false; in clearConfigForPhone()
585 if (sendBroadcast) broadcastConfigChangedIntent(phoneId, false); in clearConfigForPhone()
588 private void notifySubscriptionInfoUpdater(int phoneId) { in notifySubscriptionInfoUpdater() argument
591 int carrierId = getSpecificCarrierIdForPhoneId(phoneId); in notifySubscriptionInfoUpdater()
594 if (mConfigFromCarrierApp[phoneId] != null) { in notifySubscriptionInfoUpdater()
595 configPackagename = getCarrierPackageForPhoneId(phoneId); in notifySubscriptionInfoUpdater()
596 configToSend = mConfigFromCarrierApp[phoneId]; in notifySubscriptionInfoUpdater()
599 configToSend = mConfigFromDefaultApp[phoneId]; in notifySubscriptionInfoUpdater()
607 PersistableBundle config = mOverrideConfigs[phoneId]; in notifySubscriptionInfoUpdater()
614 phoneId, configPackagename, configToSend, in notifySubscriptionInfoUpdater()
615 mHandler.obtainMessage(EVENT_SUBSCRIPTION_INFO_UPDATED, phoneId, -1)); in notifySubscriptionInfoUpdater()
618 private void broadcastConfigChangedIntent(int phoneId) { in broadcastConfigChangedIntent() argument
619 broadcastConfigChangedIntent(phoneId, true); in broadcastConfigChangedIntent()
622 private void broadcastConfigChangedIntent(int phoneId, boolean addSubIdExtra) { in broadcastConfigChangedIntent() argument
628 int[] subIds = SubscriptionManager.getSubId(phoneId); in broadcastConfigChangedIntent()
634 logd("Broadcast CARRIER_CONFIG_CHANGED for phone " + phoneId in broadcastConfigChangedIntent()
639 SubscriptionManager.putPhoneIdAndSubIdExtra(intent, phoneId); in broadcastConfigChangedIntent()
641 getSpecificCarrierIdForPhoneId(phoneId)); in broadcastConfigChangedIntent()
642 intent.putExtra(TelephonyManager.EXTRA_CARRIER_ID, getCarrierIdForPhoneId(phoneId)); in broadcastConfigChangedIntent()
645 intent.putExtra(CarrierConfigManager.EXTRA_SLOT_INDEX, phoneId); in broadcastConfigChangedIntent()
647 mFromSystemUnlocked[phoneId]); in broadcastConfigChangedIntent()
649 int[] subIds = SubscriptionManager.getSubId(phoneId); in broadcastConfigChangedIntent()
651 logd("Broadcast CARRIER_CONFIG_CHANGED for phone " + phoneId + ", subId=" + subIds[0]); in broadcastConfigChangedIntent()
653 logd("Broadcast CARRIER_CONFIG_CHANGED for phone " + phoneId); in broadcastConfigChangedIntent()
655 mHasSentConfigChange[phoneId] = true; in broadcastConfigChangedIntent()
656 mFromSystemUnlocked[phoneId] = false; in broadcastConfigChangedIntent()
660 private boolean bindToConfigPackage(String pkgName, int phoneId, int eventId) { in bindToConfigPackage() argument
661 logdWithLocalLog("Binding to " + pkgName + " for phone " + phoneId); in bindToConfigPackage()
664 mServiceConnection[phoneId] = new CarrierServiceConnection(phoneId, pkgName, eventId); in bindToConfigPackage()
666 if (mContext.bindService(carrierService, mServiceConnection[phoneId], in bindToConfigPackage()
668 mServiceBound[phoneId] = true; in bindToConfigPackage()
678 private CarrierIdentifier getCarrierIdentifierForPhoneId(int phoneId) { in getCarrierIdentifierForPhoneId() argument
684 String spn = TelephonyManager.from(mContext).getSimOperatorNameForPhone(phoneId); in getCarrierIdentifierForPhoneId()
685 String simOperator = TelephonyManager.from(mContext).getSimOperatorNumericForPhone(phoneId); in getCarrierIdentifierForPhoneId()
693 Phone phone = PhoneFactory.getPhone(phoneId); in getCarrierIdentifierForPhoneId()
705 private String getCarrierPackageForPhoneId(int phoneId) { in getCarrierPackageForPhoneId() argument
708 new Intent(CarrierService.CARRIER_SERVICE_INTERFACE), phoneId); in getCarrierPackageForPhoneId()
716 private String getIccIdForPhoneId(int phoneId) { in getIccIdForPhoneId() argument
717 if (!SubscriptionManager.isValidPhoneId(phoneId)) { in getIccIdForPhoneId()
720 Phone phone = PhoneFactory.getPhone(phoneId); in getIccIdForPhoneId()
730 private int getSpecificCarrierIdForPhoneId(int phoneId) { in getSpecificCarrierIdForPhoneId() argument
731 if (!SubscriptionManager.isValidPhoneId(phoneId)) { in getSpecificCarrierIdForPhoneId()
734 Phone phone = PhoneFactory.getPhone(phoneId); in getSpecificCarrierIdForPhoneId()
744 private int getCarrierIdForPhoneId(int phoneId) { in getCarrierIdForPhoneId() argument
745 if (!SubscriptionManager.isValidPhoneId(phoneId)) { in getCarrierIdForPhoneId()
748 Phone phone = PhoneFactory.getPhone(phoneId); in getCarrierIdForPhoneId()
776 private void saveConfigToXml(String packageName, @NonNull String extraString, int phoneId, in saveConfigToXml() argument
778 if (SubscriptionManager.getSimStateForSlotIndex(phoneId) in saveConfigToXml()
784 final String iccid = getIccIdForPhoneId(phoneId); in saveConfigToXml()
806 "Save config to xml, packagename: " + packageName + " phoneId: " + phoneId); in saveConfigToXml()
838 int phoneId) { in restoreConfigFromXml() argument
844 if (SubscriptionManager.getSimStateForSlotIndex(phoneId) in restoreConfigFromXml()
850 final String iccid = getIccIdForPhoneId(phoneId); in restoreConfigFromXml()
851 final int cid = getSpecificCarrierIdForPhoneId(phoneId); in restoreConfigFromXml()
941 private void updateConfigForPhoneId(int phoneId) { in updateConfigForPhoneId() argument
944 if (mConfigFromCarrierApp[phoneId] != null && in updateConfigForPhoneId()
945 getCarrierPackageForPhoneId(phoneId) == null) { in updateConfigForPhoneId()
946 mConfigFromCarrierApp[phoneId] = null; in updateConfigForPhoneId()
948 mHandler.sendMessage(mHandler.obtainMessage(EVENT_DO_FETCH_DEFAULT, phoneId, -1)); in updateConfigForPhoneId()
973 int phoneId = SubscriptionManager.getPhoneId(subId); in getConfigForSubIdWithFeature() local
975 if (SubscriptionManager.isValidPhoneId(phoneId)) { in getConfigForSubIdWithFeature()
976 PersistableBundle config = mConfigFromDefaultApp[phoneId]; in getConfigForSubIdWithFeature()
979 if (getCarrierPackageForPhoneId(phoneId) == null) { in getConfigForSubIdWithFeature()
984 config = mConfigFromCarrierApp[phoneId]; in getConfigForSubIdWithFeature()
989 config = mPersistentOverrideConfigs[phoneId]; in getConfigForSubIdWithFeature()
994 config = mOverrideConfigs[phoneId]; in getConfigForSubIdWithFeature()
1008 int phoneId = SubscriptionManager.getPhoneId(subscriptionId); in overrideConfig() local
1009 if (!SubscriptionManager.isValidPhoneId(phoneId)) { in overrideConfig()
1010 logd("Ignore invalid phoneId: " + phoneId + " for subId: " + subscriptionId); in overrideConfig()
1013 overrideConfig(mOverrideConfigs, phoneId, overrides); in overrideConfig()
1016 overrideConfig(mPersistentOverrideConfigs, phoneId, overrides); in overrideConfig()
1019 final CarrierIdentifier carrierId = getCarrierIdentifierForPhoneId(phoneId); in overrideConfig()
1020 saveConfigToXml(mPlatformCarrierConfigPackage, OVERRIDE_PACKAGE_ADDITION, phoneId, in overrideConfig()
1021 carrierId, mPersistentOverrideConfigs[phoneId]); in overrideConfig()
1023 final String iccid = getIccIdForPhoneId(phoneId); in overrideConfig()
1024 final int cid = getSpecificCarrierIdForPhoneId(phoneId); in overrideConfig()
1031 notifySubscriptionInfoUpdater(phoneId); in overrideConfig()
1034 private void overrideConfig(@NonNull PersistableBundle[] currentOverrides, int phoneId, in overrideConfig() argument
1037 currentOverrides[phoneId] = new PersistableBundle(); in overrideConfig()
1038 } else if (currentOverrides[phoneId] == null) { in overrideConfig()
1039 currentOverrides[phoneId] = overrides; in overrideConfig()
1041 currentOverrides[phoneId].putAll(overrides); in overrideConfig()
1047 int phoneId = SubscriptionManager.getPhoneId(subId); in notifyConfigChangedForSubId() local
1048 if (!SubscriptionManager.isValidPhoneId(phoneId)) { in notifyConfigChangedForSubId()
1049 logd("Ignore invalid phoneId: " + phoneId + " for subId: " + subId); in notifyConfigChangedForSubId()
1064 updateConfigForPhoneId(phoneId); in notifyConfigChangedForSubId()
1068 public void updateConfigForPhoneId(int phoneId, String simState) { in updateConfigForPhoneId() argument
1071 logdWithLocalLog("Update config for phoneId: " + phoneId + " simState: " + simState); in updateConfigForPhoneId()
1072 if (!SubscriptionManager.isValidPhoneId(phoneId)) { in updateConfigForPhoneId()
1082 mHandler.sendMessage(mHandler.obtainMessage(EVENT_CLEAR_CONFIG, phoneId, -1)); in updateConfigForPhoneId()
1086 updateConfigForPhoneId(phoneId); in updateConfigForPhoneId()
1100 int phoneId) { in unbindIfBound() argument
1101 if (mServiceBound[phoneId]) { in unbindIfBound()
1102 mServiceBound[phoneId] = false; in unbindIfBound()
1239 if (connection == null || !SubscriptionManager.isValidPhoneId(connection.phoneId) in dumpCarrierServiceIfBound()
1249 connection.phoneId); in dumpCarrierServiceIfBound()
1262 logd(targetPkgName + " has carrier privileges on phoneId " + connection.phoneId in dumpCarrierServiceIfBound()
1298 private boolean hasCarrierPrivileges(String pkgName, int phoneId) { in hasCarrierPrivileges() argument
1299 int[] subIds = SubscriptionManager.getSubId(phoneId); in hasCarrierPrivileges()
1309 final int phoneId; field in CarrierConfigLoader.CarrierServiceConnection
1314 CarrierServiceConnection(int phoneId, String pkgName, int eventId) { in CarrierServiceConnection() argument
1315 this.phoneId = phoneId; in CarrierServiceConnection()
1324 mHandler.sendMessage(mHandler.obtainMessage(eventId, phoneId, -1, this)); in onServiceConnected()