Merge "Check for null pointer before use."

This commit is contained in:
TreeHugger Robot
2016-06-01 18:41:20 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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() {