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

Unverified Commit 8d3ba5cf authored by Oliver Scott's avatar Oliver Scott Committed by Michael Bestas
Browse files

Implement firewall status bar indicator



* Add API to get the last resumed activity's UID
* Show blocked status indicator based on the last resumed activity's
  UID blocked status
* Rely on NetworkCallbacks from ConnectivityManager instead of network
  policy callbacks from INetworkPolicyListener to react to blocked
  status changes rather than policy changes

Co-authored-by: default avatarMichael Bestas <mkbestas@gmail.com>
Change-Id2: Ic5ba608ed468ae50dba5e92a4350b2cd7a190221
Change-Id: I7aa405e7f5a2f70e6cf2b6156a29d220617e4ae5
parent cfe8392b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -288,6 +288,11 @@ interface IActivityTaskManager {
     */
    int getLastResumedActivityUserId();

    /**
     * Return the uid of last resumed activity.
     */
    int getLastResumedActivityUid();

    /**
     * Updates global configuration and applies changes to the entire system.
     * @param values Update values for global configuration. If null is passed it will request the
+1 −0
Original line number Diff line number Diff line
@@ -401,6 +401,7 @@ class PhoneStatusBarPolicyTest : SysuiTestCase() {

    private fun createStatusBarPolicy(): PhoneStatusBarPolicy {
        return PhoneStatusBarPolicy(
            context,
            iconController,
            commandQueue,
            broadcastDispatcher,
+9 −0
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
  <path
      android:fillColor="#FF000000"
      android:pathData="M11,8.17L6.49,3.66C8.07,2.61 9.96,2 12,2c5.52,0 10,4.48 10,10c0,2.04 -0.61,3.93 -1.66,5.51l-1.46,-1.46C19.59,14.87 20,13.48 20,12c0,-3.35 -2.07,-6.22 -5,-7.41V5c0,1.1 -0.9,2 -2,2h-2V8.17zM21.19,21.19l-1.41,1.41l-2.27,-2.27C15.93,21.39 14.04,22 12,22C6.48,22 2,17.52 2,12c0,-2.04 0.61,-3.93 1.66,-5.51L1.39,4.22l1.41,-1.41L21.19,21.19zM11,18c-1.1,0 -2,-0.9 -2,-2v-1l-4.79,-4.79C4.08,10.79 4,11.38 4,12c0,4.08 3.05,7.44 7,7.93V18z"/>
</vector>
+4 −0
Original line number Diff line number Diff line
@@ -104,4 +104,8 @@
    <string name="vpn_credentials_username">Username</string>
    <string name="vpn_credentials_password">Password</string>
    <string name="vpn_credentials_dialog_connect">Connect</string>

    <!-- Name of the firewall status bar icon. -->
    <string name="status_bar_firewall">Firewall</string>
    <string name="status_bar_firewall_slot" translatable="false">firewall</string>
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -28,6 +28,10 @@
        android:key="headset"
        android:title="@string/headset" />

    <com.android.systemui.tuner.StatusBarSwitch
        android:key="firewall"
        android:title="@string/status_bar_firewall" />

    <com.android.systemui.tuner.StatusBarSwitch
        android:icon="@drawable/ic_statusbar_work"
        android:key="managed_profile"
Loading