Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

skip getCallState #15

Open
wants to merge 1 commit into
base: relatel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@ public int onStartCommand(final Intent intent, int flags, int startId) {
mWifiLock = mWifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, this.getPackageName()+"-wifi-call-lock");
mWifiLock.setReferenceCounted(false);
mTelephonyManager = (TelephonyManager) getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
mGSMIdle = mTelephonyManager.getCallState() == TelephonyManager.CALL_STATE_IDLE;

// getCallState is deprecated in api 31. So we skip this check for now.
// mGSMIdle = mTelephonyManager.getCallState() == TelephonyManager.CALL_STATE_IDLE;

IntentFilter phoneStateFilter = new IntentFilter(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
registerReceiver(mPhoneStateChangedReceiver, phoneStateFilter);

Expand Down