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

Commit b25334ca authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Allow sysui-managed remote volume controllers."

parents d6d468ed cdb57aeb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ interface INotificationManager

    ZenModeConfig getZenModeConfig();
    boolean setZenModeConfig(in ZenModeConfig config);
    oneway void setZenMode(int mode);
    oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions);
    oneway void requestZenModeConditions(in IConditionListener callback, int relevance);
    oneway void setZenModeCondition(in Condition condition);
+51 −0
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.StrictMode;
import android.os.UserHandle;
import android.service.notification.Condition;
import android.service.notification.IConditionListener;
import android.service.notification.ZenModeConfig;
import android.util.Log;

/**
@@ -276,5 +279,53 @@ public class NotificationManager
        }
    }

    /**
     * @hide
     */
    public void setZenMode(int mode) {
        INotificationManager service = getService();
        try {
            service.setZenMode(mode);
        } catch (RemoteException e) {
        }
    }

    /**
     * @hide
     */
    public void requestZenModeConditions(IConditionListener listener, int relevance) {
        INotificationManager service = getService();
        try {
            service.requestZenModeConditions(listener, relevance);
        } catch (RemoteException e) {
        }
    }

    /**
     * @hide
     */
    public void setZenModeCondition(Condition exitCondition) {
        INotificationManager service = getService();
        try {
            service.setZenModeCondition(exitCondition);
        } catch (RemoteException e) {
        }
    }

    /**
     * @hide
     */
    public Condition getZenModeCondition() {
        INotificationManager service = getService();
        try {
            final ZenModeConfig config = service.getZenModeConfig();
            if (config != null) {
                return config.exitCondition;
            }
        } catch (RemoteException e) {
        }
        return null;
    }

    private Context mContext;
}
+4 −0
Original line number Diff line number Diff line
@@ -5289,6 +5289,10 @@ public final class Settings {
        /** @hide */
        public static final String BAR_SERVICE_COMPONENT = "bar_service_component";

        /** @hide */
        public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
                = "volume_controller_service_component";

        /** @hide */
        public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";

+2 −2
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
 */
package android.media;

import android.os.IBinder;

import com.android.server.LocalServices;

/**
@@ -47,6 +45,8 @@ public abstract class AudioManagerInternal {

    public abstract void setRingerModeInternal(int ringerMode, String caller);

    public abstract int getVolumeControllerUid();

    public interface RingerModeDelegate {
        /** Called when external ringer mode is evaluated, returns the new internal ringer mode */
        int onSetRingerModeExternal(int ringerModeOld, int ringerModeNew, String caller,
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
    <item type="id" name="notification_power"/>
    <item type="id" name="notification_screenshot"/>
    <item type="id" name="notification_hidden"/>
    <item type="id" name="notification_volumeui"/>

    <!-- Whether the icon is from a notification for which targetSdk < L -->
    <item type="id" name="icon_is_pre_L"/>
Loading