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

Commit be1fa864 authored by Ethan Chen's avatar Ethan Chen
Browse files

Add config to show WiFi/data activity indicators

Change-Id: Iaf4d7065a2f3be4ed96f9f4072676260bb5f2d1c
parent 0c99b80d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -369,4 +369,10 @@

    <!-- Region locked prebundled packages -->
    <java-symbol type="array" name="config_region_locked_packages" />

    <!-- Show data activity indicators on signal bar -->
    <java-symbol type="bool" name="config_showDataActivityIndicators" />

    <!-- Show WiFi activity indicators on signal bar -->
    <java-symbol type="bool" name="config_showWifiActivityIndicators" />
</resources>
+5 −0
Original line number Diff line number Diff line
@@ -2375,4 +2375,9 @@
    <string-array name="config_region_locked_packages" translatable="false">
    </string-array>

    <!-- Show data activity indicators on signal bar -->
    <bool name="config_showDataActivityIndicators">true</bool>

    <!-- Show WiFi activity indicators on signal bar -->
    <bool name="config_showWifiActivityIndicators">true</bool>
</resources>
+12 −7
Original line number Diff line number Diff line
@@ -848,7 +848,8 @@ public class NetworkControllerImpl extends BroadcastReceiver
            Handler handler = new WifiHandler();
            mWifiChannel = new AsyncChannel();
            Messenger wifiMessenger = mWifiManager.getWifiServiceMessenger();
            if (wifiMessenger != null) {
            if (wifiMessenger != null &&
                    context.getResources().getBoolean(com.android.internal.R.bool.config_showWifiActivityIndicators)) {
                mWifiChannel.connect(context, handler, wifiMessenger);
            }
            // WiFi only has one state.
@@ -1129,12 +1130,16 @@ public class NetworkControllerImpl extends BroadcastReceiver
         * Start listening for phone state changes.
         */
        public void registerListener() {
            mPhone.listen(mPhoneStateListener,
                    PhoneStateListener.LISTEN_SERVICE_STATE
                            | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
                            | PhoneStateListener.LISTEN_CALL_STATE
                            | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
                            | PhoneStateListener.LISTEN_DATA_ACTIVITY);
            int eventMask = PhoneStateListener.LISTEN_SERVICE_STATE |
                PhoneStateListener.LISTEN_SIGNAL_STRENGTHS |
                PhoneStateListener.LISTEN_CALL_STATE |
                PhoneStateListener.LISTEN_DATA_CONNECTION_STATE;

            if (mContext.getResources().getBoolean(com.android.internal.R.bool.config_showDataActivityIndicators)) {
                eventMask = eventMask | PhoneStateListener.LISTEN_DATA_ACTIVITY;
            }

            mPhone.listen(mPhoneStateListener, eventMask);
        }

        /**