code
stringlengths 11
173k
| docstring
stringlengths 2
593k
| func_name
stringlengths 2
189
| language
stringclasses 1
value | repo
stringclasses 844
values | path
stringlengths 11
294
| url
stringlengths 60
339
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public static int getDeviceIdLabel(Phone phone) {
if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM) {
return com.android.internal.R.string.imei;
} else if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
return com.android.internal.R.string.meid;
} else {
Rlog.w(LOG_TAG, "getDeviceIdLabel: no known label for phone "
+ phone.getPhoneName());
return 0;
}
} |
Returns a resource ID for a label to use when displaying the
"device id" of the current device. (This is currently used as the
title of the "device id" dialog.)
This is specific to the device's telephony technology: the device
id is called "IMEI" on GSM phones and "MEID" on CDMA phones.
| TelephonyCapabilities::getDeviceIdLabel | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | MIT |
public static boolean supportsConferenceCallManagement(Phone phone) {
return ((phone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM)
|| (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_SIP));
} |
Return true if the current phone supports the ability to explicitly
manage the state of a conference call (i.e. view the participants,
and hangup or separate individual callers.)
The in-call screen's "Manage conference" UI is available only on
devices that support this feature.
Currently this is assumed to be true on GSM phones and false otherwise.
| TelephonyCapabilities::supportsConferenceCallManagement | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | MIT |
public static boolean supportsHoldAndUnhold(Phone phone) {
return ((phone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM)
|| (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_SIP)
|| (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS));
} |
Return true if the current phone supports explicit "Hold" and
"Unhold" actions for an active call. (If so, the in-call UI will
provide onscreen "Hold" / "Unhold" buttons.)
Currently this is assumed to be true on GSM phones and false
otherwise. (In particular, CDMA has no concept of "putting a call
on hold.")
| TelephonyCapabilities::supportsHoldAndUnhold | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | MIT |
public static boolean supportsAnswerAndHold(Phone phone) {
return ((phone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM)
|| (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_SIP));
} |
Return true if the current phone supports distinct "Answer & Hold"
and "Answer & End" behaviors in the call-waiting scenario. If so,
the in-call UI may provide separate buttons or menu items for these
two actions.
Currently this is assumed to be true on GSM phones and false
otherwise. (In particular, CDMA has no concept of explicitly
managing the background call, or "putting a call on hold.")
TODO: It might be better to expose this capability in a more
generic form, like maybe "supportsExplicitMultipleLineManagement()"
rather than focusing specifically on call-waiting behavior.
| TelephonyCapabilities::supportsAnswerAndHold | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | MIT |
public static boolean canDistinguishDialingAndConnected(int phoneType) {
return phoneType == PhoneConstants.PHONE_TYPE_GSM;
} |
Returns true if the device can distinguish the phone's dialing state
(Call.State.DIALING/ALERTING) and connected state (Call.State.ACTIVE).
Currently this returns true for GSM phones as we cannot know when a CDMA
phone has transitioned from dialing/active to connected.
| TelephonyCapabilities::canDistinguishDialingAndConnected | java | Reginer/aosp-android-jar | android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/telephony/TelephonyCapabilities.java | MIT |
public Stub()
{
this.markVintfStability();
this.attachInterface(this, DESCRIPTOR);
} |
The version of this interface that the caller is built against.
This might be different from what {@link #getInterfaceVersion()
getInterfaceVersion} returns as that is the version of the interface
that the remote object is implementing.
public static final int VERSION = 2;
public static final String HASH = "ea8742d6993e1a82917da38b9938e537aa7fcb54";
/** Default implementation for IVibratorCallback.
public static class Default implements android.hardware.vibrator.IVibratorCallback
{
@Override public void onComplete() throws android.os.RemoteException
{
}
@Override
public int getInterfaceVersion() {
return 0;
}
@Override
public String getInterfaceHash() {
return "";
}
@Override
public android.os.IBinder asBinder() {
return null;
}
}
/** Local-side IPC implementation stub class.
public static abstract class Stub extends android.os.Binder implements android.hardware.vibrator.IVibratorCallback
{
/** Construct the stub at attach it to the interface. | Stub::Stub | java | Reginer/aosp-android-jar | android-34/src/android/hardware/vibrator/IVibratorCallback.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/vibrator/IVibratorCallback.java | MIT |
public static android.hardware.vibrator.IVibratorCallback asInterface(android.os.IBinder obj)
{
if ((obj==null)) {
return null;
}
android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
if (((iin!=null)&&(iin instanceof android.hardware.vibrator.IVibratorCallback))) {
return ((android.hardware.vibrator.IVibratorCallback)iin);
}
return new android.hardware.vibrator.IVibratorCallback.Stub.Proxy(obj);
} |
Cast an IBinder object into an android.hardware.vibrator.IVibratorCallback interface,
generating a proxy if needed.
| Stub::asInterface | java | Reginer/aosp-android-jar | android-34/src/android/hardware/vibrator/IVibratorCallback.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/vibrator/IVibratorCallback.java | MIT |
public T notation(Notation notation) {
return create(KEY_NOTATION, notation);
} |
Specifies the notation style (simple, scientific, or compact) for rendering numbers.
<ul>
<li>Simple notation: "12,300"
<li>Scientific notation: "1.23E4"
<li>Compact notation: "12K"
</ul>
<p>
All notation styles will be properly localized with locale data, and all notation styles are
compatible with units, rounding strategies, and other number formatter settings.
<p>
Pass this method the return value of a {@link Notation} factory method. For example:
<pre>
NumberFormatter.with().notation(Notation.compactShort())
</pre>
The default is to use simple notation.
@param notation
The notation strategy to use.
@return The fluent chain.
@see Notation
| NumberFormatterSettings::notation | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T unit(MeasureUnit unit) {
return create(KEY_UNIT, unit);
} |
Specifies the unit (unit of measure, currency, or percent) to associate with rendered numbers.
<ul>
<li>Unit of measure: "12.3 meters"
<li>Currency: "$12.30"
<li>Percent: "12.3%"
</ul>
<p>
<strong>Note:</strong> The unit can also be specified by passing a {@link Measure} to
{@link LocalizedNumberFormatter#format(Measure)}. Units specified via the format method take
precedence over units specified here. This setter is designed for situations when the unit is
constant for the duration of the number formatting process.
<p>
All units will be properly localized with locale data, and all units are compatible with notation
styles, rounding strategies, and other number formatter settings.
<p>
Pass this method any instance of {@link MeasureUnit}. For units of measure:
<pre>
NumberFormatter.with().unit(MeasureUnit.METER)
</pre>
Currency:
<pre>
NumberFormatter.with().unit(Currency.getInstance("USD"))
</pre>
<p>
See {@link #perUnit} for information on how to format strings like "5 meters per second".
<p>
If the input usage is correctly set the output unit <b>will change</b>
according to `usage`, `locale` and `unit` value.
</p>
@param unit
The unit to render.
@return The fluent chain.
@see MeasureUnit
@see Currency
@see #perUnit
| NumberFormatterSettings::unit | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T perUnit(MeasureUnit perUnit) {
return create(KEY_PER_UNIT, perUnit);
} |
Sets a unit to be used in the denominator. For example, to format "3 m/s", pass METER to the unit
and SECOND to the perUnit.
<p>
Pass this method any instance of {@link MeasureUnit}. For example:
<pre>
NumberFormatter.with().unit(MeasureUnit.METER).perUnit(MeasureUnit.SECOND)
</pre>
<p>
The default is not to display any unit in the denominator.
<p>
If a per-unit is specified without a primary unit via {@link #unit}, the behavior is undefined.
@param perUnit
The unit to render in the denominator.
@return The fluent chain
@see #unit
| NumberFormatterSettings::perUnit | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T precision(Precision precision) {
return create(KEY_PRECISION, precision);
} |
Specifies the rounding precision to use when formatting numbers.
<ul>
<li>Round to 3 decimal places: "3.142"
<li>Round to 3 significant figures: "3.14"
<li>Round to the closest nickel: "3.15"
<li>Do not perform rounding: "3.1415926..."
</ul>
<p>
Pass this method the return value of one of the factory methods on {@link Precision}. For example:
<pre>
NumberFormatter.with().precision(Precision.fixedFraction(2))
</pre>
<p>
In most cases, the default rounding precision is to round to 6 fraction places; i.e.,
<code>Precision.maxFraction(6)</code>. The exceptions are if compact notation is being used, then
the compact notation rounding precision is used (see {@link Notation#compactShort} for details), or
if the unit is a currency, then standard currency rounding is used, which varies from currency to
currency (see {@link Precision#currency} for details).
@param precision
The rounding precision to use.
@return The fluent chain.
@see Precision
| NumberFormatterSettings::precision | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T roundingMode(RoundingMode roundingMode) {
return create(KEY_ROUNDING_MODE, roundingMode);
} |
Specifies how to determine the direction to round a number when it has more digits than fit in the
desired precision. When formatting 1.235:
<ul>
<li>Ceiling rounding mode with integer precision: "2"
<li>Half-down rounding mode with 2 fixed fraction digits: "1.23"
<li>Half-up rounding mode with 2 fixed fraction digits: "1.24"
</ul>
The default is HALF_EVEN. For more information on rounding mode, see the ICU userguide here:
https://unicode-org.github.io/icu/userguide/format_parse/numbers/rounding-modes
@param roundingMode
The rounding mode to use.
@return The fluent chain.
@see Precision
| NumberFormatterSettings::roundingMode | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T grouping(GroupingStrategy strategy) {
return create(KEY_GROUPING, strategy);
} |
Specifies the grouping strategy to use when formatting numbers.
<ul>
<li>Default grouping: "12,300" and "1,230"
<li>Grouping with at least 2 digits: "12,300" and "1230"
<li>No grouping: "12300" and "1230"
</ul>
<p>
The exact grouping widths will be chosen based on the locale.
<p>
Pass this method an element from the {@link GroupingStrategy} enum. For example:
<pre>
NumberFormatter.with().grouping(GroupingStrategy.MIN2)
</pre>
The default is to perform grouping according to locale data; most locales, but not all locales,
enable it by default.
@param strategy
The grouping strategy to use.
@return The fluent chain.
@see GroupingStrategy
| NumberFormatterSettings::grouping | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T integerWidth(IntegerWidth style) {
return create(KEY_INTEGER, style);
} |
Specifies the minimum and maximum number of digits to render before the decimal mark.
<ul>
<li>Zero minimum integer digits: ".08"
<li>One minimum integer digit: "0.08"
<li>Two minimum integer digits: "00.08"
</ul>
<p>
Pass this method the return value of {@link IntegerWidth#zeroFillTo(int)}. For example:
<pre>
NumberFormatter.with().integerWidth(IntegerWidth.zeroFillTo(2))
</pre>
The default is to have one minimum integer digit.
@param style
The integer width to use.
@return The fluent chain.
@see IntegerWidth
| NumberFormatterSettings::integerWidth | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T symbols(DecimalFormatSymbols symbols) {
symbols = (DecimalFormatSymbols) symbols.clone();
return create(KEY_SYMBOLS, symbols);
} |
Specifies the symbols (decimal separator, grouping separator, percent sign, numerals, etc.) to use
when rendering numbers.
<ul>
<li><em>en_US</em> symbols: "12,345.67"
<li><em>fr_FR</em> symbols: "12 345,67"
<li><em>de_CH</em> symbols: "12’345.67"
<li><em>my_MY</em> symbols: "၁၂,၃၄၅.၆၇"
</ul>
<p>
Pass this method an instance of {@link DecimalFormatSymbols}. For example:
<pre>
NumberFormatter.with().symbols(DecimalFormatSymbols.getInstance(new ULocale("de_CH")))
</pre>
<p>
<strong>Note:</strong> DecimalFormatSymbols automatically chooses the best numbering system based
on the locale. In the examples above, the first three are using the Latin numbering system, and
the fourth is using the Myanmar numbering system.
<p>
<strong>Note:</strong> The instance of DecimalFormatSymbols will be copied: changes made to the
symbols object after passing it into the fluent chain will not be seen.
<p>
<strong>Note:</strong> Calling this method will override the NumberingSystem previously specified
in {@link #symbols(NumberingSystem)}.
<p>
The default is to choose the symbols based on the locale specified in the fluent chain.
@param symbols
The DecimalFormatSymbols to use.
@return The fluent chain.
@see DecimalFormatSymbols
| NumberFormatterSettings::symbols | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T symbols(NumberingSystem ns) {
return create(KEY_SYMBOLS, ns);
} |
Specifies that the given numbering system should be used when fetching symbols.
<ul>
<li>Latin numbering system: "12,345"
<li>Myanmar numbering system: "၁၂,၃၄၅"
<li>Math Sans Bold numbering system: "𝟭𝟮,𝟯𝟰𝟱"
</ul>
<p>
Pass this method an instance of {@link NumberingSystem}. For example, to force the locale to
always use the Latin alphabet numbering system (ASCII digits):
<pre>
NumberFormatter.with().symbols(NumberingSystem.LATIN)
</pre>
<p>
<strong>Note:</strong> Calling this method will override the DecimalFormatSymbols previously
specified in {@link #symbols(DecimalFormatSymbols)}.
<p>
The default is to choose the best numbering system for the locale.
@param ns
The NumberingSystem to use.
@return The fluent chain.
@see NumberingSystem
| NumberFormatterSettings::symbols | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T unitWidth(UnitWidth style) {
return create(KEY_UNIT_WIDTH, style);
} |
Sets the width of the unit (measure unit or currency). Most common values:
<ul>
<li>Short: "$12.00", "12 m"
<li>ISO Code: "USD 12.00"
<li>Full name: "12.00 US dollars", "12 meters"
</ul>
<p>
Pass an element from the {@link UnitWidth} enum to this setter. For example:
<pre>
NumberFormatter.with().unitWidth(UnitWidth.FULL_NAME)
</pre>
<p>
The default is the SHORT width.
@param style
The width to use when rendering numbers.
@return The fluent chain
@see UnitWidth
| NumberFormatterSettings::unitWidth | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T sign(SignDisplay style) {
return create(KEY_SIGN, style);
} |
Sets the plus/minus sign display strategy. Most common values:
<ul>
<li>Auto: "123", "-123"
<li>Always: "+123", "-123"
<li>Accounting: "$123", "($123)"
</ul>
<p>
Pass an element from the {@link SignDisplay} enum to this setter. For example:
<pre>
NumberFormatter.with().sign(SignDisplay.ALWAYS)
</pre>
<p>
The default is AUTO sign display.
@param style
The sign display strategy to use when rendering numbers.
@return The fluent chain
@see SignDisplay
| NumberFormatterSettings::sign | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T decimal(DecimalSeparatorDisplay style) {
return create(KEY_DECIMAL, style);
} |
Sets the decimal separator display strategy. This affects integer numbers with no fraction part.
Most common values:
<ul>
<li>Auto: "1"
<li>Always: "1."
</ul>
<p>
Pass an element from the {@link DecimalSeparatorDisplay} enum to this setter. For example:
<pre>
NumberFormatter.with().decimal(DecimalSeparatorDisplay.ALWAYS)
</pre>
<p>
The default is AUTO decimal separator display.
@param style
The decimal separator display strategy to use when rendering numbers.
@return The fluent chain
@see DecimalSeparatorDisplay
| NumberFormatterSettings::decimal | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T scale(Scale scale) {
return create(KEY_SCALE, scale);
} |
Sets a scale (multiplier) to be used to scale the number by an arbitrary amount before formatting.
Most common values:
<ul>
<li>Multiply by 100: useful for percentages.
<li>Multiply by an arbitrary value: useful for unit conversions.
</ul>
<p>
Pass an element from a {@link Scale} factory method to this setter. For example:
<pre>
NumberFormatter.with().scale(Scale.powerOfTen(2))
</pre>
<p>
The default is to not apply any multiplier.
@param scale
An amount to be multiplied against numbers before formatting.
@return The fluent chain
@see Scale
| NumberFormatterSettings::scale | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T usage(String usage) {
if (usage != null && usage.isEmpty()) {
return create(KEY_USAGE, null);
}
return create(KEY_USAGE, usage);
} |
Specifies the usage for which numbers will be formatted ("person-height",
"road", "rainfall", etc.)
<p>
When a `usage` is specified, the output unit will change depending on the
`Locale` and the unit quantity. For example, formatting length
measurements specified in meters:
<pre>
NumberFormatter.with().usage("person").unit(MeasureUnit.METER).locale(new ULocale("en-US"))
</pre>
<ul>
<li> When formatting 0.25, the output will be "10 inches".
<li> When formatting 1.50, the output will be "4 feet and 11 inches".
</ul>
<p>
The input unit specified via unit() determines the type of measurement
being formatted (e.g. "length" when the unit is "foot"). The usage
requested will be looked for only within this category of measurement
units.
<p>
The output unit can be found via FormattedNumber.getOutputUnit().
<p>
If the usage has multiple parts (e.g. "land-agriculture-grain") and does
not match a known usage preference, the last part will be dropped
repeatedly until a match is found (e.g. trying "land-agriculture", then
"land"). If a match is still not found, usage will fall back to
"default".
<p>
Setting usage to an empty string clears the usage (disables usage-based
localized formatting).
<p>
Setting a usage string but not a correct input unit will result in an
U_ILLEGAL_ARGUMENT_ERROR.
<p>
When using usage, specifying rounding or precision is unnecessary.
Specifying a precision in some manner will override the default
formatting.
@param usage A usage parameter from the units resource.
@return The fluent chain
@throws IllegalArgumentException in case of Setting a usage string but not a correct input unit.
| NumberFormatterSettings::usage | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public T displayOptions(DisplayOptions displayOptions) {
// `displayCase` does not recognise the `undefined`
if (displayOptions.getGrammaticalCase() == GrammaticalCase.UNDEFINED) {
return create(KEY_UNIT_DISPLAY_CASE, null);
}
return create(KEY_UNIT_DISPLAY_CASE, displayOptions.getGrammaticalCase().getIdentifier());
} |
Specifies the {@code DisplayOptions}. For example, {@code GrammaticalCase} specifies
the desired case for a unit formatter's output (e.g. accusative, dative, genitive).
@return The fluent chain.
@hide draft / provisional / internal are hidden on Android
| NumberFormatterSettings::displayOptions | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public String toSkeleton() {
return NumberSkeletonImpl.generate(resolve());
} |
Creates a skeleton string representation of this number formatter. A skeleton string is a
locale-agnostic serialized form of a number formatter.
<p>
Not all options are capable of being represented in the skeleton string; for example, a
DecimalFormatSymbols object. If any such option is encountered, an
{@link UnsupportedOperationException} is thrown.
<p>
The returned skeleton is in normalized form, such that two number formatters with equivalent
behavior should produce the same skeleton.
<p>
For more information on number skeleton strings, see:
https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html
@return A number skeleton string with behavior corresponding to this number formatter.
@throws UnsupportedOperationException
If the number formatter has an option that cannot be represented in a skeleton string.
@hide unsupported on Android
| NumberFormatterSettings::toSkeleton | java | Reginer/aosp-android-jar | android-34/src/android/icu/number/NumberFormatterSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/number/NumberFormatterSettings.java | MIT |
public Object[][] getContents() {
Object[][] contents = new Object[][] {
{ MsgKey.BAD_MSGKEY,
"\u041a\u043b\u044e\u0447 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ''{0}'' \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0441\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ''{1}''" },
{ MsgKey.BAD_MSGFORMAT,
"\u0424\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ''{0}'' \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ''{1}'' \u0432\u044b\u0437\u0432\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0443. " },
{ MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
"\u041a\u043b\u0430\u0441\u0441 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 ''{0}'' \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 org.xml.sax.ContentHandler. " },
{ MsgKey.ER_RESOURCE_COULD_NOT_FIND,
"\u0420\u0435\u0441\u0443\u0440\u0441 [ {0} ] \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d.\n {1}" },
{ MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 [ {0} ]: {1} \n {2} \t {3}" },
{ MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
"\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430 <=0" },
{ MsgKey.ER_INVALID_UTF16_SURROGATE,
"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 UTF-16: {0} ?" },
{ MsgKey.ER_OIERROR,
"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430" },
{ MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
"\u0410\u0442\u0440\u0438\u0431\u0443\u0442 {0} \u043d\u0435\u043b\u044c\u0437\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432 \u0438 \u0434\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d. " },
/*
* Note to translators: The stylesheet contained a reference to a
* namespace prefix that was undefined. The value of the substitution
* text is the name of the prefix.
*/
{ MsgKey.ER_NAMESPACE_PREFIX,
"\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 ''{0}'' \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e. " },
/*
* Note to translators: This message is reported if the stylesheet
* being processed attempted to construct an XML document with an
* attribute in a place other than on an element. The substitution text
* specifies the name of the attribute.
*/
{ MsgKey.ER_STRAY_ATTRIBUTE,
"\u0410\u0442\u0440\u0438\u0431\u0443\u0442 ''{0}'' \u0432\u043d\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. " },
/*
* Note to translators: As with the preceding message, a namespace
* declaration has the form of an attribute and is only permitted to
* appear on an element. The substitution text {0} is the namespace
* prefix and {1} is the URI that was being used in the erroneous
* namespace declaration.
*/
{ MsgKey.ER_STRAY_NAMESPACE,
"\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d ''{0}''=''{1}'' \u0432\u043d\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. " },
{ MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c ''{0}'' (\u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 CLASSPATH), \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e" },
{ MsgKey.ER_ILLEGAL_CHARACTER,
"\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 {0} \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 {1}. " },
{ MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0441\u0432\u043e\u0439\u0441\u0442\u0432 ''{0}'' \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 ''{1}'' (\u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 CLASSPATH)" },
{ MsgKey.ER_INVALID_PORT,
"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430" },
{ MsgKey.ER_PORT_WHEN_HOST_NULL,
"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0445\u043e\u0441\u0442\u0430" },
{ MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
"\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d \u0430\u0434\u0440\u0435\u0441 \u0445\u043e\u0441\u0442\u0430" },
{ MsgKey.ER_SCHEME_NOT_CONFORMANT,
"\u0421\u0445\u0435\u043c\u0430 \u043d\u0435 \u043a\u043e\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u0430." },
{ MsgKey.ER_SCHEME_FROM_NULL_STRING,
"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0434\u043b\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438" },
{ MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
"\u0412 \u0438\u043c\u0435\u043d\u0438 \u043f\u0443\u0442\u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f Esc-\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c" },
{ MsgKey.ER_PATH_INVALID_CHAR,
"\u0412 \u0438\u043c\u0435\u043d\u0438 \u043f\u0443\u0442\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b: {0}" },
{ MsgKey.ER_FRAG_INVALID_CHAR,
"\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b" },
{ MsgKey.ER_FRAG_WHEN_PATH_NULL,
"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u043f\u0443\u0442\u0438" },
{ MsgKey.ER_FRAG_FOR_GENERIC_URI,
"\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 URI" },
{ MsgKey.ER_NO_SCHEME_IN_URI,
"\u0412 URI \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0441\u0445\u0435\u043c\u0430" },
{ MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c URI \u0441 \u043f\u0443\u0441\u0442\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438" },
{ MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043f\u0443\u0442\u0438 \u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430" },
{ MsgKey.ER_NO_QUERY_STRING_IN_PATH,
"\u041d\u0435\u043b\u044c\u0437\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0443\u0442\u0438 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430" },
{ MsgKey.ER_NO_PORT_IF_NO_HOST,
"\u041d\u0435\u043b\u044c\u0437\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d \u0445\u043e\u0441\u0442" },
{ MsgKey.ER_NO_USERINFO_IF_NO_HOST,
"\u041d\u0435\u043b\u044c\u0437\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d \u0445\u043e\u0441\u0442" },
{ MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
"\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 ''{0}''. \u042d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f XML \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0412\u0435\u0440\u0441\u0438\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 ''1.0''. " },
{ MsgKey.ER_SCHEME_REQUIRED,
"\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0441\u0445\u0435\u043c\u0430!" },
/*
* Note to translators: The words 'Properties' and
* 'SerializerFactory' in this message are Java class names
* and should not be translated.
*/
{ MsgKey.ER_FACTORY_PROPERTY_MISSING,
"\u041e\u0431\u044a\u0435\u043a\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 SerializerFactory, \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c ''{0}''. " },
{ MsgKey.ER_ENCODING_NOT_SUPPORTED,
"\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: \u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 ''{0}'' \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Java." },
{MsgKey.ER_FEATURE_NOT_FOUND,
"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 ''{0}'' \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d. "},
{MsgKey.ER_FEATURE_NOT_SUPPORTED,
"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 ''{0}'' \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d, \u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c. "},
{MsgKey.ER_STRING_TOO_LONG,
"\u0421\u0442\u0440\u043e\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 DOMString: ''{0}''. "},
{MsgKey.ER_TYPE_MISMATCH_ERR,
"\u0422\u0438\u043f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0441 \u044d\u0442\u0438 \u0438\u043c\u0435\u043d\u0435\u043c \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. "},
{MsgKey.ER_NO_OUTPUT_SPECIFIED,
"\u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. "},
{MsgKey.ER_UNSUPPORTED_ENCODING,
"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430. "},
{MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0437\u0435\u043b. "},
{MsgKey.ER_CDATA_SECTIONS_SPLIT,
"\u0420\u0430\u0437\u0434\u0435\u043b CDATA \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439 ']]>'. "},
{MsgKey.ER_WARNING_WF_NOT_CHECKED,
"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 true, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c. "
},
{MsgKey.ER_WF_INVALID_CHARACTER,
"\u0423\u0437\u0435\u043b ''{0}'' \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b XML. "
},
{ MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
"\u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b XML (\u042e\u043d\u0438\u043a\u043e\u0434: 0x{0})."
},
{ MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
"\u041f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 instructiondata \u0431\u044b\u043b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b XML (\u042e\u043d\u0438\u043a\u043e\u0434: 0x{0}). "
},
{ MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
"\u0412 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c CDATASection \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b XML (\u042e\u043d\u0438\u043a\u043e\u0434: 0x{0})."
},
{ MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
"\u0412 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0437\u043b\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b XML (\u042e\u043d\u0438\u043a\u043e\u0434: 0x{0})."
},
{ MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b XML \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u044b \u0432 \u0443\u0437\u043b\u0435 {0} \u0441 \u0438\u043c\u0435\u043d\u0435\u043c ''{1}''. "
},
{ MsgKey.ER_WF_DASH_IN_COMMENT,
"\u0421\u0442\u0440\u043e\u043a\u0430 \"--\" \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. "
},
{MsgKey.ER_WF_LT_IN_ATTVAL,
"\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \"{1}\", \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u0442\u0438\u043f\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \"{0}\", \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b ''<''. "
},
{MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
"\u041d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \"&{0};\" \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430. "
},
{MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
"\u0412\u043d\u0435\u0448\u043d\u044f\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \"&{0};\" \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430. "
},
{MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
"\u041f\u0440\u0435\u0444\u0438\u043a\u0441 \"{0}\" \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d \"{1}\". "
},
{MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
"\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \"{0}\" \u043f\u0443\u0441\u0442\u043e. "
},
{MsgKey.ER_NULL_LOCAL_ATTR_NAME,
"\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \"{0}\" \u043f\u0443\u0441\u0442\u043e. "
},
{ MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
"\u0422\u0435\u043a\u0441\u0442 \u0437\u0430\u043c\u0435\u043d\u044b \u0434\u043b\u044f \u0443\u0437\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \"{0}\" \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0437\u0435\u043b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \"{1}\" \u0441 \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \"{2}\". "
},
{ MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
"\u0422\u0435\u043a\u0441\u0442 \u0437\u0430\u043c\u0435\u043d\u044b \u0434\u043b\u044f \u0443\u0437\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \"{0}\" \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0437\u0435\u043b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \"{1}\" \u0441 \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \"{2}\". "
},
};
return contents;
} |
An instance of this class is a ListResourceBundle that
has the required getContents() method that returns
an array of message-key/message associations.
<p>
The message keys are defined in {@link MsgKey}. The
messages that those keys map to are defined here.
<p>
The messages in the English version are intended to be
translated.
This class is not a public API, it is only public because it is
used in org.apache.xml.serializer.
@xsl.usage internal
public class SerializerMessages_ru extends ListResourceBundle {
/*
This file contains error and warning messages related to
Serializer Error Handling.
General notes to translators:
1) A stylesheet is a description of how to transform an input XML document
into a resultant XML document (or HTML document or text). The
stylesheet itself is described in the form of an XML document.
2) An element is a mark-up tag in an XML document; an attribute is a
modifier on the tag. For example, in <elem attr='val' attr2='val2'>
"elem" is an element name, "attr" and "attr2" are attribute names with
the values "val" and "val2", respectively.
3) A namespace declaration is a special attribute that is used to associate
a prefix with a URI (the namespace). The meanings of element names and
attribute names that use that prefix are defined with respect to that
namespace.
/** The lookup table for error messages. | SerializerMessages_ru::getContents | java | Reginer/aosp-android-jar | android-34/src/org/apache/xml/serializer/utils/SerializerMessages_ru.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xml/serializer/utils/SerializerMessages_ru.java | MIT |
public INetworkStatsService getBinder() {
return mService;
} |
Virtual RAT type to represent 5G NSA (Non Stand Alone) mode, where the primary cell is
still LTE and network allocates a secondary 5G cell so telephony reports RAT = LTE along
with NR state as connected. This is a concept added by NetworkStats on top of the telephony
constants for backward compatibility of metrics so this should not be overlapped with any of
the {@code TelephonyManager.NETWORK_TYPE_*} constants.
@hide
@SystemApi(client = MODULE_LIBRARIES)
public static final int NETWORK_TYPE_5G_NSA = -2;
private int mFlags;
/** @hide
@VisibleForTesting
public NetworkStatsManager(Context context, INetworkStatsService service) {
mContext = context;
mService = service;
setPollOnOpen(true);
setAugmentWithSubscriptionPlan(true);
}
/** @hide | NetworkStatsManager::getBinder | java | Reginer/aosp-android-jar | android-35/src/android/app/usage/NetworkStatsManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/usage/NetworkStatsManager.java | MIT |
public void setAugmentWithSubscriptionPlan(boolean augmentWithSubscriptionPlan) {
if (augmentWithSubscriptionPlan) {
mFlags |= FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN;
} else {
mFlags &= ~FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN;
}
} |
Set poll force flag to indicate that calling any subsequent query method will force a stats
poll.
@hide
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@SystemApi(client = MODULE_LIBRARIES)
public void setPollForce(boolean pollForce) {
if (pollForce) {
mFlags |= FLAG_POLL_FORCE;
} else {
mFlags &= ~FLAG_POLL_FORCE;
}
}
/** @hide | NetworkStatsManager::setAugmentWithSubscriptionPlan | java | Reginer/aosp-android-jar | android-35/src/android/app/usage/NetworkStatsManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/usage/NetworkStatsManager.java | MIT |
public void registerUsageCallback(int networkType, @Nullable String subscriberId,
long thresholdBytes, @NonNull UsageCallback callback) {
registerUsageCallback(networkType, subscriberId, thresholdBytes, callback,
null /* handler */);
} |
Registers to receive notifications about data usage on specified networks.
<p>The callbacks will continue to be called as long as the process is live or
{@link #unregisterUsageCallback} is called.
@param networkType Type of network to monitor. Either
{@link ConnectivityManager#TYPE_MOBILE} or {@link ConnectivityManager#TYPE_WIFI}.
@param subscriberId If applicable, the subscriber id of the network interface.
<p>Starting with API level 29, the {@code subscriberId} is guarded by
additional restrictions. Calling apps that do not meet the new
requirements to access the {@code subscriberId} can provide a {@code
null} value when registering for the mobile network type to receive
notifications for all mobile networks. For additional details see {@link
TelephonyManager#getSubscriberId()}.
<p>Starting with API level 31, calling apps can provide a
{@code subscriberId} with wifi network type to receive usage for
wifi networks which is under the given subscription if applicable.
Otherwise, pass {@code null} when querying all wifi networks.
@param thresholdBytes Threshold in bytes to be notified on.
@param callback The {@link UsageCallback} that the system will call when data usage
has exceeded the specified threshold.
| NetworkStatsManager::registerUsageCallback | java | Reginer/aosp-android-jar | android-35/src/android/app/usage/NetworkStatsManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/usage/NetworkStatsManager.java | MIT |
public void registerUsageCallback(int networkType, @Nullable String subscriberId,
long thresholdBytes, @NonNull UsageCallback callback, @Nullable Handler handler) {
NetworkTemplate template = createTemplate(networkType, subscriberId);
if (DBG) {
Log.d(TAG, "registerUsageCallback called with: {"
+ " networkType=" + networkType
+ " subscriberId=" + subscriberId
+ " thresholdBytes=" + thresholdBytes
+ " }");
}
final Executor executor = handler == null ? r -> r.run() : r -> handler.post(r);
registerUsageCallback(template, thresholdBytes, executor, callback);
} |
Registers to receive notifications about data usage on specified networks.
<p>The callbacks will continue to be called as long as the process is live or
{@link #unregisterUsageCallback} is called.
@param networkType Type of network to monitor. Either
{@link ConnectivityManager#TYPE_MOBILE} or {@link ConnectivityManager#TYPE_WIFI}.
@param subscriberId If applicable, the subscriber id of the network interface.
<p>Starting with API level 29, the {@code subscriberId} is guarded by
additional restrictions. Calling apps that do not meet the new
requirements to access the {@code subscriberId} can provide a {@code
null} value when registering for the mobile network type to receive
notifications for all mobile networks. For additional details see {@link
TelephonyManager#getSubscriberId()}.
<p>Starting with API level 31, calling apps can provide a
{@code subscriberId} with wifi network type to receive usage for
wifi networks which is under the given subscription if applicable.
Otherwise, pass {@code null} when querying all wifi networks.
@param thresholdBytes Threshold in bytes to be notified on.
@param callback The {@link UsageCallback} that the system will call when data usage
has exceeded the specified threshold.
@param handler to dispatch callback events through, otherwise if {@code null} it uses
the calling thread.
| NetworkStatsManager::registerUsageCallback | java | Reginer/aosp-android-jar | android-35/src/android/app/usage/NetworkStatsManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/usage/NetworkStatsManager.java | MIT |
public void unregisterUsageCallback(@NonNull UsageCallback callback) {
if (callback == null || callback.request == null
|| callback.request.requestId == DataUsageRequest.REQUEST_ID_UNSET) {
throw new IllegalArgumentException("Invalid UsageCallback");
}
try {
mService.unregisterUsageRequest(callback.request);
} catch (RemoteException e) {
if (DBG) Log.d(TAG, "Remote exception when unregistering callback");
throw e.rethrowFromSystemServer();
}
} |
Unregisters callbacks on data usage.
@param callback The {@link UsageCallback} used when registering.
| NetworkStatsManager::unregisterUsageCallback | java | Reginer/aosp-android-jar | android-35/src/android/app/usage/NetworkStatsManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/usage/NetworkStatsManager.java | MIT |
private static int networkTypeForTemplate(@NonNull NetworkTemplate template) {
switch (template.getMatchRule()) {
case NetworkTemplate.MATCH_MOBILE:
return ConnectivityManager.TYPE_MOBILE;
case NetworkTemplate.MATCH_WIFI:
return ConnectivityManager.TYPE_WIFI;
default:
return ConnectivityManager.TYPE_NONE;
}
} |
Get network type from a template if feasible.
@param template the target {@link NetworkTemplate}.
@return legacy network type, only supports for the types which is already supported in
{@link #registerUsageCallback(int, String, long, UsageCallback, Handler)}.
{@link ConnectivityManager#TYPE_NONE} for other types.
| UsageCallback::networkTypeForTemplate | java | Reginer/aosp-android-jar | android-35/src/android/app/usage/NetworkStatsManager.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/usage/NetworkStatsManager.java | MIT |
public RootElement(String uri, String localName) {
super(null, uri, localName, 0);
} |
Constructs a new root element with the given name.
@param uri the namespace
@param localName the local name
| RootElement::RootElement | java | Reginer/aosp-android-jar | android-33/src/android/sax/RootElement.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/sax/RootElement.java | MIT |
public RootElement(String localName) {
this("", localName);
} |
Constructs a new root element with the given name. Uses an empty string
as the namespace.
@param localName the local name
| RootElement::RootElement | java | Reginer/aosp-android-jar | android-33/src/android/sax/RootElement.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/sax/RootElement.java | MIT |
public ContentHandler getContentHandler() {
return this.handler;
} |
Gets the SAX {@code ContentHandler}. Pass this to your SAX parser.
| RootElement::getContentHandler | java | Reginer/aosp-android-jar | android-33/src/android/sax/RootElement.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/sax/RootElement.java | MIT |
void fixInstalledAppDirMode() {
try (var files = Files.newDirectoryStream(mPm.getAppInstallDir().toPath())) {
files.forEach(dir -> {
try {
Os.chmod(dir.toString(), 0771);
} catch (ErrnoException e) {
Slog.w(TAG, "Failed to fix an installed app dir mode", e);
}
});
} catch (Exception e) {
Slog.w(TAG, "Failed to walk the app install directory to fix the modes", e);
}
} |
Fix up the previously-installed app directory mode - they can't be readable by non-system
users to prevent them from listing the dir to discover installed package names.
| InitAppsHelper::fixInstalledAppDirMode | java | Reginer/aosp-android-jar | android-35/src/com/android/server/pm/InitAppsHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/InitAppsHelper.java | MIT |
private void createBoundsInterpolator(long duration, DisplayInfo displayInfo) {
boolean growing = mEndBounds.width() - mStartBounds.width()
+ mEndBounds.height() - mStartBounds.height() >= 0;
float scalePart = 0.7f;
long scalePeriod = (long) (duration * scalePart);
float startScaleX = scalePart * ((float) mStartBounds.width()) / mEndBounds.width()
+ (1.f - scalePart);
float startScaleY = scalePart * ((float) mStartBounds.height()) / mEndBounds.height()
+ (1.f - scalePart);
if (mIsThumbnail) {
AnimationSet animSet = new AnimationSet(true);
Animation anim = new AlphaAnimation(1.f, 0.f);
anim.setDuration(scalePeriod);
if (!growing) {
anim.setStartOffset(duration - scalePeriod);
}
animSet.addAnimation(anim);
float endScaleX = 1.f / startScaleX;
float endScaleY = 1.f / startScaleY;
anim = new ScaleAnimation(endScaleX, endScaleX, endScaleY, endScaleY);
anim.setDuration(duration);
animSet.addAnimation(anim);
mAnimation = animSet;
mAnimation.initialize(mStartBounds.width(), mStartBounds.height(),
mEndBounds.width(), mEndBounds.height());
} else {
AnimationSet animSet = new AnimationSet(true);
final Animation scaleAnim = new ScaleAnimation(startScaleX, 1, startScaleY, 1);
scaleAnim.setDuration(scalePeriod);
if (!growing) {
scaleAnim.setStartOffset(duration - scalePeriod);
}
animSet.addAnimation(scaleAnim);
final Animation translateAnim = new TranslateAnimation(mStartBounds.left,
mEndBounds.left, mStartBounds.top, mEndBounds.top);
translateAnim.setDuration(duration);
animSet.addAnimation(translateAnim);
Rect startClip = new Rect(mStartBounds);
Rect endClip = new Rect(mEndBounds);
startClip.offsetTo(0, 0);
endClip.offsetTo(0, 0);
final Animation clipAnim = new ClipRectAnimation(startClip, endClip);
clipAnim.setDuration(duration);
animSet.addAnimation(clipAnim);
mAnimation = animSet;
mAnimation.initialize(mStartBounds.width(), mStartBounds.height(),
displayInfo.appWidth, displayInfo.appHeight);
}
} |
This animator behaves slightly differently depending on whether the window is growing
or shrinking:
If growing, it will do a clip-reveal after quicker fade-out/scale of the smaller (old)
snapshot.
If shrinking, it will do an opposite clip-reveal on the old snapshot followed by a quicker
fade-out of the bigger (old) snapshot while simultaneously shrinking the new window into
place.
@param duration
@param displayInfo
| WindowChangeAnimationSpec::createBoundsInterpolator | java | Reginer/aosp-android-jar | android-34/src/com/android/server/wm/WindowChangeAnimationSpec.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/wm/WindowChangeAnimationSpec.java | MIT |
final static boolean isValidFocusGain(int focusGain) {
switch (focusGain) {
case AudioManager.AUDIOFOCUS_GAIN:
case AudioManager.AUDIOFOCUS_GAIN_TRANSIENT:
case AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK:
case AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE:
return true;
default:
return false;
}
} |
@hide
Checks whether a focus gain constant is a valid value for an audio focus request.
@param focusGain value to check
@return true if focusGain is a valid value for an audio focus request.
| AudioFocusRequest::isValidFocusGain | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public @Nullable Handler getOnAudioFocusChangeListenerHandler() {
return mListenerHandler;
} |
@hide
Returns the {@link Handler} to be used for the focus change listener.
@return the same {@code Handler} set in.
{@link Builder#setOnAudioFocusChangeListener(OnAudioFocusChangeListener, Handler)}, or null
if no listener was set.
| AudioFocusRequest::getOnAudioFocusChangeListenerHandler | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public @NonNull AudioAttributes getAudioAttributes() {
return mAttr;
} |
Returns the {@link AudioAttributes} set for this {@code AudioFocusRequest}, or the default
attributes if none were set.
@return non-null {@link AudioAttributes}.
| AudioFocusRequest::getAudioAttributes | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public int getFocusGain() {
return mFocusGain;
} |
Returns the type of audio focus request configured for this {@code AudioFocusRequest}.
@return one of {@link AudioManager#AUDIOFOCUS_GAIN},
{@link AudioManager#AUDIOFOCUS_GAIN_TRANSIENT},
{@link AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK}, and
{@link AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE}.
| AudioFocusRequest::getFocusGain | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public boolean willPauseWhenDucked() {
return (mFlags & AudioManager.AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS)
== AudioManager.AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS;
} |
Returns whether the application that would use this {@code AudioFocusRequest} would pause
when it is requested to duck.
@return the duck/pause behavior.
| AudioFocusRequest::willPauseWhenDucked | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public boolean acceptsDelayedFocusGain() {
return (mFlags & AudioManager.AUDIOFOCUS_FLAG_DELAY_OK)
== AudioManager.AUDIOFOCUS_FLAG_DELAY_OK;
} |
Returns whether the application that would use this {@code AudioFocusRequest} supports
a focus gain granted after a temporary request failure.
@return whether delayed focus gain is supported.
| AudioFocusRequest::acceptsDelayedFocusGain | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public Builder(int focusGain) {
setFocusGain(focusGain);
} |
Constructs a new {@code Builder}, and specifies how audio focus
will be requested. Valid values for focus requests are
{@link AudioManager#AUDIOFOCUS_GAIN}, {@link AudioManager#AUDIOFOCUS_GAIN_TRANSIENT},
{@link AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK}, and
{@link AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE}.
<p>By default there is no focus change listener, delayed focus is not supported, ducking
is suitable for the application, and the <code>AudioAttributes</code>
have a usage of {@link AudioAttributes#USAGE_MEDIA}.
@param focusGain the type of audio focus gain that will be requested
@throws IllegalArgumentException thrown when an invalid focus gain type is used
| Builder::Builder | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public Builder(@NonNull AudioFocusRequest requestToCopy) {
if (requestToCopy == null) {
throw new IllegalArgumentException("Illegal null AudioFocusRequest");
}
mAttr = requestToCopy.mAttr;
mFocusListener = requestToCopy.mFocusListener;
mListenerHandler = requestToCopy.mListenerHandler;
mFocusGain = requestToCopy.mFocusGain;
mPausesOnDuck = requestToCopy.willPauseWhenDucked();
mDelayedFocus = requestToCopy.acceptsDelayedFocusGain();
} |
Constructs a new {@code Builder} with all the properties of the {@code AudioFocusRequest}
passed as parameter.
Use this method when you want a new request to differ only by some properties.
@param requestToCopy the non-null {@code AudioFocusRequest} to build a duplicate from.
@throws IllegalArgumentException thrown when a null {@code AudioFocusRequest} is used.
| Builder::Builder | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public @NonNull Builder setFocusGain(int focusGain) {
if (!isValidFocusGain(focusGain)) {
throw new IllegalArgumentException("Illegal audio focus gain type " + focusGain);
}
mFocusGain = focusGain;
return this;
} |
Sets the type of focus gain that will be requested.
Use this method to replace the focus gain when building a request by modifying an
existing {@code AudioFocusRequest} instance.
@param focusGain the type of audio focus gain that will be requested.
@return this {@code Builder} instance
@throws IllegalArgumentException thrown when an invalid focus gain type is used
| Builder::setFocusGain | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public @NonNull Builder setOnAudioFocusChangeListener(
@NonNull OnAudioFocusChangeListener listener) {
if (listener == null) {
throw new NullPointerException("Illegal null focus listener");
}
mFocusListener = listener;
mListenerHandler = null;
return this;
} |
Sets the listener called when audio focus changes after being requested with
{@link AudioManager#requestAudioFocus(AudioFocusRequest)}, and until being abandoned
with {@link AudioManager#abandonAudioFocusRequest(AudioFocusRequest)}.
Note that only focus changes (gains and losses) affecting the focus owner are reported,
not gains and losses of other focus requesters in the system.<br>
Notifications are delivered on the {@link Looper} associated with the one of
the creation of the {@link AudioManager} used to request focus
(see {@link AudioManager#requestAudioFocus(AudioFocusRequest)}).
@param listener the listener receiving the focus change notifications.
@return this {@code Builder} instance.
@throws NullPointerException thrown when a null focus listener is used.
| Builder::setOnAudioFocusChangeListener | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
@NonNull Builder setOnAudioFocusChangeListenerInt(
OnAudioFocusChangeListener listener, Handler handler) {
mFocusListener = listener;
mListenerHandler = handler;
return this;
} |
@hide
Internal listener setter, no null checks on listener nor handler
@param listener
@param handler
@return this {@code Builder} instance.
| Builder::setOnAudioFocusChangeListenerInt | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public @NonNull Builder setOnAudioFocusChangeListener(
@NonNull OnAudioFocusChangeListener listener, @NonNull Handler handler) {
if (listener == null || handler == null) {
throw new NullPointerException("Illegal null focus listener or handler");
}
mFocusListener = listener;
mListenerHandler = handler;
return this;
} |
Sets the listener called when audio focus changes after being requested with
{@link AudioManager#requestAudioFocus(AudioFocusRequest)}, and until being abandoned
with {@link AudioManager#abandonAudioFocusRequest(AudioFocusRequest)}.
Note that only focus changes (gains and losses) affecting the focus owner are reported,
not gains and losses of other focus requesters in the system.
@param listener the listener receiving the focus change notifications.
@param handler the {@link Handler} for the thread on which to execute
the notifications.
@return this {@code Builder} instance.
@throws NullPointerException thrown when a null focus listener or handler is used.
| Builder::setOnAudioFocusChangeListener | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public @NonNull Builder setAudioAttributes(@NonNull AudioAttributes attributes) {
if (attributes == null) {
throw new NullPointerException("Illegal null AudioAttributes");
}
mAttr = attributes;
return this;
} |
Sets the {@link AudioAttributes} to be associated with the focus request, and which
describe the use case for which focus is requested.
As the focus requests typically precede audio playback, this information is used on
certain platforms to declare the subsequent playback use case. It is therefore good
practice to use in this method the same {@code AudioAttributes} as used for
playback, see for example {@link MediaPlayer#setAudioAttributes(AudioAttributes)} in
{@code MediaPlayer} or {@link AudioTrack.Builder#setAudioAttributes(AudioAttributes)}
in {@code AudioTrack}.
@param attributes the {@link AudioAttributes} for the focus request.
@return this {@code Builder} instance.
@throws NullPointerException thrown when using null for the attributes.
| Builder::setAudioAttributes | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public @NonNull Builder setWillPauseWhenDucked(boolean pauseOnDuck) {
mPausesOnDuck = pauseOnDuck;
return this;
} |
Declare the intended behavior of the application with regards to audio ducking.
See more details in the {@link AudioFocusRequest} class documentation.
@param pauseOnDuck use {@code true} if the application intends to pause audio playback
when losing focus with {@link AudioManager#AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK}.
If {@code true}, note that you must also set a focus listener to receive such an
event, with
{@link #setOnAudioFocusChangeListener(OnAudioFocusChangeListener, Handler)}.
@return this {@code Builder} instance.
| Builder::setWillPauseWhenDucked | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public @NonNull Builder setAcceptsDelayedFocusGain(boolean acceptsDelayedFocusGain) {
mDelayedFocus = acceptsDelayedFocusGain;
return this;
} |
Marks this focus request as compatible with delayed focus.
See more details about delayed focus in the {@link AudioFocusRequest} class
documentation.
@param acceptsDelayedFocusGain use {@code true} if the application supports delayed
focus. If {@code true}, note that you must also set a focus listener to be notified
of delayed focus gain, with
{@link #setOnAudioFocusChangeListener(OnAudioFocusChangeListener, Handler)}.
@return this {@code Builder} instance
| Builder::setAcceptsDelayedFocusGain | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public @NonNull Builder setForceDucking(boolean forceDucking) {
mA11yForceDucking = forceDucking;
return this;
} |
Marks this focus request as forcing ducking, regardless of the conditions in which
the system would or would not enforce ducking.
Forcing ducking will only be honored when requesting AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK
with an {@link AudioAttributes} usage of
{@link AudioAttributes#USAGE_ASSISTANCE_ACCESSIBILITY}, coming from an accessibility
service, and will be ignored otherwise.
@param forceDucking {@code true} to force ducking
@return this {@code Builder} instance
| Builder::setForceDucking | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public AudioFocusRequest build() {
if ((mDelayedFocus || mPausesOnDuck) && (mFocusListener == null)) {
throw new IllegalStateException(
"Can't use delayed focus or pause on duck without a listener");
}
if (mA11yForceDucking) {
final Bundle extraInfo;
if (mAttr.getBundle() == null) {
extraInfo = new Bundle();
} else {
extraInfo = mAttr.getBundle();
}
// checking of usage and focus request is done server side
extraInfo.putBoolean(KEY_ACCESSIBILITY_FORCE_FOCUS_DUCKING, true);
mAttr = new AudioAttributes.Builder(mAttr).addBundle(extraInfo).build();
}
final int flags = 0
| (mDelayedFocus ? AudioManager.AUDIOFOCUS_FLAG_DELAY_OK : 0)
| (mPausesOnDuck ? AudioManager.AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS : 0)
| (mFocusLocked ? AudioManager.AUDIOFOCUS_FLAG_LOCK : 0);
return new AudioFocusRequest(mFocusListener, mListenerHandler,
mAttr, mFocusGain, flags);
} |
Builds a new {@code AudioFocusRequest} instance combining all the information gathered
by this {@code Builder}'s configuration methods.
@return the {@code AudioFocusRequest} instance qualified by all the properties set
on this {@code Builder}.
@throws IllegalStateException thrown when attempting to build a focus request that is set
to accept delayed focus, or to pause on duck, but no focus change listener was set.
| Builder::build | java | Reginer/aosp-android-jar | android-31/src/android/media/AudioFocusRequest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/media/AudioFocusRequest.java | MIT |
public static int getDeviceConfigPropertyInt(@NonNull String namespace, @NonNull String name,
int defaultValue) {
String value = getDeviceConfigProperty(namespace, name, null /* defaultValue */);
try {
return (value != null) ? Integer.parseInt(value) : defaultValue;
} catch (NumberFormatException e) {
return defaultValue;
}
} |
Look up the value of a property for a particular namespace from {@link DeviceConfig}.
@param namespace The namespace containing the property to look up.
@param name The name of the property to look up.
@param defaultValue The value to return if the property does not exist or its value is null.
@return the corresponding value, or defaultValue if none exists.
| getSimpleName::getDeviceConfigPropertyInt | java | Reginer/aosp-android-jar | android-32/src/com/android/net/module/util/DeviceConfigUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/net/module/util/DeviceConfigUtils.java | MIT |
public static int getDeviceConfigPropertyInt(@NonNull String namespace, @NonNull String name,
int minimumValue, int maximumValue, int defaultValue) {
int value = getDeviceConfigPropertyInt(namespace, name, defaultValue);
if (value < minimumValue || value > maximumValue) return defaultValue;
return value;
} |
Look up the value of a property for a particular namespace from {@link DeviceConfig}.
Flags like timeouts should use this method and set an appropriate min/max range: if invalid
values like "0" or "1" are pushed to devices, everything would timeout. The min/max range
protects against this kind of breakage.
@param namespace The namespace containing the property to look up.
@param name The name of the property to look up.
@param minimumValue The minimum value of a property.
@param maximumValue The maximum value of a property.
@param defaultValue The value to return if the property does not exist or its value is null.
@return the corresponding value, or defaultValue if none exists or the fetched value is
not in the provided range.
| getSimpleName::getDeviceConfigPropertyInt | java | Reginer/aosp-android-jar | android-32/src/com/android/net/module/util/DeviceConfigUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/net/module/util/DeviceConfigUtils.java | MIT |
public static boolean getDeviceConfigPropertyBoolean(@NonNull String namespace,
@NonNull String name, boolean defaultValue) {
String value = getDeviceConfigProperty(namespace, name, null /* defaultValue */);
return (value != null) ? Boolean.parseBoolean(value) : defaultValue;
} |
Look up the value of a property for a particular namespace from {@link DeviceConfig}.
@param namespace The namespace containing the property to look up.
@param name The name of the property to look up.
@param defaultValue The value to return if the property does not exist or its value is null.
@return the corresponding value, or defaultValue if none exists.
| getSimpleName::getDeviceConfigPropertyBoolean | java | Reginer/aosp-android-jar | android-32/src/com/android/net/module/util/DeviceConfigUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/net/module/util/DeviceConfigUtils.java | MIT |
public static boolean isFeatureEnabled(@NonNull Context context, @NonNull String namespace,
@NonNull String name) {
return isFeatureEnabled(context, namespace, name, false /* defaultEnabled */);
} |
Check whether or not one specific experimental feature for a particular namespace from
{@link DeviceConfig} is enabled by comparing module package version
with current version of property. If this property version is valid, the corresponding
experimental feature would be enabled, otherwise disabled.
This is useful to ensure that if a module install is rolled back, flags are not left fully
rolled out on a version where they have not been well tested.
@param context The global context information about an app environment.
@param namespace The namespace containing the property to look up.
@param name The name of the property to look up.
@return true if this feature is enabled, or false if disabled.
| getSimpleName::isFeatureEnabled | java | Reginer/aosp-android-jar | android-32/src/com/android/net/module/util/DeviceConfigUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/net/module/util/DeviceConfigUtils.java | MIT |
public static boolean isFeatureEnabled(@NonNull Context context, @NonNull String namespace,
@NonNull String name, boolean defaultEnabled) {
try {
final long packageVersion = getPackageVersion(context);
return isFeatureEnabled(context, packageVersion, namespace, name, defaultEnabled);
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Could not find the package name", e);
return false;
}
} |
Check whether or not one specific experimental feature for a particular namespace from
{@link DeviceConfig} is enabled by comparing module package version
with current version of property. If this property version is valid, the corresponding
experimental feature would be enabled, otherwise disabled.
This is useful to ensure that if a module install is rolled back, flags are not left fully
rolled out on a version where they have not been well tested.
@param context The global context information about an app environment.
@param namespace The namespace containing the property to look up.
@param name The name of the property to look up.
@param defaultEnabled The value to return if the property does not exist or its value is
null.
@return true if this feature is enabled, or false if disabled.
| getSimpleName::isFeatureEnabled | java | Reginer/aosp-android-jar | android-32/src/com/android/net/module/util/DeviceConfigUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/net/module/util/DeviceConfigUtils.java | MIT |
public static boolean isFeatureEnabled(@NonNull Context context, @NonNull String namespace,
@NonNull String name, @NonNull String moduleName, boolean defaultEnabled) {
try {
final long packageVersion = getModuleVersion(context, moduleName);
return isFeatureEnabled(context, packageVersion, namespace, name, defaultEnabled);
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Could not find the module name", e);
return false;
}
} |
Check whether or not one specific experimental feature for a particular namespace from
{@link DeviceConfig} is enabled by comparing module package version
with current version of property. If this property version is valid, the corresponding
experimental feature would be enabled, otherwise disabled.
This is useful to ensure that if a module install is rolled back, flags are not left fully
rolled out on a version where they have not been well tested.
@param context The global context information about an app environment.
@param namespace The namespace containing the property to look up.
@param name The name of the property to look up.
@param moduleName The mainline module name which is released as apex.
@param defaultEnabled The value to return if the property does not exist or its value is
null.
@return true if this feature is enabled, or false if disabled.
| getSimpleName::isFeatureEnabled | java | Reginer/aosp-android-jar | android-32/src/com/android/net/module/util/DeviceConfigUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/net/module/util/DeviceConfigUtils.java | MIT |
public static boolean getResBooleanConfig(@NonNull final Context context,
@BoolRes int configResource, final boolean defaultValue) {
final Resources res = context.getResources();
try {
return res.getBoolean(configResource);
} catch (Resources.NotFoundException e) {
return defaultValue;
}
} |
Gets boolean config from resources.
| getSimpleName::getResBooleanConfig | java | Reginer/aosp-android-jar | android-32/src/com/android/net/module/util/DeviceConfigUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/net/module/util/DeviceConfigUtils.java | MIT |
public static File getFileFromFd(Context context, ParcelFileDescriptor fd,
String packageName, String compressionAlg) {
File newFile = getTemporaryFile(context, packageName);
if (fd == null || fd.getFileDescriptor() == null) {
return null;
}
InputStream fr = new ParcelFileDescriptor.AutoCloseInputStream(fd);
try {
if (TextUtils.equals(compressionAlg, COMPRESSION_XZ)) {
fr = new XZInputStream(fr);
} else if (TextUtils.equals(compressionAlg, COMPRESSION_LZMA)) {
fr = new LZMAInputStream(fr);
}
} catch (IOException e) {
Log.e(TAG, "Compression was set to " + compressionAlg + ", but could not decode ", e);
return null;
}
int nRead;
byte[] data = new byte[1024];
try {
final FileOutputStream fo = new FileOutputStream(newFile);
while ((nRead = fr.read(data, 0, data.length)) != -1) {
fo.write(data, 0, nRead);
}
fo.flush();
fo.close();
Os.chmod(newFile.getAbsolutePath(), 0644);
return newFile;
} catch (IOException e) {
Log.e(TAG, "Reading from Asset FD or writing to temp file failed ", e);
return null;
} catch (ErrnoException e) {
Log.e(TAG, "Could not set permissions on file ", e);
return null;
} finally {
try {
fr.close();
} catch (IOException e) {
Log.e(TAG, "Failed to close the file from FD ", e);
}
}
} |
In order to make sure that the Wearable Asset Manager has a reasonable apk that can be used
by the PackageManager, we will parse it before sending it to the PackageManager.
Unfortunately, PackageParser needs a file to parse. So, we have to temporarily convert the fd
to a File.
@param context
@param fd FileDescriptor to convert to File
@param packageName Name of package, will define the name of the file
@param compressionAlg Can be null. For ALT mode the APK will be compressed. We will
decompress it here
| WearPackageUtil::getFileFromFd | java | Reginer/aosp-android-jar | android-32/src/com/android/packageinstaller/wear/WearPackageUtil.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/packageinstaller/wear/WearPackageUtil.java | MIT |
public static String getSanitizedPackageName(Uri packageUri) {
String packageName = packageUri.getEncodedSchemeSpecificPart();
if (packageName != null) {
return packageName.replaceAll("^/+", "");
}
return packageName;
} |
@return com.google.com from expected formats like
Uri: package:com.google.com, package:/com.google.com, package://com.google.com
| WearPackageUtil::getSanitizedPackageName | java | Reginer/aosp-android-jar | android-32/src/com/android/packageinstaller/wear/WearPackageUtil.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/packageinstaller/wear/WearPackageUtil.java | MIT |
public domimplementationcreatedocumenttype04(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
super(factory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "staffNS", false);
} |
Constructor.
@param factory document factory, may not be null
@throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
| domimplementationcreatedocumenttype04::domimplementationcreatedocumenttype04 | java | Reginer/aosp-android-jar | android-31/src/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java | MIT |
public void runTest() throws Throwable {
Document doc;
DOMImplementation domImpl;
DocumentType newDocType;
String publicId = "http://www.w3.org/DOM/Test/dom2.dtd";
String systemId = "dom2.dtd";
String qualifiedName;
java.util.List qualifiedNames = new java.util.ArrayList();
qualifiedNames.add("{");
qualifiedNames.add("}");
qualifiedNames.add("'");
qualifiedNames.add("~");
qualifiedNames.add("`");
qualifiedNames.add("@");
qualifiedNames.add("#");
qualifiedNames.add("$");
qualifiedNames.add("%");
qualifiedNames.add("^");
qualifiedNames.add("&");
qualifiedNames.add("*");
qualifiedNames.add("(");
qualifiedNames.add(")");
doc = (Document) load("staffNS", false);
domImpl = doc.getImplementation();
for (int indexN10073 = 0; indexN10073 < qualifiedNames.size(); indexN10073++) {
qualifiedName = (String) qualifiedNames.get(indexN10073);
{
boolean success = false;
try {
newDocType = domImpl.createDocumentType(qualifiedName, publicId, systemId);
} catch (DOMException ex) {
success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
}
assertTrue("domimplementationcreatedocumenttype04", success);
}
}
} |
Runs the test case.
@throws Throwable Any uncaught exception causes test to fail
| domimplementationcreatedocumenttype04::runTest | java | Reginer/aosp-android-jar | android-31/src/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java | MIT |
public String getTargetURI() {
return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/domimplementationcreatedocumenttype04";
} |
Gets URI that identifies the test.
@return uri identifier of test
| domimplementationcreatedocumenttype04::getTargetURI | java | Reginer/aosp-android-jar | android-31/src/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java | MIT |
public static void main(final String[] args) {
DOMTestCase.doMain(domimplementationcreatedocumenttype04.class, args);
} |
Runs this test from the command line.
@param args command line arguments
| domimplementationcreatedocumenttype04::main | java | Reginer/aosp-android-jar | android-31/src/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/org/w3c/domts/level2/core/domimplementationcreatedocumenttype04.java | MIT |
public int getResInstanceState() {
return mResInstanceState;
} |
Gets the resource instance state.
@hide
| PresResInstanceInfo::getResInstanceState | java | Reginer/aosp-android-jar | android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | MIT |
public String getResId() {
return mId;
} |
Gets the resource ID.
@hide
| PresResInstanceInfo::getResId | java | Reginer/aosp-android-jar | android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | MIT |
public String getReason() {
return mReason;
} |
Gets the reason phrase associated with the SIP response
code.
@hide
| PresResInstanceInfo::getReason | java | Reginer/aosp-android-jar | android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | MIT |
public String getPresentityUri() {
return mPresentityUri;
} |
Gets the entity URI.
@hide
| PresResInstanceInfo::getPresentityUri | java | Reginer/aosp-android-jar | android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | MIT |
public PresTupleInfo[] getTupleInfo() {
return mTupleInfoArray;
} |
Gets the tuple information.
@hide
| PresResInstanceInfo::getTupleInfo | java | Reginer/aosp-android-jar | android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | MIT |
public int describeContents() {
return 0;
} |
Constructor for the PresResInstanceInfo class.
@hide
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public PresResInstanceInfo(){
};
/** @hide | PresResInstanceInfo::describeContents | java | Reginer/aosp-android-jar | android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | MIT |
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mId);
dest.writeString(mReason);
dest.writeInt(mResInstanceState);
dest.writeString(mPresentityUri);
dest.writeParcelableArray(mTupleInfoArray, flags);
} |
Constructor for the PresResInstanceInfo class.
@hide
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public PresResInstanceInfo(){
};
/** @hide
public int describeContents() {
return 0;
}
/** @hide | PresResInstanceInfo::writeToParcel | java | Reginer/aosp-android-jar | android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | MIT |
private PresResInstanceInfo(Parcel source) {
readFromParcel(source);
} |
Constructor for the PresResInstanceInfo class.
@hide
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public PresResInstanceInfo(){
};
/** @hide
public int describeContents() {
return 0;
}
/** @hide
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mId);
dest.writeString(mReason);
dest.writeInt(mResInstanceState);
dest.writeString(mPresentityUri);
dest.writeParcelableArray(mTupleInfoArray, flags);
}
/** @hide
public static final Parcelable.Creator<PresResInstanceInfo> CREATOR =
new Parcelable.Creator<PresResInstanceInfo>() {
public PresResInstanceInfo createFromParcel(Parcel source) {
return new PresResInstanceInfo(source);
}
public PresResInstanceInfo[] newArray(int size) {
return new PresResInstanceInfo[size];
}
};
/** @hide | PresResInstanceInfo::PresResInstanceInfo | java | Reginer/aosp-android-jar | android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | MIT |
public void readFromParcel(Parcel source) {
mId = source.readString();
mReason = source.readString();
mResInstanceState = source.readInt();
mPresentityUri = source.readString();
Parcelable[] tempParcelableArray = source.readParcelableArray(
PresTupleInfo.class.getClassLoader(), PresTupleInfo.class);
mTupleInfoArray = new PresTupleInfo[] {};
if(tempParcelableArray != null) {
mTupleInfoArray = Arrays.copyOf(tempParcelableArray, tempParcelableArray.length,
PresTupleInfo[].class);
}
} |
Constructor for the PresResInstanceInfo class.
@hide
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public PresResInstanceInfo(){
};
/** @hide
public int describeContents() {
return 0;
}
/** @hide
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mId);
dest.writeString(mReason);
dest.writeInt(mResInstanceState);
dest.writeString(mPresentityUri);
dest.writeParcelableArray(mTupleInfoArray, flags);
}
/** @hide
public static final Parcelable.Creator<PresResInstanceInfo> CREATOR =
new Parcelable.Creator<PresResInstanceInfo>() {
public PresResInstanceInfo createFromParcel(Parcel source) {
return new PresResInstanceInfo(source);
}
public PresResInstanceInfo[] newArray(int size) {
return new PresResInstanceInfo[size];
}
};
/** @hide
private PresResInstanceInfo(Parcel source) {
readFromParcel(source);
}
/** @hide | PresResInstanceInfo::readFromParcel | java | Reginer/aosp-android-jar | android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/ims/internal/uce/presence/PresResInstanceInfo.java | MIT |
public static List<AccessibilityTarget> getTargets(Context context,
@ShortcutType int shortcutType) {
// List all accessibility target
final List<AccessibilityTarget> installedTargets = getInstalledTargets(context,
shortcutType);
// List accessibility shortcut target
final AccessibilityManager am = (AccessibilityManager) context.getSystemService(
Context.ACCESSIBILITY_SERVICE);
final List<String> assignedTargets = am.getAccessibilityShortcutTargets(shortcutType);
// Get the list of accessibility shortcut target in all accessibility target
final List<AccessibilityTarget> results = new ArrayList<>();
for (String assignedTarget : assignedTargets) {
for (AccessibilityTarget installedTarget : installedTargets) {
if (!MAGNIFICATION_CONTROLLER_NAME.contentEquals(assignedTarget)) {
final ComponentName assignedTargetComponentName =
ComponentName.unflattenFromString(assignedTarget);
final ComponentName targetComponentName = ComponentName.unflattenFromString(
installedTarget.getId());
if (assignedTargetComponentName.equals(targetComponentName)) {
results.add(installedTarget);
continue;
}
}
if (assignedTarget.contentEquals(installedTarget.getId())) {
results.add(installedTarget);
}
}
}
return results;
} |
Returns list of {@link AccessibilityTarget} of assigned accessibility shortcuts from
{@link AccessibilityManager#getAccessibilityShortcutTargets} including accessibility
feature's package name, component id, etc.
@param context The context of the application.
@param shortcutType The shortcut type.
@return The list of {@link AccessibilityTarget}.
@hide
| AccessibilityTargetHelper::getTargets | java | Reginer/aosp-android-jar | android-34/src/com/android/internal/accessibility/dialog/AccessibilityTargetHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/internal/accessibility/dialog/AccessibilityTargetHelper.java | MIT |
static List<AccessibilityTarget> getInstalledTargets(Context context,
@ShortcutType int shortcutType) {
final List<AccessibilityTarget> targets = new ArrayList<>();
targets.addAll(getAccessibilityFilteredTargets(context, shortcutType));
targets.addAll(getAllowListingFeatureTargets(context, shortcutType));
return targets;
} |
Returns list of {@link AccessibilityTarget} of the installed accessibility service,
accessibility activity, and allowlisting feature including accessibility feature's package
name, component id, etc.
@param context The context of the application.
@param shortcutType The shortcut type.
@return The list of {@link AccessibilityTarget}.
| AccessibilityTargetHelper::getInstalledTargets | java | Reginer/aosp-android-jar | android-34/src/com/android/internal/accessibility/dialog/AccessibilityTargetHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/internal/accessibility/dialog/AccessibilityTargetHelper.java | MIT |
public static boolean isAccessibilityTargetAllowed(Context context, String packageName,
int uid) {
final AccessibilityManager am = context.getSystemService(AccessibilityManager.class);
return am.isAccessibilityTargetAllowed(packageName, uid, UserHandle.myUserId());
} |
Determines if the{@link AccessibilityTarget} is allowed.
| AccessibilityTargetHelper::isAccessibilityTargetAllowed | java | Reginer/aosp-android-jar | android-34/src/com/android/internal/accessibility/dialog/AccessibilityTargetHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/internal/accessibility/dialog/AccessibilityTargetHelper.java | MIT |
protected SSLServerSocketFactory() { /* NOTHING */ } |
Constructor is used only by subclasses.
| SSLServerSocketFactory::SSLServerSocketFactory | java | Reginer/aosp-android-jar | android-34/src/javax/net/ssl/SSLServerSocketFactory.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/javax/net/ssl/SSLServerSocketFactory.java | MIT |
public static synchronized ServerSocketFactory getDefault() {
// Android-changed: Check Security.getVersion() on each update.
if (defaultServerSocketFactory != null && lastVersion == Security.getVersion()) {
return defaultServerSocketFactory;
}
lastVersion = Security.getVersion();
SSLServerSocketFactory previousDefaultServerSocketFactory = defaultServerSocketFactory;
defaultServerSocketFactory = null;
String clsName = SSLSocketFactory.getSecurityProperty
("ssl.ServerSocketFactory.provider");
if (clsName != null) {
// Android-changed: Check if we already have an instance of the default factory class.
// The instance for the default socket factory is checked for updates quite
// often (for instance, every time a security provider is added). Which leads
// to unnecessary overload and excessive error messages in case of class-loading
// errors. Avoid creating a new object if the class name is the same as before.
if (previousDefaultServerSocketFactory != null
&& clsName.equals(previousDefaultServerSocketFactory.getClass().getName())) {
defaultServerSocketFactory = previousDefaultServerSocketFactory;
return defaultServerSocketFactory;
}
log("setting up default SSLServerSocketFactory");
try {
Class<?> cls = null;
try {
cls = Class.forName(clsName);
} catch (ClassNotFoundException e) {
// Android-changed; Try the contextClassLoader first.
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
cl = ClassLoader.getSystemClassLoader();
}
if (cl != null) {
// Android-changed: Use Class.forName() so the class gets initialized.
cls = Class.forName(clsName, true, cl);
}
}
log("class " + clsName + " is loaded");
SSLServerSocketFactory fac = (SSLServerSocketFactory)cls.newInstance();
log("instantiated an instance of class " + clsName);
defaultServerSocketFactory = fac;
return fac;
} catch (Exception e) {
log("SSLServerSocketFactory instantiation failed: " + e);
// Android-changed: Fallback to the default SSLContext on exception.
}
}
try {
// Android-changed: Allow for {@code null} SSLContext.getDefault.
SSLContext context = SSLContext.getDefault();
if (context != null) {
defaultServerSocketFactory = context.getServerSocketFactory();
} else {
defaultServerSocketFactory = new DefaultSSLServerSocketFactory(new IllegalStateException("No factory found."));
}
return defaultServerSocketFactory;
} catch (NoSuchAlgorithmException e) {
return new DefaultSSLServerSocketFactory(e);
}
} |
Returns the default SSL server socket factory.
<p>The first time this method is called, the security property
"ssl.ServerSocketFactory.provider" is examined. If it is non-null, a
class by that name is loaded and instantiated. If that is successful and
the object is an instance of SSLServerSocketFactory, it is made the
default SSL server socket factory.
<p>Otherwise, this method returns
<code>SSLContext.getDefault().getServerSocketFactory()</code>. If that
call fails, an inoperative factory is returned.
@return the default <code>ServerSocketFactory</code>
@see SSLContext#getDefault
| SSLServerSocketFactory::getDefault | java | Reginer/aosp-android-jar | android-34/src/javax/net/ssl/SSLServerSocketFactory.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/javax/net/ssl/SSLServerSocketFactory.java | MIT |
synchronized void reset() {
mGlobalBindingId = 0;
mIdMap.clear();
} |
Reset the internal state. Subsequent getId calls will no longer return previously returned
values.
| UniqueIdGenerator::reset | java | Reginer/aosp-android-jar | android-34/src/com/android/clockwork/displayoffload/UniqueIdGenerator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/clockwork/displayoffload/UniqueIdGenerator.java | MIT |
synchronized int nextId() {
while (mIdMap.containsKey(mGlobalBindingId) || mShouldSkip.apply(mGlobalBindingId)) {
// Skip numbers that are used or reserved
mGlobalBindingId += 1;
}
int retVal = mGlobalBindingId++;
if (DEBUG) {
Log.d(mTag, "nextId: " + retVal);
}
return retVal;
} |
Create and reserve a new integer identifier.
@return the newly created unique integer identifier
| UniqueIdGenerator::nextId | java | Reginer/aosp-android-jar | android-34/src/com/android/clockwork/displayoffload/UniqueIdGenerator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/clockwork/displayoffload/UniqueIdGenerator.java | MIT |
synchronized int getId(Object originalId) {
if (originalId instanceof Integer && mShouldSkip.apply((Integer) originalId)) {
// Explicitly requesting a system resource id
int originalIdInt = (Integer) originalId;
mIdMap.put(originalId, originalIdInt);
if (DEBUG) {
Log.d(mTag, "getId(Reserved): " + originalIdInt);
}
return originalIdInt;
}
if (mIdMap.containsKey(originalId)) {
int retVal = mIdMap.get(originalId);
if (DEBUG) {
Log.d(mTag, "getId(hit/" + originalId + "): " + retVal);
}
return retVal;
}
int id = nextId();
mIdMap.put(originalId, id);
if (DEBUG) {
Log.d(mTag, "getId(miss/" + originalId + "):" + id);
}
return id;
} |
Get a new integer identifier for an Object. Create and reserve a new one if this Object
has not been seen before. Otherwise, return the same integer value as last time.
@param originalId any Object identifier
@return the newly created unique integer identifier, or a previously returned value for
this Object
| UniqueIdGenerator::getId | java | Reginer/aosp-android-jar | android-34/src/com/android/clockwork/displayoffload/UniqueIdGenerator.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/clockwork/displayoffload/UniqueIdGenerator.java | MIT |
static void resetLocalLockoutStateToNone(int sensorId, int userId,
@NonNull LockoutCache lockoutTracker,
@NonNull LockoutResetDispatcher lockoutResetDispatcher) {
lockoutTracker.setLockoutModeForUser(userId, LockoutTracker.LOCKOUT_NONE);
lockoutResetDispatcher.notifyLockoutResetCallbacks(sensorId);
} |
Reset the local lockout state and notify any listeners.
This should only be called when the HAL sends a reset request directly to the
framework (i.e. time based reset, etc.). When the HAL is responding to a
resetLockout request from an instance of this client {@link #onLockoutCleared()} should
be used instead.
| FaceResetLockoutClient::resetLocalLockoutStateToNone | java | Reginer/aosp-android-jar | android-32/src/com/android/server/biometrics/sensors/face/aidl/FaceResetLockoutClient.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/biometrics/sensors/face/aidl/FaceResetLockoutClient.java | MIT |
public void testConstructor() {
AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
assertSame(one, ai.getReference());
assertFalse(ai.isMarked());
AtomicMarkableReference a2 = new AtomicMarkableReference(null, true);
assertNull(a2.getReference());
assertTrue(a2.isMarked());
} |
constructor initializes to given reference and mark
| AtomicMarkableReferenceTest::testConstructor | java | Reginer/aosp-android-jar | android-34/src/jsr166/AtomicMarkableReferenceTest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicMarkableReferenceTest.java | MIT |
public void testGetSet() {
boolean[] mark = new boolean[1];
AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
assertSame(one, ai.getReference());
assertFalse(ai.isMarked());
assertSame(one, ai.get(mark));
assertFalse(mark[0]);
ai.set(two, false);
assertSame(two, ai.getReference());
assertFalse(ai.isMarked());
assertSame(two, ai.get(mark));
assertFalse(mark[0]);
ai.set(one, true);
assertSame(one, ai.getReference());
assertTrue(ai.isMarked());
assertSame(one, ai.get(mark));
assertTrue(mark[0]);
} |
get returns the last values of reference and mark set
| AtomicMarkableReferenceTest::testGetSet | java | Reginer/aosp-android-jar | android-34/src/jsr166/AtomicMarkableReferenceTest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicMarkableReferenceTest.java | MIT |
public void testAttemptMark() {
boolean[] mark = new boolean[1];
AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
assertFalse(ai.isMarked());
assertTrue(ai.attemptMark(one, true));
assertTrue(ai.isMarked());
assertSame(one, ai.get(mark));
assertTrue(mark[0]);
} |
attemptMark succeeds in single thread
| AtomicMarkableReferenceTest::testAttemptMark | java | Reginer/aosp-android-jar | android-34/src/jsr166/AtomicMarkableReferenceTest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicMarkableReferenceTest.java | MIT |
public void testCompareAndSet() {
boolean[] mark = new boolean[1];
AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
assertSame(one, ai.get(mark));
assertFalse(ai.isMarked());
assertFalse(mark[0]);
assertTrue(ai.compareAndSet(one, two, false, false));
assertSame(two, ai.get(mark));
assertFalse(mark[0]);
assertTrue(ai.compareAndSet(two, m3, false, true));
assertSame(m3, ai.get(mark));
assertTrue(mark[0]);
assertFalse(ai.compareAndSet(two, m3, true, true));
assertSame(m3, ai.get(mark));
assertTrue(mark[0]);
} |
compareAndSet succeeds in changing values if equal to expected reference
and mark else fails
| AtomicMarkableReferenceTest::testCompareAndSet | java | Reginer/aosp-android-jar | android-34/src/jsr166/AtomicMarkableReferenceTest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicMarkableReferenceTest.java | MIT |
public void testCompareAndSetInMultipleThreads() throws Exception {
final AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
Thread t = new Thread(new CheckedRunnable() {
public void realRun() {
while (!ai.compareAndSet(two, three, false, false))
Thread.yield();
}});
t.start();
assertTrue(ai.compareAndSet(one, two, false, false));
t.join(LONG_DELAY_MS);
assertFalse(t.isAlive());
assertSame(three, ai.getReference());
assertFalse(ai.isMarked());
} |
compareAndSet in one thread enables another waiting for reference value
to succeed
| AtomicMarkableReferenceTest::testCompareAndSetInMultipleThreads | java | Reginer/aosp-android-jar | android-34/src/jsr166/AtomicMarkableReferenceTest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicMarkableReferenceTest.java | MIT |
public void testCompareAndSetInMultipleThreads2() throws Exception {
final AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
Thread t = new Thread(new CheckedRunnable() {
public void realRun() {
while (!ai.compareAndSet(one, one, true, false))
Thread.yield();
}});
t.start();
assertTrue(ai.compareAndSet(one, one, false, true));
t.join(LONG_DELAY_MS);
assertFalse(t.isAlive());
assertSame(one, ai.getReference());
assertFalse(ai.isMarked());
} |
compareAndSet in one thread enables another waiting for mark value
to succeed
| AtomicMarkableReferenceTest::testCompareAndSetInMultipleThreads2 | java | Reginer/aosp-android-jar | android-34/src/jsr166/AtomicMarkableReferenceTest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicMarkableReferenceTest.java | MIT |
public void testWeakCompareAndSet() {
boolean[] mark = new boolean[1];
AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
assertSame(one, ai.get(mark));
assertFalse(ai.isMarked());
assertFalse(mark[0]);
do {} while (!ai.weakCompareAndSet(one, two, false, false));
assertSame(two, ai.get(mark));
assertFalse(mark[0]);
do {} while (!ai.weakCompareAndSet(two, m3, false, true));
assertSame(m3, ai.get(mark));
assertTrue(mark[0]);
} |
repeated weakCompareAndSet succeeds in changing values when equal
to expected
| AtomicMarkableReferenceTest::testWeakCompareAndSet | java | Reginer/aosp-android-jar | android-34/src/jsr166/AtomicMarkableReferenceTest.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicMarkableReferenceTest.java | MIT |
public static @NonNull List<InetAddress> rfc6724Sort(@Nullable Network network,
@NonNull List<InetAddress> answers) {
final ArrayList<SortableAddress> sortableAnswerList = new ArrayList<>();
for (InetAddress addr : answers) {
sortableAnswerList.add(new SortableAddress(addr, findSrcAddress(network, addr)));
}
Collections.sort(sortableAnswerList, sRfc6724Comparator);
final List<InetAddress> sortedAnswers = new ArrayList<>();
for (SortableAddress ans : sortableAnswerList) {
sortedAnswers.add(ans.address);
}
return sortedAnswers;
} |
Sort the given address list in RFC6724 order.
Will leave the list unchanged if an error occurs.
This function matches the behaviour of _rfc6724_sort in the native resolver.
| SortableAddress::rfc6724Sort | java | Reginer/aosp-android-jar | android-34/src/android/net/util/DnsUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/util/DnsUtils.java | MIT |
private static int findLabel(@NonNull InetAddress addr) {
if (isIpv4Address(addr)) {
return 4;
} else if (isIpv6Address(addr)) {
if (addr.isLoopbackAddress()) {
return 0;
} else if (isIpv6Address6To4(addr)) {
return 2;
} else if (isIpv6AddressTeredo(addr)) {
return 5;
} else if (isIpv6AddressULA(addr)) {
return 13;
} else if (((Inet6Address) addr).isIPv4CompatibleAddress()) {
return 3;
} else if (addr.isSiteLocalAddress()) {
return 11;
} else if (isIpv6Address6Bone(addr)) {
return 12;
} else {
// All other IPv6 addresses, including global unicast addresses.
return 1;
}
} else {
// This should never happen.
return 1;
}
} |
Get the label for a given IPv4/IPv6 address.
RFC 6724, section 2.1.
Note that Java will return an IPv4-mapped address as an IPv4 address.
| SortableAddress::findLabel | java | Reginer/aosp-android-jar | android-34/src/android/net/util/DnsUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/util/DnsUtils.java | MIT |
private static int findPrecedence(@NonNull InetAddress addr) {
if (isIpv4Address(addr)) {
return 35;
} else if (isIpv6Address(addr)) {
if (addr.isLoopbackAddress()) {
return 50;
} else if (isIpv6Address6To4(addr)) {
return 30;
} else if (isIpv6AddressTeredo(addr)) {
return 5;
} else if (isIpv6AddressULA(addr)) {
return 3;
} else if (((Inet6Address) addr).isIPv4CompatibleAddress() || addr.isSiteLocalAddress()
|| isIpv6Address6Bone(addr)) {
return 1;
} else {
// All other IPv6 addresses, including global unicast addresses.
return 40;
}
} else {
return 1;
}
} |
Get the precedence for a given IPv4/IPv6 address.
RFC 6724, section 2.1.
Note that Java will return an IPv4-mapped address as an IPv4 address.
| SortableAddress::findPrecedence | java | Reginer/aosp-android-jar | android-34/src/android/net/util/DnsUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/util/DnsUtils.java | MIT |
private static int compareIpv6PrefixMatchLen(@NonNull InetAddress srcAddr,
@NonNull InetAddress dstAddr) {
final byte[] srcByte = srcAddr.getAddress();
final byte[] dstByte = dstAddr.getAddress();
// This should never happen.
if (srcByte.length != dstByte.length) return 0;
for (int i = 0; i < dstByte.length; ++i) {
if (srcByte[i] == dstByte[i]) {
continue;
}
int x = (srcByte[i] & 0xff) ^ (dstByte[i] & 0xff);
return i * CHAR_BIT + (Integer.numberOfLeadingZeros(x) - 24); // Java ints are 32 bits
}
return dstByte.length * CHAR_BIT;
} |
Find number of matching initial bits between the two addresses.
| SortableAddress::compareIpv6PrefixMatchLen | java | Reginer/aosp-android-jar | android-34/src/android/net/util/DnsUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/util/DnsUtils.java | MIT |
public static boolean haveIpv4(@Nullable Network network) {
final SocketAddress addrIpv4 =
new InetSocketAddress(InetAddresses.parseNumericAddress("8.8.8.8"), 0);
return checkConnectivity(network, AF_INET, addrIpv4);
} |
Check if given network has Ipv4 capability
This function matches the behaviour of have_ipv4 in the native resolver.
| SortableAddress::haveIpv4 | java | Reginer/aosp-android-jar | android-34/src/android/net/util/DnsUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/util/DnsUtils.java | MIT |
public static boolean haveIpv6(@Nullable Network network) {
final SocketAddress addrIpv6 =
new InetSocketAddress(InetAddresses.parseNumericAddress("2000::"), 0);
return checkConnectivity(network, AF_INET6, addrIpv6);
} |
Check if given network has Ipv6 capability
This function matches the behaviour of have_ipv6 in the native resolver.
| SortableAddress::haveIpv6 | java | Reginer/aosp-android-jar | android-34/src/android/net/util/DnsUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/util/DnsUtils.java | MIT |
public static void addOrReplaceSpan(
Spannable spannable, Object span, int start, int end, int spanFlags) {
Object[] existingSpans = spannable.getSpans(start, end, span.getClass());
for (Object existingSpan : existingSpans) {
if (spannable.getSpanStart(existingSpan) == start
&& spannable.getSpanEnd(existingSpan) == end
&& spannable.getSpanFlags(existingSpan) == spanFlags) {
spannable.removeSpan(existingSpan);
}
}
spannable.setSpan(span, start, end, spanFlags);
} |
Adds {@code span} to {@code spannable} between {@code start} and {@code end}, removing any
existing spans of the same type and with the same indices and flags.
<p>This is useful for types of spans that don't make sense to duplicate and where the
evaluation order might have an unexpected impact on the final text, e.g. {@link
ForegroundColorSpan}.
@param spannable The {@link Spannable} to add {@code span} to.
@param span The span object to be added.
@param start The start index to add the new span at.
@param end The end index to add the new span at.
@param spanFlags The flags to pass to {@link Spannable#setSpan(Object, int, int, int)}.
| SpanUtil::addOrReplaceSpan | java | Reginer/aosp-android-jar | android-35/src/com/google/android/exoplayer2/text/span/SpanUtil.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/google/android/exoplayer2/text/span/SpanUtil.java | MIT |
public void readPrefixTimeZonesMap(SortedMap<Integer, String> sortedPrefixTimeZoneMap) {
phonePrefixMap.readPhonePrefixMap(sortedPrefixTimeZoneMap);
} |
Creates a {@link PrefixTimeZonesMap} initialized with {@code sortedPrefixTimeZoneMap}. Note
that the underlying implementation of this method is expensive thus should not be called by
time-critical applications.
@param sortedPrefixTimeZoneMap a map from phone number prefixes to their corresponding time
zones, sorted in ascending order of the phone number prefixes as integers.
| PrefixTimeZonesMap::readPrefixTimeZonesMap | java | Reginer/aosp-android-jar | android-34/src/com/android/i18n/phonenumbers/prefixmapper/PrefixTimeZonesMap.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PrefixTimeZonesMap.java | MIT |
public void writeExternal(ObjectOutput objectOutput) throws IOException {
phonePrefixMap.writeExternal(objectOutput);
} |
Supports Java Serialization.
| PrefixTimeZonesMap::writeExternal | java | Reginer/aosp-android-jar | android-34/src/com/android/i18n/phonenumbers/prefixmapper/PrefixTimeZonesMap.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PrefixTimeZonesMap.java | MIT |
private List<String> lookupTimeZonesForNumber(long key) {
// Lookup in the map data. The returned String may consist of several time zones, so it must be
// split.
String timezonesString = phonePrefixMap.lookup(key);
if (timezonesString == null) {
return new LinkedList<String>();
}
return tokenizeRawOutputString(timezonesString);
} |
Returns the list of time zones {@code key} corresponds to.
<p>{@code key} could be the calling country code and the full significant number of a
certain number, or it could be just a phone-number prefix.
For example, the full number 16502530000 (from the phone-number +1 650 253 0000) is a valid
input. Also, any of its prefixes, such as 16502, is also valid.
@param key the key to look up
@return the list of corresponding time zones
| PrefixTimeZonesMap::lookupTimeZonesForNumber | java | Reginer/aosp-android-jar | android-34/src/com/android/i18n/phonenumbers/prefixmapper/PrefixTimeZonesMap.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PrefixTimeZonesMap.java | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.