Merge "Check for null pointer before use."
This commit is contained in:
committed by
Android (Google) Code Review
commit
86956c2f50
@@ -78,6 +78,10 @@ public class CarBatteryController extends BroadcastReceiver implements BatteryCo
|
||||
public CarBatteryController(Context context) {
|
||||
mContext = context;
|
||||
|
||||
if (mAdapter == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mAdapter.getProfileProxy(context.getApplicationContext(), mHfpServiceListener,
|
||||
BluetoothProfile.HEADSET_CLIENT);
|
||||
}
|
||||
|
||||
@@ -69,12 +69,16 @@ public class ConnectedDeviceSignalController extends BroadcastReceiver {
|
||||
mNetworkSignalView = (ImageView)
|
||||
mSignalsView.findViewById(R.id.connected_device_network_signal);
|
||||
|
||||
mAdapter.getProfileProxy(context.getApplicationContext(), mHfpServiceListener,
|
||||
BluetoothProfile.HEADSET_CLIENT);
|
||||
|
||||
TypedValue typedValue = new TypedValue();
|
||||
context.getResources().getValue(R.dimen.status_bar_icon_scale_factor, typedValue, true);
|
||||
mIconScaleFactor = typedValue.getFloat();
|
||||
|
||||
if (mAdapter == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mAdapter.getProfileProxy(context.getApplicationContext(), mHfpServiceListener,
|
||||
BluetoothProfile.HEADSET_CLIENT);
|
||||
}
|
||||
|
||||
public void startListening() {
|
||||
|
||||
Reference in New Issue
Block a user