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 getOverrideLevel() { return 0; }
Return a valid log level from {@link android.util.Log} to override the system log level. Return 0 to instead defer to system log level.
LogHelper::getOverrideLevel
java
Reginer/aosp-android-jar
android-34/src/com/android/ex/camera2/portability/debug/LogHelper.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/ex/camera2/portability/debug/LogHelper.java
MIT
public static Intent sanitizeIntent(Intent origIntent) { final Intent sanitizedIntent; sanitizedIntent = new Intent(origIntent.getAction()); Set<String> categories = origIntent.getCategories(); if (categories != null) { for (String category : categories) { sanitizedIntent.addCategory(category); } } Uri sanitizedUri = origIntent.getData() == null ? null : Uri.fromParts(origIntent.getScheme(), "", ""); sanitizedIntent.setDataAndType(sanitizedUri, origIntent.getType()); sanitizedIntent.addFlags(origIntent.getFlags()); sanitizedIntent.setPackage(origIntent.getPackage()); return sanitizedIntent; }
Returns an intent with potential PII removed from the original intent. Fields removed include extras and the host + path of the data, if defined.
InstantAppResolver::sanitizeIntent
java
Reginer/aosp-android-jar
android-34/src/com/android/server/pm/InstantAppResolver.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/pm/InstantAppResolver.java
MIT
public static Intent buildEphemeralInstallerIntent( @NonNull Intent origIntent, @NonNull Intent sanitizedIntent, @Nullable Intent failureIntent, @NonNull String callingPackage, @Nullable String callingFeatureId, @Nullable Bundle verificationBundle, @NonNull String resolvedType, int userId, @Nullable ComponentName installFailureActivity, @Nullable String token, boolean needsPhaseTwo, List<AuxiliaryResolveInfo.AuxiliaryFilter> filters) { // Construct the intent that launches the instant installer int flags = origIntent.getFlags(); final Intent intent = new Intent(); intent.setFlags(flags | Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); if (token != null) { intent.putExtra(Intent.EXTRA_INSTANT_APP_TOKEN, token); } if (origIntent.getData() != null) { intent.putExtra(Intent.EXTRA_INSTANT_APP_HOSTNAME, origIntent.getData().getHost()); } intent.putExtra(Intent.EXTRA_INSTANT_APP_ACTION, origIntent.getAction()); intent.putExtra(Intent.EXTRA_INTENT, sanitizedIntent); if (needsPhaseTwo) { intent.setAction(Intent.ACTION_RESOLVE_INSTANT_APP_PACKAGE); } else { // We have all of the data we need; just start the installer without a second phase if (failureIntent != null || installFailureActivity != null) { // Intent that is launched if the package couldn't be installed for any reason. try { final Intent onFailureIntent; if (installFailureActivity != null) { onFailureIntent = new Intent(); onFailureIntent.setComponent(installFailureActivity); if (filters != null && filters.size() == 1) { onFailureIntent.putExtra(Intent.EXTRA_SPLIT_NAME, filters.get(0).splitName); } onFailureIntent.putExtra(Intent.EXTRA_INTENT, origIntent); } else { onFailureIntent = failureIntent; } final IIntentSender failureIntentTarget = ActivityManager.getService() .getIntentSenderWithFeature( ActivityManager.INTENT_SENDER_ACTIVITY, callingPackage, callingFeatureId, null /*token*/, null /*resultWho*/, 1 /*requestCode*/, new Intent[] { onFailureIntent }, new String[] { resolvedType }, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE, null /*bOptions*/, userId); IntentSender failureSender = new IntentSender(failureIntentTarget); // TODO(b/72700831): remove populating old extra intent.putExtra(Intent.EXTRA_INSTANT_APP_FAILURE, failureSender); } catch (RemoteException ignore) { /* ignore; same process */ } } // Intent that is launched if the package was installed successfully. final Intent successIntent = new Intent(origIntent); successIntent.setLaunchToken(token); try { final IIntentSender successIntentTarget = ActivityManager.getService() .getIntentSenderWithFeature( ActivityManager.INTENT_SENDER_ACTIVITY, callingPackage, callingFeatureId, null /*token*/, null /*resultWho*/, 0 /*requestCode*/, new Intent[] { successIntent }, new String[] { resolvedType }, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE, null /*bOptions*/, userId); IntentSender successSender = new IntentSender(successIntentTarget); intent.putExtra(Intent.EXTRA_INSTANT_APP_SUCCESS, successSender); } catch (RemoteException ignore) { /* ignore; same process */ } if (verificationBundle != null) { intent.putExtra(Intent.EXTRA_VERIFICATION_BUNDLE, verificationBundle); } intent.putExtra(Intent.EXTRA_CALLING_PACKAGE, callingPackage); if (filters != null) { Bundle resolvableFilters[] = new Bundle[filters.size()]; for (int i = 0, max = filters.size(); i < max; i++) { Bundle resolvableFilter = new Bundle(); AuxiliaryResolveInfo.AuxiliaryFilter filter = filters.get(i); resolvableFilter.putBoolean(Intent.EXTRA_UNKNOWN_INSTANT_APP, filter.resolveInfo != null && filter.resolveInfo.shouldLetInstallerDecide()); resolvableFilter.putString(Intent.EXTRA_PACKAGE_NAME, filter.packageName); resolvableFilter.putString(Intent.EXTRA_SPLIT_NAME, filter.splitName); resolvableFilter.putLong(Intent.EXTRA_LONG_VERSION_CODE, filter.versionCode); resolvableFilter.putBundle(Intent.EXTRA_INSTANT_APP_EXTRAS, filter.extras); resolvableFilters[i] = resolvableFilter; if (i == 0) { // for backwards compat, always set the first result on the intent and add // the int version code intent.putExtras(resolvableFilter); intent.putExtra(Intent.EXTRA_VERSION_CODE, (int) filter.versionCode); } } intent.putExtra(Intent.EXTRA_INSTANT_APP_BUNDLES, resolvableFilters); } intent.setAction(Intent.ACTION_INSTALL_INSTANT_APP_PACKAGE); } return intent; }
Builds and returns an intent to launch the instant installer.
InstantAppResolver::buildEphemeralInstallerIntent
java
Reginer/aosp-android-jar
android-34/src/com/android/server/pm/InstantAppResolver.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/pm/InstantAppResolver.java
MIT
private static Intent createFailureIntent(Intent origIntent, String token) { final Intent failureIntent = new Intent(origIntent); failureIntent.setFlags(failureIntent.getFlags() | Intent.FLAG_IGNORE_EPHEMERAL); failureIntent.setFlags(failureIntent.getFlags() & ~Intent.FLAG_ACTIVITY_MATCH_EXTERNAL); failureIntent.setLaunchToken(token); return failureIntent; }
Creates a failure intent for the installer to send in the case that the instant app cannot be launched for any reason.
InstantAppResolver::createFailureIntent
java
Reginer/aosp-android-jar
android-34/src/com/android/server/pm/InstantAppResolver.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/pm/InstantAppResolver.java
MIT
private static List<AuxiliaryResolveInfo.AuxiliaryFilter> computeResolveFilters( @NonNull Computer computer, @NonNull UserManagerService userManager, Intent origIntent, String resolvedType, int userId, String packageName, String token, InstantAppResolveInfo instantAppInfo) { if (instantAppInfo.shouldLetInstallerDecide()) { return Collections.singletonList( new AuxiliaryResolveInfo.AuxiliaryFilter( instantAppInfo, null /* splitName */, instantAppInfo.getExtras())); } if (packageName != null && !packageName.equals(instantAppInfo.getPackageName())) { return null; } final List<InstantAppIntentFilter> instantAppFilters = instantAppInfo.getIntentFilters(); if (instantAppFilters == null || instantAppFilters.isEmpty()) { // No filters on web intent; no matches, 2nd phase unnecessary. if (origIntent.isWebIntent()) { return null; } // No filters; we need to start phase two if (DEBUG_INSTANT) { Log.d(TAG, "No app filters; go to phase 2"); } return Collections.emptyList(); } final ComponentResolver.InstantAppIntentResolver instantAppResolver = new ComponentResolver.InstantAppIntentResolver(userManager); for (int j = instantAppFilters.size() - 1; j >= 0; --j) { final InstantAppIntentFilter instantAppFilter = instantAppFilters.get(j); final List<IntentFilter> splitFilters = instantAppFilter.getFilters(); if (splitFilters == null || splitFilters.isEmpty()) { continue; } for (int k = splitFilters.size() - 1; k >= 0; --k) { IntentFilter filter = splitFilters.get(k); Iterator<IntentFilter.AuthorityEntry> authorities = filter.authoritiesIterator(); // ignore http/s-only filters. if ((authorities == null || !authorities.hasNext()) && (filter.hasDataScheme("http") || filter.hasDataScheme("https")) && filter.hasAction(Intent.ACTION_VIEW) && filter.hasCategory(Intent.CATEGORY_BROWSABLE)) { continue; } instantAppResolver.addFilter(computer, new AuxiliaryResolveInfo.AuxiliaryFilter( filter, instantAppInfo, instantAppFilter.getSplitName(), instantAppInfo.getExtras() )); } } List<AuxiliaryResolveInfo.AuxiliaryFilter> matchedResolveInfoList = instantAppResolver.queryIntent(computer, origIntent, resolvedType, false /*defaultOnly*/, userId); if (!matchedResolveInfoList.isEmpty()) { if (DEBUG_INSTANT) { Log.d(TAG, "[" + token + "] Found match(es); " + matchedResolveInfoList); } return matchedResolveInfoList; } else if (DEBUG_INSTANT) { Log.d(TAG, "[" + token + "] No matches found" + " package: " + instantAppInfo.getPackageName() + ", versionCode: " + instantAppInfo.getVersionCode()); } return null; }
Returns one of three states: <p/> <ul> <li>{@code null} if there are no matches will not be; resolution is unnecessary.</li> <li>An empty list signifying that a 2nd phase of resolution is required.</li> <li>A populated list meaning that matches were found and should be sent directly to the installer</li> </ul>
InstantAppResolver::computeResolveFilters
java
Reginer/aosp-android-jar
android-34/src/com/android/server/pm/InstantAppResolver.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/pm/InstantAppResolver.java
MIT
private boolean iconEquals(@Nullable android.graphics.drawable.Icon icon1, @Nullable android.graphics.drawable.Icon icon2) { if (icon1 == icon2) { return true; } if (icon1 == null || icon2 == null) { return false; } if (icon1.getType() != android.graphics.drawable.Icon.TYPE_RESOURCE || icon2.getType() != android.graphics.drawable.Icon.TYPE_RESOURCE) { return false; } if (icon1.getResId() != icon2.getResId()) { return false; } if (!Objects.equals(icon1.getResPackage(), icon2.getResPackage())) { return false; } return true; }
Compare two icons, only works for resources.
CustomTile::iconEquals
java
Reginer/aosp-android-jar
android-34/src/com/android/systemui/qs/external/CustomTile.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/systemui/qs/external/CustomTile.java
MIT
public void updateTileState(Tile tile) { // This comes from a binder call IQSService.updateQsTile mHandler.post(() -> handleUpdateTileState(tile)); }
Update state of {@link this#mTile} from a remote {@link TileService}. @param tile tile populated with state to apply
CustomTile::updateTileState
java
Reginer/aosp-android-jar
android-34/src/com/android/systemui/qs/external/CustomTile.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/systemui/qs/external/CustomTile.java
MIT
private static void debugPrintln(String msg) { if (debug) { System.err.println( CLASS_NAME + ":" + msg); } }
<p>Output debugging messages.</p> @param msg <code>String</code> to print to <code>stderr</code>.
FactoryFinder::debugPrintln
java
Reginer/aosp-android-jar
android-35/src/javax/xml/datatype/FactoryFinder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/javax/xml/datatype/FactoryFinder.java
MIT
private static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (debug) debugPrintln( "Using context class loader: " + classLoader); if (classLoader == null) { // if we have no Context ClassLoader // so use the current ClassLoader classLoader = FactoryFinder.class.getClassLoader(); if (debug) debugPrintln( "Using the class loader of FactoryFinder: " + classLoader); } return classLoader; }
<p>Find the appropriate <code>ClassLoader</code> to use.</p> <p>The context ClassLoader is preferred.</p> @return <code>ClassLoader</code> to use. @throws ConfigurationError If a valid <code>ClassLoader</code> cannot be identified.
FactoryFinder::findClassLoader
java
Reginer/aosp-android-jar
android-35/src/javax/xml/datatype/FactoryFinder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/javax/xml/datatype/FactoryFinder.java
MIT
static Object find(String factoryId, String fallbackClassName) throws ConfigurationError { ClassLoader classLoader = findClassLoader(); // Use the system property first String systemProp = System.getProperty(factoryId); if (systemProp != null && systemProp.length() > 0) { if (debug) debugPrintln("found " + systemProp + " in the system property " + factoryId); return newInstance(systemProp, classLoader); } // try to read from $java.home/lib/jaxp.properties try { String factoryClassName = CacheHolder.cacheProps.getProperty(factoryId); if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties"); if (factoryClassName != null) { return newInstance(factoryClassName, classLoader); } } catch (Exception ex) { if (debug) { ex.printStackTrace(); } } // Try Jar Service Provider Mechanism Object provider = findJarServiceProvider(factoryId); if (provider != null) { return provider; } if (fallbackClassName == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } if (debug) debugPrintln("loaded from fallback value: " + fallbackClassName); return newInstance(fallbackClassName, classLoader); }
Finds the implementation Class object in the specified order. Main entry point. Package private so this code can be shared. @param factoryId Name of the factory to find, same as a property name @param fallbackClassName Implementation class name, if nothing else is found. Use null to mean no fallback. @return Class Object of factory, never null @throws ConfigurationError If Class cannot be found.
FactoryFinder::find
java
Reginer/aosp-android-jar
android-35/src/javax/xml/datatype/FactoryFinder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/javax/xml/datatype/FactoryFinder.java
MIT
ConfigurationError(String msg, Exception x) { super(msg); this.exception = x; }
<p>Construct a new instance with the specified detail string and exception.</p> @param msg Detail message for this error. @param x Exception that caused the error.
ConfigurationError::ConfigurationError
java
Reginer/aosp-android-jar
android-35/src/javax/xml/datatype/FactoryFinder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/javax/xml/datatype/FactoryFinder.java
MIT
Exception getException() { return exception; }
<p>Get the Exception that caused the error.</p> @return Exception that caused the error.
ConfigurationError::getException
java
Reginer/aosp-android-jar
android-35/src/javax/xml/datatype/FactoryFinder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/javax/xml/datatype/FactoryFinder.java
MIT
public hc_elementgetelementsbytagnamenomatch(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException { super(factory); // // check if loaded documents are supported for content type // String contentType = getContentType(); preload(contentType, "hc_staff", false); }
Constructor. @param factory document factory, may not be null @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
hc_elementgetelementsbytagnamenomatch::hc_elementgetelementsbytagnamenomatch
java
Reginer/aosp-android-jar
android-32/src/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
MIT
public void runTest() throws Throwable { Document doc; NodeList elementList; doc = (Document) load("hc_staff", false); elementList = doc.getElementsByTagName("noMatch"); assertSize("elementGetElementsByTagNameNoMatchNoMatchAssert", 0, elementList); }
Runs the test case. @throws Throwable Any uncaught exception causes test to fail
hc_elementgetelementsbytagnamenomatch::runTest
java
Reginer/aosp-android-jar
android-32/src/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
MIT
public String getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnamenomatch"; }
Gets URI that identifies the test. @return uri identifier of test
hc_elementgetelementsbytagnamenomatch::getTargetURI
java
Reginer/aosp-android-jar
android-32/src/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
MIT
public static void main(final String[] args) { DOMTestCase.doMain(hc_elementgetelementsbytagnamenomatch.class, args); }
Runs this test from the command line. @param args command line arguments
hc_elementgetelementsbytagnamenomatch::main
java
Reginer/aosp-android-jar
android-32/src/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level1/core/hc_elementgetelementsbytagnamenomatch.java
MIT
Lexer(Compiler compiler, PrefixResolver resolver, XPathParser xpathProcessor) { m_compiler = compiler; m_namespaceContext = resolver; m_processor = xpathProcessor; }
Create a Lexer object. @param compiler The owning compiler for this lexer. @param resolver The prefix resolver for mapping qualified name prefixes to namespace URIs. @param xpathProcessor The parser that is processing strings to opcodes.
Lexer::Lexer
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
void tokenize(String pat) throws javax.xml.transform.TransformerException { tokenize(pat, null); }
Walk through the expression and build a token queue, and a map of the top-level elements. @param pat XSLT Expression. @throws javax.xml.transform.TransformerException
Lexer::tokenize
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
void tokenize(String pat, Vector targetStrings) throws javax.xml.transform.TransformerException { m_compiler.m_currentPattern = pat; m_patternMapSize = 0; // This needs to grow too. Use a conservative estimate that the OpMapVector // needs about five time the length of the input path expression - to a // maximum of MAXTOKENQUEUESIZE*5. If the OpMapVector needs to grow, grow // it freely (second argument to constructor). int initTokQueueSize = ((pat.length() < OpMap.MAXTOKENQUEUESIZE) ? pat.length() : OpMap.MAXTOKENQUEUESIZE) * 5; m_compiler.m_opMap = new OpMapVector(initTokQueueSize, OpMap.BLOCKTOKENQUEUESIZE * 5, OpMap.MAPINDEX_LENGTH); int nChars = pat.length(); int startSubstring = -1; int posOfNSSep = -1; boolean isStartOfPat = true; boolean isAttrName = false; boolean isNum = false; // Nesting of '[' so we can know if the given element should be // counted inside the m_patternMap. int nesting = 0; // char[] chars = pat.toCharArray(); for (int i = 0; i < nChars; i++) { char c = pat.charAt(i); switch (c) { case '\"' : { if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } } startSubstring = i; for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\"'); i++); if (c == '\"' && i < nChars) { addToTokenQueue(pat.substring(startSubstring, i + 1)); startSubstring = -1; } else { m_processor.error(XPATHErrorResources.ER_EXPECTED_DOUBLE_QUOTE, null); //"misquoted literal... expected double quote!"); } } break; case '\'' : if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } } startSubstring = i; for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\''); i++); if (c == '\'' && i < nChars) { addToTokenQueue(pat.substring(startSubstring, i + 1)); startSubstring = -1; } else { m_processor.error(XPATHErrorResources.ER_EXPECTED_SINGLE_QUOTE, null); //"misquoted literal... expected single quote!"); } break; case 0x0A : case 0x0D : case ' ' : case '\t' : if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } startSubstring = -1; } break; case '@' : isAttrName = true; // fall-through on purpose case '-' : if ('-' == c) { if (!(isNum || (startSubstring == -1))) { break; } isNum = false; } // fall-through on purpose case '(' : case '[' : case ')' : case ']' : case '|' : case '/' : case '*' : case '+' : case '=' : case ',' : case '\\' : // Unused at the moment case '^' : // Unused at the moment case '!' : // Unused at the moment case '$' : case '<' : case '>' : if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } startSubstring = -1; } else if (('/' == c) && isStartOfPat) { isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); } else if ('*' == c) { isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; } if (0 == nesting) { if ('|' == c) { if (null != targetStrings) { recordTokenString(targetStrings); } isStartOfPat = true; } } if ((')' == c) || (']' == c)) { nesting--; } else if (('(' == c) || ('[' == c)) { nesting++; } addToTokenQueue(pat.substring(i, i + 1)); break; case ':' : if (i>0) { if (posOfNSSep == (i - 1)) { if (startSubstring != -1) { if (startSubstring < (i - 1)) addToTokenQueue(pat.substring(startSubstring, i - 1)); } isNum = false; isAttrName = false; startSubstring = -1; posOfNSSep = -1; addToTokenQueue(pat.substring(i - 1, i + 1)); break; } else { posOfNSSep = i; } } // fall through on purpose default : if (-1 == startSubstring) { startSubstring = i; isNum = Character.isDigit(c); } else if (isNum) { isNum = Character.isDigit(c); } } } if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); if ((-1 != posOfNSSep) || ((m_namespaceContext != null) && (m_namespaceContext.handlesNullPrefixes()))) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, nChars); } else { addToTokenQueue(pat.substring(startSubstring, nChars)); } } if (0 == m_compiler.getTokenQueueSize()) { m_processor.error(XPATHErrorResources.ER_EMPTY_EXPRESSION, null); //"Empty expression!"); } else if (null != targetStrings) { recordTokenString(targetStrings); } m_processor.m_queueMark = 0; }
Walk through the expression and build a token queue, and a map of the top-level elements. @param pat XSLT Expression. @param targetStrings Vector to hold Strings, may be null. @throws javax.xml.transform.TransformerException
Lexer::tokenize
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
private boolean mapPatternElemPos(int nesting, boolean isStart, boolean isAttrName) { if (0 == nesting) { if(m_patternMapSize >= m_patternMap.length) { int patternMap[] = m_patternMap; int len = m_patternMap.length; m_patternMap = new int[m_patternMapSize + 100]; System.arraycopy(patternMap, 0, m_patternMap, 0, len); } if (!isStart) { m_patternMap[m_patternMapSize - 1] -= TARGETEXTRA; } m_patternMap[m_patternMapSize] = (m_compiler.getTokenQueueSize() - (isAttrName ? 1 : 0)) + TARGETEXTRA; m_patternMapSize++; isStart = false; } return isStart; }
Record the current position on the token queue as long as this is a top-level element. Must be called before the next token is added to the m_tokenQueue. @param nesting The nesting count for the pattern element. @param isStart true if this is the start of a pattern. @param isAttrName true if we have determined that this is an attribute name. @return true if this is the start of a pattern.
Lexer::mapPatternElemPos
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
private int getTokenQueuePosFromMap(int i) { int pos = m_patternMap[i]; return (pos >= TARGETEXTRA) ? (pos - TARGETEXTRA) : pos; }
Given a map pos, return the corresponding token queue pos. @param i The index in the m_patternMap. @return the token queue position.
Lexer::getTokenQueuePosFromMap
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
private final void resetTokenMark(int mark) { int qsz = m_compiler.getTokenQueueSize(); m_processor.m_queueMark = (mark > 0) ? ((mark <= qsz) ? mark - 1 : mark) : 0; if (m_processor.m_queueMark < qsz) { m_processor.m_token = (String) m_compiler.getTokenQueue().elementAt(m_processor.m_queueMark++); m_processor.m_tokenChar = m_processor.m_token.charAt(0); } else { m_processor.m_token = null; m_processor.m_tokenChar = 0; } }
Reset token queue mark and m_token to a given position. @param mark The new position.
Lexer::resetTokenMark
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
final int getKeywordToken(String key) { int tok; try { Integer itok = (Integer) Keywords.getKeyWord(key); tok = (null != itok) ? itok.intValue() : 0; } catch (NullPointerException npe) { tok = 0; } catch (ClassCastException cce) { tok = 0; } return tok; }
Given a string, return the corresponding keyword token. @param key The keyword. @return An opcode value.
Lexer::getKeywordToken
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
private void recordTokenString(Vector targetStrings) { int tokPos = getTokenQueuePosFromMap(m_patternMapSize - 1); resetTokenMark(tokPos + 1); if (m_processor.lookahead('(', 1)) { int tok = getKeywordToken(m_processor.m_token); switch (tok) { case OpCodes.NODETYPE_COMMENT : targetStrings.addElement(PsuedoNames.PSEUDONAME_COMMENT); break; case OpCodes.NODETYPE_TEXT : targetStrings.addElement(PsuedoNames.PSEUDONAME_TEXT); break; case OpCodes.NODETYPE_NODE : targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY); break; case OpCodes.NODETYPE_ROOT : targetStrings.addElement(PsuedoNames.PSEUDONAME_ROOT); break; case OpCodes.NODETYPE_ANYELEMENT : targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY); break; case OpCodes.NODETYPE_PI : targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY); break; default : targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY); } } else { if (m_processor.tokenIs('@')) { tokPos++; resetTokenMark(tokPos + 1); } if (m_processor.lookahead(':', 1)) { tokPos += 2; } targetStrings.addElement(m_compiler.getTokenQueue().elementAt(tokPos)); } }
Record the current token in the passed vector. @param targetStrings Vector of string.
Lexer::recordTokenString
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
private final void addToTokenQueue(String s) { m_compiler.getTokenQueue().addElement(s); }
Add a token to the token queue. @param s The token.
Lexer::addToTokenQueue
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
private int mapNSTokens(String pat, int startSubstring, int posOfNSSep, int posOfScan) throws javax.xml.transform.TransformerException { String prefix = ""; if ((startSubstring >= 0) && (posOfNSSep >= 0)) { prefix = pat.substring(startSubstring, posOfNSSep); } String uName; if ((null != m_namespaceContext) &&!prefix.equals("*") &&!prefix.equals("xmlns")) { try { if (prefix.length() > 0) uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix( prefix); else { // Assume last was wildcard. This is not legal according // to the draft. Set the below to true to make namespace // wildcards work. if (false) { addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); return -1; } else { uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix( prefix); } } } catch (ClassCastException cce) { uName = m_namespaceContext.getNamespaceForPrefix(prefix); } } else { uName = prefix; } if ((null != uName) && (uName.length() > 0)) { addToTokenQueue(uName); addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); } else { // To older XPath code it doesn't matter if // error() is called or errorForDOM3(). m_processor.errorForDOM3(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE, new String[] {prefix}); //"Prefix must resolve to a namespace: {0}"; /** old code commented out 17-Sep-2004 // error("Could not locate namespace for prefix: "+prefix); // m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE, // new String[] {prefix}); //"Prefix must resolve to a namespace: {0}"; */ /*** Old code commented out 10-Jan-2001 addToTokenQueue(prefix); addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); ***/ } return -1; }
When a seperator token is found, see if there's a element name or the like to map. @param pat The XPath name string. @param startSubstring The start of the name string. @param posOfNSSep The position of the namespace seperator (':'). @param posOfScan The end of the name index. @throws javax.xml.transform.TransformerException @return -1 always.
Lexer::mapNSTokens
java
Reginer/aosp-android-jar
android-34/src/org/apache/xpath/compiler/Lexer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xpath/compiler/Lexer.java
MIT
public RadioBugDetector(Context context, int slotId) { mContext = context; mSlotId = slotId; init(); }
Default configuration values for radio bug detection. The value should be large enough to avoid false alarm. From past log analysis, 10 wakelock timeout took around 1 hour. 100 accumulated system_err is an estimation for abnormal radio. private static final int DEFAULT_WAKELOCK_TIMEOUT_COUNT_THRESHOLD = 10; private static final int DEFAULT_SYSTEM_ERROR_COUNT_THRESHOLD = 100; private Context mContext; private int mContinuousWakelockTimoutCount = 0; private int mRadioBugStatus = RADIO_BUG_NONE; private int mSlotId; private int mWakelockTimeoutThreshold = 0; private int mSystemErrorThreshold = 0; private HashMap<Integer, Integer> mSysErrRecord = new HashMap<Integer, Integer>(); /** Constructor
RadioBugDetector::RadioBugDetector
java
Reginer/aosp-android-jar
android-32/src/com/android/internal/telephony/RadioBugDetector.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/telephony/RadioBugDetector.java
MIT
public synchronized void detectRadioBug(int requestType, int error) { /** * When this function is executed, it means RIL is alive. So, reset WakelockTimeoutCount. * Regarding SYSTEM_ERR, although RIL is alive, the connection with modem may be broken. * For this error, accumulate the count and check if broadcast should be sent or not. * For normal response or other error, reset the count of SYSTEM_ERR of the specific * request type and mRadioBugStatus if necessary */ mContinuousWakelockTimoutCount = 0; if (error == RadioError.SYSTEM_ERR) { int errorCount = mSysErrRecord.getOrDefault(requestType, 0); errorCount++; mSysErrRecord.put(requestType, errorCount); broadcastBug(true); } else { // Reset system error count if we get non-system error response. mSysErrRecord.remove(requestType); if (!isFrequentSystemError()) { mRadioBugStatus = RADIO_BUG_NONE; } } }
Detect radio bug and notify this issue once the threshold is reached. @param requestType The command type information we retrieved @param error The error we received
RadioBugDetector::detectRadioBug
java
Reginer/aosp-android-jar
android-32/src/com/android/internal/telephony/RadioBugDetector.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/telephony/RadioBugDetector.java
MIT
public void processWakelockTimeout() { mContinuousWakelockTimoutCount++; broadcastBug(false); }
When wakelock timeout is detected, accumulate its count and check if broadcast should be sent or not.
RadioBugDetector::processWakelockTimeout
java
Reginer/aosp-android-jar
android-32/src/com/android/internal/telephony/RadioBugDetector.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/internal/telephony/RadioBugDetector.java
MIT
public documentgetelementbyid01(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
documentgetelementbyid01::documentgetelementbyid01
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/documentgetelementbyid01.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/documentgetelementbyid01.java
MIT
public void runTest() throws Throwable { Document doc; Element element; String elementId = "---"; doc = (Document) load("staffNS", false); element = doc.getElementById(elementId); assertNull("documentgetelementbyid01", element); }
Runs the test case. @throws Throwable Any uncaught exception causes test to fail
documentgetelementbyid01::runTest
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/documentgetelementbyid01.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/documentgetelementbyid01.java
MIT
public String getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentgetelementbyid01"; }
Gets URI that identifies the test. @return uri identifier of test
documentgetelementbyid01::getTargetURI
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/documentgetelementbyid01.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/documentgetelementbyid01.java
MIT
public static void main(final String[] args) { DOMTestCase.doMain(documentgetelementbyid01.class, args); }
Runs this test from the command line. @param args command line arguments
documentgetelementbyid01::main
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/documentgetelementbyid01.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/documentgetelementbyid01.java
MIT
public Vector(int initialCapacity, int capacityIncrement) { super(); if (initialCapacity < 0) throw new IllegalArgumentException("Illegal Capacity: "+ initialCapacity); this.elementData = new Object[initialCapacity]; this.capacityIncrement = capacityIncrement; }
Constructs an empty vector with the specified initial capacity and capacity increment. @param initialCapacity the initial capacity of the vector @param capacityIncrement the amount by which the capacity is increased when the vector overflows @throws IllegalArgumentException if the specified initial capacity is negative
Vector::Vector
java
Reginer/aosp-android-jar
android-33/src/java/util/Vector.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/Vector.java
MIT
public Vector(int initialCapacity) { this(initialCapacity, 0); }
Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero. @param initialCapacity the initial capacity of the vector @throws IllegalArgumentException if the specified initial capacity is negative
Vector::Vector
java
Reginer/aosp-android-jar
android-33/src/java/util/Vector.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/Vector.java
MIT
public Vector() { this(10); }
Constructs an empty vector so that its internal data array has size {@code 10} and its standard capacity increment is zero.
Vector::Vector
java
Reginer/aosp-android-jar
android-33/src/java/util/Vector.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/Vector.java
MIT
public Vector(Collection<? extends E> c) { elementData = c.toArray(); elementCount = elementData.length; // c.toArray might (incorrectly) not return Object[] (see 6260652) if (elementData.getClass() != Object[].class) elementData = Arrays.copyOf(elementData, elementCount, Object[].class); }
Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator. @param c the collection whose elements are to be placed into this vector @throws NullPointerException if the specified collection is null @since 1.2
Vector::Vector
java
Reginer/aosp-android-jar
android-33/src/java/util/Vector.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/Vector.java
MIT
VectorSpliterator(Vector<E> list, Object[] array, int origin, int fence, int expectedModCount) { this.list = list; this.array = array; this.index = origin; this.fence = fence; this.expectedModCount = expectedModCount; }
Creates a <em><a href="Spliterator.html#binding">late-binding</a></em> and <em>fail-fast</em> {@link Spliterator} over the elements in this list. <p>The {@code Spliterator} reports {@link Spliterator#SIZED}, {@link Spliterator#SUBSIZED}, and {@link Spliterator#ORDERED}. Overriding implementations should document the reporting of additional characteristic values. @return a {@code Spliterator} over the elements in this list @since 1.8 @Override public Spliterator<E> spliterator() { return new VectorSpliterator<>(this, null, 0, -1, 0); } /** Similar to ArrayList Spliterator static final class VectorSpliterator<E> implements Spliterator<E> { private final Vector<E> list; private Object[] array; private int index; // current index, modified on advance/split private int fence; // -1 until used; then one past last index private int expectedModCount; // initialized when fence set /** Create new spliterator covering the given range
VectorSpliterator::VectorSpliterator
java
Reginer/aosp-android-jar
android-33/src/java/util/Vector.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/Vector.java
MIT
public AlphaAnimation(Context context, AttributeSet attrs) { super(context, attrs); TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.AlphaAnimation); mFromAlpha = a.getFloat(com.android.internal.R.styleable.AlphaAnimation_fromAlpha, 1.0f); mToAlpha = a.getFloat(com.android.internal.R.styleable.AlphaAnimation_toAlpha, 1.0f); a.recycle(); }
Constructor used when an AlphaAnimation is loaded from a resource. @param context Application context to use @param attrs Attribute set from which to read values
AlphaAnimation::AlphaAnimation
java
Reginer/aosp-android-jar
android-32/src/android/view/animation/AlphaAnimation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/view/animation/AlphaAnimation.java
MIT
public AlphaAnimation(float fromAlpha, float toAlpha) { mFromAlpha = fromAlpha; mToAlpha = toAlpha; }
Constructor to use when building an AlphaAnimation from code @param fromAlpha Starting alpha value for the animation, where 1.0 means fully opaque and 0.0 means fully transparent. @param toAlpha Ending alpha value for the animation.
AlphaAnimation::AlphaAnimation
java
Reginer/aosp-android-jar
android-32/src/android/view/animation/AlphaAnimation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/view/animation/AlphaAnimation.java
MIT
public AccessibilityManager(Context context, IAccessibilityManager service, int userId) { // Constructor can't be chained because we can't create an instance of an inner class // before calling another constructor. mCallback = new MyCallback(); mHandler = new Handler(context.getMainLooper(), mCallback); mUserId = userId; synchronized (mLock) { initialFocusAppearanceLocked(context.getResources()); tryConnectToServiceLocked(service); } }
Create an instance. @param context A {@link Context}. @param service An interface to the backing service. @param userId User id under which to run. @hide
AccessibilityManager::AccessibilityManager
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public IAccessibilityManagerClient getClient() { return mClient; }
@hide
AccessibilityManager::getClient
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean removeClient() { synchronized (mLock) { IAccessibilityManager service = getServiceLocked(); if (service == null) { return false; } try { return service.removeClient(mClient, mUserId); } catch (RemoteException re) { Log.e(LOG_TAG, "AccessibilityManagerService is dead", re); } } return false; }
Unregisters the IAccessibilityManagerClient from the backing service @hide
AccessibilityManager::removeClient
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean isEnabled() { synchronized (mLock) { return mIsEnabled || (mAccessibilityPolicy != null && mAccessibilityPolicy.isEnabled(mIsEnabled)); } }
Returns if the accessibility in the system is enabled. @return True if accessibility is enabled, false otherwise.
AccessibilityManager::isEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean isTouchExplorationEnabled() { synchronized (mLock) { IAccessibilityManager service = getServiceLocked(); if (service == null) { return false; } return mIsTouchExplorationEnabled; } }
Returns if the touch exploration in the system is enabled. @return True if touch exploration is enabled, false otherwise.
AccessibilityManager::isTouchExplorationEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void sendAccessibilityEvent(AccessibilityEvent event) { final IAccessibilityManager service; final int userId; final AccessibilityEvent dispatchedEvent; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } event.setEventTime(SystemClock.uptimeMillis()); if (event.getAction() == 0) { event.setAction(mPerformingAction); } if (mAccessibilityPolicy != null) { dispatchedEvent = mAccessibilityPolicy.onAccessibilityEvent(event, mIsEnabled, mRelevantEventTypes); if (dispatchedEvent == null) { return; } } else { dispatchedEvent = event; } if (!isEnabled()) { Looper myLooper = Looper.myLooper(); if (myLooper == Looper.getMainLooper()) { throw new IllegalStateException( "Accessibility off. Did you forget to check that?"); } else { // If we're not running on the thread with the main looper, it's possible for // the state of accessibility to change between checking isEnabled and // calling this method. So just log the error rather than throwing the // exception. Log.e(LOG_TAG, "AccessibilityEvent sent with accessibility disabled"); return; } } if ((dispatchedEvent.getEventType() & mRelevantEventTypes) == 0) { if (DEBUG) { Log.i(LOG_TAG, "Not dispatching irrelevant event: " + dispatchedEvent + " that is not among " + AccessibilityEvent.eventTypeToString(mRelevantEventTypes)); } return; } userId = mUserId; } try { // it is possible that this manager is in the same process as the service but // client using it is called through Binder from another process. Example: MMS // app adds a SMS notification and the NotificationManagerService calls this method final long identityToken = Binder.clearCallingIdentity(); try { service.sendAccessibilityEvent(dispatchedEvent, userId); } finally { Binder.restoreCallingIdentity(identityToken); } if (DEBUG) { Log.i(LOG_TAG, dispatchedEvent + " sent"); } } catch (RemoteException re) { Log.e(LOG_TAG, "Error during sending " + dispatchedEvent + " ", re); } finally { if (event != dispatchedEvent) { event.recycle(); } dispatchedEvent.recycle(); } }
Sends an {@link AccessibilityEvent}. @param event The event to send. @throws IllegalStateException if accessibility is not enabled. <strong>Note:</strong> The preferred mechanism for sending custom accessibility events is through calling {@link android.view.ViewParent#requestSendAccessibilityEvent(View, AccessibilityEvent)} instead of this method to allow predecessors to augment/filter events sent by their descendants.
AccessibilityManager::sendAccessibilityEvent
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void interrupt() { final IAccessibilityManager service; final int userId; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } if (!isEnabled()) { Looper myLooper = Looper.myLooper(); if (myLooper == Looper.getMainLooper()) { throw new IllegalStateException( "Accessibility off. Did you forget to check that?"); } else { // If we're not running on the thread with the main looper, it's possible for // the state of accessibility to change between checking isEnabled and // calling this method. So just log the error rather than throwing the // exception. Log.e(LOG_TAG, "Interrupt called with accessibility disabled"); return; } } userId = mUserId; } try { service.interrupt(userId); if (DEBUG) { Log.i(LOG_TAG, "Requested interrupt from all services"); } } catch (RemoteException re) { Log.e(LOG_TAG, "Error while requesting interrupt from all services. ", re); } }
Requests feedback interruption from all accessibility services.
AccessibilityManager::interrupt
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList() { final IAccessibilityManager service; final int userId; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return Collections.emptyList(); } userId = mUserId; } List<AccessibilityServiceInfo> services = null; try { services = service.getInstalledAccessibilityServiceList(userId); if (DEBUG) { Log.i(LOG_TAG, "Installed AccessibilityServices " + services); } } catch (RemoteException re) { Log.e(LOG_TAG, "Error while obtaining the installed AccessibilityServices. ", re); } if (mAccessibilityPolicy != null) { services = mAccessibilityPolicy.getInstalledAccessibilityServiceList(services); } if (services != null) { return Collections.unmodifiableList(services); } else { return Collections.emptyList(); } }
Returns the {@link AccessibilityServiceInfo}s of the installed accessibility services. @return An unmodifiable list with {@link AccessibilityServiceInfo}s.
AccessibilityManager::getInstalledAccessibilityServiceList
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList( int feedbackTypeFlags) { final IAccessibilityManager service; final int userId; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return Collections.emptyList(); } userId = mUserId; } List<AccessibilityServiceInfo> services = null; try { services = service.getEnabledAccessibilityServiceList(feedbackTypeFlags, userId); if (DEBUG) { Log.i(LOG_TAG, "Enabled AccessibilityServices " + services); } } catch (RemoteException re) { Log.e(LOG_TAG, "Error while obtaining the enabled AccessibilityServices. ", re); } if (mAccessibilityPolicy != null) { services = mAccessibilityPolicy.getEnabledAccessibilityServiceList( feedbackTypeFlags, services); } if (services != null) { return Collections.unmodifiableList(services); } else { return Collections.emptyList(); } }
Returns the {@link AccessibilityServiceInfo}s of the enabled accessibility services for a given feedback type. @param feedbackTypeFlags The feedback type flags. @return An unmodifiable list with {@link AccessibilityServiceInfo}s. @see AccessibilityServiceInfo#FEEDBACK_AUDIBLE @see AccessibilityServiceInfo#FEEDBACK_GENERIC @see AccessibilityServiceInfo#FEEDBACK_HAPTIC @see AccessibilityServiceInfo#FEEDBACK_SPOKEN @see AccessibilityServiceInfo#FEEDBACK_VISUAL @see AccessibilityServiceInfo#FEEDBACK_BRAILLE
AccessibilityManager::getEnabledAccessibilityServiceList
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean addAccessibilityStateChangeListener( @NonNull AccessibilityStateChangeListener listener) { addAccessibilityStateChangeListener(listener, null); return true; }
Registers an {@link AccessibilityStateChangeListener} for changes in the global accessibility state of the system. Equivalent to calling {@link #addAccessibilityStateChangeListener(AccessibilityStateChangeListener, Handler)} with a null handler. @param listener The listener. @return Always returns {@code true}.
AccessibilityManager::addAccessibilityStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void addAccessibilityStateChangeListener( @NonNull AccessibilityStateChangeListener listener, @Nullable Handler handler) { synchronized (mLock) { mAccessibilityStateChangeListeners .put(listener, (handler == null) ? mHandler : handler); } }
Registers an {@link AccessibilityStateChangeListener} for changes in the global accessibility state of the system. If the listener has already been registered, the handler used to call it back is updated. @param listener The listener. @param handler The handler on which the listener should be called back, or {@code null} for a callback on the process's main handler.
AccessibilityManager::addAccessibilityStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean removeAccessibilityStateChangeListener( @NonNull AccessibilityStateChangeListener listener) { synchronized (mLock) { int index = mAccessibilityStateChangeListeners.indexOfKey(listener); mAccessibilityStateChangeListeners.remove(listener); return (index >= 0); } }
Unregisters an {@link AccessibilityStateChangeListener}. @param listener The listener. @return True if the listener was previously registered.
AccessibilityManager::removeAccessibilityStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean addTouchExplorationStateChangeListener( @NonNull TouchExplorationStateChangeListener listener) { addTouchExplorationStateChangeListener(listener, null); return true; }
Registers a {@link TouchExplorationStateChangeListener} for changes in the global touch exploration state of the system. Equivalent to calling {@link #addTouchExplorationStateChangeListener(TouchExplorationStateChangeListener, Handler)} with a null handler. @param listener The listener. @return Always returns {@code true}.
AccessibilityManager::addTouchExplorationStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void addTouchExplorationStateChangeListener( @NonNull TouchExplorationStateChangeListener listener, @Nullable Handler handler) { synchronized (mLock) { mTouchExplorationStateChangeListeners .put(listener, (handler == null) ? mHandler : handler); } }
Registers an {@link TouchExplorationStateChangeListener} for changes in the global touch exploration state of the system. If the listener has already been registered, the handler used to call it back is updated. @param listener The listener. @param handler The handler on which the listener should be called back, or {@code null} for a callback on the process's main handler.
AccessibilityManager::addTouchExplorationStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean removeTouchExplorationStateChangeListener( @NonNull TouchExplorationStateChangeListener listener) { synchronized (mLock) { int index = mTouchExplorationStateChangeListeners.indexOfKey(listener); mTouchExplorationStateChangeListeners.remove(listener); return (index >= 0); } }
Unregisters a {@link TouchExplorationStateChangeListener}. @param listener The listener. @return True if listener was previously registered.
AccessibilityManager::removeTouchExplorationStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void addAccessibilityServicesStateChangeListener( @NonNull @CallbackExecutor Executor executor, @NonNull AccessibilityServicesStateChangeListener listener) { synchronized (mLock) { mServicesStateChangeListeners.put(listener, executor); } }
Registers a {@link AccessibilityServicesStateChangeListener}. @param executor The executor. @param listener The listener.
AccessibilityManager::addAccessibilityServicesStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void addAccessibilityServicesStateChangeListener( @NonNull AccessibilityServicesStateChangeListener listener) { addAccessibilityServicesStateChangeListener(new HandlerExecutor(mHandler), listener); }
Registers a {@link AccessibilityServicesStateChangeListener}. This will execute a callback on the process's main handler. @param listener The listener.
AccessibilityManager::addAccessibilityServicesStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean removeAccessibilityServicesStateChangeListener( @NonNull AccessibilityServicesStateChangeListener listener) { synchronized (mLock) { return mServicesStateChangeListeners.remove(listener) != null; } }
Unregisters a {@link AccessibilityServicesStateChangeListener}. @param listener The listener. @return {@code true} if the listener was previously registered.
AccessibilityManager::removeAccessibilityServicesStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void addAccessibilityRequestPreparer(AccessibilityRequestPreparer preparer) { if (mRequestPreparerLists == null) { mRequestPreparerLists = new SparseArray<>(1); } int id = preparer.getAccessibilityViewId(); List<AccessibilityRequestPreparer> requestPreparerList = mRequestPreparerLists.get(id); if (requestPreparerList == null) { requestPreparerList = new ArrayList<>(1); mRequestPreparerLists.put(id, requestPreparerList); } requestPreparerList.add(preparer); }
Registers a {@link AccessibilityRequestPreparer}.
AccessibilityManager::addAccessibilityRequestPreparer
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void removeAccessibilityRequestPreparer(AccessibilityRequestPreparer preparer) { if (mRequestPreparerLists == null) { return; } int viewId = preparer.getAccessibilityViewId(); List<AccessibilityRequestPreparer> requestPreparerList = mRequestPreparerLists.get(viewId); if (requestPreparerList != null) { requestPreparerList.remove(preparer); if (requestPreparerList.isEmpty()) { mRequestPreparerLists.remove(viewId); } } }
Unregisters a {@link AccessibilityRequestPreparer}.
AccessibilityManager::removeAccessibilityRequestPreparer
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public int getRecommendedTimeoutMillis(int originalTimeout, @ContentFlag int uiContentFlags) { boolean hasControls = (uiContentFlags & FLAG_CONTENT_CONTROLS) != 0; boolean hasIconsOrText = (uiContentFlags & FLAG_CONTENT_ICONS) != 0 || (uiContentFlags & FLAG_CONTENT_TEXT) != 0; int recommendedTimeout = originalTimeout; if (hasControls) { recommendedTimeout = Math.max(recommendedTimeout, mInteractiveUiTimeout); } if (hasIconsOrText) { recommendedTimeout = Math.max(recommendedTimeout, mNonInteractiveUiTimeout); } return recommendedTimeout; }
Get the recommended timeout for changes to the UI needed by this user. Controls should remain on the screen for at least this long to give users time to react. Some users may need extra time to review the controls, or to reach them, or to activate assistive technology to activate the controls automatically. <p> Use the combination of content flags to indicate contents of UI. For example, use {@code FLAG_CONTENT_ICONS | FLAG_CONTENT_TEXT} for message notification which contains icons and text, or use {@code FLAG_CONTENT_TEXT | FLAG_CONTENT_CONTROLS} for button dialog which contains text and button controls. <p/> @param originalTimeout The timeout appropriate for users with no accessibility needs. @param uiContentFlags The combination of flags {@link #FLAG_CONTENT_ICONS}, {@link #FLAG_CONTENT_TEXT} or {@link #FLAG_CONTENT_CONTROLS} to indicate the contents of UI. @return The recommended UI timeout for the current user in milliseconds.
AccessibilityManager::getRecommendedTimeoutMillis
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public int getAccessibilityFocusStrokeWidth() { synchronized (mLock) { return mFocusStrokeWidth; } }
Gets the strokeWidth of the focus rectangle. This value can be set by {@link AccessibilityService}. @return The strokeWidth of the focus rectangle in pixels.
AccessibilityManager::getAccessibilityFocusStrokeWidth
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public @ColorInt int getAccessibilityFocusColor() { synchronized (mLock) { return mFocusColor; } }
Gets the color of the focus rectangle. This value can be set by {@link AccessibilityService}. @return The color of the focus rectangle.
AccessibilityManager::getAccessibilityFocusColor
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean isA11yInteractionConnectionTraceEnabled() { synchronized (mLock) { return ((mAccessibilityTracingState & STATE_FLAG_TRACE_A11Y_INTERACTION_CONNECTION_ENABLED) != 0); } }
Gets accessibility interaction connection tracing enabled state. @hide
AccessibilityManager::isA11yInteractionConnectionTraceEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean isA11yInteractionConnectionCBTraceEnabled() { synchronized (mLock) { return ((mAccessibilityTracingState & STATE_FLAG_TRACE_A11Y_INTERACTION_CONNECTION_CB_ENABLED) != 0); } }
Gets accessibility interaction connection callback tracing enabled state. @hide
AccessibilityManager::isA11yInteractionConnectionCBTraceEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean isA11yInteractionClientTraceEnabled() { synchronized (mLock) { return ((mAccessibilityTracingState & STATE_FLAG_TRACE_A11Y_INTERACTION_CLIENT_ENABLED) != 0); } }
Gets accessibility interaction client tracing enabled state. @hide
AccessibilityManager::isA11yInteractionClientTraceEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean isA11yServiceTraceEnabled() { synchronized (mLock) { return ((mAccessibilityTracingState & STATE_FLAG_TRACE_A11Y_SERVICE_ENABLED) != 0); } }
Gets accessibility service tracing enabled state. @hide
AccessibilityManager::isA11yServiceTraceEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public List<AccessibilityRequestPreparer> getRequestPreparersForAccessibilityId(int id) { if (mRequestPreparerLists == null) { return null; } return mRequestPreparerLists.get(id); }
Get the preparers that are registered for an accessibility ID @param id The ID of interest @return The list of preparers, or {@code null} if there are none. @hide
AccessibilityManager::getRequestPreparersForAccessibilityId
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void notifyPerformingAction(int actionId) { mPerformingAction = actionId; }
Set the currently performing accessibility action in views. @param actionId the action id of {@link AccessibilityNodeInfo.AccessibilityAction}. @hide
AccessibilityManager::notifyPerformingAction
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void addHighTextContrastStateChangeListener( @NonNull HighTextContrastChangeListener listener, @Nullable Handler handler) { synchronized (mLock) { mHighTextContrastStateChangeListeners .put(listener, (handler == null) ? mHandler : handler); } }
Registers a {@link HighTextContrastChangeListener} for changes in the global high text contrast state of the system. @param listener The listener. @hide
AccessibilityManager::addHighTextContrastStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void removeHighTextContrastStateChangeListener( @NonNull HighTextContrastChangeListener listener) { synchronized (mLock) { mHighTextContrastStateChangeListeners.remove(listener); } }
Unregisters a {@link HighTextContrastChangeListener}. @param listener The listener. @hide
AccessibilityManager::removeHighTextContrastStateChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void addAudioDescriptionRequestedChangeListener( @NonNull Executor executor, @NonNull AudioDescriptionRequestedChangeListener listener) { synchronized (mLock) { mAudioDescriptionRequestedChangeListeners.put(listener, executor); } }
Registers a {@link AudioDescriptionRequestedChangeListener} for changes in the audio description by default state of the system. The value could be read via {@link #isAudioDescriptionRequested}. @param executor The executor on which the listener should be called back. @param listener The listener.
AccessibilityManager::addAudioDescriptionRequestedChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean removeAudioDescriptionRequestedChangeListener( @NonNull AudioDescriptionRequestedChangeListener listener) { synchronized (mLock) { return (mAudioDescriptionRequestedChangeListeners.remove(listener) != null); } }
Unregisters a {@link AudioDescriptionRequestedChangeListener}. @param listener The listener. @return True if listener was previously registered.
AccessibilityManager::removeAudioDescriptionRequestedChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void setAccessibilityPolicy(@Nullable AccessibilityPolicy policy) { synchronized (mLock) { mAccessibilityPolicy = policy; } }
Sets the {@link AccessibilityPolicy} controlling this manager. @param policy The policy. @hide
AccessibilityManager::setAccessibilityPolicy
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean isAccessibilityVolumeStreamActive() { List<AccessibilityServiceInfo> serviceInfos = getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_ALL_MASK); for (int i = 0; i < serviceInfos.size(); i++) { if ((serviceInfos.get(i).flags & FLAG_ENABLE_ACCESSIBILITY_VOLUME) != 0) { return true; } } return false; }
Check if the accessibility volume stream is active. @return True if accessibility volume is active (i.e. some service has requested it). False otherwise. @hide
AccessibilityManager::isAccessibilityVolumeStreamActive
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean sendFingerprintGesture(int keyCode) { final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return false; } } try { return service.sendFingerprintGesture(keyCode); } catch (RemoteException e) { return false; } }
Report a fingerprint gesture to accessibility. Only available for the system process. @param keyCode The key code of the gesture @return {@code true} if accessibility consumes the event. {@code false} if not. @hide
AccessibilityManager::sendFingerprintGesture
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void associateEmbeddedHierarchy(@NonNull IBinder host, @NonNull IBinder embedded) { final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } } try { service.associateEmbeddedHierarchy(host, embedded); } catch (RemoteException e) { return; } }
Associate the connection between the host View and the embedded SurfaceControlViewHost. @hide
AccessibilityManager::associateEmbeddedHierarchy
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void disassociateEmbeddedHierarchy(@NonNull IBinder token) { if (token == null) { return; } final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } } try { service.disassociateEmbeddedHierarchy(token); } catch (RemoteException e) { return; } }
Disassociate the connection between the host View and the embedded SurfaceControlViewHost. The given token could be either from host side or embedded side. @hide
AccessibilityManager::disassociateEmbeddedHierarchy
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public AccessibilityServiceInfo getInstalledServiceInfoWithComponentName( ComponentName componentName) { final List<AccessibilityServiceInfo> installedServiceInfos = getInstalledAccessibilityServiceList(); if ((installedServiceInfos == null) || (componentName == null)) { return null; } for (int i = 0; i < installedServiceInfos.size(); i++) { if (componentName.equals(installedServiceInfos.get(i).getComponentName())) { return installedServiceInfos.get(i); } } return null; }
Find an installed service with the specified {@link ComponentName}. @param componentName The name to match to the service. @return The info corresponding to the installed service, or {@code null} if no such service is installed. @hide
AccessibilityManager::getInstalledServiceInfoWithComponentName
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public int addAccessibilityInteractionConnection(IWindow windowToken, IBinder leashToken, String packageName, IAccessibilityInteractionConnection connection) { final IAccessibilityManager service; final int userId; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return View.NO_ID; } userId = mUserId; } try { return service.addAccessibilityInteractionConnection(windowToken, leashToken, connection, packageName, userId); } catch (RemoteException re) { Log.e(LOG_TAG, "Error while adding an accessibility interaction connection. ", re); } return View.NO_ID; }
Adds an accessibility interaction connection interface for a given window. @param windowToken The window token to which a connection is added. @param leashToken The leash token to which a connection is added. @param connection The connection. @hide
AccessibilityManager::addAccessibilityInteractionConnection
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void removeAccessibilityInteractionConnection(IWindow windowToken) { final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } } try { service.removeAccessibilityInteractionConnection(windowToken); } catch (RemoteException re) { Log.e(LOG_TAG, "Error while removing an accessibility interaction connection. ", re); } }
Removed an accessibility interaction connection interface for a given window. @param windowToken The window token to which a connection is removed. @hide
AccessibilityManager::removeAccessibilityInteractionConnection
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void notifyAccessibilityButtonVisibilityChanged(boolean shown) { final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } } try { service.notifyAccessibilityButtonVisibilityChanged(shown); } catch (RemoteException re) { Log.e(LOG_TAG, "Error while dispatching accessibility button visibility change", re); } }
Notifies that the visibility of the accessibility button in the system's navigation area has changed. @param shown {@code true} if the accessibility button is visible within the system navigation area, {@code false} otherwise @hide
AccessibilityManager::notifyAccessibilityButtonVisibilityChanged
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void setPictureInPictureActionReplacingConnection( @Nullable IAccessibilityInteractionConnection connection) { final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } } try { service.setPictureInPictureActionReplacingConnection(connection); } catch (RemoteException re) { Log.e(LOG_TAG, "Error setting picture in picture action replacement", re); } }
Set an IAccessibilityInteractionConnection to replace the actions of a picture-in-picture window. Intended for use by the System UI only. @param connection The connection to handle the actions. Set to {@code null} to avoid affecting the actions. @hide
AccessibilityManager::setPictureInPictureActionReplacingConnection
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void setWindowMagnificationConnection(@Nullable IWindowMagnificationConnection connection) { final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } } try { service.setWindowMagnificationConnection(connection); } catch (RemoteException re) { Log.e(LOG_TAG, "Error setting window magnfication connection", re); } }
Sets an {@link IWindowMagnificationConnection} that manipulates window magnification. @param connection The connection that manipulates window magnification. @hide
AccessibilityManager::setWindowMagnificationConnection
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean isAudioDescriptionRequested() { synchronized (mLock) { IAccessibilityManager service = getServiceLocked(); if (service == null) { return false; } return mIsAudioDescriptionByDefaultRequested; } }
Determines if users want to select sound track with audio description by default. <p> Audio description, also referred to as a video description, described video, or more precisely called a visual description, is a form of narration used to provide information surrounding key visual elements in a media work for the benefit of blind and visually impaired consumers. </p> <p> The method provides the preference value to content provider apps to select the default sound track during playing a video or movie. </p> <p> Add listener to detect the state change via {@link #addAudioDescriptionRequestedChangeListener} </p> @return {@code true} if the audio description is enabled, {@code false} otherwise.
AccessibilityManager::isAudioDescriptionRequested
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void setSystemAudioCaptioningEnabled(boolean isEnabled, int userId) { final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } } try { service.setSystemAudioCaptioningEnabled(isEnabled, userId); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
Sets the system audio caption enabled state. @param isEnabled The system audio captioning enabled state. @param userId The user Id. @hide
AccessibilityManager::setSystemAudioCaptioningEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public boolean isSystemAudioCaptioningUiEnabled(int userId) { final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return false; } } try { return service.isSystemAudioCaptioningUiEnabled(userId); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
Gets the system audio caption UI enabled state. @param userId The user Id. @return the system audio caption UI enabled state. @hide
AccessibilityManager::isSystemAudioCaptioningUiEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public void setSystemAudioCaptioningUiEnabled(boolean isEnabled, int userId) { final IAccessibilityManager service; synchronized (mLock) { service = getServiceLocked(); if (service == null) { return; } } try { service.setSystemAudioCaptioningUiEnabled(isEnabled, userId); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
Sets the system audio caption UI enabled state. @param isEnabled The system audio captioning UI enabled state. @param userId The user Id. @hide
AccessibilityManager::setSystemAudioCaptioningUiEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
private void notifyAccessibilityStateChanged() { final boolean isEnabled; final ArrayMap<AccessibilityStateChangeListener, Handler> listeners; synchronized (mLock) { if (mAccessibilityStateChangeListeners.isEmpty()) { return; } isEnabled = isEnabled(); listeners = new ArrayMap<>(mAccessibilityStateChangeListeners); } final int numListeners = listeners.size(); for (int i = 0; i < numListeners; i++) { final AccessibilityStateChangeListener listener = listeners.keyAt(i); listeners.valueAt(i).post(() -> listener.onAccessibilityStateChanged(isEnabled)); } }
Notifies the registered {@link AccessibilityStateChangeListener}s.
AccessibilityManager::notifyAccessibilityStateChanged
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
private void notifyTouchExplorationStateChanged() { final boolean isTouchExplorationEnabled; final ArrayMap<TouchExplorationStateChangeListener, Handler> listeners; synchronized (mLock) { if (mTouchExplorationStateChangeListeners.isEmpty()) { return; } isTouchExplorationEnabled = mIsTouchExplorationEnabled; listeners = new ArrayMap<>(mTouchExplorationStateChangeListeners); } final int numListeners = listeners.size(); for (int i = 0; i < numListeners; i++) { final TouchExplorationStateChangeListener listener = listeners.keyAt(i); listeners.valueAt(i).post(() -> listener.onTouchExplorationStateChanged(isTouchExplorationEnabled)); } }
Notifies the registered {@link TouchExplorationStateChangeListener}s.
AccessibilityManager::notifyTouchExplorationStateChanged
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
private void notifyHighTextContrastStateChanged() { final boolean isHighTextContrastEnabled; final ArrayMap<HighTextContrastChangeListener, Handler> listeners; synchronized (mLock) { if (mHighTextContrastStateChangeListeners.isEmpty()) { return; } isHighTextContrastEnabled = mIsHighTextContrastEnabled; listeners = new ArrayMap<>(mHighTextContrastStateChangeListeners); } final int numListeners = listeners.size(); for (int i = 0; i < numListeners; i++) { final HighTextContrastChangeListener listener = listeners.keyAt(i); listeners.valueAt(i).post(() -> listener.onHighTextContrastStateChanged(isHighTextContrastEnabled)); } }
Notifies the registered {@link HighTextContrastChangeListener}s.
AccessibilityManager::notifyHighTextContrastStateChanged
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
private void notifyAudioDescriptionbyDefaultStateChanged() { final boolean isAudioDescriptionByDefaultRequested; final ArrayMap<AudioDescriptionRequestedChangeListener, Executor> listeners; synchronized (mLock) { if (mAudioDescriptionRequestedChangeListeners.isEmpty()) { return; } isAudioDescriptionByDefaultRequested = mIsAudioDescriptionByDefaultRequested; listeners = new ArrayMap<>(mAudioDescriptionRequestedChangeListeners); } final int numListeners = listeners.size(); for (int i = 0; i < numListeners; i++) { final AudioDescriptionRequestedChangeListener listener = listeners.keyAt(i); listeners.valueAt(i).execute(() -> listener.onAudioDescriptionRequestedChanged( isAudioDescriptionByDefaultRequested)); } }
Notifies the registered {@link AudioDescriptionStateChangeListener}s.
AccessibilityManager::notifyAudioDescriptionbyDefaultStateChanged
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
private void updateAccessibilityTracingState(int stateFlag) { synchronized (mLock) { mAccessibilityTracingState = stateFlag; } }
Update mAccessibilityTracingState.
AccessibilityManager::updateAccessibilityTracingState
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
private void updateUiTimeout(long uiTimeout) { mInteractiveUiTimeout = IntPair.first(uiTimeout); mNonInteractiveUiTimeout = IntPair.second(uiTimeout); }
Update interactive and non-interactive UI timeout. @param uiTimeout A pair of {@code int}s. First integer for interactive one, and second integer for non-interactive one.
AccessibilityManager::updateUiTimeout
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
private void updateFocusAppearanceLocked(int strokeWidth, int color) { if (mFocusStrokeWidth == strokeWidth && mFocusColor == color) { return; } mFocusStrokeWidth = strokeWidth; mFocusColor = color; }
Updates the stroke width and color of the focus rectangle. @param strokeWidth The strokeWidth of the focus rectangle. @param color The color of the focus rectangle.
AccessibilityManager::updateFocusAppearanceLocked
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
private void initialFocusAppearanceLocked(Resources resource) { try { mFocusStrokeWidth = resource.getDimensionPixelSize( R.dimen.accessibility_focus_highlight_stroke_width); mFocusColor = resource.getColor(R.color.accessibility_focus_highlight_color); } catch (Resources.NotFoundException re) { // Sets the stroke width and color to default value by hardcoded for making // the Talkback can work normally. mFocusStrokeWidth = (int) (4 * resource.getDisplayMetrics().density); mFocusColor = 0xbf39b500; Log.e(LOG_TAG, "Error while initialing the focus appearance data then setting to" + " default value by hardcoded", re); } }
Sets the stroke width and color of the focus rectangle to default value. @param resource The resources.
AccessibilityManager::initialFocusAppearanceLocked
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public static boolean isAccessibilityButtonSupported() { final Resources res = Resources.getSystem(); return res.getBoolean(com.android.internal.R.bool.config_showNavigationBar); }
Determines if the accessibility button within the system navigation area is supported. @return {@code true} if the accessibility button is supported on this device, {@code false} otherwise
AccessibilityManager::isAccessibilityButtonSupported
java
Reginer/aosp-android-jar
android-33/src/android/view/accessibility/AccessibilityManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/accessibility/AccessibilityManager.java
MIT
public nodeclonefalsenocopytext(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException { super(factory); // // check if loaded documents are supported for content type // String contentType = getContentType(); preload(contentType, "staff", true); }
Constructor. @param factory document factory, may not be null @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
nodeclonefalsenocopytext::nodeclonefalsenocopytext
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java
MIT
public void runTest() throws Throwable { Document doc; NodeList elementList; Node employeeNode; NodeList childList; Node childNode; Node clonedNode; Node lastChildNode; doc = (Document) load("staff", true); elementList = doc.getElementsByTagName("employee"); employeeNode = elementList.item(1); childList = employeeNode.getChildNodes(); childNode = childList.item(3); clonedNode = childNode.cloneNode(false); lastChildNode = clonedNode.getLastChild(); assertNull("noTextNodes", lastChildNode); }
Runs the test case. @throws Throwable Any uncaught exception causes test to fail
nodeclonefalsenocopytext::runTest
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java
MIT
public String getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/nodeclonefalsenocopytext"; }
Gets URI that identifies the test. @return uri identifier of test
nodeclonefalsenocopytext::getTargetURI
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level1/core/nodeclonefalsenocopytext.java
MIT