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

Commit b4782526 authored by John Spurlock's avatar John Spurlock
Browse files

Display notification effects suppressor in the volume panel.

Bug:16958514

Change-Id: I0eac173875e8af62e3c6b39001722c3fda4517de
parent a34cb5e3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -62,6 +62,8 @@ interface INotificationManager
    void requestHintsFromListener(in INotificationListener token, int hints);
    int getHintsFromListener(in INotificationListener token);

    ComponentName getEffectsSuppressor();

    ZenModeConfig getZenModeConfig();
    boolean setZenModeConfig(in ZenModeConfig config);
    oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions);
+24 −0
Original line number Diff line number Diff line
@@ -16,7 +16,9 @@

package android.app;

import android.annotation.SdkConstant;
import android.app.Notification.Builder;
import android.content.ComponentName;
import android.content.Context;
import android.os.Handler;
import android.os.IBinder;
@@ -72,6 +74,16 @@ public class NotificationManager
    private static String TAG = "NotificationManager";
    private static boolean localLOGV = false;

    /**
     * Intent that is broadcast when the state of {@link #getEffectsSuppressor()} changes.
     * This broadcast is only sent to registered receivers.
     *
     * @hide
     */
    @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_EFFECTS_SUPPRESSOR_CHANGED
            = "android.os.action.ACTION_EFFECTS_SUPPRESSOR_CHANGED";

    private static INotificationManager sService;

    /** @hide */
@@ -227,5 +239,17 @@ public class NotificationManager
        }
    }

    /**
     * @hide
     */
    public ComponentName getEffectsSuppressor() {
        INotificationManager service = getService();
        try {
            return service.getEffectsSuppressor();
        } catch (RemoteException e) {
            return null;
        }
    }

    private Context mContext;
}
+24 −0
Original line number Diff line number Diff line
<!--
Copyright (C) 2014 The Android Open Source Project

   Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="32dp"
        android:height="32dp"
        android:viewportWidth="48.0"
        android:viewportHeight="48.0">
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M23.000000,44.000000c2.200000,0.000000 4.000000,-1.800000 4.000000,-4.000000l-8.000000,0.000000C19.000000,42.200001 20.799999,44.000000 23.000000,44.000000zM36.000000,21.000000c0.000000,-6.100000 -4.300000,-11.300000 -10.000000,-12.600000L26.000000,7.000000c0.000000,-1.700000 -1.300000,-3.000000 -3.000000,-3.000000c-1.700000,0.000000 -3.000000,1.300000 -3.000000,3.000000l0.000000,1.400000c-1.000000,0.200000 -2.000000,0.600000 -2.900000,1.100000L36.000000,28.400000L36.000000,21.000000zM35.500000,38.000000l4.000000,4.000000l2.500000,-2.500000L8.500000,6.000000L6.000000,8.500000l5.800000,5.800000C10.700000,16.299999 10.000000,18.600000 10.000000,21.000000l0.000000,11.000000l-4.000000,4.000000l0.000000,2.000000L35.500000,38.000000z"/>
</vector>
+23 −7
Original line number Diff line number Diff line
@@ -29,14 +29,30 @@
        android:background="@drawable/btn_borderless_rect"
        android:contentDescription="@null" />

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1" >

        <TextView
            android:id="@+id/suppressor"
            android:visibility="gone"
            android:textAppearance="@style/TextAppearance.QS.VolumeSuppressor"
            android:paddingStart="8dp"
            android:paddingEnd="8dp"
            android:singleLine="true"
            android:ellipsize="end"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <SeekBar
            android:id="@+id/seekbar"
        android:layout_width="0dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
        android:layout_weight="1"
            android:paddingBottom="0dp"
            android:paddingEnd="16dp"
            android:paddingStart="8dp"
        android:paddingTop="0dip" />
            android:paddingTop="0dp" />

    </FrameLayout>
</LinearLayout>
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -141,6 +141,11 @@
        <item name="android:textColor">@color/system_accent_color</item>
    </style>

    <style name="TextAppearance.QS.VolumeSuppressor">
        <item name="android:textSize">14sp</item>
        <item name="android:textColor">@color/qs_tile_text</item>
    </style>

    <style name="TextAppearance.QS.DetailButton">
        <item name="android:textSize">14sp</item>
        <item name="android:textAllCaps">true</item>
Loading