enter image description here
this is the backtrack log, it said “BluetoothPhoneService.java:775”, but my “BluetoothPhoneService”just like follow.
package com.android.server.telecom.components;
import com.android.server.telecom.TelecomSystem;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
/**
* Bluetooth headset manager for Telecom. This class shares the call state with the bluetooth device
* and accepts call-related commands to perform on behalf of the BT device.
*/
public final class BluetoothPhoneService extends Service implements TelecomSystem.Component {
@Override
public IBinder onBind(Intent intent) {
synchronized (getTelecomSystem().getLock()) {
return getTelecomSystem().getBluetoothPhoneServiceImpl().getBinder();
}
}
@Override
public TelecomSystem getTelecomSystem() {
return TelecomSystem.getInstance();
}
}
It is from AOSP, only has 42 lines, but log say it run the 775th line.
I dont know why.I also find a packages/services/Telecomm/src/com/android/server/telecom/BluetoothPhoneServiceImpl.java. Are there any relationship between them?
I want to know how to find the code form this trackback log. And is it a Android or Java characteristic ?
what is its name? Where can i learn it?
the log is follow.
2024-09-11 20:00:31.365 1263-3516 BluetoothHeadset com.vdroid I java.lang.Throwable
at android.bluetooth.BluetoothHeadset.phoneStateChanged(BluetoothHeadset.java:970)
at java.lang.reflect.Method.invoke(Native Method)
at android.bluetooth.BluetoothPhoneService.updateInThread(BluetoothPhoneService.java:429)
at android.bluetooth.BluetoothPhoneService.access$800(BluetoothPhoneService.java:31)
at android.bluetooth.BluetoothPhoneService$BluetoothAsyncTask.doInBackground(BluetoothPhoneService.java:775)
at android.bluetooth.BluetoothPhoneService$BluetoothAsyncTask.doInBackground(BluetoothPhoneService.java:758)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
2
Pay close attention to the package name.
Notice the app that is having the issue is com.vdroid
which is not part of AOSP. Also AOSP does not have a class with the fully qualified name android.bluetooth.BluetoothPhoneService
. The source code you found is for com.android.server.telecom.components.BluetoothPhoneService
which is a different class.
The best conclusion thus is that the application com.vdroid
has it’s own class named android.bluetooth.BluetoothPhoneService
which is not part of AOSP. Interestingly that class appears to be using reflection to access the class android.bluetooth.BluetoothHeadset
which really is part of AOSP: https://cs.android.com/android/platform/superproject/+/android14-dev:packages/modules/Bluetooth/framework/java/android/bluetooth/BluetoothHeadset.java
Unless you are the author of com.vdroid
or it is a well known open source project (don’t think so) it won’t be possible to find the source for their android.bluetooth.BluetoothPhoneService
class.
All that being said even if it was an AOSP class it is hard to correlate AOSP code to what is running on most phones since AOSP is moving target: there are many versions of Android and Google/vendors are constantly making tweaks/fixes/patches.
If you have a Pixel device or are using the emulator you can look at build tags to determine the precise AOSP git tag, see https://source.android.com/docs/setup/reference/build-numbers
On the other hand if you are using a Samsung or some other vendors device then it’s impossible to know which exact code will match what is running on the phone since Apache 2.0 does not mandate that vendors release their code changes to AOSP.