Loading media/java/android/media/AudioManager.java +15 −6 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import android.compat.annotation.ChangeId; import android.compat.annotation.EnabledSince; import android.compat.annotation.Overridable; import android.compat.annotation.UnsupportedAppUsage; import android.content.AttributionSource; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -1918,12 +1919,18 @@ public class AudioManager { @Deprecated public void setSpeakerphoneOn(boolean on) { final IAudioService service = getService(); try { service.setSpeakerphoneOn(mICallBack, on); service.setSpeakerphoneOn(mICallBack, on, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } private AttributionSource getAttributionSource() { Context context = getContext(); return (context != null) ? context.getAttributionSource() : AttributionSource.myAttributionSource(); } /** * Checks whether the speakerphone is on or off. * Loading Loading @@ -3089,7 +3096,8 @@ public class AudioManager { final IAudioService service = getService(); try { service.startBluetoothSco(mICallBack, getContext().getApplicationInfo().targetSdkVersion); getContext().getApplicationInfo().targetSdkVersion, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -3114,7 +3122,7 @@ public class AudioManager { public void startBluetoothScoVirtualCall() { final IAudioService service = getService(); try { service.startBluetoothScoVirtualCall(mICallBack); service.startBluetoothScoVirtualCall(mICallBack, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -3134,7 +3142,7 @@ public class AudioManager { @Deprecated public void stopBluetoothSco() { final IAudioService service = getService(); try { service.stopBluetoothSco(mICallBack); service.stopBluetoothSco(mICallBack, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -9023,7 +9031,8 @@ public class AudioManager { Log.w(TAG, "setCommunicationDevice: device not found: " + device); return false; } return getService().setCommunicationDevice(mICallBack, device.getId()); return getService().setCommunicationDevice(mICallBack, device.getId(), getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -9035,7 +9044,7 @@ public class AudioManager { */ public void clearCommunicationDevice() { try { getService().setCommunicationDevice(mICallBack, 0); getService().setCommunicationDevice(mICallBack, 0, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading media/java/android/media/IAudioService.aidl +6 −5 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ interface IAudioService { int getEncodedSurroundMode(int targetSdkVersion); void setSpeakerphoneOn(IBinder cb, boolean on); void setSpeakerphoneOn(IBinder cb, boolean on, in AttributionSource attributionSource); boolean isSpeakerphoneOn(); Loading Loading @@ -263,9 +263,10 @@ interface IAudioService { int getCurrentAudioFocus(); void startBluetoothSco(IBinder cb, int targetSdkVersion); void startBluetoothScoVirtualCall(IBinder cb); void stopBluetoothSco(IBinder cb); void startBluetoothSco(IBinder cb, int targetSdkVersion, in AttributionSource attributionSource); void startBluetoothScoVirtualCall(IBinder cb, in AttributionSource attributionSource); void stopBluetoothSco(IBinder cb, in AttributionSource attributionSource); void forceVolumeControlStream(int streamType, IBinder cb); Loading Loading @@ -542,7 +543,7 @@ interface IAudioService { int[] getAvailableCommunicationDeviceIds(); boolean setCommunicationDevice(IBinder cb, int portId); boolean setCommunicationDevice(IBinder cb, int portId, in AttributionSource attributionSource); int getCommunicationDevice(); Loading Loading
media/java/android/media/AudioManager.java +15 −6 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import android.compat.annotation.ChangeId; import android.compat.annotation.EnabledSince; import android.compat.annotation.Overridable; import android.compat.annotation.UnsupportedAppUsage; import android.content.AttributionSource; import android.content.ComponentName; import android.content.Context; import android.content.Intent; Loading Loading @@ -1918,12 +1919,18 @@ public class AudioManager { @Deprecated public void setSpeakerphoneOn(boolean on) { final IAudioService service = getService(); try { service.setSpeakerphoneOn(mICallBack, on); service.setSpeakerphoneOn(mICallBack, on, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } private AttributionSource getAttributionSource() { Context context = getContext(); return (context != null) ? context.getAttributionSource() : AttributionSource.myAttributionSource(); } /** * Checks whether the speakerphone is on or off. * Loading Loading @@ -3089,7 +3096,8 @@ public class AudioManager { final IAudioService service = getService(); try { service.startBluetoothSco(mICallBack, getContext().getApplicationInfo().targetSdkVersion); getContext().getApplicationInfo().targetSdkVersion, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -3114,7 +3122,7 @@ public class AudioManager { public void startBluetoothScoVirtualCall() { final IAudioService service = getService(); try { service.startBluetoothScoVirtualCall(mICallBack); service.startBluetoothScoVirtualCall(mICallBack, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -3134,7 +3142,7 @@ public class AudioManager { @Deprecated public void stopBluetoothSco() { final IAudioService service = getService(); try { service.stopBluetoothSco(mICallBack); service.stopBluetoothSco(mICallBack, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -9023,7 +9031,8 @@ public class AudioManager { Log.w(TAG, "setCommunicationDevice: device not found: " + device); return false; } return getService().setCommunicationDevice(mICallBack, device.getId()); return getService().setCommunicationDevice(mICallBack, device.getId(), getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -9035,7 +9044,7 @@ public class AudioManager { */ public void clearCommunicationDevice() { try { getService().setCommunicationDevice(mICallBack, 0); getService().setCommunicationDevice(mICallBack, 0, getAttributionSource()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
media/java/android/media/IAudioService.aidl +6 −5 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ interface IAudioService { int getEncodedSurroundMode(int targetSdkVersion); void setSpeakerphoneOn(IBinder cb, boolean on); void setSpeakerphoneOn(IBinder cb, boolean on, in AttributionSource attributionSource); boolean isSpeakerphoneOn(); Loading Loading @@ -263,9 +263,10 @@ interface IAudioService { int getCurrentAudioFocus(); void startBluetoothSco(IBinder cb, int targetSdkVersion); void startBluetoothScoVirtualCall(IBinder cb); void stopBluetoothSco(IBinder cb); void startBluetoothSco(IBinder cb, int targetSdkVersion, in AttributionSource attributionSource); void startBluetoothScoVirtualCall(IBinder cb, in AttributionSource attributionSource); void stopBluetoothSco(IBinder cb, in AttributionSource attributionSource); void forceVolumeControlStream(int streamType, IBinder cb); Loading Loading @@ -542,7 +543,7 @@ interface IAudioService { int[] getAvailableCommunicationDeviceIds(); boolean setCommunicationDevice(IBinder cb, int portId); boolean setCommunicationDevice(IBinder cb, int portId, in AttributionSource attributionSource); int getCommunicationDevice(); Loading