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 void reportEngineShown(boolean waitForEngineShown) { if (mIWallpaperEngine.mShownReported) return; Trace.beginSection("WPMS.reportEngineShown-" + waitForEngineShown); Log.d(TAG, "reportEngineShown: shouldWait=" + waitForEngineShown); if (!waitForEngineShown) { Message message = mCaller.obtainMessage(MSG_REPORT_SHOWN); mCaller.removeMessages(MSG_REPORT_SHOWN); mCaller.sendMessage(message); } else { // if we are already waiting, no need to reset the timeout. if (!mCaller.hasMessages(MSG_REPORT_SHOWN)) { Message message = mCaller.obtainMessage(MSG_REPORT_SHOWN); mCaller.sendMessageDelayed(message, TimeUnit.SECONDS.toMillis(5)); } } Trace.endSection(); }
Reports the rendering is finished, stops waiting, then invokes {@link IWallpaperEngineWrapper#reportShown()}. @hide
WallpaperInputEventReceiver::reportEngineShown
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
public void setTouchEventsEnabled(boolean enabled) { mWindowFlags = enabled ? (mWindowFlags&~WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE) : (mWindowFlags|WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE); if (mCreated) { updateSurface(false, false, false); } }
Control whether this wallpaper will receive raw touch events from the window manager as the user interacts with the window that is currently displaying the wallpaper. By default they are turned off. If enabled, the events will be received in {@link #onTouchEvent(MotionEvent)}.
WallpaperInputEventReceiver::setTouchEventsEnabled
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
public void setOffsetNotificationsEnabled(boolean enabled) { mWindowPrivateFlags = enabled ? (mWindowPrivateFlags | WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS) : (mWindowPrivateFlags & ~WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS); if (mCreated) { updateSurface(false, false, false); } }
Control whether this wallpaper will receive notifications when the wallpaper has been scrolled. By default, wallpapers will receive notifications, although the default static image wallpapers do not. It is a performance optimization to set this to false. @param enabled whether the wallpaper wants to receive offset notifications
WallpaperInputEventReceiver::setOffsetNotificationsEnabled
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
public void setShowForAllUsers(boolean show) { mWindowPrivateFlags = show ? (mWindowPrivateFlags | WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS) : (mWindowPrivateFlags & ~WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS); if (mCreated) { updateSurface(false, false, false); } }
Control whether this wallpaper will receive notifications when the wallpaper has been scrolled. By default, wallpapers will receive notifications, although the default static image wallpapers do not. It is a performance optimization to set this to false. @param enabled whether the wallpaper wants to receive offset notifications public void setOffsetNotificationsEnabled(boolean enabled) { mWindowPrivateFlags = enabled ? (mWindowPrivateFlags | WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS) : (mWindowPrivateFlags & ~WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS); if (mCreated) { updateSurface(false, false, false); } } /** @hide
WallpaperInputEventReceiver::setShowForAllUsers
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
public void notifyColorsChanged() { if (mDestroyed) { Log.i(TAG, "Ignoring notifyColorsChanged(), Engine has already been destroyed."); return; } final long now = mClockFunction.get(); if (now - mLastColorInvalidation < NOTIFY_COLORS_RATE_LIMIT_MS) { Log.w(TAG, "This call has been deferred. You should only call " + "notifyColorsChanged() once every " + (NOTIFY_COLORS_RATE_LIMIT_MS / 1000f) + " seconds."); if (!mHandler.hasCallbacks(mNotifyColorsChanged)) { mHandler.postDelayed(mNotifyColorsChanged, NOTIFY_COLORS_RATE_LIMIT_MS); } return; } mLastColorInvalidation = now; mHandler.removeCallbacks(mNotifyColorsChanged); try { final WallpaperColors newColors = onComputeColors(); if (mConnection != null) { mConnection.onWallpaperColorsChanged(newColors, mDisplay.getDisplayId()); } else { Log.w(TAG, "Can't notify system because wallpaper connection " + "was not established."); } mResetWindowPages = true; processLocalColors(); } catch (RemoteException e) { Log.w(TAG, "Can't notify system because wallpaper connection was lost.", e); } }
Notifies the engine that wallpaper colors changed significantly. This will trigger a {@link #onComputeColors()} call.
WallpaperInputEventReceiver::notifyColorsChanged
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
public void notifyLocalColorsChanged(@NonNull List<RectF> regions, @NonNull List<WallpaperColors> colors) throws RuntimeException { for (int i = 0; i < regions.size() && i < colors.size(); i++) { WallpaperColors color = colors.get(i); RectF area = regions.get(i); if (color == null || area == null) { if (DEBUG) { Log.e(TAG, "notifyLocalColorsChanged null values. color: " + color + " area " + area); } continue; } try { mConnection.onLocalWallpaperColorsChanged( area, color, mDisplayContext.getDisplayId() ); } catch (RemoteException e) { throw new RuntimeException(e); } } WallpaperColors primaryColors = mIWallpaperEngine.mWallpaperManager .getWallpaperColors(WallpaperManager.FLAG_SYSTEM); setPrimaryWallpaperColors(primaryColors); }
Send the changed local color areas for the connection @param regions @param colors @hide
WallpaperInputEventReceiver::notifyLocalColorsChanged
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
private void updateWallpaperDimming(float dimAmount) { mCustomDimAmount = Math.min(1f, dimAmount); // If default dim is enabled, the actual dim amount is at least the default dim amount mWallpaperDimAmount = (!mShouldDimByDefault) ? mCustomDimAmount : Math.max(mDefaultDimAmount, mCustomDimAmount); if (!ENABLE_WALLPAPER_DIMMING || mBbqSurfaceControl == null || !mBbqSurfaceControl.isValid() || mWallpaperDimAmount == mPreviousWallpaperDimAmount) { return; } SurfaceControl.Transaction surfaceControlTransaction = new SurfaceControl.Transaction(); // TODO: apply the dimming to preview as well once surface transparency works in // preview mode. if (!isPreview()) { Log.v(TAG, "Setting wallpaper dimming: " + mWallpaperDimAmount); // Animate dimming to gradually change the wallpaper alpha from the previous // dim amount to the new amount only if the dim amount changed. ValueAnimator animator = ValueAnimator.ofFloat( mPreviousWallpaperDimAmount, mWallpaperDimAmount); animator.setDuration(DIMMING_ANIMATION_DURATION_MS); animator.addUpdateListener((ValueAnimator va) -> { final float dimValue = (float) va.getAnimatedValue(); if (mBbqSurfaceControl != null) { surfaceControlTransaction .setAlpha(mBbqSurfaceControl, 1 - dimValue).apply(); } }); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { updateSurface(false, false, true); } }); animator.start(); } else { Log.v(TAG, "Setting wallpaper dimming: " + 0); surfaceControlTransaction.setAlpha(mBbqSurfaceControl, 1.0f).apply(); updateSurface(false, false, true); } mPreviousWallpaperDimAmount = mWallpaperDimAmount; // after the dim changes, allow colors to be immediately recomputed mLastColorInvalidation = 0; if (offloadColorExtraction()) onDimAmountChanged(mWallpaperDimAmount); }
Update the dim amount of the wallpaper by updating the surface. @param dimAmount Float amount between [0.0, 1.0] to dim the wallpaper.
WallpaperInputEventReceiver::updateWallpaperDimming
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
private void processLocalColors() { if (mProcessLocalColorsPending.compareAndSet(false, true)) { final long now = mClockFunction.get(); final long timeSinceLastColorProcess = now - mLastProcessLocalColorsTimestamp; final long timeToWait = Math.max(0, PROCESS_LOCAL_COLORS_INTERVAL_MS - timeSinceLastColorProcess); mHandler.postDelayed(() -> { mLastProcessLocalColorsTimestamp = now + timeToWait; mProcessLocalColorsPending.set(false); processLocalColorsInternal(); }, timeToWait); } }
Thread-safe util to call {@link #processLocalColorsInternal} with a minimum interval of {@link #PROCESS_LOCAL_COLORS_INTERVAL_MS} between two calls.
WallpaperInputEventReceiver::processLocalColors
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
private void processLocalColorsInternal() { if (supportsLocalColorExtraction()) return; float xOffset; float xOffsetStep; float wallpaperDimAmount; int xPage; int xPages; Set<RectF> areas; EngineWindowPage current; synchronized (mLock) { xOffset = mPendingXOffset; xOffsetStep = mPendingXOffsetStep; wallpaperDimAmount = mWallpaperDimAmount; if (DEBUG) { Log.d(TAG, "processLocalColors " + xOffset + " of step " + xOffsetStep); } if (xOffset % xOffsetStep > MIN_PAGE_ALLOWED_MARGIN || !mSurfaceHolder.getSurface().isValid()) return; int xCurrentPage; if (!validStep(xOffsetStep)) { if (DEBUG) { Log.w(TAG, "invalid offset step " + xOffsetStep); } xOffset = 0; xOffsetStep = 1; xCurrentPage = 0; xPages = 1; } else { xPages = Math.round(1 / xOffsetStep) + 1; xOffsetStep = (float) 1 / (float) xPages; float shrink = (float) (xPages - 1) / (float) xPages; xOffset *= shrink; xCurrentPage = Math.round(xOffset / xOffsetStep); } if (DEBUG) { Log.d(TAG, "xPages " + xPages + " xPage " + xCurrentPage); Log.d(TAG, "xOffsetStep " + xOffsetStep + " xOffset " + xOffset); } float finalXOffsetStep = xOffsetStep; float finalXOffset = xOffset; resetWindowPages(); xPage = xCurrentPage; if (mWindowPages.length == 0 || (mWindowPages.length != xPages)) { mWindowPages = new EngineWindowPage[xPages]; initWindowPages(mWindowPages, finalXOffsetStep); } if (mLocalColorsToAdd.size() != 0) { for (RectF colorArea : mLocalColorsToAdd) { if (!isValid(colorArea)) continue; mLocalColorAreas.add(colorArea); int colorPage = getRectFPage(colorArea, finalXOffsetStep); EngineWindowPage currentPage = mWindowPages[colorPage]; currentPage.setLastUpdateTime(0); currentPage.removeColor(colorArea); } mLocalColorsToAdd.clear(); } if (xPage >= mWindowPages.length) { if (DEBUG) { Log.e(TAG, "error xPage >= mWindowPages.length page: " + xPage); Log.e(TAG, "error on page " + xPage + " out of " + xPages); Log.e(TAG, "error on xOffsetStep " + finalXOffsetStep + " xOffset " + finalXOffset); } xPage = mWindowPages.length - 1; } current = mWindowPages[xPage]; areas = new HashSet<>(current.getAreas()); } updatePage(current, areas, xPage, xPages, wallpaperDimAmount); }
Default implementation of the local color extraction. This will take a screenshot of the whole wallpaper on the main thread. Then, in a background thread, for each launcher page, for each area that needs color extraction in this page, creates a sub-bitmap and call {@link WallpaperColors#fromBitmap} to extract the colors. Every time a launcher page has been processed, call {@link #notifyLocalColorsChanged} with the color and areas of this page.
WallpaperInputEventReceiver::processLocalColorsInternal
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
public void addLocalColorsAreas(@NonNull List<RectF> regions) { if (supportsLocalColorExtraction()) return; if (DEBUG) { Log.d(TAG, "addLocalColorsAreas adding local color areas " + regions); } mBackgroundHandler.post(() -> { synchronized (mLock) { mLocalColorsToAdd.addAll(regions); } processLocalColors(); }); }
Add local colors areas of interest @param regions list of areas @hide
WallpaperInputEventReceiver::addLocalColorsAreas
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
public void removeLocalColorsAreas(@NonNull List<RectF> regions) { if (supportsLocalColorExtraction()) return; mBackgroundHandler.post(() -> { synchronized (mLock) { float step = mPendingXOffsetStep; mLocalColorsToAdd.removeAll(regions); mLocalColorAreas.removeAll(regions); if (!validStep(step)) { return; } for (int i = 0; i < mWindowPages.length; i++) { for (int j = 0; j < regions.size(); j++) { mWindowPages[i].removeArea(regions.get(j)); } } } }); }
Remove local colors areas of interest if they exist @param regions list of areas @hide
WallpaperInputEventReceiver::removeLocalColorsAreas
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/WallpaperService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/WallpaperService.java
MIT
public XNodeSet getNodeSetDTMByKey( XPathContext xctxt, int doc, QName name, XMLString ref, PrefixResolver nscontext) throws javax.xml.transform.TransformerException { XNodeSet nl = null; ElemTemplateElement template = (ElemTemplateElement) nscontext; // yuck -sb if ((null != template) && null != template.getStylesheetRoot().getKeysComposed()) { boolean foundDoc = false; if (null == m_key_tables) { m_key_tables = new Vector(4); } else { int nKeyTables = m_key_tables.size(); for (int i = 0; i < nKeyTables; i++) { KeyTable kt = (KeyTable) m_key_tables.elementAt(i); if (kt.getKeyTableName().equals(name) && doc == kt.getDocKey()) { nl = kt.getNodeSetDTMByKey(name, ref); if (nl != null) { foundDoc = true; break; } } } } if ((null == nl) &&!foundDoc /* && m_needToBuildKeysTable */) { KeyTable kt = new KeyTable(doc, nscontext, name, template.getStylesheetRoot().getKeysComposed(), xctxt); m_key_tables.addElement(kt); if (doc == kt.getDocKey()) { foundDoc = true; nl = kt.getNodeSetDTMByKey(name, ref); } } } return nl; }
Given a valid element key, return the corresponding node list. @param xctxt The XPath runtime state @param doc The document node @param name The key element name @param ref The key value we're looking for @param nscontext The prefix resolver for the execution context @return A nodelist of nodes mathing the given key @throws javax.xml.transform.TransformerException
KeyManager::getNodeSetDTMByKey
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/transformer/KeyManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/transformer/KeyManager.java
MIT
private ReadRecordsRequestUsingFilters( @NonNull TimeRangeFilter timeRangeFilter, @NonNull Class<T> recordType, @NonNull Set<DataOrigin> dataOrigins, int pageSize, long pageToken, boolean ascending) { super(recordType); Objects.requireNonNull(dataOrigins); mTimeRangeFilter = timeRangeFilter; mDataOrigins = dataOrigins; mPageSize = pageSize; mAscending = PageTokenWrapper.from(pageToken, ascending).isAscending(); mPageToken = pageToken; }
@see Builder
ReadRecordsRequestUsingFilters::ReadRecordsRequestUsingFilters
java
Reginer/aosp-android-jar
android-35/src/android/health/connect/ReadRecordsRequestUsingFilters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/health/connect/ReadRecordsRequestUsingFilters.java
MIT
public long getPageToken() { return mPageToken; }
Returns the set of {@link DataOrigin data origins} to be read, or empty list for no filter @NonNull public Set<DataOrigin> getDataOrigins() { return mDataOrigins; } /** Returns maximum number of records to be returned by the read operation @IntRange(from = 1, to = 5000) public int getPageSize() { return mPageSize; } /** Returns page token to read the current page of the result. -1 if none available
ReadRecordsRequestUsingFilters::getPageToken
java
Reginer/aosp-android-jar
android-35/src/android/health/connect/ReadRecordsRequestUsingFilters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/health/connect/ReadRecordsRequestUsingFilters.java
MIT
public boolean isAscending() { return mAscending; }
Returns the set of {@link DataOrigin data origins} to be read, or empty list for no filter @NonNull public Set<DataOrigin> getDataOrigins() { return mDataOrigins; } /** Returns maximum number of records to be returned by the read operation @IntRange(from = 1, to = 5000) public int getPageSize() { return mPageSize; } /** Returns page token to read the current page of the result. -1 if none available public long getPageToken() { return mPageToken; } /** Returns ordering of results to be returned
ReadRecordsRequestUsingFilters::isAscending
java
Reginer/aosp-android-jar
android-35/src/android/health/connect/ReadRecordsRequestUsingFilters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/health/connect/ReadRecordsRequestUsingFilters.java
MIT
public String getPublicId() { return m_publicId; }
Return the public identifier for the current document event. <p>This will be the public identifier @return A string containing the public identifier, or null if none is available. @see #getSystemId
ElemTemplate::getPublicId
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public String getSystemId() { return m_systemId; }
Return the system identifier for the current document event. <p>If the system identifier is a URL, the parser must resolve it fully before passing it to the application.</p> @return A string containing the system identifier, or null if none is available. @see #getPublicId
ElemTemplate::getSystemId
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void setLocaterInfo(SourceLocator locator) { m_publicId = locator.getPublicId(); m_systemId = locator.getSystemId(); super.setLocaterInfo(locator); }
Set the location information for this element. @param locator SourceLocator holding location information
ElemTemplate::setLocaterInfo
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public StylesheetComposed getStylesheetComposed() { return m_stylesheet.getStylesheetComposed(); }
Get the stylesheet composed (resolves includes and imports and has methods on it that return "composed" properties. @return The stylesheet composed.
ElemTemplate::getStylesheetComposed
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public Stylesheet getStylesheet() { return m_stylesheet; }
Get the owning stylesheet. @return The owning stylesheet.
ElemTemplate::getStylesheet
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void setStylesheet(Stylesheet sheet) { m_stylesheet = sheet; }
Set the owning stylesheet. @param sheet The owning stylesheet for this element
ElemTemplate::setStylesheet
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public StylesheetRoot getStylesheetRoot() { return m_stylesheet.getStylesheetRoot(); }
Get the root stylesheet. @return The root stylesheet for this element
ElemTemplate::getStylesheetRoot
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void setMatch(XPath v) { m_matchPattern = v; }
Set the "match" attribute. The match attribute is a Pattern that identifies the source node or nodes to which the rule applies. The match attribute is required unless the xsl:template element has a name attribute (see [6 Named Templates]). It is an error for the value of the match attribute to contain a VariableReference. @see <a href="http://www.w3.org/TR/xslt#patterns">patterns in XSLT Specification</a> @param v Value to set for the "match" attribute
ElemTemplate::setMatch
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public XPath getMatch() { return m_matchPattern; }
Get the "match" attribute. The match attribute is a Pattern that identifies the source node or nodes to which the rule applies. The match attribute is required unless the xsl:template element has a name attribute (see [6 Named Templates]). It is an error for the value of the match attribute to contain a VariableReference. @see <a href="http://www.w3.org/TR/xslt#patterns">patterns in XSLT Specification</a> @return Value of the "match" attribute
ElemTemplate::getMatch
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void setName(QName v) { m_name = v; }
Set the "name" attribute. An xsl:template element with a name attribute specifies a named template. If an xsl:template element has a name attribute, it may, but need not, also have a match attribute. @see <a href="http://www.w3.org/TR/xslt#named-templates">named-templates in XSLT Specification</a> @param v Value to set the "name" attribute
ElemTemplate::setName
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public QName getName() { return m_name; }
Get the "name" attribute. An xsl:template element with a name attribute specifies a named template. If an xsl:template element has a name attribute, it may, but need not, also have a match attribute. @see <a href="http://www.w3.org/TR/xslt#named-templates">named-templates in XSLT Specification</a> @return Value of the "name" attribute
ElemTemplate::getName
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void setMode(QName v) { m_mode = v; }
Set the "mode" attribute. Modes allow an element to be processed multiple times, each time producing a different result. If xsl:template does not have a match attribute, it must not have a mode attribute. @see <a href="http://www.w3.org/TR/xslt#modes">modes in XSLT Specification</a> @param v Value to set the "mode" attribute
ElemTemplate::setMode
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public QName getMode() { return m_mode; }
Get the "mode" attribute. Modes allow an element to be processed multiple times, each time producing a different result. If xsl:template does not have a match attribute, it must not have a mode attribute. @see <a href="http://www.w3.org/TR/xslt#modes">modes in XSLT Specification</a> @return Value of the "mode" attribute
ElemTemplate::getMode
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void setPriority(double v) { m_priority = v; }
Set the "priority" attribute. The priority of a template rule is specified by the priority attribute on the template rule. The value of this must be a real number (positive or negative), matching the production Number with an optional leading minus sign (-). @see <a href="http://www.w3.org/TR/xslt#conflict">conflict in XSLT Specification</a> @param v The value to set for the "priority" attribute
ElemTemplate::setPriority
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public double getPriority() { return m_priority; }
Get the "priority" attribute. The priority of a template rule is specified by the priority attribute on the template rule. The value of this must be a real number (positive or negative), matching the production Number with an optional leading minus sign (-). @see <a href="http://www.w3.org/TR/xslt#conflict">conflict in XSLT Specification</a> @return The value of the "priority" attribute
ElemTemplate::getPriority
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public int getXSLToken() { return Constants.ELEMNAME_TEMPLATE; }
Get an int constant identifying the type of element. @see org.apache.xalan.templates.Constants @return The token ID for the element
ElemTemplate::getXSLToken
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public String getNodeName() { return Constants.ELEMNAME_TEMPLATE_STRING; }
Return the node name. @return The element's name
ElemTemplate::getNodeName
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if(null != m_matchPattern) m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); cstate.resetStackFrameSize(); m_inArgsSize = 0; }
This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition.
ElemTemplate::compose
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void endCompose(StylesheetRoot sroot) throws TransformerException { StylesheetRoot.ComposeState cstate = sroot.getComposeState(); super.endCompose(sroot); m_frameSize = cstate.getFrameSize(); cstate.resetStackFrameSize(); }
This after the template's children have been composed.
ElemTemplate::endCompose
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); xctxt.pushRTFContext(); // %REVIEW% commenting out of the code below. // if (null != sourceNode) // { transformer.executeChildTemplates(this, true); // } // else // if(null == sourceNode) // { // transformer.getMsgMgr().error(this, // this, sourceNode, // XSLTErrorResources.ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES); // // //"sourceNode is null in handleApplyTemplatesInstruction!"); // } xctxt.popRTFContext(); }
Copy the template contents into the result tree. The content of the xsl:template element is the template that is instantiated when the template rule is applied. @param transformer non-null reference to the the current transform-time state. @throws TransformerException
ElemTemplate::execute
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public void recompose(StylesheetRoot root) { root.recomposeTemplates(this); }
This function is called during recomposition to control how this element is composed. @param root The root stylesheet for this transformation.
ElemTemplate::recompose
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/templates/ElemTemplate.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/templates/ElemTemplate.java
MIT
public static boolean isWeaklyValidatedHostname(@NonNull String hostname) { // TODO(b/34953048): Use a validation method that permits more accurate, // but still inexpensive, checking of likely valid DNS hostnames. final String weakHostnameRegex = "^[a-zA-Z0-9_.-]+$"; if (!hostname.matches(weakHostnameRegex)) { return false; } for (int address_family : ADDRESS_FAMILIES) { if (Os.inet_pton(address_family, hostname) != null) { return false; } } return true; }
Returns true if the hostname is weakly validated. @param hostname Name of host to validate. @return True if it's a valid-ish hostname. @hide
NetworkUtilsInternal::isWeaklyValidatedHostname
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/net/NetworkUtilsInternal.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/net/NetworkUtilsInternal.java
MIT
public static long multiplySafeByRational(long value, long num, long den) { if (den == 0) { throw new ArithmeticException("Invalid Denominator"); } long x = value; long y = num; // Logic shamelessly borrowed from Math.multiplyExact() long r = x * y; long ax = Math.abs(x); long ay = Math.abs(y); if (((ax | ay) >>> 31 != 0)) { // Some bits greater than 2^31 that might cause overflow // Check the result using the divide operator // and check for the special case of Long.MIN_VALUE * -1 if (((y != 0) && (r / y != x)) || (x == Long.MIN_VALUE && y == -1)) { // Use double math to avoid overflowing return (long) (((double) num / den) * value); } } return r / den; }
Safely multiple a value by a rational. <p> Internally it uses integer-based math whenever possible, but switches over to double-based math if values would overflow. @hide
NetworkUtilsInternal::multiplySafeByRational
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/net/NetworkUtilsInternal.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/net/NetworkUtilsInternal.java
MIT
/* package */ BluetoothHearingAid(Context context, ServiceListener listener, BluetoothAdapter adapter) { mAdapter = adapter; mAttributionSource = adapter.getAttributionSource(); mProfileConnector.connect(context, listener); }
Create a BluetoothHearingAid proxy object for interacting with the local Bluetooth Hearing Aid service.
BluetoothHearingAid::BluetoothHearingAid
java
Reginer/aosp-android-jar
android-31/src/android/bluetooth/BluetoothHearingAid.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/bluetooth/BluetoothHearingAid.java
MIT
public static String stateToString(int state) { switch (state) { case STATE_DISCONNECTED: return "disconnected"; case STATE_CONNECTING: return "connecting"; case STATE_CONNECTED: return "connected"; case STATE_DISCONNECTING: return "disconnecting"; default: return "<unknown state " + state + ">"; } }
Helper for converting a state to a string. For debug use only - strings are not internationalized. @hide
BluetoothHearingAid::stateToString
java
Reginer/aosp-android-jar
android-31/src/android/bluetooth/BluetoothHearingAid.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/bluetooth/BluetoothHearingAid.java
MIT
public void setWhitelist(@UserIdInt int userId, @Nullable List<String> packageNames, @Nullable List<ComponentName> components) { synchronized (mGlobalWhitelistStateLock) { if (mWhitelisterHelpers == null) { mWhitelisterHelpers = new SparseArray<>(1); } WhitelistHelper helper = mWhitelisterHelpers.get(userId); if (helper == null) { helper = new WhitelistHelper(); mWhitelisterHelpers.put(userId, helper); } helper.setWhitelist(packageNames, components); } }
Sets the allowlist for the given user.
GlobalWhitelistState::setWhitelist
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/infra/GlobalWhitelistState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/infra/GlobalWhitelistState.java
MIT
public boolean isWhitelisted(@UserIdInt int userId, @NonNull String packageName) { synchronized (mGlobalWhitelistStateLock) { if (mWhitelisterHelpers == null) return false; final WhitelistHelper helper = mWhitelisterHelpers.get(userId); return helper == null ? false : helper.isWhitelisted(packageName); } }
Checks if the given package is allowlisted for the given user.
GlobalWhitelistState::isWhitelisted
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/infra/GlobalWhitelistState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/infra/GlobalWhitelistState.java
MIT
public boolean isWhitelisted(@UserIdInt int userId, @NonNull ComponentName componentName) { synchronized (mGlobalWhitelistStateLock) { if (mWhitelisterHelpers == null) return false; final WhitelistHelper helper = mWhitelisterHelpers.get(userId); return helper == null ? false : helper.isWhitelisted(componentName); } }
Checks if the given component is allowlisted for the given user.
GlobalWhitelistState::isWhitelisted
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/infra/GlobalWhitelistState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/infra/GlobalWhitelistState.java
MIT
public ArraySet<ComponentName> getWhitelistedComponents(@UserIdInt int userId, @NonNull String packageName) { synchronized (mGlobalWhitelistStateLock) { if (mWhitelisterHelpers == null) return null; final WhitelistHelper helper = mWhitelisterHelpers.get(userId); return helper == null ? null : helper.getWhitelistedComponents(packageName); } }
Gets the allowlisted components for the given package and user.
GlobalWhitelistState::getWhitelistedComponents
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/infra/GlobalWhitelistState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/infra/GlobalWhitelistState.java
MIT
public ArraySet<String> getWhitelistedPackages(@UserIdInt int userId) { synchronized (mGlobalWhitelistStateLock) { if (mWhitelisterHelpers == null) return null; final WhitelistHelper helper = mWhitelisterHelpers.get(userId); return helper == null ? null : helper.getWhitelistedPackages(); } }
Gets packages that are either entirely allowlisted or have components that are allowlisted for the given user.
GlobalWhitelistState::getWhitelistedPackages
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/infra/GlobalWhitelistState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/infra/GlobalWhitelistState.java
MIT
public void resetWhitelist(@NonNull int userId) { synchronized (mGlobalWhitelistStateLock) { if (mWhitelisterHelpers == null) return; mWhitelisterHelpers.remove(userId); if (mWhitelisterHelpers.size() == 0) { mWhitelisterHelpers = null; } } }
Resets the allowlist for the given user.
GlobalWhitelistState::resetWhitelist
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/infra/GlobalWhitelistState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/infra/GlobalWhitelistState.java
MIT
public void dump(@NonNull String prefix, @NonNull PrintWriter pw) { pw.print(prefix); pw.print("State: "); synchronized (mGlobalWhitelistStateLock) { if (mWhitelisterHelpers == null) { pw.println("empty"); return; } pw.print(mWhitelisterHelpers.size()); pw.println(" services"); final String prefix2 = prefix + " "; for (int i = 0; i < mWhitelisterHelpers.size(); i++) { final int userId = mWhitelisterHelpers.keyAt(i); final WhitelistHelper helper = mWhitelisterHelpers.valueAt(i); helper.dump(prefix2, "Whitelist for userId " + userId, pw); } } }
Dumps it!
GlobalWhitelistState::dump
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/infra/GlobalWhitelistState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/infra/GlobalWhitelistState.java
MIT
public void getContextualSearchState(@NonNull @CallbackExecutor Executor executor, @NonNull OutcomeReceiver<ContextualSearchState, Throwable> callback) { if (DEBUG) Log.d(TAG, "getContextualSearchState for token:" + mToken); boolean tokenUsed; synchronized (mLock) { tokenUsed = markUsedLocked(); } if (tokenUsed) { callback.onError(new IllegalAccessException("Token already used.")); return; } try { // Get the service from the system server. IBinder b = ServiceManager.getService(Context.CONTEXTUAL_SEARCH_SERVICE); IContextualSearchManager service = IContextualSearchManager.Stub.asInterface(b); final CallbackWrapper wrapper = new CallbackWrapper(executor, callback); // If the service is not null, hand over the call to the service. if (service != null) { service.getContextualSearchState(mToken, wrapper); } else { Log.w(TAG, "Failed to getContextualSearchState. Service null."); } } catch (RemoteException e) { if (DEBUG) Log.d(TAG, "Failed to call getContextualSearchState", e); e.rethrowFromSystemServer(); } }
Returns the {@link ContextualSearchState} to the handler via the provided callback. The method can only be invoked to provide the {@link OutcomeReceiver} once and all subsequent invocations of this method will result in {@link OutcomeReceiver#onError} being called with an {@link IllegalAccessException}. Note that the callback could be invoked multiple times, e.g. in the case of split screen. @param executor The executor which will be used to invoke the callback. @param callback The callback which will be used to return {@link ContextualSearchState} if/when it is available via {@link OutcomeReceiver#onResult}. It will also be used to return errors via {@link OutcomeReceiver#onError}.
getSimpleName::getContextualSearchState
java
Reginer/aosp-android-jar
android-35/src/android/app/contextualsearch/CallbackToken.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/contextualsearch/CallbackToken.java
MIT
IntPipeline(Supplier<? extends Spliterator<Integer>> source, int sourceFlags, boolean parallel) { super(source, sourceFlags, parallel); }
Constructor for the head of a stream pipeline. @param source {@code Supplier<Spliterator>} describing the stream source @param sourceFlags The source flags for the stream source, described in {@link StreamOpFlag} @param parallel {@code true} if the pipeline is parallel
IntPipeline::IntPipeline
java
Reginer/aosp-android-jar
android-35/src/java/util/stream/IntPipeline.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/java/util/stream/IntPipeline.java
MIT
IntPipeline(Spliterator<Integer> source, int sourceFlags, boolean parallel) { super(source, sourceFlags, parallel); }
Constructor for the head of a stream pipeline. @param source {@code Spliterator} describing the stream source @param sourceFlags The source flags for the stream source, described in {@link StreamOpFlag} @param parallel {@code true} if the pipeline is parallel
IntPipeline::IntPipeline
java
Reginer/aosp-android-jar
android-35/src/java/util/stream/IntPipeline.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/java/util/stream/IntPipeline.java
MIT
IntPipeline(AbstractPipeline<?, E_IN, ?> upstream, int opFlags) { super(upstream, opFlags); }
Constructor for appending an intermediate operation onto an existing pipeline. @param upstream the upstream element source @param opFlags the operation flags for the new operation
IntPipeline::IntPipeline
java
Reginer/aosp-android-jar
android-35/src/java/util/stream/IntPipeline.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/java/util/stream/IntPipeline.java
MIT
private static IntConsumer adapt(Sink<Integer> sink) { if (sink instanceof IntConsumer) { return (IntConsumer) sink; } else { if (Tripwire.ENABLED) Tripwire.trip(AbstractPipeline.class, "using IntStream.adapt(Sink<Integer> s)"); return sink::accept; } }
Adapt a {@code Sink<Integer> to an {@code IntConsumer}, ideally simply by casting.
IntPipeline::adapt
java
Reginer/aosp-android-jar
android-35/src/java/util/stream/IntPipeline.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/java/util/stream/IntPipeline.java
MIT
public hc_documentinvalidcharacterexceptioncreateelement1(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", true); }
Constructor. @param factory document factory, may not be null @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
hc_documentinvalidcharacterexceptioncreateelement1::hc_documentinvalidcharacterexceptioncreateelement1
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
MIT
public void runTest() throws Throwable { Document doc; Element badElement; doc = (Document) load("hc_staff", true); { boolean success = false; try { badElement = doc.createElement(""); } catch (DOMException ex) { success = (ex.code == DOMException.INVALID_CHARACTER_ERR); } assertTrue("throw_INVALID_CHARACTER_ERR", success); } }
Runs the test case. @throws Throwable Any uncaught exception causes test to fail
hc_documentinvalidcharacterexceptioncreateelement1::runTest
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
MIT
public String getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement1"; }
Gets URI that identifies the test. @return uri identifier of test
hc_documentinvalidcharacterexceptioncreateelement1::getTargetURI
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
MIT
public static void main(final String[] args) { DOMTestCase.doMain(hc_documentinvalidcharacterexceptioncreateelement1.class, args); }
Runs this test from the command line. @param args command line arguments
hc_documentinvalidcharacterexceptioncreateelement1::main
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.java
MIT
public Stub() { this.markVintfStability(); this.attachInterface(this, DESCRIPTOR); }
The version of this interface that the caller is built against. This might be different from what {@link #getInterfaceVersion() getInterfaceVersion} returns as that is the version of the interface that the remote object is implementing. public static final int VERSION = 1; public static final String HASH = "7d8d63478cd50e766d2072140c8aa3457f9fb585"; /** Default implementation for ISoundTriggerHw. public static class Default implements android.hardware.soundtrigger3.ISoundTriggerHw { @Override public android.media.soundtrigger.Properties getProperties() throws android.os.RemoteException { return null; } @Override public void registerGlobalCallback(android.hardware.soundtrigger3.ISoundTriggerHwGlobalCallback callback) throws android.os.RemoteException { } @Override public int loadSoundModel(android.media.soundtrigger.SoundModel soundModel, android.hardware.soundtrigger3.ISoundTriggerHwCallback callback) throws android.os.RemoteException { return 0; } @Override public int loadPhraseSoundModel(android.media.soundtrigger.PhraseSoundModel soundModel, android.hardware.soundtrigger3.ISoundTriggerHwCallback callback) throws android.os.RemoteException { return 0; } @Override public void unloadSoundModel(int modelHandle) throws android.os.RemoteException { } @Override public void startRecognition(int modelHandle, int deviceHandle, int ioHandle, android.media.soundtrigger.RecognitionConfig config) throws android.os.RemoteException { } @Override public void stopRecognition(int modelHandle) throws android.os.RemoteException { } @Override public void forceRecognitionEvent(int modelHandle) throws android.os.RemoteException { } @Override public android.media.soundtrigger.ModelParameterRange queryParameter(int modelHandle, int modelParam) throws android.os.RemoteException { return null; } @Override public int getParameter(int modelHandle, int modelParam) throws android.os.RemoteException { return 0; } @Override public void setParameter(int modelHandle, int modelParam, int value) throws android.os.RemoteException { } @Override public int getInterfaceVersion() { return 0; } @Override public String getInterfaceHash() { return ""; } @Override public android.os.IBinder asBinder() { return null; } } /** Local-side IPC implementation stub class. public static abstract class Stub extends android.os.Binder implements android.hardware.soundtrigger3.ISoundTriggerHw { /** Construct the stub at attach it to the interface.
Stub::Stub
java
Reginer/aosp-android-jar
android-34/src/android/hardware/soundtrigger3/ISoundTriggerHw.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/soundtrigger3/ISoundTriggerHw.java
MIT
public static android.hardware.soundtrigger3.ISoundTriggerHw asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof android.hardware.soundtrigger3.ISoundTriggerHw))) { return ((android.hardware.soundtrigger3.ISoundTriggerHw)iin); } return new android.hardware.soundtrigger3.ISoundTriggerHw.Stub.Proxy(obj); }
Cast an IBinder object into an android.hardware.soundtrigger3.ISoundTriggerHw interface, generating a proxy if needed.
Stub::asInterface
java
Reginer/aosp-android-jar
android-34/src/android/hardware/soundtrigger3/ISoundTriggerHw.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/soundtrigger3/ISoundTriggerHw.java
MIT
public StructMsghdr(@Nullable SocketAddress msg_name, @NonNull ByteBuffer[] msg_iov, @Nullable StructCmsghdr[] msg_control, int msg_flags) { this.msg_name = msg_name; this.msg_iov = msg_iov; this.msg_control = msg_control; this.msg_flags = msg_flags; }
Constructs an instance with the given field values
StructMsghdr::StructMsghdr
java
Reginer/aosp-android-jar
android-33/src/android/system/StructMsghdr.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/system/StructMsghdr.java
MIT
public static DocumentBuilderFactory newInstance() { // instantiate the class directly rather than using reflection return new DocumentBuilderFactoryImpl(); }
Returns Android's implementation of {@code DocumentBuilderFactory}. Unlike other Java implementations, this method does not consult system properties, property files, or the services API. @return a new DocumentBuilderFactory.
DocumentBuilderFactory::newInstance
java
Reginer/aosp-android-jar
android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
MIT
public static DocumentBuilderFactory newInstance(String factoryClassName, ClassLoader classLoader) { if (factoryClassName == null) { throw new FactoryConfigurationError("factoryClassName == null"); } if (classLoader == null) { classLoader = Thread.currentThread().getContextClassLoader(); } try { Class<?> type = classLoader != null ? classLoader.loadClass(factoryClassName) : Class.forName(factoryClassName); return (DocumentBuilderFactory) type.newInstance(); } catch (ClassNotFoundException e) { throw new FactoryConfigurationError(e); } catch (InstantiationException e) { throw new FactoryConfigurationError(e); } catch (IllegalAccessException e) { throw new FactoryConfigurationError(e); } }
Returns an instance of the named implementation of {@code DocumentBuilderFactory}. @throws FactoryConfigurationError if {@code factoryClassName} is not available or cannot be instantiated. @since 1.6
DocumentBuilderFactory::newInstance
java
Reginer/aosp-android-jar
android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
MIT
public Schema getSchema() { throw new UnsupportedOperationException( "This parser does not support specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\" version \"" + this.getClass().getPackage().getSpecificationVersion() + "\"" ); }
Gets the {@link Schema} object specified through the {@link #setSchema(Schema schema)} method. @throws UnsupportedOperationException For backward compatibility, when implementations for earlier versions of JAXP is used, this exception will be thrown. @return the {@link Schema} object that was last set through the {@link #setSchema(Schema)} method, or null if the method was not invoked since a {@link DocumentBuilderFactory} is created. @since 1.5
DocumentBuilderFactory::getSchema
java
Reginer/aosp-android-jar
android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
MIT
public void setSchema(Schema schema) { throw new UnsupportedOperationException( "This parser does not support specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\" version \"" + this.getClass().getPackage().getSpecificationVersion() + "\"" ); }
<p>Set the {@link Schema} to be used by parsers created from this factory. <p> When a {@link Schema} is non-null, a parser will use a validator created from it to validate documents before it passes information down to the application. <p>When errors are found by the validator, the parser is responsible to report them to the user-specified {@link org.xml.sax.ErrorHandler} (or if the error handler is not set, ignore them or throw them), just like any other errors found by the parser itself. In other words, if the user-specified {@link org.xml.sax.ErrorHandler} is set, it must receive those errors, and if not, they must be treated according to the implementation specific default error handling rules. <p> A validator may modify the outcome of a parse (for example by adding default values that were missing in documents), and a parser is responsible to make sure that the application will receive modified DOM trees. <p> Initially, null is set as the {@link Schema}. <p> This processing will take effect even if the {@link #isValidating()} method returns <tt>false</tt>. <p>It is an error to use the <code>http://java.sun.com/xml/jaxp/properties/schemaSource</code> property and/or the <code>http://java.sun.com/xml/jaxp/properties/schemaLanguage</code> property in conjunction with a {@link Schema} object. Such configuration will cause a {@link ParserConfigurationException} exception when the {@link #newDocumentBuilder()} is invoked.</p> <h4>Note for implementors</h4> <p> A parser must be able to work with any {@link Schema} implementation. However, parsers and schemas are allowed to use implementation-specific custom mechanisms as long as they yield the result described in the specification. @param schema <code>Schema</code> to use or <code>null</code> to remove a schema. @throws UnsupportedOperationException For backward compatibility, when implementations for earlier versions of JAXP is used, this exception will be thrown. @since 1.5
DocumentBuilderFactory::setSchema
java
Reginer/aosp-android-jar
android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
MIT
public void setXIncludeAware(final boolean state) { throw new UnsupportedOperationException( "This parser does not support specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\" version \"" + this.getClass().getPackage().getSpecificationVersion() + "\"" ); }
<p>Set state of XInclude processing.</p> <p>If XInclude markup is found in the document instance, should it be processed as specified in <a href="http://www.w3.org/TR/xinclude/"> XML Inclusions (XInclude) Version 1.0</a>.</p> <p>XInclude processing defaults to <code>false</code>.</p> @param state Set XInclude processing to <code>true</code> or <code>false</code> @throws UnsupportedOperationException For backward compatibility, when implementations for earlier versions of JAXP is used, this exception will be thrown. @since 1.5
DocumentBuilderFactory::setXIncludeAware
java
Reginer/aosp-android-jar
android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
MIT
public boolean isXIncludeAware() { throw new UnsupportedOperationException( "This parser does not support specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\" version \"" + this.getClass().getPackage().getSpecificationVersion() + "\"" ); }
<p>Get state of XInclude processing.</p> @return current state of XInclude processing @throws UnsupportedOperationException For backward compatibility, when implementations for earlier versions of JAXP is used, this exception will be thrown. @since 1.5
DocumentBuilderFactory::isXIncludeAware
java
Reginer/aosp-android-jar
android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/javax/xml/parsers/DocumentBuilderFactory.java
MIT
public void testConstructor() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) assertEquals(0, aa.get(i)); }
constructor creates array of given size with all elements zero
AtomicLongArrayTest::testConstructor
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testConstructor2NPE() { try { long[] a = null; new AtomicLongArray(a); shouldThrow(); } catch (NullPointerException success) {} }
constructor with null array throws NPE
AtomicLongArrayTest::testConstructor2NPE
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testConstructor2() { long[] a = { 17L, 3L, -42L, 99L, -7L }; AtomicLongArray aa = new AtomicLongArray(a); assertEquals(a.length, aa.length()); for (int i = 0; i < a.length; i++) assertEquals(a[i], aa.get(i)); }
constructor with array is of same size and has all elements
AtomicLongArrayTest::testConstructor2
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testIndexing() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int index : new int[] { -1, SIZE }) { try { aa.get(index); shouldThrow(); } catch (IndexOutOfBoundsException success) {} try { aa.set(index, 1); shouldThrow(); } catch (IndexOutOfBoundsException success) {} try { aa.lazySet(index, 1); shouldThrow(); } catch (IndexOutOfBoundsException success) {} try { aa.compareAndSet(index, 1, 2); shouldThrow(); } catch (IndexOutOfBoundsException success) {} try { aa.weakCompareAndSet(index, 1, 2); shouldThrow(); } catch (IndexOutOfBoundsException success) {} try { aa.getAndAdd(index, 1); shouldThrow(); } catch (IndexOutOfBoundsException success) {} try { aa.addAndGet(index, 1); shouldThrow(); } catch (IndexOutOfBoundsException success) {} } }
get and set for out of bound indices throw IndexOutOfBoundsException
AtomicLongArrayTest::testIndexing
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testGetSet() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(1, aa.get(i)); aa.set(i, 2); assertEquals(2, aa.get(i)); aa.set(i, -3); assertEquals(-3, aa.get(i)); } }
get returns the last value set at index
AtomicLongArrayTest::testGetSet
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testGetLazySet() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.lazySet(i, 1); assertEquals(1, aa.get(i)); aa.lazySet(i, 2); assertEquals(2, aa.get(i)); aa.lazySet(i, -3); assertEquals(-3, aa.get(i)); } }
get returns the last value lazySet at index by same thread
AtomicLongArrayTest::testGetLazySet
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testCompareAndSet() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertTrue(aa.compareAndSet(i, 1, 2)); assertTrue(aa.compareAndSet(i, 2, -4)); assertEquals(-4, aa.get(i)); assertFalse(aa.compareAndSet(i, -5, 7)); assertEquals(-4, aa.get(i)); assertTrue(aa.compareAndSet(i, -4, 7)); assertEquals(7, aa.get(i)); } }
compareAndSet succeeds in changing value if equal to expected else fails
AtomicLongArrayTest::testCompareAndSet
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testCompareAndSetInMultipleThreads() throws InterruptedException { final AtomicLongArray a = new AtomicLongArray(1); a.set(0, 1); Thread t = new Thread(new CheckedRunnable() { public void realRun() { while (!a.compareAndSet(0, 2, 3)) Thread.yield(); }}); t.start(); assertTrue(a.compareAndSet(0, 1, 2)); t.join(LONG_DELAY_MS); assertFalse(t.isAlive()); assertEquals(3, a.get(0)); }
compareAndSet in one thread enables another waiting for value to succeed
AtomicLongArrayTest::testCompareAndSetInMultipleThreads
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testWeakCompareAndSet() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); do {} while (!aa.weakCompareAndSet(i, 1, 2)); do {} while (!aa.weakCompareAndSet(i, 2, -4)); assertEquals(-4, aa.get(i)); do {} while (!aa.weakCompareAndSet(i, -4, 7)); assertEquals(7, aa.get(i)); } }
repeated weakCompareAndSet succeeds in changing value when equal to expected
AtomicLongArrayTest::testWeakCompareAndSet
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testGetAndSet() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(1, aa.getAndSet(i, 0)); assertEquals(0, aa.getAndSet(i, -10)); assertEquals(-10, aa.getAndSet(i, 1)); } }
getAndSet returns previous value and sets to given value at given index
AtomicLongArrayTest::testGetAndSet
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testGetAndAdd() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(1, aa.getAndAdd(i, 2)); assertEquals(3, aa.get(i)); assertEquals(3, aa.getAndAdd(i, -4)); assertEquals(-1, aa.get(i)); } }
getAndAdd returns previous value and adds given value
AtomicLongArrayTest::testGetAndAdd
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testGetAndDecrement() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(1, aa.getAndDecrement(i)); assertEquals(0, aa.getAndDecrement(i)); assertEquals(-1, aa.getAndDecrement(i)); } }
getAndDecrement returns previous value and decrements
AtomicLongArrayTest::testGetAndDecrement
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testGetAndIncrement() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(1, aa.getAndIncrement(i)); assertEquals(2, aa.get(i)); aa.set(i, -2); assertEquals(-2, aa.getAndIncrement(i)); assertEquals(-1, aa.getAndIncrement(i)); assertEquals(0, aa.getAndIncrement(i)); assertEquals(1, aa.get(i)); } }
getAndIncrement returns previous value and increments
AtomicLongArrayTest::testGetAndIncrement
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testAddAndGet() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(3, aa.addAndGet(i, 2)); assertEquals(3, aa.get(i)); assertEquals(-1, aa.addAndGet(i, -4)); assertEquals(-1, aa.get(i)); } }
addAndGet adds given value to current, and returns current value
AtomicLongArrayTest::testAddAndGet
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testDecrementAndGet() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(0, aa.decrementAndGet(i)); assertEquals(-1, aa.decrementAndGet(i)); assertEquals(-2, aa.decrementAndGet(i)); assertEquals(-2, aa.get(i)); } }
decrementAndGet decrements and returns current value
AtomicLongArrayTest::testDecrementAndGet
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testIncrementAndGet() { AtomicLongArray aa = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertEquals(2, aa.incrementAndGet(i)); assertEquals(2, aa.get(i)); aa.set(i, -2); assertEquals(-1, aa.incrementAndGet(i)); assertEquals(0, aa.incrementAndGet(i)); assertEquals(1, aa.incrementAndGet(i)); assertEquals(1, aa.get(i)); } }
incrementAndGet increments and returns current value
AtomicLongArrayTest::testIncrementAndGet
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testCountingInMultipleThreads() throws InterruptedException { final AtomicLongArray aa = new AtomicLongArray(SIZE); long countdown = 10000; for (int i = 0; i < SIZE; i++) aa.set(i, countdown); Counter c1 = new Counter(aa); Counter c2 = new Counter(aa); Thread t1 = new Thread(c1); Thread t2 = new Thread(c2); t1.start(); t2.start(); t1.join(); t2.join(); assertEquals(c1.counts+c2.counts, SIZE * countdown); }
Multiple threads using same array of counters successfully update a number of times equal to total count
Counter::testCountingInMultipleThreads
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testSerialization() throws Exception { AtomicLongArray x = new AtomicLongArray(SIZE); for (int i = 0; i < SIZE; i++) x.set(i, -i); AtomicLongArray y = serialClone(x); assertNotSame(x, y); assertEquals(x.length(), y.length()); for (int i = 0; i < SIZE; i++) { assertEquals(x.get(i), y.get(i)); } }
a deserialized serialized array holds same values
Counter::testSerialization
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public void testToString() { long[] a = { 17, 3, -42, 99, -7 }; AtomicLongArray aa = new AtomicLongArray(a); assertEquals(Arrays.toString(a), aa.toString()); }
toString returns current value.
Counter::testToString
java
Reginer/aosp-android-jar
android-34/src/jsr166/AtomicLongArrayTest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/jsr166/AtomicLongArrayTest.java
MIT
public ClosedDirectoryStreamException() { }
Constructs an instance of this class.
ClosedDirectoryStreamException::ClosedDirectoryStreamException
java
Reginer/aosp-android-jar
android-33/src/java/nio/file/ClosedDirectoryStreamException.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/file/ClosedDirectoryStreamException.java
MIT
public WrappedKeyEntry(byte[] wrappedKeyBytes, String wrappingKeyAlias, String transformation, AlgorithmParameterSpec algorithmParameterSpec) { mWrappedKeyBytes = wrappedKeyBytes; mWrappingKeyAlias = wrappingKeyAlias; mTransformation = transformation; mAlgorithmParameterSpec = algorithmParameterSpec; }
Constructs a {@link WrappedKeyEntry} with a binary wrapped key. @param wrappedKeyBytes ASN.1 DER encoded wrapped key @param wrappingKeyAlias identifies the private key that can unwrap the wrapped key @param transformation used to unwrap the key. ex: "RSA/ECB/OAEPPadding" @param algorithmParameterSpec spec for the private key used to unwrap the wrapped key
WrappedKeyEntry::WrappedKeyEntry
java
Reginer/aosp-android-jar
android-32/src/android/security/keystore/WrappedKeyEntry.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/security/keystore/WrappedKeyEntry.java
MIT
public ParcelableConnection( PhoneAccountHandle phoneAccount, int state, int capabilities, int properties, int supportedAudioRoutes, Uri address, int addressPresentation, String callerDisplayName, int callerDisplayNamePresentation, IVideoProvider videoProvider, int videoState, boolean ringbackRequested, boolean isVoipAudioMode, long connectTimeMillis, long connectElapsedTimeMillis, StatusHints statusHints, DisconnectCause disconnectCause, List<String> conferenceableConnectionIds, Bundle extras, String parentCallId, @Call.Details.CallDirection int callDirection, @Connection.VerificationStatus int callerNumberVerificationStatus) { this(phoneAccount, state, capabilities, properties, supportedAudioRoutes, address, addressPresentation, callerDisplayName, callerDisplayNamePresentation, videoProvider, videoState, ringbackRequested, isVoipAudioMode, connectTimeMillis, connectElapsedTimeMillis, statusHints, disconnectCause, conferenceableConnectionIds, extras, callerNumberVerificationStatus); mParentCallId = parentCallId; mCallDirection = callDirection; }
Information about a connection that is used between Telecom and the ConnectionService. This is used to send initial Connection information to Telecom when the connection is first created. @hide public final class ParcelableConnection implements Parcelable { private final PhoneAccountHandle mPhoneAccount; private final int mState; private final int mConnectionCapabilities; private final int mConnectionProperties; private final int mSupportedAudioRoutes; private final Uri mAddress; private final int mAddressPresentation; private final String mCallerDisplayName; private final int mCallerDisplayNamePresentation; private final IVideoProvider mVideoProvider; private final int mVideoState; private final boolean mRingbackRequested; private final boolean mIsVoipAudioMode; private final long mConnectTimeMillis; private final long mConnectElapsedTimeMillis; private final StatusHints mStatusHints; private final DisconnectCause mDisconnectCause; private final List<String> mConferenceableConnectionIds; private final Bundle mExtras; private String mParentCallId; private @Call.Details.CallDirection int mCallDirection; private @Connection.VerificationStatus int mCallerNumberVerificationStatus; /** @hide
ParcelableConnection::ParcelableConnection
java
Reginer/aosp-android-jar
android-35/src/android/telecom/ParcelableConnection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telecom/ParcelableConnection.java
MIT
public ParcelableConnection( PhoneAccountHandle phoneAccount, int state, int capabilities, int properties, int supportedAudioRoutes, Uri address, int addressPresentation, String callerDisplayName, int callerDisplayNamePresentation, IVideoProvider videoProvider, int videoState, boolean ringbackRequested, boolean isVoipAudioMode, long connectTimeMillis, long connectElapsedTimeMillis, StatusHints statusHints, DisconnectCause disconnectCause, List<String> conferenceableConnectionIds, Bundle extras, @Connection.VerificationStatus int callerNumberVerificationStatus) { mPhoneAccount = phoneAccount; mState = state; mConnectionCapabilities = capabilities; mConnectionProperties = properties; mSupportedAudioRoutes = supportedAudioRoutes; mAddress = address; mAddressPresentation = addressPresentation; mCallerDisplayName = callerDisplayName; mCallerDisplayNamePresentation = callerDisplayNamePresentation; mVideoProvider = videoProvider; mVideoState = videoState; mRingbackRequested = ringbackRequested; mIsVoipAudioMode = isVoipAudioMode; mConnectTimeMillis = connectTimeMillis; mConnectElapsedTimeMillis = connectElapsedTimeMillis; mStatusHints = statusHints; mDisconnectCause = disconnectCause; mConferenceableConnectionIds = conferenceableConnectionIds; mExtras = extras; mParentCallId = null; mCallDirection = Call.Details.DIRECTION_UNKNOWN; mCallerNumberVerificationStatus = callerNumberVerificationStatus; }
Information about a connection that is used between Telecom and the ConnectionService. This is used to send initial Connection information to Telecom when the connection is first created. @hide public final class ParcelableConnection implements Parcelable { private final PhoneAccountHandle mPhoneAccount; private final int mState; private final int mConnectionCapabilities; private final int mConnectionProperties; private final int mSupportedAudioRoutes; private final Uri mAddress; private final int mAddressPresentation; private final String mCallerDisplayName; private final int mCallerDisplayNamePresentation; private final IVideoProvider mVideoProvider; private final int mVideoState; private final boolean mRingbackRequested; private final boolean mIsVoipAudioMode; private final long mConnectTimeMillis; private final long mConnectElapsedTimeMillis; private final StatusHints mStatusHints; private final DisconnectCause mDisconnectCause; private final List<String> mConferenceableConnectionIds; private final Bundle mExtras; private String mParentCallId; private @Call.Details.CallDirection int mCallDirection; private @Connection.VerificationStatus int mCallerNumberVerificationStatus; /** @hide public ParcelableConnection( PhoneAccountHandle phoneAccount, int state, int capabilities, int properties, int supportedAudioRoutes, Uri address, int addressPresentation, String callerDisplayName, int callerDisplayNamePresentation, IVideoProvider videoProvider, int videoState, boolean ringbackRequested, boolean isVoipAudioMode, long connectTimeMillis, long connectElapsedTimeMillis, StatusHints statusHints, DisconnectCause disconnectCause, List<String> conferenceableConnectionIds, Bundle extras, String parentCallId, @Call.Details.CallDirection int callDirection, @Connection.VerificationStatus int callerNumberVerificationStatus) { this(phoneAccount, state, capabilities, properties, supportedAudioRoutes, address, addressPresentation, callerDisplayName, callerDisplayNamePresentation, videoProvider, videoState, ringbackRequested, isVoipAudioMode, connectTimeMillis, connectElapsedTimeMillis, statusHints, disconnectCause, conferenceableConnectionIds, extras, callerNumberVerificationStatus); mParentCallId = parentCallId; mCallDirection = callDirection; } /** @hide
ParcelableConnection::ParcelableConnection
java
Reginer/aosp-android-jar
android-35/src/android/telecom/ParcelableConnection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telecom/ParcelableConnection.java
MIT
public int getConnectionCapabilities() { return mConnectionCapabilities; }
Returns the current connection capabilities bit-mask. Connection capabilities are defined as {@code CAPABILITY_*} constants in {@link Connection}. @return Bit-mask containing capabilities of the connection.
ParcelableConnection::getConnectionCapabilities
java
Reginer/aosp-android-jar
android-35/src/android/telecom/ParcelableConnection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telecom/ParcelableConnection.java
MIT
public int getConnectionProperties() { return mConnectionProperties; }
Returns the current connection properties bit-mask. Connection properties are defined as {@code PROPERTY_*} constants in {@link Connection}. @return Bit-mask containing properties of the connection.
ParcelableConnection::getConnectionProperties
java
Reginer/aosp-android-jar
android-35/src/android/telecom/ParcelableConnection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telecom/ParcelableConnection.java
MIT
public static String sleepReasonToString(int sleepReason) { switch (sleepReason) { case GO_TO_SLEEP_REASON_APPLICATION: return "application"; case GO_TO_SLEEP_REASON_DEVICE_ADMIN: return "device_admin"; case GO_TO_SLEEP_REASON_TIMEOUT: return "timeout"; case GO_TO_SLEEP_REASON_LID_SWITCH: return "lid_switch"; case GO_TO_SLEEP_REASON_POWER_BUTTON: return "power_button"; case GO_TO_SLEEP_REASON_HDMI: return "hdmi"; case GO_TO_SLEEP_REASON_SLEEP_BUTTON: return "sleep_button"; case GO_TO_SLEEP_REASON_ACCESSIBILITY: return "accessibility"; case GO_TO_SLEEP_REASON_FORCE_SUSPEND: return "force_suspend"; case GO_TO_SLEEP_REASON_INATTENTIVE: return "inattentive"; case GO_TO_SLEEP_REASON_DISPLAY_GROUP_REMOVED: return "display_group_removed"; case GO_TO_SLEEP_REASON_DISPLAY_GROUPS_TURNED_OFF: return "display_groups_turned_off"; default: return Integer.toString(sleepReason); } }
@hide
PowerManager::sleepReasonToString
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT
public static String wakeReasonToString(@WakeReason int wakeReason) { switch (wakeReason) { case WAKE_REASON_UNKNOWN: return "WAKE_REASON_UNKNOWN"; case WAKE_REASON_POWER_BUTTON: return "WAKE_REASON_POWER_BUTTON"; case WAKE_REASON_APPLICATION: return "WAKE_REASON_APPLICATION"; case WAKE_REASON_PLUGGED_IN: return "WAKE_REASON_PLUGGED_IN"; case WAKE_REASON_GESTURE: return "WAKE_REASON_GESTURE"; case WAKE_REASON_CAMERA_LAUNCH: return "WAKE_REASON_CAMERA_LAUNCH"; case WAKE_REASON_WAKE_KEY: return "WAKE_REASON_WAKE_KEY"; case WAKE_REASON_WAKE_MOTION: return "WAKE_REASON_WAKE_MOTION"; case WAKE_REASON_HDMI: return "WAKE_REASON_HDMI"; case WAKE_REASON_LID: return "WAKE_REASON_LID"; case WAKE_REASON_DISPLAY_GROUP_ADDED: return "WAKE_REASON_DISPLAY_GROUP_ADDED"; case WAKE_REASON_DISPLAY_GROUP_TURNED_ON: return "WAKE_REASON_DISPLAY_GROUP_TURNED_ON"; case WAKE_REASON_UNFOLD_DEVICE: return "WAKE_REASON_UNFOLD_DEVICE"; default: return Integer.toString(wakeReason); } }
Convert the wake reason to a string for debugging purposes. @hide
PowerManager::wakeReasonToString
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT
public static String locationPowerSaveModeToString(@LocationPowerSaveMode int mode) { switch (mode) { case LOCATION_MODE_NO_CHANGE: return "NO_CHANGE"; case LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF: return "GPS_DISABLED_WHEN_SCREEN_OFF"; case LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF: return "ALL_DISABLED_WHEN_SCREEN_OFF"; case LOCATION_MODE_FOREGROUND_ONLY: return "FOREGROUND_ONLY"; case LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF: return "THROTTLE_REQUESTS_WHEN_SCREEN_OFF"; default: return Integer.toString(mode); } }
@hide @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"SOUND_TRIGGER_MODE_"}, value = { SOUND_TRIGGER_MODE_ALL_ENABLED, SOUND_TRIGGER_MODE_CRITICAL_ONLY, SOUND_TRIGGER_MODE_ALL_DISABLED, }) public @interface SoundTriggerPowerSaveMode {} /** @hide
WakeData::locationPowerSaveModeToString
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT
public PowerManager(Context context, IPowerManager service, IThermalService thermalService, Handler handler) { mContext = context; mService = service; mThermalService = thermalService; mHandler = handler; }
{@hide}
WakeData::PowerManager
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT
public void setReferenceCounted(boolean value) { synchronized (mToken) { mRefCounted = value; } }
Sets whether this WakeLock is reference counted. <p> Wake locks are reference counted by default. If a wake lock is reference counted, then each call to {@link #acquire()} must be balanced by an equal number of calls to {@link #release()}. If a wake lock is not reference counted, then one call to {@link #release()} is sufficient to undo the effect of all previous calls to {@link #acquire()}. </p> @param value True to make the wake lock reference counted, false to make the wake lock non-reference counted.
WakeLock::setReferenceCounted
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT
public void acquire() { synchronized (mToken) { acquireLocked(); } }
Acquires the wake lock. <p> Ensures that the device is on at the level requested when the wake lock was created. </p>
WakeLock::acquire
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT
public void acquire(long timeout) { synchronized (mToken) { acquireLocked(); mHandler.postDelayed(mReleaser, timeout); } }
Acquires the wake lock with a timeout. <p> Ensures that the device is on at the level requested when the wake lock was created. The lock will be released after the given timeout expires. </p> @param timeout The timeout after which to release the wake lock, in milliseconds.
WakeLock::acquire
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT
public void release() { release(0); }
Releases the wake lock. <p> This method releases your claim to the CPU or screen being on. The screen may turn off shortly after you release the wake lock, or it may not if there are other wake locks still held. </p>
WakeLock::release
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT
public void release(int flags) { synchronized (mToken) { if (mInternalCount > 0) { // internal count must only be decreased if it is > 0 or state of // the WakeLock object is broken. mInternalCount--; } if ((flags & RELEASE_FLAG_TIMEOUT) == 0) { mExternalCount--; } if (!mRefCounted || mInternalCount == 0) { mHandler.removeCallbacks(mReleaser); if (mHeld) { Trace.asyncTraceEnd(Trace.TRACE_TAG_POWER, mTraceName, 0); try { mService.releaseWakeLock(mToken, flags); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } mHeld = false; } } if (mRefCounted && mExternalCount < 0) { throw new RuntimeException("WakeLock under-locked " + mTag); } } }
Releases the wake lock with flags to modify the release behavior. <p> This method releases your claim to the CPU or screen being on. The screen may turn off shortly after you release the wake lock, or it may not if there are other wake locks still held. </p> @param flags Combination of flag values to modify the release behavior. Currently only {@link #RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY} is supported. Passing 0 is equivalent to calling {@link #release()}.
WakeLock::release
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT
public boolean isHeld() { synchronized (mToken) { return mHeld; } }
Returns true if the wake lock has been acquired but not yet released. @return True if the wake lock is held.
WakeLock::isHeld
java
Reginer/aosp-android-jar
android-32/src/android/os/PowerManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/PowerManager.java
MIT