Loading android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java +20 −9 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect static final int CONTACTS_LOADED = 5; static final int CHECK_SECONDARY_VERSION_COUNTER = 6; static final int ROLLOVER_COUNTERS = 7; static final int GET_LOCAL_TELEPHONY_DETAILS = 8; static final int USER_CONFIRM_TIMEOUT_VALUE = 30000; static final int RELEASE_WAKE_LOCK_DELAY = 10000; Loading Loading @@ -408,6 +409,8 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect mPbapStateMachineMap.remove(remoteDevice); } break; case GET_LOCAL_TELEPHONY_DETAILS: getLocalTelephonyDetails(); default: break; } Loading Loading @@ -507,16 +510,10 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect Log.e(TAG, "Illegal state exception, content observer is already registered"); } TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (tm != null) { sLocalPhoneNum = tm.getLine1Number(); sLocalPhoneName = tm.getLine1AlphaTag(); if (TextUtils.isEmpty(sLocalPhoneName)) { sLocalPhoneName = this.getString(R.string.localPhoneName); } } setBluetoothPbapService(this); mSessionStatusHandler.sendMessage( mSessionStatusHandler.obtainMessage(GET_LOCAL_TELEPHONY_DETAILS)); mSessionStatusHandler.sendMessage(mSessionStatusHandler.obtainMessage(LOAD_CONTACTS)); mSessionStatusHandler.sendMessage(mSessionStatusHandler.obtainMessage(START_LISTENER)); return true; Loading Loading @@ -775,4 +772,18 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect mThreadUpdateSecVersionCounter.start(); } } private void getLocalTelephonyDetails() { TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (tm != null) { sLocalPhoneNum = tm.getLine1Number(); sLocalPhoneName = tm.getLine1AlphaTag(); if (TextUtils.isEmpty(sLocalPhoneName)) { sLocalPhoneName = this.getString(R.string.localPhoneName); } } if (VERBOSE) Log.v(TAG, "Local Phone Details- Number:" + sLocalPhoneNum + ", Name:" + sLocalPhoneName); } } Loading
android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java +20 −9 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect static final int CONTACTS_LOADED = 5; static final int CHECK_SECONDARY_VERSION_COUNTER = 6; static final int ROLLOVER_COUNTERS = 7; static final int GET_LOCAL_TELEPHONY_DETAILS = 8; static final int USER_CONFIRM_TIMEOUT_VALUE = 30000; static final int RELEASE_WAKE_LOCK_DELAY = 10000; Loading Loading @@ -408,6 +409,8 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect mPbapStateMachineMap.remove(remoteDevice); } break; case GET_LOCAL_TELEPHONY_DETAILS: getLocalTelephonyDetails(); default: break; } Loading Loading @@ -507,16 +510,10 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect Log.e(TAG, "Illegal state exception, content observer is already registered"); } TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (tm != null) { sLocalPhoneNum = tm.getLine1Number(); sLocalPhoneName = tm.getLine1AlphaTag(); if (TextUtils.isEmpty(sLocalPhoneName)) { sLocalPhoneName = this.getString(R.string.localPhoneName); } } setBluetoothPbapService(this); mSessionStatusHandler.sendMessage( mSessionStatusHandler.obtainMessage(GET_LOCAL_TELEPHONY_DETAILS)); mSessionStatusHandler.sendMessage(mSessionStatusHandler.obtainMessage(LOAD_CONTACTS)); mSessionStatusHandler.sendMessage(mSessionStatusHandler.obtainMessage(START_LISTENER)); return true; Loading Loading @@ -775,4 +772,18 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect mThreadUpdateSecVersionCounter.start(); } } private void getLocalTelephonyDetails() { TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (tm != null) { sLocalPhoneNum = tm.getLine1Number(); sLocalPhoneName = tm.getLine1AlphaTag(); if (TextUtils.isEmpty(sLocalPhoneName)) { sLocalPhoneName = this.getString(R.string.localPhoneName); } } if (VERBOSE) Log.v(TAG, "Local Phone Details- Number:" + sLocalPhoneNum + ", Name:" + sLocalPhoneName); } }