void BluetoothRilListener::ServiceChanged(uint32_t aClientId, bool aRegistered) { // Stop listening ListenMobileConnAndIccInfo(false); /** * aRegistered: * - TRUE: service becomes registered. We were listening to all clients * and one of them becomes available. Select it to listen. * - FALSE: service becomes un-registered. The client we were listening * becomes unavailable. Select another registered one to listen. */ if (aRegistered) { mClientId = aClientId; } else { SelectClient(); } // Restart listening ListenMobileConnAndIccInfo(true); BT_LOGR("%d client %d. new mClientId %d", aRegistered, aClientId, (mClientId < mMobileConnListeners.Length()) ? mClientId : -1); }
//--------------------------------------------------------------------------- void __fastcall TFormClientRep::FormCreate(TObject *Sender) { sPageControl1->ActivePage = sTabSheet1; InitCommon(); InitGData(); SetPage(); if (!ClientID) SelectClient(); else SetClient(ClientID,ClientName); }
/** * BluetoothRilListener */ BluetoothRilListener::BluetoothRilListener() { nsCOMPtr<nsIMobileConnectionService> service = do_GetService(NS_MOBILE_CONNECTION_SERVICE_CONTRACTID); NS_ENSURE_TRUE_VOID(service); // Query number of total clients (sim slots) uint32_t numItems = 0; if (NS_SUCCEEDED(service->GetNumItems(&numItems))) { // Init MobileConnectionListener array and IccInfoListener for (uint32_t i = 0; i < numItems; i++) { mMobileConnListeners.AppendElement(new MobileConnectionListener(i)); } } mTelephonyListener = new TelephonyListener(); mIccListener = new IccListener(); mIccListener->SetOwner(this); // Probe for available client SelectClient(); }
/** * BluetoothRilListener */ BluetoothRilListener::BluetoothRilListener() { // Query number of total clients (sim slots) uint32_t numOfClients; nsCOMPtr<nsIRadioInterfaceLayer> radioInterfaceLayer = do_GetService(NS_RADIOINTERFACELAYER_CONTRACTID); NS_ENSURE_TRUE_VOID(radioInterfaceLayer); radioInterfaceLayer->GetNumRadioInterfaces(&numOfClients); // Init MobileConnectionListener array and IccInfoListener for (uint32_t i = 0; i < numOfClients; i++) { mMobileConnListeners.AppendElement(new MobileConnectionListener(i)); } mTelephonyListener = new TelephonyListener(); mIccListener = new IccListener(); mIccListener->SetOwner(this); // Probe for available client SelectClient(); }
//--------------------------------------------------------------------------- void __fastcall TFormClientRep::sComboEdit1ButtonClick(TObject *Sender) { SelectClient(); }