Revert "Exports API to allow RULE_MATCH_UID support both RECORDE..."
Revert submission 14702753-audio_injection_by_uid Reason for revert: moving API work to master. Reverted Changes: I92775675e:Add Gts test for audio injection with UID-based mi... I8eebfc8c1:Exports API to allow RULE_MATCH_UID support both R... Bug: 183693610 Change-Id: I4e448e9a1215eeddcd4d93b5e7389c6d428ffde3
This commit is contained in:
@@ -5388,8 +5388,6 @@ package android.media.audiopolicy {
|
|||||||
field public static final int MIX_STATE_DISABLED = -1; // 0xffffffff
|
field public static final int MIX_STATE_DISABLED = -1; // 0xffffffff
|
||||||
field public static final int MIX_STATE_IDLE = 0; // 0x0
|
field public static final int MIX_STATE_IDLE = 0; // 0x0
|
||||||
field public static final int MIX_STATE_MIXING = 1; // 0x1
|
field public static final int MIX_STATE_MIXING = 1; // 0x1
|
||||||
field public static final int MIX_TYPE_PLAYERS = 0; // 0x0
|
|
||||||
field public static final int MIX_TYPE_RECORDERS = 1; // 0x1
|
|
||||||
field public static final int ROUTE_FLAG_LOOP_BACK = 2; // 0x2
|
field public static final int ROUTE_FLAG_LOOP_BACK = 2; // 0x2
|
||||||
field public static final int ROUTE_FLAG_RENDER = 1; // 0x1
|
field public static final int ROUTE_FLAG_RENDER = 1; // 0x1
|
||||||
}
|
}
|
||||||
@@ -5403,7 +5401,6 @@ package android.media.audiopolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class AudioMixingRule {
|
public class AudioMixingRule {
|
||||||
method public int getTargetMixType();
|
|
||||||
field public static final int RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET = 2; // 0x2
|
field public static final int RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET = 2; // 0x2
|
||||||
field public static final int RULE_MATCH_ATTRIBUTE_USAGE = 1; // 0x1
|
field public static final int RULE_MATCH_ATTRIBUTE_USAGE = 1; // 0x1
|
||||||
field public static final int RULE_MATCH_UID = 4; // 0x4
|
field public static final int RULE_MATCH_UID = 4; // 0x4
|
||||||
@@ -5418,7 +5415,6 @@ package android.media.audiopolicy {
|
|||||||
method public android.media.audiopolicy.AudioMixingRule build();
|
method public android.media.audiopolicy.AudioMixingRule build();
|
||||||
method public android.media.audiopolicy.AudioMixingRule.Builder excludeMixRule(int, Object) throws java.lang.IllegalArgumentException;
|
method public android.media.audiopolicy.AudioMixingRule.Builder excludeMixRule(int, Object) throws java.lang.IllegalArgumentException;
|
||||||
method public android.media.audiopolicy.AudioMixingRule.Builder excludeRule(android.media.AudioAttributes, int) throws java.lang.IllegalArgumentException;
|
method public android.media.audiopolicy.AudioMixingRule.Builder excludeRule(android.media.AudioAttributes, int) throws java.lang.IllegalArgumentException;
|
||||||
method @NonNull public android.media.audiopolicy.AudioMixingRule.Builder setTargetMixType(int);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AudioPolicy {
|
public class AudioPolicy {
|
||||||
|
|||||||
@@ -113,10 +113,12 @@ public class AudioMix {
|
|||||||
*/
|
*/
|
||||||
public static final int MIX_TYPE_INVALID = -1;
|
public static final int MIX_TYPE_INVALID = -1;
|
||||||
/**
|
/**
|
||||||
|
* @hide
|
||||||
* Mix type indicating playback streams are mixed.
|
* Mix type indicating playback streams are mixed.
|
||||||
*/
|
*/
|
||||||
public static final int MIX_TYPE_PLAYERS = 0;
|
public static final int MIX_TYPE_PLAYERS = 0;
|
||||||
/**
|
/**
|
||||||
|
* @hide
|
||||||
* Mix type indicating recording streams are mixed.
|
* Mix type indicating recording streams are mixed.
|
||||||
*/
|
*/
|
||||||
public static final int MIX_TYPE_RECORDERS = 1;
|
public static final int MIX_TYPE_RECORDERS = 1;
|
||||||
|
|||||||
@@ -16,9 +16,6 @@
|
|||||||
|
|
||||||
package android.media.audiopolicy;
|
package android.media.audiopolicy;
|
||||||
|
|
||||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
|
||||||
|
|
||||||
import android.annotation.IntDef;
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.compat.annotation.UnsupportedAppUsage;
|
import android.compat.annotation.UnsupportedAppUsage;
|
||||||
@@ -27,7 +24,6 @@ import android.os.Build;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -203,19 +199,7 @@ public class AudioMixingRule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final int mTargetMixType;
|
private final int mTargetMixType;
|
||||||
|
int getTargetMixType() { return mTargetMixType; }
|
||||||
/** @hide */
|
|
||||||
@IntDef({AudioMix.MIX_TYPE_PLAYERS, AudioMix.MIX_TYPE_RECORDERS})
|
|
||||||
@Retention(SOURCE)
|
|
||||||
public @interface MixType {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets target mix type of the mixing rule.
|
|
||||||
*/
|
|
||||||
public @MixType int getTargetMixType() {
|
|
||||||
return mTargetMixType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||||
private final ArrayList<AudioMixMatchCriterion> mCriteria;
|
private final ArrayList<AudioMixMatchCriterion> mCriteria;
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@@ -485,24 +469,17 @@ public class AudioMixingRule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets target mix type of the mixing rule.
|
* Set target mix type of the mixing rule.
|
||||||
*
|
*
|
||||||
* <p>Note: If the mix type was not specified, it will be decided automatically by matched
|
* <p>Note: If the mix type was not specified, it will be decided automatically by mixing
|
||||||
* mixing rule. For example, {@link AudioMixingRule#RULE_MATCH_ATTRIBUTE_USAGE} or {@link
|
* rule. For {@link #RULE_MATCH_UID}, the default type is {@link AudioMix#MIX_TYPE_PLAYERS}.
|
||||||
* AudioMixingRule#RULE_MATCH_USERID} applied {@link AudioMix#MIX_TYPE_PLAYERS}, {@link
|
|
||||||
* AudioMixingRule#RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET} applied {@link
|
|
||||||
* AudioMix#MIX_TYPE_RECORDERS}. For {@link AudioMixingRule#RULE_MATCH_UID}, the mix type
|
|
||||||
* could be {@link AudioMix#MIX_TYPE_PLAYERS} or {@link AudioMix#MIX_TYPE_RECORDERS}, and
|
|
||||||
* {@link AudioMix#MIX_TYPE_PLAYERS} is the default value.
|
|
||||||
*
|
*
|
||||||
* @param mixType {@link AudioMix#MIX_TYPE_PLAYERS} or {@link AudioMix#MIX_TYPE_RECORDERS}
|
* @param mixType {@link AudioMix#MIX_TYPE_PLAYERS} or {@link AudioMix#MIX_TYPE_RECORDERS}
|
||||||
* @return the same Builder instance.
|
* @return the same Builder instance.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
public @NonNull Builder setTargetMixType(@MixType int mixType) {
|
public @NonNull Builder setTargetMixType(int mixType) {
|
||||||
if (mixType != AudioMix.MIX_TYPE_PLAYERS && mixType != AudioMix.MIX_TYPE_RECORDERS) {
|
|
||||||
throw new IllegalArgumentException("Illegal argument for mix type");
|
|
||||||
}
|
|
||||||
|
|
||||||
mTargetMixType = mixType;
|
mTargetMixType = mixType;
|
||||||
Log.i("AudioMixingRule", "Builder setTargetMixType " + mixType);
|
Log.i("AudioMixingRule", "Builder setTargetMixType " + mixType);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Reference in New Issue
Block a user