Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3e7386b authored by Sam Hurst's avatar Sam Hurst Committed by Rakesh Iyer
Browse files

Check for null pointer before use.

Bug: 29044977
Change-Id: Ie20c656598eeb2e4700dc245c83e6a765e186117
(cherry picked from commit f384fbf05d000775b00f25fd78bda090afb088d0)
parent 7bc7be23
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);
    }
+7 −3
Original line number Diff line number Diff line
@@ -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() {