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

Commit 3d3ad023 authored by Yiwen Chen's avatar Yiwen Chen
Browse files

Add Ramping Ringer platform flags and fix some Ringtone bugs.

Bug: 120789399
Test: When finish the whole change, flash into a dev phone to test first.
Change-Id: Ifd952cf7dfc8fedb6b1b95d276fd8a46e79d172b
parent 302d36b6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -5529,6 +5529,12 @@ package android.provider {
    method public void onPropertyChanged(String, String, String);
  }
  public static interface DeviceConfig.Telephony {
    field public static final String NAMESPACE = "telephony";
    field public static final String PROPERTY_ENABLE_RAMPING_RINGER = "enable_ramping_ringer";
    field public static final String PROPERTY_RAMPING_RINGER_DURATION = "ramping_duration";
  }
  public final class DocumentsContract {
    method public static boolean isManageMode(android.net.Uri);
    method public static android.net.Uri setManageMode(android.net.Uri);
+18 −0
Original line number Diff line number Diff line
@@ -103,6 +103,24 @@ public final class DeviceConfig {
    @SystemApi
    public static final String NAMESPACE_NOTIFICATION_ASSISTANT = "notification_assistant";

    /**
     * Telephony related properties definitions.
     *
     * @hide
     */
    @SystemApi
    public interface Telephony {
        String NAMESPACE = "telephony";
        /**
         * Whether to apply ramping ringer on incoming phone calls.
         */
        String PROPERTY_ENABLE_RAMPING_RINGER = "enable_ramping_ringer";
        /**
         * Ringer ramping time in milliseconds.
         */
        String PROPERTY_RAMPING_RINGER_DURATION = "ramping_duration";
    }

    private static final Object sLock = new Object();
    @GuardedBy("sLock")
    private static Map<OnPropertyChangedListener, Pair<String, Executor>> sListeners =
+2 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ public class Ringtone {
        mAudioAttributes = attributes;
        // The audio attributes have to be set before the media player is prepared.
        // Re-initialize it.
        setUri(mUri);
        setUri(mUri, mVolumeShaperConfig);
    }

    /**
@@ -415,6 +415,7 @@ public class Ringtone {
            mLocalPlayer.reset();
            mLocalPlayer.release();
            mLocalPlayer = null;
            mVolumeShaper = null;
            synchronized (sActiveRingtones) {
                sActiveRingtones.remove(this);
            }