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 int updateCallForward(int action, int condition, String number, int serviceClass, int timeSeconds) { return 0; }
Updates the configuration of the call forward.
ImsUtImplBase::updateCallForward
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public int updateCallWaiting(boolean enable, int serviceClass) { return -1; }
Updates the configuration of the call waiting.
ImsUtImplBase::updateCallWaiting
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public int updateCLIR(int clirMode) { return updateClir(clirMode); }
Updates the configuration of the CLIR supplementary service. @hide
ImsUtImplBase::updateCLIR
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public int updateCLIP(boolean enable) { return updateClip(enable); }
Updates the configuration of the CLIP supplementary service. @hide
ImsUtImplBase::updateCLIP
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public int updateCOLR(int presentation) { return updateColr(presentation); }
Updates the configuration of the COLR supplementary service. @hide
ImsUtImplBase::updateCOLR
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public int updateCOLP(boolean enable) { return updateColp(enable); }
Updates the configuration of the COLP supplementary service. @hide
ImsUtImplBase::updateCOLP
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public int updateClir(int clirMode) { return -1; }
Updates the configuration of the CLIR supplementary service.
ImsUtImplBase::updateClir
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public int updateClip(boolean enable) { return -1; }
Updates the configuration of the CLIP supplementary service.
ImsUtImplBase::updateClip
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public int updateColr(int presentation) { return -1; }
Updates the configuration of the COLR supplementary service.
ImsUtImplBase::updateColr
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public int updateColp(boolean enable) { return -1; }
Updates the configuration of the COLP supplementary service.
ImsUtImplBase::updateColp
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public void setListener(ImsUtListener listener) { }
Sets the listener.
ImsUtImplBase::setListener
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public IImsUt getInterface() { return mServiceImpl; }
@hide
ImsUtImplBase::getInterface
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public final void setDefaultExecutor(@NonNull Executor executor) { mExecutor = executor; }
Set default Executor from MmTelFeature. @param executor The default executor for the framework to use when executing the methods overridden by the implementation of ImsUT. @hide
ImsUtImplBase::setDefaultExecutor
java
Reginer/aosp-android-jar
android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/stub/ImsUtImplBase.java
MIT
public IslamicCalendar() { this(TimeZone.getDefault(), ULocale.getDefault(Category.FORMAT)); }
Constructs a default <code>IslamicCalendar</code> using the current time in the default time zone with the default <code>FORMAT</code> locale. @see Category#FORMAT
IslamicCalendar::IslamicCalendar
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public IslamicCalendar(TimeZone zone) { this(zone, ULocale.getDefault(Category.FORMAT)); }
Constructs an <code>IslamicCalendar</code> based on the current time in the given time zone with the default <code>FORMAT</code> locale. @param zone the given time zone. @see Category#FORMAT
IslamicCalendar::IslamicCalendar
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public IslamicCalendar(Locale aLocale) { this(TimeZone.forLocaleOrDefault(aLocale), aLocale); }
Constructs an <code>IslamicCalendar</code> based on the current time in the default time zone with the given locale. @param aLocale the given locale.
IslamicCalendar::IslamicCalendar
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public IslamicCalendar(ULocale locale) { this(TimeZone.forULocaleOrDefault(locale), locale); }
Constructs an <code>IslamicCalendar</code> based on the current time in the default time zone with the given locale. @param locale the given ulocale.
IslamicCalendar::IslamicCalendar
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public IslamicCalendar(TimeZone zone, Locale aLocale) { this(zone, ULocale.forLocale(aLocale)); }
Constructs an <code>IslamicCalendar</code> based on the current time in the given time zone with the given locale. @param zone the given time zone. @param aLocale the given locale.
IslamicCalendar::IslamicCalendar
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public IslamicCalendar(TimeZone zone, ULocale locale) { super(zone, locale); setCalcTypeForLocale(locale); setTimeInMillis(System.currentTimeMillis()); }
Constructs an <code>IslamicCalendar</code> based on the current time in the given time zone with the given locale. @param zone the given time zone. @param locale the given ulocale.
IslamicCalendar::IslamicCalendar
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public IslamicCalendar(Date date) { super(TimeZone.getDefault(), ULocale.getDefault(Category.FORMAT)); this.setTime(date); }
Constructs an <code>IslamicCalendar</code> with the given date set in the default time zone with the default <code>FORMAT</code> locale. @param date The date to which the new calendar is set. @see Category#FORMAT
IslamicCalendar::IslamicCalendar
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public IslamicCalendar(int year, int month, int date) { super(TimeZone.getDefault(), ULocale.getDefault(Category.FORMAT)); this.set(Calendar.YEAR, year); this.set(Calendar.MONTH, month); this.set(Calendar.DATE, date); }
Constructs an <code>IslamicCalendar</code> with the given date set in the default time zone with the default <code>FORMAT</code> locale. @param year the value used to set the {@link #YEAR YEAR} time field in the calendar. @param month the value used to set the {@link #MONTH MONTH} time field in the calendar. Note that the month value is 0-based. e.g., 0 for Muharram. @param date the value used to set the {@link #DATE DATE} time field in the calendar. @see Category#FORMAT
IslamicCalendar::IslamicCalendar
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public IslamicCalendar(int year, int month, int date, int hour, int minute, int second) { super(TimeZone.getDefault(), ULocale.getDefault(Category.FORMAT)); this.set(Calendar.YEAR, year); this.set(Calendar.MONTH, month); this.set(Calendar.DATE, date); this.set(Calendar.HOUR_OF_DAY, hour); this.set(Calendar.MINUTE, minute); this.set(Calendar.SECOND, second); }
Constructs an <code>IslamicCalendar</code> with the given date and time set for the default time zone with the default <code>FORMAT</code> locale. @param year the value used to set the {@link #YEAR YEAR} time field in the calendar. @param month the value used to set the {@link #MONTH MONTH} time field in the calendar. Note that the month value is 0-based. e.g., 0 for Muharram. @param date the value used to set the {@link #DATE DATE} time field in the calendar. @param hour the value used to set the {@link #HOUR_OF_DAY HOUR_OF_DAY} time field in the calendar. @param minute the value used to set the {@link #MINUTE MINUTE} time field in the calendar. @param second the value used to set the {@link #SECOND SECOND} time field in the calendar. @see Category#FORMAT
IslamicCalendar::IslamicCalendar
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public void setCivil(boolean beCivil) { civil = beCivil; if (beCivil && cType != CalculationType.ISLAMIC_CIVIL) { // The fields of the calendar will become invalid, because the calendar // rules are different long m = getTimeInMillis(); cType = CalculationType.ISLAMIC_CIVIL; clear(); setTimeInMillis(m); } else if(!beCivil && cType != CalculationType.ISLAMIC) { // The fields of the calendar will become invalid, because the calendar // rules are different long m = getTimeInMillis(); cType = CalculationType.ISLAMIC; clear(); setTimeInMillis(m); } }
Determines whether this object uses the fixed-cycle Islamic civil calendar or an approximation of the religious, astronomical calendar. @param beCivil <code>true</code> to use the civil calendar, <code>false</code> to use the astronomical calendar. @apiNote <strong>Discouraged:</strong> ICU 57 use setCalculationType(CalculationType) instead @hide unsupported on Android
IslamicCalendar::setCivil
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public boolean isCivil() { if(cType == CalculationType.ISLAMIC_CIVIL) { return true; } return false; }
Returns <code>true</code> if this object is using the fixed-cycle civil calendar, or <code>false</code> if using the religious, astronomical calendar. @apiNote <strong>Discouraged:</strong> ICU 57 use getCalculationType() instead @hide unsupported on Android
IslamicCalendar::isCivil
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
private final static boolean civilLeapYear(int year) { return (14 + 11 * year) % 30 < 11; }
Determine whether a year is a leap year in the Islamic civil calendar
IslamicCalendar::civilLeapYear
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
private long yearStart(int year) { long ys = 0; if (cType == CalculationType.ISLAMIC_CIVIL || cType == CalculationType.ISLAMIC_TBLA || (cType == CalculationType.ISLAMIC_UMALQURA && (year < UMALQURA_YEAR_START || year > UMALQURA_YEAR_END))) { ys = (year-1)*354 + (long)Math.floor((3+11*year)/30.0); } else if(cType == CalculationType.ISLAMIC) { ys = trueMonthStart(12*(year-1)); } else if(cType == CalculationType.ISLAMIC_UMALQURA){ year -= UMALQURA_YEAR_START; // rounded least-squares fit of the dates previously calculated from UMALQURA_MONTHLENGTH iteration int yrStartLinearEstimate = (int)((354.36720 * year) + 460322.05 + 0.5); // need a slight correction to some ys = yrStartLinearEstimate + UMALQURA_YEAR_START_ESTIMATE_FIX[year]; } return ys; }
Return the day # on which the given year starts. Days are counted from the Hijri epoch, origin 0.
IslamicCalendar::yearStart
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
private long monthStart(int year, int month) { // Normalize year/month in case month is outside the normal bounds, which may occur // in the case of an add operation int realYear = year + month / 12; int realMonth = month % 12; long ms = 0; if (cType == CalculationType.ISLAMIC_CIVIL || cType == CalculationType.ISLAMIC_TBLA || (cType == CalculationType.ISLAMIC_UMALQURA && year < UMALQURA_YEAR_START )) { ms = (long)Math.ceil(29.5*realMonth) + (realYear-1)*354 + (long)Math.floor((3+11*realYear)/30.0); } else if(cType == CalculationType.ISLAMIC) { ms = trueMonthStart(12*(realYear-1) + realMonth); } else if(cType == CalculationType.ISLAMIC_UMALQURA) { ms = yearStart(year); for(int i=0; i< month; i++) { ms+= handleGetMonthLength(year, i); } } return ms; }
Return the day # on which the given month starts. Days are counted from the Hijri epoch, origin 0. @param year The hijri year @param month The hijri month, 0-based
IslamicCalendar::monthStart
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
private static final long trueMonthStart(long month) { long start = cache.get(month); if (start == CalendarCache.EMPTY) { // Make a guess at when the month started, using the average length long origin = HIJRA_MILLIS + (long)Math.floor(month * CalendarAstronomer.SYNODIC_MONTH) * ONE_DAY; double age = moonAge(origin); if (moonAge(origin) >= 0) { // The month has already started do { origin -= ONE_DAY; age = moonAge(origin); } while (age >= 0); } else { // Preceding month has not ended yet. do { origin += ONE_DAY; age = moonAge(origin); } while (age < 0); } start = (origin - HIJRA_MILLIS) / ONE_DAY + 1; cache.put(month, start); } return start; }
Find the day number on which a particular month of the true/lunar Islamic calendar starts. @param month The month in question, origin 0 from the Hijri epoch @return The day number on which the given month starts.
IslamicCalendar::trueMonthStart
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
static final double moonAge(long time) { double age = 0; synchronized(astro) { astro.setTime(time); age = astro.getMoonAge(); } // Convert to degrees and normalize... age = age * 180 / Math.PI; if (age > 180) { age = age - 360; } return age; }
Return the "age" of the moon at the given time; this is the difference in ecliptic latitude between the moon and the sun. This method simply calls CalendarAstronomer.moonAge, converts to degrees, and adjusts the resultto be in the range [-180, 180]. @param time The time at which the moon's age is desired, in millis since 1/1/1970.
IslamicCalendar::moonAge
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public void setCalculationType(CalculationType type) { cType = type; // ensure civil property is up-to-date if(cType == CalculationType.ISLAMIC_CIVIL) civil = true; else civil = false; }
sets the calculation type for this calendar.
CalculationType::setCalculationType
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public CalculationType getCalculationType() { return cType; }
gets the calculation type for this calendar.
CalculationType::getCalculationType
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
private void setCalcTypeForLocale(ULocale locale) { String localeCalType = CalendarUtil.getCalendarType(locale); if("islamic-civil".equals(localeCalType)) setCalculationType(CalculationType.ISLAMIC_CIVIL); else if("islamic-umalqura".equals(localeCalType)) setCalculationType(CalculationType.ISLAMIC_UMALQURA); else if("islamic-tbla".equals(localeCalType)) setCalculationType(CalculationType.ISLAMIC_TBLA); else if(localeCalType.startsWith("islamic")) setCalculationType(CalculationType.ISLAMIC); // needs to be last so it's always the default if it's islamic-something-unhandled else setCalculationType(CalculationType.ISLAMIC_CIVIL); // default for any non-islamic calendar locale }
set type based on locale
CalculationType::setCalcTypeForLocale
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/IslamicCalendar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/IslamicCalendar.java
MIT
public prefix01(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
prefix01::prefix01
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/prefix01.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/prefix01.java
MIT
public void runTest() throws Throwable { Document doc; Node createdNode; String prefix; doc = (Document) load("staffNS", false); createdNode = doc.createElement("test:employee"); prefix = createdNode.getPrefix(); assertNull("throw_Null", prefix); }
Runs the test case. @throws Throwable Any uncaught exception causes test to fail
prefix01::runTest
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/prefix01.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/prefix01.java
MIT
public String getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/prefix01"; }
Gets URI that identifies the test. @return uri identifier of test
prefix01::getTargetURI
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/prefix01.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/prefix01.java
MIT
public static void main(final String[] args) { DOMTestCase.doMain(prefix01.class, args); }
Runs this test from the command line. @param args command line arguments
prefix01::main
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/prefix01.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/prefix01.java
MIT
public SsaDecoder(@Nullable List<byte[]> initializationData) { super("SsaDecoder"); screenWidth = Cue.DIMEN_UNSET; screenHeight = Cue.DIMEN_UNSET; if (initializationData != null && !initializationData.isEmpty()) { haveInitializationData = true; String formatLine = Util.fromUtf8Bytes(initializationData.get(0)); Assertions.checkArgument(formatLine.startsWith(FORMAT_LINE_PREFIX)); dialogueFormatFromInitializationData = Assertions.checkNotNull(SsaDialogueFormat.fromFormatLine(formatLine)); parseHeader(new ParsableByteArray(initializationData.get(1))); } else { haveInitializationData = false; dialogueFormatFromInitializationData = null; } }
Constructs an SsaDecoder with optional format and header info. @param initializationData Optional initialization data for the decoder. If not null or empty, the initialization data must consist of two byte arrays. The first must contain an SSA format line. The second must contain an SSA header that will be assumed common to all samples. The header is everything in an SSA file before the {@code [Events]} section (i.e. {@code [Script Info]} and optional {@code [V4+ Styles]} section.
SsaDecoder::SsaDecoder
java
Reginer/aosp-android-jar
android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
MIT
private void parseHeader(ParsableByteArray data) { @Nullable String currentLine; while ((currentLine = data.readLine()) != null) { if ("[Script Info]".equalsIgnoreCase(currentLine)) { parseScriptInfo(data); } else if ("[V4+ Styles]".equalsIgnoreCase(currentLine)) { styles = parseStyles(data); } else if ("[V4 Styles]".equalsIgnoreCase(currentLine)) { Log.i(TAG, "[V4 Styles] are not supported"); } else if ("[Events]".equalsIgnoreCase(currentLine)) { // We've reached the [Events] section, so the header is over. return; } } }
Parses the header of the subtitle. @param data A {@link ParsableByteArray} from which the header should be read.
SsaDecoder::parseHeader
java
Reginer/aosp-android-jar
android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
MIT
private void parseScriptInfo(ParsableByteArray data) { @Nullable String currentLine; while ((currentLine = data.readLine()) != null && (data.bytesLeft() == 0 || data.peekUnsignedByte() != '[')) { String[] infoNameAndValue = currentLine.split(":"); if (infoNameAndValue.length != 2) { continue; } switch (Ascii.toLowerCase(infoNameAndValue[0].trim())) { case "playresx": try { screenWidth = Float.parseFloat(infoNameAndValue[1].trim()); } catch (NumberFormatException e) { // Ignore invalid PlayResX value. } break; case "playresy": try { screenHeight = Float.parseFloat(infoNameAndValue[1].trim()); } catch (NumberFormatException e) { // Ignore invalid PlayResY value. } break; } } }
Parse the {@code [Script Info]} section. <p>When this returns, {@code data.position} will be set to the beginning of the first line that starts with {@code [} (i.e. the title of the next section). @param data A {@link ParsableByteArray} with {@link ParsableByteArray#getPosition() position} set to the beginning of the first line after {@code [Script Info]}.
SsaDecoder::parseScriptInfo
java
Reginer/aosp-android-jar
android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
MIT
private static Map<String, SsaStyle> parseStyles(ParsableByteArray data) { Map<String, SsaStyle> styles = new LinkedHashMap<>(); @Nullable SsaStyle.Format formatInfo = null; @Nullable String currentLine; while ((currentLine = data.readLine()) != null && (data.bytesLeft() == 0 || data.peekUnsignedByte() != '[')) { if (currentLine.startsWith(FORMAT_LINE_PREFIX)) { formatInfo = SsaStyle.Format.fromFormatLine(currentLine); } else if (currentLine.startsWith(STYLE_LINE_PREFIX)) { if (formatInfo == null) { Log.w(TAG, "Skipping 'Style:' line before 'Format:' line: " + currentLine); continue; } @Nullable SsaStyle style = SsaStyle.fromStyleLine(currentLine, formatInfo); if (style != null) { styles.put(style.name, style); } } } return styles; }
Parse the {@code [V4+ Styles]} section. <p>When this returns, {@code data.position} will be set to the beginning of the first line that starts with {@code [} (i.e. the title of the next section). @param data A {@link ParsableByteArray} with {@link ParsableByteArray#getPosition()} pointing at the beginning of the first line after {@code [V4+ Styles]}.
SsaDecoder::parseStyles
java
Reginer/aosp-android-jar
android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
MIT
private void parseEventBody(ParsableByteArray data, List<List<Cue>> cues, List<Long> cueTimesUs) { @Nullable SsaDialogueFormat format = haveInitializationData ? dialogueFormatFromInitializationData : null; @Nullable String currentLine; while ((currentLine = data.readLine()) != null) { if (currentLine.startsWith(FORMAT_LINE_PREFIX)) { format = SsaDialogueFormat.fromFormatLine(currentLine); } else if (currentLine.startsWith(DIALOGUE_LINE_PREFIX)) { if (format == null) { Log.w(TAG, "Skipping dialogue line before complete format: " + currentLine); continue; } parseDialogueLine(currentLine, format, cues, cueTimesUs); } } }
Parses the event body of the subtitle. @param data A {@link ParsableByteArray} from which the body should be read. @param cues A list to which parsed cues will be added. @param cueTimesUs A sorted list to which parsed cue timestamps will be added.
SsaDecoder::parseEventBody
java
Reginer/aosp-android-jar
android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
MIT
private void parseDialogueLine( String dialogueLine, SsaDialogueFormat format, List<List<Cue>> cues, List<Long> cueTimesUs) { Assertions.checkArgument(dialogueLine.startsWith(DIALOGUE_LINE_PREFIX)); String[] lineValues = dialogueLine.substring(DIALOGUE_LINE_PREFIX.length()).split(",", format.length); if (lineValues.length != format.length) { Log.w(TAG, "Skipping dialogue line with fewer columns than format: " + dialogueLine); return; } long startTimeUs = parseTimecodeUs(lineValues[format.startTimeIndex]); if (startTimeUs == C.TIME_UNSET) { Log.w(TAG, "Skipping invalid timing: " + dialogueLine); return; } long endTimeUs = parseTimecodeUs(lineValues[format.endTimeIndex]); if (endTimeUs == C.TIME_UNSET) { Log.w(TAG, "Skipping invalid timing: " + dialogueLine); return; } @Nullable SsaStyle style = styles != null && format.styleIndex != C.INDEX_UNSET ? styles.get(lineValues[format.styleIndex].trim()) : null; String rawText = lineValues[format.textIndex]; SsaStyle.Overrides styleOverrides = SsaStyle.Overrides.parseFromDialogue(rawText); String text = SsaStyle.Overrides.stripStyleOverrides(rawText) .replace("\\N", "\n") .replace("\\n", "\n") .replace("\\h", "\u00A0"); Cue cue = createCue(text, style, styleOverrides, screenWidth, screenHeight); int startTimeIndex = addCuePlacerholderByTime(startTimeUs, cueTimesUs, cues); int endTimeIndex = addCuePlacerholderByTime(endTimeUs, cueTimesUs, cues); // Iterate on cues from startTimeIndex until endTimeIndex, adding the current cue. for (int i = startTimeIndex; i < endTimeIndex; i++) { cues.get(i).add(cue); } }
Parses a dialogue line. @param dialogueLine The dialogue values (i.e. everything after {@code Dialogue:}). @param format The dialogue format to use when parsing {@code dialogueLine}. @param cues A list to which parsed cues will be added. @param cueTimesUs A sorted list to which parsed cue timestamps will be added.
SsaDecoder::parseDialogueLine
java
Reginer/aosp-android-jar
android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
MIT
private static long parseTimecodeUs(String timeString) { Matcher matcher = SSA_TIMECODE_PATTERN.matcher(timeString.trim()); if (!matcher.matches()) { return C.TIME_UNSET; } long timestampUs = Long.parseLong(castNonNull(matcher.group(1))) * 60 * 60 * C.MICROS_PER_SECOND; timestampUs += Long.parseLong(castNonNull(matcher.group(2))) * 60 * C.MICROS_PER_SECOND; timestampUs += Long.parseLong(castNonNull(matcher.group(3))) * C.MICROS_PER_SECOND; timestampUs += Long.parseLong(castNonNull(matcher.group(4))) * 10000; // 100ths of a second. return timestampUs; }
Parses an SSA timecode string. @param timeString The string to parse. @return The parsed timestamp in microseconds.
SsaDecoder::parseTimecodeUs
java
Reginer/aosp-android-jar
android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
MIT
private static int addCuePlacerholderByTime( long timeUs, List<Long> sortedCueTimesUs, List<List<Cue>> cues) { int insertionIndex = 0; for (int i = sortedCueTimesUs.size() - 1; i >= 0; i--) { if (sortedCueTimesUs.get(i) == timeUs) { return i; } if (sortedCueTimesUs.get(i) < timeUs) { insertionIndex = i + 1; break; } } sortedCueTimesUs.add(insertionIndex, timeUs); // Copy over cues from left, or use an empty list if we're inserting at the beginning. cues.add( insertionIndex, insertionIndex == 0 ? new ArrayList<>() : new ArrayList<>(cues.get(insertionIndex - 1))); return insertionIndex; }
Searches for {@code timeUs} in {@code sortedCueTimesUs}, inserting it if it's not found, and returns the index. <p>If it's inserted, we also insert a matching entry to {@code cues}.
SsaDecoder::addCuePlacerholderByTime
java
Reginer/aosp-android-jar
android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/google/android/exoplayer2/text/ssa/SsaDecoder.java
MIT
public void addSession(MediaSessionRecordImpl record) { mSessions.add(record); clearCache(record.getUserId()); // Update the media button session. // The added session could be the session from the package with the audio playback. // This can happen if an app starts audio playback before creating media session. updateMediaButtonSessionIfNeeded(); }
Add a record to the priority tracker. @param record The record to add.
MediaSessionStack::addSession
java
Reginer/aosp-android-jar
android-32/src/com/android/server/media/MediaSessionStack.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/media/MediaSessionStack.java
MIT
public MediaSessionRecord getMediaSessionRecord(MediaSession.Token sessionToken) { for (MediaSessionRecordImpl record : mSessions) { if (record instanceof MediaSessionRecord) { MediaSessionRecord session1 = (MediaSessionRecord) record; if (Objects.equals(session1.getSessionToken(), sessionToken)) { return session1; } } } return null; }
Gets the {@link MediaSessionRecord} with the {@link MediaSession.Token}. @param sessionToken session token @return the MediaSessionRecord. Can be {@code null} if the session is gone meanwhile.
getUserId::getMediaSessionRecord
java
Reginer/aosp-android-jar
android-32/src/com/android/server/media/MediaSessionStack.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/media/MediaSessionStack.java
MIT
private MediaSessionRecordImpl findMediaButtonSession(int uid) { MediaSessionRecordImpl mediaButtonSession = null; for (MediaSessionRecordImpl session : mSessions) { if (session instanceof MediaSession2Record) { // TODO(jaewan): Make MediaSession2 to receive media key event continue; } if (uid == session.getUid()) { if (session.checkPlaybackActiveState( mAudioPlayerStateMonitor.isPlaybackActive(session.getUid()))) { // If there's a media session whose PlaybackState matches // the audio playback state, return it immediately. return session; } if (mediaButtonSession == null) { // Among the media sessions whose PlaybackState doesn't match // the audio playback state, pick the top priority. mediaButtonSession = session; } } } return mediaButtonSession; }
Find the media button session with the given {@param uid}. If the app has multiple media sessions, the media session whose playback state is not null and matches the audio playback state becomes the media button session. Otherwise the top priority session becomes the media button session. @return The media button session. Returns {@code null} if the app doesn't have a media session.
MediaSessionStack::findMediaButtonSession
java
Reginer/aosp-android-jar
android-32/src/com/android/server/media/MediaSessionStack.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/media/MediaSessionStack.java
MIT
public List<MediaSessionRecord> getActiveSessions(int userId) { List<MediaSessionRecord> cachedActiveList = mCachedActiveLists.get(userId); if (cachedActiveList == null) { cachedActiveList = getPriorityList(true, userId); mCachedActiveLists.put(userId, cachedActiveList); } return cachedActiveList; }
Get the current priority sorted list of active sessions. The most important session is at index 0 and the least important at size - 1. @param userId The user to check. It can be {@link UserHandle#USER_ALL} to get all sessions for all users in this {@link MediaSessionStack}. @return All the active sessions in priority order.
MediaSessionStack::getActiveSessions
java
Reginer/aosp-android-jar
android-32/src/com/android/server/media/MediaSessionStack.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/media/MediaSessionStack.java
MIT
public List<Session2Token> getSession2Tokens(int userId) { ArrayList<Session2Token> session2Records = new ArrayList<>(); for (MediaSessionRecordImpl record : mSessions) { if ((userId == UserHandle.USER_ALL || record.getUserId() == userId) && record.isActive() && record instanceof MediaSession2Record) { MediaSession2Record session2 = (MediaSession2Record) record; session2Records.add(session2.getSession2Token()); } } return session2Records; }
Gets the session2 tokens. @param userId The user to check. It can be {@link UserHandle#USER_ALL} to get all session2 tokens for all users in this {@link MediaSessionStack}. @return All session2 tokens.
MediaSessionStack::getSession2Tokens
java
Reginer/aosp-android-jar
android-32/src/com/android/server/media/MediaSessionStack.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/media/MediaSessionStack.java
MIT
default void forEachRemaining(Consumer<? super T> action) { do { } while (tryAdvance(action)); }
Performs the given action for each remaining element, sequentially in the current thread, until all elements have been processed or the action throws an exception. If this Spliterator is {@link #ORDERED}, actions are performed in encounter order. Exceptions thrown by the action are relayed to the caller. <p> Subsequent behavior of a spliterator is unspecified if the action throws an exception. @implSpec The default implementation repeatedly invokes {@link #tryAdvance} until it returns {@code false}. It should be overridden whenever possible. @param action The action @throws NullPointerException if the specified action is null
forEachRemaining
java
Reginer/aosp-android-jar
android-34/src/java/util/Spliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/util/Spliterator.java
MIT
default long getExactSizeIfKnown() { return (characteristics() & SIZED) == 0 ? -1L : estimateSize(); }
Convenience method that returns {@link #estimateSize()} if this Spliterator is {@link #SIZED}, else {@code -1}. @implSpec The default implementation returns the result of {@code estimateSize()} if the Spliterator reports a characteristic of {@code SIZED}, and {@code -1} otherwise. @return the exact size, if known, else {@code -1}.
getExactSizeIfKnown
java
Reginer/aosp-android-jar
android-34/src/java/util/Spliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/util/Spliterator.java
MIT
default boolean hasCharacteristics(int characteristics) { return (characteristics() & characteristics) == characteristics; }
Returns {@code true} if this Spliterator's {@link #characteristics} contain all of the given characteristics. @implSpec The default implementation returns true if the corresponding bits of the given characteristics are set. @param characteristics the characteristics to check for @return {@code true} if all the specified characteristics are present, else {@code false}
hasCharacteristics
java
Reginer/aosp-android-jar
android-34/src/java/util/Spliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/util/Spliterator.java
MIT
default Comparator<? super T> getComparator() { throw new IllegalStateException(); }
If this Spliterator's source is {@link #SORTED} by a {@link Comparator}, returns that {@code Comparator}. If the source is {@code SORTED} in {@linkplain Comparable natural order}, returns {@code null}. Otherwise, if the source is not {@code SORTED}, throws {@link IllegalStateException}. @implSpec The default implementation always throws {@link IllegalStateException}. @return a Comparator, or {@code null} if the elements are sorted in the natural order. @throws IllegalStateException if the spliterator does not report a characteristic of {@code SORTED}.
getComparator
java
Reginer/aosp-android-jar
android-34/src/java/util/Spliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/util/Spliterator.java
MIT
public FastXmlSerializer(int bufferSize) { mBufferLen = (bufferSize > 0) ? bufferSize : DEFAULT_BUFFER_LEN; mText = new char[mBufferLen]; mBytes = ByteBuffer.allocate(mBufferLen); }
Allocate a FastXmlSerializer with the given internal output buffer size. If the size is zero or negative, then the default buffer size will be used. @param bufferSize Size in bytes of the in-memory output buffer that the writer will use.
FastXmlSerializer::FastXmlSerializer
java
Reginer/aosp-android-jar
android-35/src/com/android/internal/util/FastXmlSerializer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/internal/util/FastXmlSerializer.java
MIT
public boolean shouldHideImeWhenNoEditorFocus() { return mHideImeWhenNoEditorFocus; }
Whether the IME should be hidden when the window gained focus without an editor focused.
InputMethodDeviceConfigs::shouldHideImeWhenNoEditorFocus
java
Reginer/aosp-android-jar
android-35/src/com/android/server/inputmethod/InputMethodDeviceConfigs.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/inputmethod/InputMethodDeviceConfigs.java
MIT
public void addState(int[] stateSet, Drawable drawable) { if (drawable != null) { mStateListState.addStateSet(stateSet, drawable); // in case the new state matches our current state... onStateChange(getState()); } }
Add a new image/string ID to the set of images. @param stateSet An array of resource Ids to associate with the image. Switch to this image by calling setState(). @param drawable The image to show. Note this must be a unique Drawable that is not shared between any other View or Drawable otherwise the results are undefined and can lead to unexpected rendering behavior
StateListDrawable::addState
java
Reginer/aosp-android-jar
android-35/src/android/graphics/drawable/StateListDrawable.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/graphics/drawable/StateListDrawable.java
MIT
private void inflateChildElements(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException { final StateListState state = mStateListState; final int innerDepth = parser.getDepth() + 1; int type; int depth; while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && ((depth = parser.getDepth()) >= innerDepth || type != XmlPullParser.END_TAG)) { if (type != XmlPullParser.START_TAG) { continue; } if (depth > innerDepth || !parser.getName().equals("item")) { continue; } // This allows state list drawable item elements to be themed at // inflation time but does NOT make them work for Zygote preload. final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.StateListDrawableItem); Drawable dr = a.getDrawable(R.styleable.StateListDrawableItem_drawable); a.recycle(); final int[] states = extractStateSet(attrs); // Loading child elements modifies the state of the AttributeSet's // underlying parser, so it needs to happen after obtaining // attributes and extracting states. if (dr == null) { while ((type = parser.next()) == XmlPullParser.TEXT) { } if (type != XmlPullParser.START_TAG) { throw new XmlPullParserException( parser.getPositionDescription() + ": <item> tag requires a 'drawable' attribute or " + "child tag defining a drawable"); } dr = Drawable.createFromXmlInner(r, parser, attrs, theme); } state.addStateSet(states, dr); } }
Inflates child elements from XML.
StateListDrawable::inflateChildElements
java
Reginer/aosp-android-jar
android-35/src/android/graphics/drawable/StateListDrawable.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/graphics/drawable/StateListDrawable.java
MIT
public int getStateCount() { return mStateListState.getChildCount(); }
Gets the number of states contained in this drawable. @return The number of states contained in this drawable. @see #getStateSet(int) @see #getStateDrawable(int)
StateListDrawable::getStateCount
java
Reginer/aosp-android-jar
android-35/src/android/graphics/drawable/StateListDrawable.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/graphics/drawable/StateListDrawable.java
MIT
public @NonNull int[] getStateSet(int index) { return mStateListState.mStateSets[index]; }
Gets the state set at an index. @param index The index of the state set. @return The state set at the index. @see #getStateCount() @see #getStateDrawable(int)
StateListDrawable::getStateSet
java
Reginer/aosp-android-jar
android-35/src/android/graphics/drawable/StateListDrawable.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/graphics/drawable/StateListDrawable.java
MIT
public @Nullable Drawable getStateDrawable(int index) { return mStateListState.getChild(index); }
Gets the drawable at an index. @param index The index of the drawable. @return The drawable at the index. @see #getStateCount() @see #getStateSet(int)
StateListDrawable::getStateDrawable
java
Reginer/aosp-android-jar
android-35/src/android/graphics/drawable/StateListDrawable.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/graphics/drawable/StateListDrawable.java
MIT
public int findStateDrawableIndex(@NonNull int[] stateSet) { return mStateListState.indexOfStateSet(stateSet); }
Gets the index of the drawable with the provided state set. @param stateSet the state set to look up @return the index of the provided state set, or -1 if not found @see #getStateDrawable(int) @see #getStateSet(int)
StateListDrawable::findStateDrawableIndex
java
Reginer/aosp-android-jar
android-35/src/android/graphics/drawable/StateListDrawable.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/graphics/drawable/StateListDrawable.java
MIT
public void clearMutated() { super.clearMutated(); mMutated = false; }
@hide
StateListDrawable::clearMutated
java
Reginer/aosp-android-jar
android-35/src/android/graphics/drawable/StateListDrawable.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/graphics/drawable/StateListDrawable.java
MIT
StateListDrawable(@Nullable StateListState state) { if (state != null) { setConstantState(state); } }
This constructor exists so subclasses can avoid calling the default constructor and setting up a StateListDrawable-specific constant state.
StateListState::StateListDrawable
java
Reginer/aosp-android-jar
android-35/src/android/graphics/drawable/StateListDrawable.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/graphics/drawable/StateListDrawable.java
MIT
private TotalCaloriesBurnedRecord( @NonNull Metadata metadata, @NonNull Instant startTime, @NonNull ZoneOffset startZoneOffset, @NonNull Instant endTime, @NonNull ZoneOffset endZoneOffset, @NonNull Energy energy, boolean skipValidation) { super( metadata, startTime, startZoneOffset, endTime, endZoneOffset, skipValidation, /* enforceFutureTimeRestrictions= */ true); Objects.requireNonNull(metadata); Objects.requireNonNull(startTime); Objects.requireNonNull(startZoneOffset); Objects.requireNonNull(startTime); Objects.requireNonNull(endZoneOffset); Objects.requireNonNull(energy); if (!skipValidation) { ValidationUtils.requireInRange(energy.getInCalories(), 0.0, 1000000000.0, "energy"); } mEnergy = energy; }
@param metadata Metadata to be associated with the record. See {@link Metadata}. @param startTime Start time of this activity @param startZoneOffset Zone offset of the user when the activity started @param endTime End time of this activity @param endZoneOffset Zone offset of the user when the activity finished @param energy Energy burned during this activity @param skipValidation Boolean flag to skip validation of record values.
TotalCaloriesBurnedRecord::TotalCaloriesBurnedRecord
java
Reginer/aosp-android-jar
android-35/src/android/health/connect/datatypes/TotalCaloriesBurnedRecord.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/health/connect/datatypes/TotalCaloriesBurnedRecord.java
MIT
public Builder( @NonNull Metadata metadata, @NonNull Instant startTime, @NonNull Instant endTime, @NonNull Energy energy) { Objects.requireNonNull(metadata); Objects.requireNonNull(startTime); Objects.requireNonNull(endTime); Objects.requireNonNull(energy); mMetadata = metadata; mStartTime = startTime; mEndTime = endTime; mEnergy = energy; mStartZoneOffset = ZoneOffset.systemDefault().getRules().getOffset(startTime); mEndZoneOffset = ZoneOffset.systemDefault().getRules().getOffset(endTime); }
@param metadata Metadata to be associated with the record. See {@link Metadata}. @param startTime Start time of this activity @param endTime End time of this activity @param energy Energy burned during this activity in {@link Energy} unit. Required field. Valid range: 0-1000000 kcal.
Builder::Builder
java
Reginer/aosp-android-jar
android-35/src/android/health/connect/datatypes/TotalCaloriesBurnedRecord.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/health/connect/datatypes/TotalCaloriesBurnedRecord.java
MIT
private CbGeoUtils() {}
This class is never instantiated @hide
CbGeoUtils::CbGeoUtils
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
public LatLng(double lat, double lng) { this.lat = lat; this.lng = lng; }
Constructor. @param lat latitude, range [-90, 90] @param lng longitude, range [-180, 180]
LatLng::LatLng
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
public double distance(@NonNull LatLng p) { double dlat = Math.sin(0.5 * Math.toRadians(lat - p.lat)); double dlng = Math.sin(0.5 * Math.toRadians(lng - p.lng)); double x = dlat * dlat + dlng * dlng * Math.cos(Math.toRadians(lat)) * Math.cos(Math.toRadians(p.lat)); return 2 * Math.atan2(Math.sqrt(x), Math.sqrt(1 - x)) * EARTH_RADIUS_METER; }
Calculate the distance in meters between this point and the given point {@code p}. @param p the point used to calculate the distance. @return the distance in meters.
LatLng::distance
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
public Polygon(@NonNull List<LatLng> vertices) { mVertices = vertices; // Find the point with smallest longitude as the mOrigin point. int idx = 0; for (int i = 1; i < vertices.size(); i++) { if (vertices.get(i).lng < vertices.get(idx).lng) { idx = i; } } mOrigin = vertices.get(idx); mScaledVertices = vertices.stream() .map(latLng -> convertAndScaleLatLng(latLng)) .collect(Collectors.toList()); }
Constructs a simple polygon from the given vertices. The adjacent two vertices are connected to form an edge of the polygon. The polygon has at least 3 vertices, and the last vertices and the first vertices must be adjacent. The longitude difference in the vertices should be less than 180 degrees.
Polygon::Polygon
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
public @NonNull List<LatLng> getVertices() { return mVertices; }
Return the list of vertices which compose the polygon.
Polygon::getVertices
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
private Point convertAndScaleLatLng(LatLng latLng) { double x = latLng.lat - mOrigin.lat; double y = latLng.lng - mOrigin.lng; // If the point is in different hemispheres(western/eastern) than the mOrigin, and the // edge between them cross the 180th meridian, then its relative coordinates will be // extended. // For example, suppose the longitude of the mOrigin is -178, and the longitude of the // point to be converted is 175, then the longitude after the conversion is -8. // calculation: (-178 - 8) - (-178). if (sign(mOrigin.lng) != 0 && sign(mOrigin.lng) != sign(latLng.lng)) { double distCross0thMeridian = Math.abs(mOrigin.lng) + Math.abs(latLng.lng); if (sign(distCross0thMeridian * 2 - 360) > 0) { y = sign(mOrigin.lng) * (360 - distCross0thMeridian); } } return new Point(x * SCALE, y * SCALE); }
Move the given point {@code latLng} to the coordinate system with {@code mOrigin} as the origin and scale it. {@code mOrigin} is selected from the vertices of a polygon, it has the smallest longitude value among all of the polygon vertices. @param latLng the point need to be converted and scaled. @Return a {@link Point} object.
Polygon::convertAndScaleLatLng
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
public Circle(@NonNull LatLng center, double radiusInMeters) { this.mCenter = center; this.mRadiusMeter = radiusInMeters; }
Construct a Circle given a center point and a radius in meters. @param center the latitude and longitude of the center of the circle @param radiusInMeters the radius of the circle in meters
Circle::Circle
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
public @NonNull LatLng getCenter() { return mCenter; }
Return the latitude and longitude of the center of the circle;
Circle::getCenter
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
public double getRadius() { return mRadiusMeter; }
Return the radius of the circle in meters.
Circle::getRadius
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
public static int sign(double value) { if (value > EPS) return 1; if (value < -EPS) return -1; return 0; }
@Return the sign of the given value {@code value} with the specified tolerance. Return 1 means the sign is positive, -1 means negative, 0 means the value will be treated as 0. @hide
Circle::sign
java
Reginer/aosp-android-jar
android-32/src/android/telephony/CbGeoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/CbGeoUtils.java
MIT
public Signature(byte[] signature) { mSignature = signature.clone(); mCertificateChain = null; }
Create Signature from an existing raw byte array.
Signature::Signature
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public Signature(Certificate[] certificateChain) throws CertificateEncodingException { mSignature = certificateChain[0].getEncoded(); if (certificateChain.length > 1) { mCertificateChain = Arrays.copyOfRange(certificateChain, 1, certificateChain.length); } }
Create signature from a certificate chain. Used for backward compatibility. @throws CertificateEncodingException @hide
Signature::Signature
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public Signature(String text) { final byte[] input = text.getBytes(); final int N = input.length; if (N % 2 != 0) { throw new IllegalArgumentException("text size " + N + " is not even"); } final byte[] sig = new byte[N / 2]; int sigIndex = 0; for (int i = 0; i < N;) { final int hi = parseHexDigit(input[i++]); final int lo = parseHexDigit(input[i++]); sig[sigIndex++] = (byte) ((hi << 4) | lo); } mSignature = sig; }
Create Signature from a text representation previously returned by {@link #toChars} or {@link #toCharsString()}. Signatures are expected to be a hex-encoded ASCII string. @param text hex-encoded string representing the signature @throws IllegalArgumentException when signature is odd-length
Signature::Signature
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public Signature(Signature other) { mSignature = other.mSignature.clone(); Certificate[] otherCertificateChain = other.mCertificateChain; if (otherCertificateChain != null && otherCertificateChain.length > 1) { mCertificateChain = Arrays.copyOfRange(otherCertificateChain, 1, otherCertificateChain.length); } mFlags = other.mFlags; }
Copy constructor that creates a new instance from the provided {@code other} Signature. @hide
Signature::Signature
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public void setFlags(int flags) { this.mFlags = flags; }
Sets the flags representing the capabilities of the past signing certificate. @hide
Signature::setFlags
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public int getFlags() { return mFlags; }
Returns the flags representing the capabilities of the past signing certificate. @hide
Signature::getFlags
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public char[] toChars() { return toChars(null, null); }
Encode the Signature as ASCII text.
Signature::toChars
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public char[] toChars(char[] existingArray, int[] outLen) { byte[] sig = mSignature; final int N = sig.length; final int N2 = N*2; char[] text = existingArray == null || N2 > existingArray.length ? new char[N2] : existingArray; for (int j=0; j<N; j++) { byte v = sig[j]; int d = (v>>4)&0xf; text[j*2] = (char)(d >= 10 ? ('a' + d - 10) : ('0' + d)); d = v&0xf; text[j*2+1] = (char)(d >= 10 ? ('a' + d - 10) : ('0' + d)); } if (outLen != null) outLen[0] = N; return text; }
Encode the Signature as ASCII text in to an existing array. @param existingArray Existing char array or null. @param outLen Output parameter for the number of characters written in to the array. @return Returns either <var>existingArray</var> if it was large enough to hold the ASCII representation, or a newly created char[] array if needed.
Signature::toChars
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public String toCharsString() { String str = mStringRef == null ? null : mStringRef.get(); if (str != null) { return str; } str = new String(toChars()); mStringRef = new SoftReference<String>(str); return str; }
Return the result of {@link #toChars()} as a String.
Signature::toCharsString
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public byte[] toByteArray() { byte[] bytes = new byte[mSignature.length]; System.arraycopy(mSignature, 0, bytes, 0, mSignature.length); return bytes; }
@return the contents of this signature as a byte array.
Signature::toByteArray
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public Signature[] getChainSignatures() throws CertificateEncodingException { if (mCertificateChain == null) { return new Signature[] { this }; } Signature[] chain = new Signature[1 + mCertificateChain.length]; chain[0] = this; int i = 1; for (Certificate c : mCertificateChain) { chain[i++] = new Signature(c.getEncoded()); } return chain; }
Used for compatibility code that needs to check the certificate chain during upgrades. @throws CertificateEncodingException @hide
Signature::getChainSignatures
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public void writeToXmlAttributeBytesHex(@NonNull TypedXmlSerializer out, @Nullable String namespace, @NonNull String name) throws IOException { out.attributeBytesHex(namespace, name, mSignature); }
Used for compatibility code that needs to check the certificate chain during upgrades. @throws CertificateEncodingException @hide public Signature[] getChainSignatures() throws CertificateEncodingException { if (mCertificateChain == null) { return new Signature[] { this }; } Signature[] chain = new Signature[1 + mCertificateChain.length]; chain[0] = this; int i = 1; for (Certificate c : mCertificateChain) { chain[i++] = new Signature(c.getEncoded()); } return chain; } @Override public boolean equals(@Nullable Object obj) { try { if (obj != null) { Signature other = (Signature)obj; // Note, some classes, such as PackageParser.SigningDetails, rely on equals // only comparing the mSignature arrays without the flags. return this == other || Arrays.equals(mSignature, other.mSignature); } } catch (ClassCastException e) { } return false; } @Override public int hashCode() { if (mHaveHashCode) { return mHashCode; } // Note, similar to equals some classes rely on the hash code not including // the flags for Set membership checks. mHashCode = Arrays.hashCode(mSignature); mHaveHashCode = true; return mHashCode; } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int parcelableFlags) { dest.writeByteArray(mSignature); } public static final @android.annotation.NonNull Parcelable.Creator<Signature> CREATOR = new Parcelable.Creator<Signature>() { public Signature createFromParcel(Parcel source) { return new Signature(source); } public Signature[] newArray(int size) { return new Signature[size]; } }; /** {@hide}
Signature::writeToXmlAttributeBytesHex
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public static boolean areExactMatch(Signature[] a, Signature[] b) { return (a.length == b.length) && ArrayUtils.containsAll(a, b) && ArrayUtils.containsAll(b, a); }
Test if given {@link Signature} sets are exactly equal. @hide
Signature::areExactMatch
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public static boolean areEffectiveMatch(Signature[] a, Signature[] b) throws CertificateException { final CertificateFactory cf = CertificateFactory.getInstance("X.509"); final Signature[] aPrime = new Signature[a.length]; for (int i = 0; i < a.length; i++) { aPrime[i] = bounce(cf, a[i]); } final Signature[] bPrime = new Signature[b.length]; for (int i = 0; i < b.length; i++) { bPrime[i] = bounce(cf, b[i]); } return areExactMatch(aPrime, bPrime); }
Test if given {@link Signature} sets are effectively equal. In rare cases, certificates can have slightly malformed encoding which causes exact-byte checks to fail. <p> To identify effective equality, we bounce the certificates through an decode/encode pass before doing the exact-byte check. To reduce attack surface area, we only allow a byte size delta of a few bytes. @throws CertificateException if the before/after length differs substantially, usually a signal of something fishy going on. @hide
Signature::areEffectiveMatch
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public static boolean areEffectiveMatch(Signature a, Signature b) throws CertificateException { final CertificateFactory cf = CertificateFactory.getInstance("X.509"); final Signature aPrime = bounce(cf, a); final Signature bPrime = bounce(cf, b); return aPrime.equals(bPrime); }
Test if given {@link Signature} objects are effectively equal. In rare cases, certificates can have slightly malformed encoding which causes exact-byte checks to fail. <p> To identify effective equality, we bounce the certificates through an decode/encode pass before doing the exact-byte check. To reduce attack surface area, we only allow a byte size delta of a few bytes. @throws CertificateException if the before/after length differs substantially, usually a signal of something fishy going on. @hide
Signature::areEffectiveMatch
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
public static Signature bounce(CertificateFactory cf, Signature s) throws CertificateException { final InputStream is = new ByteArrayInputStream(s.mSignature); final X509Certificate cert = (X509Certificate) cf.generateCertificate(is); final Signature sPrime = new Signature(cert.getEncoded()); if (Math.abs(sPrime.mSignature.length - s.mSignature.length) > 2) { throw new CertificateException("Bounced cert length looks fishy; before " + s.mSignature.length + ", after " + sPrime.mSignature.length); } return sPrime; }
Bounce the given {@link Signature} through a decode/encode cycle. @throws CertificateException if the before/after length differs substantially, usually a signal of something fishy going on. @hide
Signature::bounce
java
Reginer/aosp-android-jar
android-31/src/android/content/pm/Signature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/pm/Signature.java
MIT
BooleanArrayList() { this(new boolean[DEFAULT_CAPACITY], 0); }
The size of the list distinct from the length of the array. That is, it is the number of elements set in the list. private int size; /** Constructs a new mutable {@code BooleanArrayList} with default capacity.
BooleanArrayList::BooleanArrayList
java
Reginer/aosp-android-jar
android-35/src/com/google/protobuf/BooleanArrayList.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/google/protobuf/BooleanArrayList.java
MIT
private BooleanArrayList(boolean[] other, int size) { array = other; this.size = size; }
Constructs a new mutable {@code BooleanArrayList} containing the same elements as {@code other}.
BooleanArrayList::BooleanArrayList
java
Reginer/aosp-android-jar
android-35/src/com/google/protobuf/BooleanArrayList.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/google/protobuf/BooleanArrayList.java
MIT
private void addBoolean(int index, boolean element) { ensureIsMutable(); if (index < 0 || index > size) { throw new IndexOutOfBoundsException(makeOutOfBoundsExceptionMessage(index)); } if (size < array.length) { // Shift everything over to make room System.arraycopy(array, index, array, index + 1, size - index); } else { // Resize to 1.5x the size int length = ((size * 3) / 2) + 1; boolean[] newArray = new boolean[length]; // Copy the first part directly System.arraycopy(array, 0, newArray, 0, index); // Copy the rest shifted over by one to make room System.arraycopy(array, index, newArray, index + 1, size - index); array = newArray; } array[index] = element; size++; modCount++; }
Constructs a new mutable {@code BooleanArrayList} containing the same elements as {@code other}. private BooleanArrayList(boolean[] other, int size) { array = other; this.size = size; } @Override protected void removeRange(int fromIndex, int toIndex) { ensureIsMutable(); if (toIndex < fromIndex) { throw new IndexOutOfBoundsException("toIndex < fromIndex"); } System.arraycopy(array, toIndex, array, fromIndex, size - toIndex); size -= (toIndex - fromIndex); modCount++; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BooleanArrayList)) { return super.equals(o); } BooleanArrayList other = (BooleanArrayList) o; if (size != other.size) { return false; } final boolean[] arr = other.array; for (int i = 0; i < size; i++) { if (array[i] != arr[i]) { return false; } } return true; } @Override public int hashCode() { int result = 1; for (int i = 0; i < size; i++) { result = (31 * result) + Internal.hashBoolean(array[i]); } return result; } @Override public BooleanList mutableCopyWithCapacity(int capacity) { if (capacity < size) { throw new IllegalArgumentException(); } return new BooleanArrayList(Arrays.copyOf(array, capacity), size); } @Override public Boolean get(int index) { return getBoolean(index); } @Override public boolean getBoolean(int index) { ensureIndexInRange(index); return array[index]; } @Override public int indexOf(Object element) { if (!(element instanceof Boolean)) { return -1; } boolean unboxedElement = (Boolean) element; int numElems = size(); for (int i = 0; i < numElems; i++) { if (array[i] == unboxedElement) { return i; } } return -1; } @Override public boolean contains(Object element) { return indexOf(element) != -1; } @Override public int size() { return size; } @Override public Boolean set(int index, Boolean element) { return setBoolean(index, element); } @Override public boolean setBoolean(int index, boolean element) { ensureIsMutable(); ensureIndexInRange(index); boolean previousValue = array[index]; array[index] = element; return previousValue; } @Override public boolean add(Boolean element) { addBoolean(element); return true; } @Override public void add(int index, Boolean element) { addBoolean(index, element); } /** Like {@link #add(Boolean)} but more efficient in that it doesn't box the element. @Override public void addBoolean(boolean element) { ensureIsMutable(); if (size == array.length) { // Resize to 1.5x the size int length = ((size * 3) / 2) + 1; boolean[] newArray = new boolean[length]; System.arraycopy(array, 0, newArray, 0, size); array = newArray; } array[size++] = element; } /** Like {@link #add(int, Boolean)} but more efficient in that it doesn't box the element.
BooleanArrayList::addBoolean
java
Reginer/aosp-android-jar
android-35/src/com/google/protobuf/BooleanArrayList.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/google/protobuf/BooleanArrayList.java
MIT
private void ensureIndexInRange(int index) { if (index < 0 || index >= size) { throw new IndexOutOfBoundsException(makeOutOfBoundsExceptionMessage(index)); } }
Ensures that the provided {@code index} is within the range of {@code [0, size]}. Throws an {@link IndexOutOfBoundsException} if it is not. @param index the index to verify is in range
BooleanArrayList::ensureIndexInRange
java
Reginer/aosp-android-jar
android-35/src/com/google/protobuf/BooleanArrayList.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/google/protobuf/BooleanArrayList.java
MIT
private TelephonyCapabilities() { }
Utilities that check if the phone supports specified capabilities. public class TelephonyCapabilities { private static final String LOG_TAG = "TelephonyCapabilities"; /** This class is never instantiated.
TelephonyCapabilities::TelephonyCapabilities
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 supportsEcm(Phone phone) { Rlog.d(LOG_TAG, "supportsEcm: Phone type = " + phone.getPhoneType() + " Ims Phone = " + phone.getImsPhone()); return (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA || phone.getImsPhone() != null); }
Return true if the current phone supports ECM ("Emergency Callback Mode"), which is a feature where the device goes into a special state for a short period of time after making an outgoing emergency call. (On current devices, that state lasts 5 minutes. It prevents data usage by other apps, to avoid conflicts with any possible incoming calls. It also puts up a notification in the status bar, showing a countdown while ECM is active, and allowing the user to exit ECM.) Currently this is assumed to be true for CDMA phones, and false otherwise.
TelephonyCapabilities::supportsEcm
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 supportsOtasp(Phone phone) { return (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA); }
Return true if the current phone supports Over The Air Service Provisioning (OTASP) Currently this is assumed to be true for CDMA phones, and false otherwise. TODO: Watch out: this is also highly carrier-specific, since the OTASP procedure is different from one carrier to the next, *and* the different carriers may want very different onscreen UI as well. The procedure may even be different for different devices with the same carrier. So we eventually will need a much more flexible, pluggable design. This method here is just a placeholder to reduce hardcoded "if (CDMA)" checks sprinkled throughout the phone app.
TelephonyCapabilities::supportsOtasp
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 supportsVoiceMessageCount(Phone phone) { return (phone.getVoiceMessageCount() != -1); }
Return true if the current phone supports voice message count. and the count is available Both CDMA and GSM phones support voice message count
TelephonyCapabilities::supportsVoiceMessageCount
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 supportsNetworkSelection(Phone phone) { return (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM); }
Return true if this phone allows the user to select which network to use. Currently this is assumed to be true only on GSM phones. TODO: Should CDMA phones allow this as well?
TelephonyCapabilities::supportsNetworkSelection
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