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

Commit bb51d9fe authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Fix UMS broadcasts in Tethering.

Now Tethering gets notified of UMS changes.  Turns out UMS Broadcasts
have attached data with a file scheme and the filter had to be set
correctly.

bug:2504908
Change-Id: I67d979000196c90068fe59846b4fa2bbf6ea00d8
parent 10362ab9
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -123,17 +123,21 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
        mTetherMasterSM = new TetherMasterSM("TetherMaster", mLooper);
        mTetherMasterSM.start();

        // TODO - remove this hack after real USB connections are detected.
        mStateReceiver = new StateReceiver();
        IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_BATTERY_CHANGED);
        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
        filter.addAction(Intent.ACTION_BOOT_COMPLETED);
        mContext.registerReceiver(mStateReceiver, filter);

        filter = new IntentFilter();
        filter.addAction(Intent.ACTION_MEDIA_SHARED);
        filter.addAction(Intent.ACTION_MEDIA_UNSHARED);
        filter.addDataScheme("file");
        mContext.registerReceiver(mStateReceiver, filter);

        mUsbMassStorageOff = !Environment.MEDIA_SHARED.equals(
                Environment.getExternalStorageState());
        mStateReceiver = new StateReceiver();
        mContext.registerReceiver(mStateReceiver, filter);

        mDhcpRange = context.getResources().getStringArray(
                com.android.internal.R.array.config_tether_dhcp_range);