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 IImsCallSession createCallSession(int sessionId, ImsCallProfile profile, IImsCallSessionListener listener) { return null; }
Creates an {@link ImsCallSession} with the specified call profile. Use other methods, if applicable, instead of interacting with {@link ImsCallSession} directly. @param sessionId a session id which is obtained from {@link #startSession} @param profile a call profile to make the call
MMTelFeature::createCallSession
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public IImsCallSession getPendingCallSession(int sessionId, String callId) { return null; }
Retrieves the call session associated with a pending call. @param sessionId a session id which is obtained from {@link #startSession} @param callId a call id to make the call
MMTelFeature::getPendingCallSession
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public ImsUtImplBase getUtInterface() { return null; }
@return The Ut interface for the supplementary service configuration.
MMTelFeature::getUtInterface
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public IImsConfig getConfigInterface() { return null; }
@return The config interface for IMS Configuration
MMTelFeature::getConfigInterface
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public void turnOnIms() { }
Signal the MMTelFeature to turn on IMS when it has been turned off using {@link #turnOffIms}
MMTelFeature::turnOnIms
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public void turnOffIms() { }
Signal the MMTelFeature to turn off IMS when it has been turned on using {@link #turnOnIms}
MMTelFeature::turnOffIms
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public ImsEcbmImplBase getEcbmInterface() { return null; }
@return The Emergency call-back mode interface for emergency VoLTE calls that support it.
MMTelFeature::getEcbmInterface
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public void setUiTTYMode(int uiTtyMode, Message onComplete) { }
Sets the current UI TTY mode for the MMTelFeature. @param uiTtyMode An integer containing the new UI TTY Mode. @param onComplete A {@link Message} to be used when the mode has been set.
MMTelFeature::setUiTTYMode
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public ImsMultiEndpointImplBase getMultiEndpointInterface() { return null; }
@return MultiEndpoint interface for DEP notifications
MMTelFeature::getMultiEndpointInterface
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public void onFeatureRemoved() { }
{@inheritDoc}
MMTelFeature::onFeatureRemoved
java
Reginer/aosp-android-jar
android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/ims/compat/feature/MMTelFeature.java
MIT
public void show() { if (getParent() != null) { if (mFadeOutAnimator.isStarted()) { mFadeOutAnimator.cancel(); } return; } setAlpha(1f); setVisibility(View.VISIBLE); mWindowManager.addView(this, getLayoutParams(mWindowToken)); announceForAccessibility( getContext().getString(R.string.inattentive_sleep_warning_message)); }
Show the warning.
InattentiveSleepWarningView::show
java
Reginer/aosp-android-jar
android-34/src/com/android/systemui/power/InattentiveSleepWarningView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/systemui/power/InattentiveSleepWarningView.java
MIT
public void dismiss(boolean animated) { if (getParent() == null) { return; } mDismissing = true; if (animated) { postOnAnimation(mFadeOutAnimator::start); } else { removeView(); } }
Dismiss the warning.
InattentiveSleepWarningView::dismiss
java
Reginer/aosp-android-jar
android-34/src/com/android/systemui/power/InattentiveSleepWarningView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/systemui/power/InattentiveSleepWarningView.java
MIT
private WindowManager.LayoutParams getLayoutParams(IBinder windowToken) { final WindowManager.LayoutParams lp = new WindowManager.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY, WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, PixelFormat.TRANSLUCENT); lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS; lp.setTitle("InattentiveSleepWarning"); lp.token = windowToken; return lp; }
@param windowToken token for the window
InattentiveSleepWarningView::getLayoutParams
java
Reginer/aosp-android-jar
android-34/src/com/android/systemui/power/InattentiveSleepWarningView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/systemui/power/InattentiveSleepWarningView.java
MIT
void addInstance(Instance instance) { mInstances.add(instance); }
Add an instance to the learner @param instance
Learner::addInstance
java
Reginer/aosp-android-jar
android-31/src/android/gesture/Learner.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/gesture/Learner.java
MIT
ArrayList<Instance> getInstances() { return mInstances; }
Retrieve all the instances @return instances
Learner::getInstances
java
Reginer/aosp-android-jar
android-31/src/android/gesture/Learner.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/gesture/Learner.java
MIT
void removeInstance(long id) { ArrayList<Instance> instances = mInstances; int count = instances.size(); for (int i = 0; i < count; i++) { Instance instance = instances.get(i); if (id == instance.id) { instances.remove(instance); return; } } }
Remove an instance based on its id @param id
Learner::removeInstance
java
Reginer/aosp-android-jar
android-31/src/android/gesture/Learner.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/gesture/Learner.java
MIT
void removeInstances(String name) { final ArrayList<Instance> toDelete = new ArrayList<Instance>(); final ArrayList<Instance> instances = mInstances; final int count = instances.size(); for (int i = 0; i < count; i++) { final Instance instance = instances.get(i); // the label can be null, as specified in Instance if ((instance.label == null && name == null) || (instance.label != null && instance.label.equals(name))) { toDelete.add(instance); } } instances.removeAll(toDelete); }
Remove all the instances of a category @param name the category name
Learner::removeInstances
java
Reginer/aosp-android-jar
android-31/src/android/gesture/Learner.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/gesture/Learner.java
MIT
public static ScriptIntrinsicHistogram create(RenderScript rs, Element e) { if ((!e.isCompatible(Element.U8_4(rs))) && (!e.isCompatible(Element.U8_3(rs))) && (!e.isCompatible(Element.U8_2(rs))) && (!e.isCompatible(Element.U8(rs)))) { throw new RSIllegalArgumentException("Unsupported element type."); } long id = rs.nScriptIntrinsicCreate(9, e.getID(rs)); ScriptIntrinsicHistogram sib = new ScriptIntrinsicHistogram(id, rs); return sib; }
Create an intrinsic for calculating the histogram of an uchar or uchar4 image. Supported elements types are {@link Element#U8_4}, {@link Element#U8_3}, {@link Element#U8_2}, {@link Element#U8} @param rs The RenderScript context @param e Element type for inputs @return ScriptIntrinsicHistogram
ScriptIntrinsicHistogram::create
java
Reginer/aosp-android-jar
android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
MIT
public void forEach(Allocation ain) { forEach(ain, null); }
Process an input buffer and place the histogram into the output allocation. The output allocation may be a narrower vector size than the input. In this case the vector size of the output is used to determine how many of the input channels are used in the computation. This is useful if you have an RGBA input buffer but only want the histogram for RGB. 1D and 2D input allocations are supported. @param ain The input image
ScriptIntrinsicHistogram::forEach
java
Reginer/aosp-android-jar
android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
MIT
public void forEach(Allocation ain, Script.LaunchOptions opt) { if (ain.getType().getElement().getVectorSize() < mOut.getType().getElement().getVectorSize()) { throw new RSIllegalArgumentException( "Input vector size must be >= output vector size."); } if (!ain.getType().getElement().isCompatible(Element.U8(mRS)) && !ain.getType().getElement().isCompatible(Element.U8_2(mRS)) && !ain.getType().getElement().isCompatible(Element.U8_3(mRS)) && !ain.getType().getElement().isCompatible(Element.U8_4(mRS))) { throw new RSIllegalArgumentException("Input type must be U8, U8_1, U8_2 or U8_4."); } forEach(0, ain, null, null, opt); }
Process an input buffer and place the histogram into the output allocation. The output allocation may be a narrower vector size than the input. In this case the vector size of the output is used to determine how many of the input channels are used in the computation. This is useful if you have an RGBA input buffer but only want the histogram for RGB. 1D and 2D input allocations are supported. @param ain The input image @param opt LaunchOptions for clipping
ScriptIntrinsicHistogram::forEach
java
Reginer/aosp-android-jar
android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
MIT
public void setDotCoefficients(float r, float g, float b, float a) { if ((r < 0.f) || (g < 0.f) || (b < 0.f) || (a < 0.f)) { throw new RSIllegalArgumentException("Coefficient may not be negative."); } if ((r + g + b + a) > 1.f) { throw new RSIllegalArgumentException("Sum of coefficients must be 1.0 or less."); } FieldPacker fp = new FieldPacker(16); fp.addF32(r); fp.addF32(g); fp.addF32(b); fp.addF32(a); setVar(0, fp); }
Set the coefficients used for the RGBA to Luminocity calculation. The default is {0.299f, 0.587f, 0.114f, 0.f}. Coefficients must be >= 0 and sum to 1.0 or less. @param r Red coefficient @param g Green coefficient @param b Blue coefficient @param a Alpha coefficient
ScriptIntrinsicHistogram::setDotCoefficients
java
Reginer/aosp-android-jar
android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
MIT
public void setOutput(Allocation aout) { mOut = aout; if (mOut.getType().getElement() != Element.U32(mRS) && mOut.getType().getElement() != Element.U32_2(mRS) && mOut.getType().getElement() != Element.U32_3(mRS) && mOut.getType().getElement() != Element.U32_4(mRS) && mOut.getType().getElement() != Element.I32(mRS) && mOut.getType().getElement() != Element.I32_2(mRS) && mOut.getType().getElement() != Element.I32_3(mRS) && mOut.getType().getElement() != Element.I32_4(mRS)) { throw new RSIllegalArgumentException("Output type must be U32 or I32."); } if ((mOut.getType().getX() != 256) || (mOut.getType().getY() != 0) || mOut.getType().hasMipmaps() || (mOut.getType().getYuv() != 0)) { throw new RSIllegalArgumentException("Output must be 1D, 256 elements."); } setVar(1, aout); }
Set the output of the histogram. 32 bit integer types are supported. @param aout The output allocation
ScriptIntrinsicHistogram::setOutput
java
Reginer/aosp-android-jar
android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
MIT
public void forEach_Dot(Allocation ain) { forEach_Dot(ain, null); }
Process an input buffer and place the histogram into the output allocation. The dot product of the input channel and the coefficients from 'setDotCoefficients' are used to calculate the output values. 1D and 2D input allocations are supported. @param ain The input image
ScriptIntrinsicHistogram::forEach_Dot
java
Reginer/aosp-android-jar
android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
MIT
public void forEach_Dot(Allocation ain, Script.LaunchOptions opt) { if (mOut.getType().getElement().getVectorSize() != 1) { throw new RSIllegalArgumentException("Output vector size must be one."); } if (!ain.getType().getElement().isCompatible(Element.U8(mRS)) && !ain.getType().getElement().isCompatible(Element.U8_2(mRS)) && !ain.getType().getElement().isCompatible(Element.U8_3(mRS)) && !ain.getType().getElement().isCompatible(Element.U8_4(mRS))) { throw new RSIllegalArgumentException("Input type must be U8, U8_1, U8_2 or U8_4."); } forEach(1, ain, null, null, opt); }
Process an input buffer and place the histogram into the output allocation. The dot product of the input channel and the coefficients from 'setDotCoefficients' are used to calculate the output values. 1D and 2D input allocations are supported. @param ain The input image @param opt LaunchOptions for clipping
ScriptIntrinsicHistogram::forEach_Dot
java
Reginer/aosp-android-jar
android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
MIT
public Script.KernelID getKernelID_Separate() { return createKernelID(0, 3, null, null); }
Get a KernelID for this intrinsic kernel. @return Script.KernelID The KernelID object.
ScriptIntrinsicHistogram::getKernelID_Separate
java
Reginer/aosp-android-jar
android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
MIT
public Script.FieldID getFieldID_Input() { return createFieldID(1, null); }
Get a FieldID for the input field of this intrinsic. @return Script.FieldID The FieldID object.
ScriptIntrinsicHistogram::getFieldID_Input
java
Reginer/aosp-android-jar
android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/renderscript/ScriptIntrinsicHistogram.java
MIT
public CredentialElement(@NonNull String key, @NonNull byte[] value) { Preconditions.checkState(key != null && value != null, "neither key or value can be null"); mKey = key; mValue = value; }
Represents an element in {@link PresenceCredential}. @hide @SystemApi public final class CredentialElement implements Parcelable { private final String mKey; private final byte[] mValue; /** Constructs a {@link CredentialElement}.
CredentialElement::CredentialElement
java
Reginer/aosp-android-jar
android-34/src/android/nearby/CredentialElement.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/nearby/CredentialElement.java
MIT
public static void deleteContents(@NonNull File dir) throws IOException { File[] files = dir.listFiles(); if (files != null) { for (File file : files) { if (file.isDirectory()) { deleteContents(file); } file.delete(); } } }
Do not use. Use createTemporaryDirectory instead. Used by frameworks/base unit tests to clean up a temporary directory. Deliberately ignores errors, on the assumption that test cleanup is only supposed to be best-effort. @deprecated Use {@link TestIoUtils#createTemporaryDirectory} instead. @hide
IoUtils::deleteContents
java
Reginer/aosp-android-jar
android-35/src/libcore/io/IoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/libcore/io/IoUtils.java
MIT
public static boolean canOpenReadOnly(String path) { try { // Use open(2) rather than stat(2) so we require fewer permissions. http://b/6485312. FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0); Libcore.os.close(fd); return true; } catch (ErrnoException errnoException) { return false; } }
Do not use. This is for System.loadLibrary use only. Checks whether {@code path} can be opened read-only. Similar to File.exists, but doesn't require read permission on the parent, so it'll work in more cases, and allow you to remove read permission from more directories. Everyone else should just open(2) and then use the fd, but the loadLibrary API is broken by its need to ask ClassLoaders where to find a .so rather than just calling dlopen(3). @hide
IoUtils::canOpenReadOnly
java
Reginer/aosp-android-jar
android-35/src/libcore/io/IoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/libcore/io/IoUtils.java
MIT
public static void throwInterruptedIoException() throws InterruptedIOException { // This is typically thrown in response to an // InterruptedException which does not leave the thread in an // interrupted state, so explicitly interrupt here. Thread.currentThread().interrupt(); // TODO: set InterruptedIOException.bytesTransferred throw new InterruptedIOException(); }
@hide
IoUtils::throwInterruptedIoException
java
Reginer/aosp-android-jar
android-35/src/libcore/io/IoUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/libcore/io/IoUtils.java
MIT
public int originalHashCode() { try { int hashCode = 0; byte[] certData = getInternalCertificate().getEncoded(); for (int i = 1; i < certData.length; i++) { hashCode += certData[i] * i; } return hashCode; } catch (CertificateEncodingException e) { return 0; } }
Returns the original hash code for Certificates pre-JDK 1.8. @return the pre-JDK 1.8 hashcode calculation.
X509CertificateObject::originalHashCode
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/jcajce/provider/asymmetric/x509/X509CertificateObject.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/jcajce/provider/asymmetric/x509/X509CertificateObject.java
MIT
public MediaQualityStatus(@NonNull String imsCallSessionId, @MediaSessionType int mediaSessionType, @TransportType int transportType, @IntRange(from = 0, to = 100) int rtpPacketLossRate, @IntRange(from = 0) int rtpJitterMillis, @IntRange(from = 0) long rptInactivityTimeMillis) { mImsCallSessionId = imsCallSessionId; mMediaSessionType = mediaSessionType; mTransportType = transportType; mRtpPacketLossRate = rtpPacketLossRate; mRtpJitterMillis = rtpJitterMillis; mRtpInactivityTimeMillis = rptInactivityTimeMillis; }
The constructor for MediaQualityStatus, which represents the media quality for each session type ({@link #MEDIA_SESSION_TYPE_AUDIO} or {@link #MEDIA_SESSION_TYPE_VIDEO}) of the IMS call @param imsCallSessionId IMS call session id of this quality status @param mediaSessionType media session type of this quality status @param transportType transport type of this quality status @param rtpPacketLossRate measured RTP packet loss rate in percentage @param rtpJitterMillis measured RTP jitter(RFC3550) in milliseconds @param rptInactivityTimeMillis measured RTP inactivity time in milliseconds
MediaQualityStatus::MediaQualityStatus
java
Reginer/aosp-android-jar
android-34/src/android/telephony/ims/MediaQualityStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/telephony/ims/MediaQualityStatus.java
MIT
public @MediaSessionType int getMediaSessionType() { return mMediaSessionType; }
Retrieves media session type of this quality status
MediaQualityStatus::getMediaSessionType
java
Reginer/aosp-android-jar
android-34/src/android/telephony/ims/MediaQualityStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/telephony/ims/MediaQualityStatus.java
MIT
public @TransportType int getTransportType() { return mTransportType; }
Retrieves Transport type for which this media quality was measured.
MediaQualityStatus::getTransportType
java
Reginer/aosp-android-jar
android-34/src/android/telephony/ims/MediaQualityStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/telephony/ims/MediaQualityStatus.java
MIT
private MediaQualityStatus(@NonNull Parcel in) { mImsCallSessionId = in.readString(); mMediaSessionType = in.readInt(); mTransportType = in.readInt(); mRtpPacketLossRate = in.readInt(); mRtpJitterMillis = in.readInt(); mRtpInactivityTimeMillis = in.readLong(); }
Creates a new instance of {@link MediaQualityStatus} from a parcel. @param in The parceled data to read.
MediaQualityStatus::MediaQualityStatus
java
Reginer/aosp-android-jar
android-34/src/android/telephony/ims/MediaQualityStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/telephony/ims/MediaQualityStatus.java
MIT
protected TLSMessageChannel(InetAddress inetAddr, int port, SIPTransactionStack sipStack, TLSMessageProcessor messageProcessor) throws IOException { if (sipStack.isLoggingEnabled()) { sipStack.getStackLogger().logDebug("creating new TLSMessageChannel (outgoing)"); sipStack.getStackLogger().logStackTrace(); } this.peerAddress = inetAddr; this.peerPort = port; this.myPort = messageProcessor.getPort(); this.peerProtocol = "TLS"; this.sipStack = sipStack; this.tlsMessageProcessor = messageProcessor; this.myAddress = messageProcessor.getIpAddress().getHostAddress(); this.key = MessageChannel.getKey(peerAddress, peerPort, "TLS"); super.messageProcessor = messageProcessor; }
Constructor - connects to the given inet address. @param inetAddr inet address to connect to. @param sipStack is the sip sipStack from which we are created. @param messageProcessor -- the message processor that created us. @throws IOException if we cannot connect.
TLSMessageChannel::TLSMessageChannel
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
MIT
public boolean isReliable() { return true; }
Returns "true" as this is a reliable transport.
TLSMessageChannel::isReliable
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
MIT
public void close() { try { if (mySock != null) mySock.close(); if (sipStack.isLoggingEnabled()) sipStack.getStackLogger().logDebug("Closing message Channel " + this); } catch (IOException ex) { if (sipStack.isLoggingEnabled()) sipStack.getStackLogger().logDebug("Error closing socket " + ex); } }
Close the message channel.
TLSMessageChannel::close
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
MIT
public SIPTransactionStack getSIPStack() { return sipStack; }
Get my SIP Stack. @return The SIP Stack for this message channel.
TLSMessageChannel::getSIPStack
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
MIT
public String getTransport() { return "tls"; }
get the transport string. @return "tcp" in this case.
TLSMessageChannel::getTransport
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
MIT
public String getPeerAddress() { if (peerAddress != null) { return peerAddress.getHostAddress(); } else return getHost(); }
get the address of the client that sent the data to us. @return Address of the client that sent us data that resulted in this channel being created.
TLSMessageChannel::getPeerAddress
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
MIT
private void sendMessage(byte[] msg, boolean retry) throws IOException { Socket sock = this.sipStack.ioHandler.sendBytes( this.getMessageProcessor().getIpAddress(), this.peerAddress, this.peerPort, this.peerProtocol, msg, retry,this); // Created a new socket so close the old one and stick the new // one in its place but dont do this if it is a datagram socket. // (could have replied via udp but received via tcp!). if (sock != mySock && sock != null) { try { if (mySock != null) mySock.close(); } catch (IOException ex) { } mySock = sock; this.myClientInputStream = mySock.getInputStream(); Thread thread = new Thread(this); thread.setDaemon(true); thread.setName("TLSMessageChannelThread"); thread.start(); } }
Send message to whoever is connected to us. Uses the topmost via address to send to. @param msg is the message to send. @param retry
TLSMessageChannel::sendMessage
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
MIT
public void sendMessage(SIPMessage sipMessage) throws IOException { byte[] msg = sipMessage.encodeAsBytes(this.getTransport()); long time = System.currentTimeMillis(); this.sendMessage(msg, sipMessage instanceof SIPRequest); if (this.sipStack.getStackLogger().isLoggingEnabled(ServerLogger.TRACE_MESSAGES)) logMessage(sipMessage, peerAddress, peerPort, time); }
Return a formatted message to the client. We try to re-connect with the peer on the other end if possible. @param sipMessage Message to send. @throws IOException If there is an error sending the message
TLSMessageChannel::sendMessage
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
MIT
public void sendMessage(byte message[], InetAddress receiverAddress, int receiverPort, boolean retry) throws IOException { if (message == null || receiverAddress == null) throw new IllegalArgumentException("Null argument"); Socket sock = this.sipStack.ioHandler.sendBytes(this.messageProcessor.getIpAddress(), receiverAddress, receiverPort, "TLS", message, retry, this); // // Created a new socket so close the old one and s // Check for null (bug fix sent in by Christophe) if (sock != mySock && sock != null) { try { if (mySock != null) mySock.close(); } catch (IOException ex) { /* ignore */ } mySock = sock; this.myClientInputStream = mySock.getInputStream(); // start a new reader on this end of the pipe. Thread mythread = new Thread(this); mythread.setDaemon(true); mythread.setName("TLSMessageChannelThread"); mythread.start(); } }
Send a message to a specified address. @param message Pre-formatted message to send. @param receiverAddress Address to send it to. @param receiverPort Receiver port. @throws IOException If there is a problem connecting or sending.
TLSMessageChannel::sendMessage
java
Reginer/aosp-android-jar
android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/gov/nist/javax/sip/stack/TLSMessageChannel.java
MIT
public static void d(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. if (REQUIRE_PROTOLOGTOOL) { throw new UnsupportedOperationException( "ProtoLog calls MUST be processed with ProtoLogTool"); } }
DEBUG level log. @param group {@code IProtoLogGroup} controlling this log call. @param messageString constant format string for the logged message. @param args parameters to be used with the format string.
ProtoLog::d
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/protolog/common/ProtoLog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/protolog/common/ProtoLog.java
MIT
public static void v(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. if (REQUIRE_PROTOLOGTOOL) { throw new UnsupportedOperationException( "ProtoLog calls MUST be processed with ProtoLogTool"); } }
VERBOSE level log. @param group {@code IProtoLogGroup} controlling this log call. @param messageString constant format string for the logged message. @param args parameters to be used with the format string.
ProtoLog::v
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/protolog/common/ProtoLog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/protolog/common/ProtoLog.java
MIT
public static void i(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. if (REQUIRE_PROTOLOGTOOL) { throw new UnsupportedOperationException( "ProtoLog calls MUST be processed with ProtoLogTool"); } }
INFO level log. @param group {@code IProtoLogGroup} controlling this log call. @param messageString constant format string for the logged message. @param args parameters to be used with the format string.
ProtoLog::i
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/protolog/common/ProtoLog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/protolog/common/ProtoLog.java
MIT
public static void w(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. if (REQUIRE_PROTOLOGTOOL) { throw new UnsupportedOperationException( "ProtoLog calls MUST be processed with ProtoLogTool"); } }
WARNING level log. @param group {@code IProtoLogGroup} controlling this log call. @param messageString constant format string for the logged message. @param args parameters to be used with the format string.
ProtoLog::w
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/protolog/common/ProtoLog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/protolog/common/ProtoLog.java
MIT
public static void e(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. if (REQUIRE_PROTOLOGTOOL) { throw new UnsupportedOperationException( "ProtoLog calls MUST be processed with ProtoLogTool"); } }
ERROR level log. @param group {@code IProtoLogGroup} controlling this log call. @param messageString constant format string for the logged message. @param args parameters to be used with the format string.
ProtoLog::e
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/protolog/common/ProtoLog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/protolog/common/ProtoLog.java
MIT
public static void wtf(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. if (REQUIRE_PROTOLOGTOOL) { throw new UnsupportedOperationException( "ProtoLog calls MUST be processed with ProtoLogTool"); } }
WHAT A TERRIBLE FAILURE level log. @param group {@code IProtoLogGroup} controlling this log call. @param messageString constant format string for the logged message. @param args parameters to be used with the format string.
ProtoLog::wtf
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/protolog/common/ProtoLog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/protolog/common/ProtoLog.java
MIT
public Usb20ASFormatII(int length, byte type, byte subtype, byte formatType, int subclass) { super(length, type, subtype, formatType, subclass); }
TBD
Usb20ASFormatII::Usb20ASFormatII
java
Reginer/aosp-android-jar
android-32/src/com/android/server/usb/descriptors/Usb20ASFormatII.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/usb/descriptors/Usb20ASFormatII.java
MIT
public int getmaxBitRate() { return mMaxBitRate; }
TBD
Usb20ASFormatII::getmaxBitRate
java
Reginer/aosp-android-jar
android-32/src/com/android/server/usb/descriptors/Usb20ASFormatII.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/usb/descriptors/Usb20ASFormatII.java
MIT
public int getSlotsPerFrame() { return mSlotsPerFrame; }
TBD
Usb20ASFormatII::getSlotsPerFrame
java
Reginer/aosp-android-jar
android-32/src/com/android/server/usb/descriptors/Usb20ASFormatII.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/usb/descriptors/Usb20ASFormatII.java
MIT
protected OnKeyboardActionListener getOnKeyboardActionListener() { return mKeyboardActionListener; }
Returns the {@link OnKeyboardActionListener} object. @return the listener attached to this keyboard
KeyboardView::getOnKeyboardActionListener
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public void setKeyboard(Keyboard keyboard) { if (mKeyboard != null) { showPreview(NOT_A_KEY); } // Remove any pending messages removeMessages(); mKeyboard = keyboard; List<Key> keys = mKeyboard.getKeys(); mKeys = keys.toArray(new Key[keys.size()]); requestLayout(); // Hint to reallocate the buffer if the size changed mKeyboardChanged = true; invalidateAllKeys(); computeProximityThreshold(keyboard); mMiniKeyboardCache.clear(); // Not really necessary to do every time, but will free up views // Switching to a different keyboard should abort any pending keys so that the key up // doesn't get delivered to the old or new keyboard mAbortKey = true; // Until the next ACTION_DOWN }
Attaches a keyboard to this view. The keyboard can be switched at any time and the view will re-layout itself to accommodate the keyboard. @see Keyboard @see #getKeyboard() @param keyboard the keyboard to display in this view
KeyboardView::setKeyboard
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public Keyboard getKeyboard() { return mKeyboard; }
Returns the current keyboard being displayed by this view. @return the currently attached keyboard @see #setKeyboard(Keyboard)
KeyboardView::getKeyboard
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public boolean setShifted(boolean shifted) { if (mKeyboard != null) { if (mKeyboard.setShifted(shifted)) { // The whole keyboard probably needs to be redrawn invalidateAllKeys(); return true; } } return false; }
Sets the state of the shift key of the keyboard, if any. @param shifted whether or not to enable the state of the shift key @return true if the shift key state changed, false if there was no change @see KeyboardView#isShifted()
KeyboardView::setShifted
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public boolean isShifted() { if (mKeyboard != null) { return mKeyboard.isShifted(); } return false; }
Returns the state of the shift key of the keyboard, if any. @return true if the shift is in a pressed state, false otherwise. If there is no shift key on the keyboard or there is no keyboard attached, it returns false. @see KeyboardView#setShifted(boolean)
KeyboardView::isShifted
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public void setPreviewEnabled(boolean previewEnabled) { mShowPreview = previewEnabled; }
Enables or disables the key feedback popup. This is a popup that shows a magnified version of the depressed key. By default the preview is enabled. @param previewEnabled whether or not to enable the key feedback popup @see #isPreviewEnabled()
KeyboardView::setPreviewEnabled
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public boolean isPreviewEnabled() { return mShowPreview; }
Returns the enabled state of the key feedback popup. @return whether or not the key feedback popup is enabled @see #setPreviewEnabled(boolean)
KeyboardView::isPreviewEnabled
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public void setProximityCorrectionEnabled(boolean enabled) { mProximityCorrectOn = enabled; }
When enabled, calls to {@link OnKeyboardActionListener#onKey} will include key codes for adjacent keys. When disabled, only the primary key code will be reported. @param enabled whether or not the proximity correction is enabled
KeyboardView::setProximityCorrectionEnabled
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public boolean isProximityCorrectionEnabled() { return mProximityCorrectOn; }
Returns true if proximity correction is enabled.
KeyboardView::isProximityCorrectionEnabled
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public void onClick(View v) { dismissPopupKeyboard(); }
Popup keyboard close button clicked. @hide
KeyboardView::onClick
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
private void computeProximityThreshold(Keyboard keyboard) { if (keyboard == null) return; final Key[] keys = mKeys; if (keys == null) return; int length = keys.length; int dimensionSum = 0; for (int i = 0; i < length; i++) { Key key = keys[i]; dimensionSum += Math.min(key.width, key.height) + key.gap; } if (dimensionSum < 0 || length == 0) return; mProximityThreshold = (int) (dimensionSum * 1.4f / length); mProximityThreshold *= mProximityThreshold; // Square it }
Compute the average distance between adjacent keys (horizontally and vertically) and square it to get the proximity threshold. We use a square here and in computing the touch distance from a key's center to avoid taking a square root. @param keyboard
KeyboardView::computeProximityThreshold
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
private CharSequence getPreviewText(Key key) { if (mInMultiTap) { // Multi-tap mPreviewLabel.setLength(0); mPreviewLabel.append((char) key.codes[mTapCount < 0 ? 0 : mTapCount]); return adjustCase(mPreviewLabel); } else { return adjustCase(key.label); } }
Handle multi-tap keys by producing the key label for the current multi-tap state.
KeyboardView::getPreviewText
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public void invalidateAllKeys() { mDirtyRect.union(0, 0, getWidth(), getHeight()); mDrawPending = true; invalidate(); }
Requests a redraw of the entire keyboard. Calling {@link #invalidate} is not sufficient because the keyboard renders the keys to an off-screen buffer and an invalidate() only draws the cached buffer. @see #invalidateKey(int)
KeyboardView::invalidateAllKeys
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public void invalidateKey(int keyIndex) { if (mKeys == null) return; if (keyIndex < 0 || keyIndex >= mKeys.length) { return; } final Key key = mKeys[keyIndex]; mInvalidatedKey = key; mDirtyRect.union(key.x + mPaddingLeft, key.y + mPaddingTop, key.x + key.width + mPaddingLeft, key.y + key.height + mPaddingTop); onBufferDraw(); invalidate(key.x + mPaddingLeft, key.y + mPaddingTop, key.x + key.width + mPaddingLeft, key.y + key.height + mPaddingTop); }
Invalidates a key so that it will be redrawn on the next repaint. Use this method if only one key is changing it's content. Any changes that affect the position or size of the key may not be honored. @param keyIndex the index of the key in the attached {@link Keyboard}. @see #invalidateAllKeys
KeyboardView::invalidateKey
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
protected boolean onLongPress(Key popupKey) { int popupKeyboardId = popupKey.popupResId; if (popupKeyboardId != 0) { mMiniKeyboardContainer = mMiniKeyboardCache.get(popupKey); if (mMiniKeyboardContainer == null) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService( Context.LAYOUT_INFLATER_SERVICE); mMiniKeyboardContainer = inflater.inflate(mPopupLayout, null); mMiniKeyboard = (KeyboardView) mMiniKeyboardContainer.findViewById( com.android.internal.R.id.keyboardView); View closeButton = mMiniKeyboardContainer.findViewById( com.android.internal.R.id.closeButton); if (closeButton != null) closeButton.setOnClickListener(this); mMiniKeyboard.setOnKeyboardActionListener(new OnKeyboardActionListener() { public void onKey(int primaryCode, int[] keyCodes) { mKeyboardActionListener.onKey(primaryCode, keyCodes); dismissPopupKeyboard(); } public void onText(CharSequence text) { mKeyboardActionListener.onText(text); dismissPopupKeyboard(); } public void swipeLeft() { } public void swipeRight() { } public void swipeUp() { } public void swipeDown() { } public void onPress(int primaryCode) { mKeyboardActionListener.onPress(primaryCode); } public void onRelease(int primaryCode) { mKeyboardActionListener.onRelease(primaryCode); } }); //mInputView.setSuggest(mSuggest); Keyboard keyboard; if (popupKey.popupCharacters != null) { keyboard = new Keyboard(getContext(), popupKeyboardId, popupKey.popupCharacters, -1, getPaddingLeft() + getPaddingRight()); } else { keyboard = new Keyboard(getContext(), popupKeyboardId); } mMiniKeyboard.setKeyboard(keyboard); mMiniKeyboard.setPopupParent(this); mMiniKeyboardContainer.measure( MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.AT_MOST)); mMiniKeyboardCache.put(popupKey, mMiniKeyboardContainer); } else { mMiniKeyboard = (KeyboardView) mMiniKeyboardContainer.findViewById( com.android.internal.R.id.keyboardView); } getLocationInWindow(mCoordinates); mPopupX = popupKey.x + mPaddingLeft; mPopupY = popupKey.y + mPaddingTop; mPopupX = mPopupX + popupKey.width - mMiniKeyboardContainer.getMeasuredWidth(); mPopupY = mPopupY - mMiniKeyboardContainer.getMeasuredHeight(); final int x = mPopupX + mMiniKeyboardContainer.getPaddingRight() + mCoordinates[0]; final int y = mPopupY + mMiniKeyboardContainer.getPaddingBottom() + mCoordinates[1]; mMiniKeyboard.setPopupOffset(x < 0 ? 0 : x, y); mMiniKeyboard.setShifted(isShifted()); mPopupKeyboard.setContentView(mMiniKeyboardContainer); mPopupKeyboard.setWidth(mMiniKeyboardContainer.getMeasuredWidth()); mPopupKeyboard.setHeight(mMiniKeyboardContainer.getMeasuredHeight()); mPopupKeyboard.showAtLocation(this, Gravity.NO_GRAVITY, x, y); mMiniKeyboardOnScreen = true; //mMiniKeyboard.onTouchEvent(getTranslatedEvent(me)); invalidateAllKeys(); return true; } return false; }
Called when a key is long pressed. By default this will open any popup keyboard associated with this key through the attributes popupLayout and popupCharacters. @param popupKey the key that was long pressed @return true if the long press is handled, false otherwise. Subclasses should call the method on the base class if the subclass doesn't wish to handle the call.
KeyboardView::onLongPress
java
Reginer/aosp-android-jar
android-32/src/android/inputmethodservice/KeyboardView.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/inputmethodservice/KeyboardView.java
MIT
public void destroy() { if (mNativeListener == 0) { return; } unregister(this); nativeDestroy(mNativeListener); mNativeListener = 0; }
Destroys the listener.
TunnelModeEnabledListener::destroy
java
Reginer/aosp-android-jar
android-34/src/android/view/TunnelModeEnabledListener.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/TunnelModeEnabledListener.java
MIT
public static void register(TunnelModeEnabledListener listener) { if (listener.mNativeListener == 0) { return; } nativeRegister(listener.mNativeListener); }
Registers a listener.
TunnelModeEnabledListener::register
java
Reginer/aosp-android-jar
android-34/src/android/view/TunnelModeEnabledListener.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/TunnelModeEnabledListener.java
MIT
public static void unregister(TunnelModeEnabledListener listener) { if (listener.mNativeListener == 0) { return; } nativeUnregister(listener.mNativeListener); }
Unregisters a listener.
TunnelModeEnabledListener::unregister
java
Reginer/aosp-android-jar
android-34/src/android/view/TunnelModeEnabledListener.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/TunnelModeEnabledListener.java
MIT
public void reset() { mAllowDraggingOffscreen = false; mIsDragging = false; mStartedDragging = false; mIsUserInteracting = false; mLastTouchDisplayId = Display.INVALID_DISPLAY; }
Resets this state.
PipTouchState::reset
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public void onTouchEvent(MotionEvent ev) { mLastTouchDisplayId = ev.getDisplayId(); switch (ev.getActionMasked()) { case MotionEvent.ACTION_DOWN: { if (!mAllowTouches) { return; } // Initialize the velocity tracker initOrResetVelocityTracker(); addMovementToVelocityTracker(ev); mActivePointerId = ev.getPointerId(0); if (DEBUG) { Log.e(TAG, "Setting active pointer id on DOWN: " + mActivePointerId); } mLastTouch.set(ev.getRawX(), ev.getRawY()); mDownTouch.set(mLastTouch); mAllowDraggingOffscreen = true; mIsUserInteracting = true; mDownTouchTime = ev.getEventTime(); mIsDoubleTap = !mPreviouslyDragging && (mDownTouchTime - mLastDownTouchTime) < DOUBLE_TAP_TIMEOUT; mIsWaitingForDoubleTap = false; mIsDragging = false; mLastDownTouchTime = mDownTouchTime; if (mDoubleTapTimeoutCallback != null) { mMainExecutor.removeCallbacks(mDoubleTapTimeoutCallback); } break; } case MotionEvent.ACTION_MOVE: { // Skip event if we did not start processing this touch gesture if (!mIsUserInteracting) { break; } // Update the velocity tracker addMovementToVelocityTracker(ev); int pointerIndex = ev.findPointerIndex(mActivePointerId); if (pointerIndex == -1) { Log.e(TAG, "Invalid active pointer id on MOVE: " + mActivePointerId); break; } float x = ev.getRawX(pointerIndex); float y = ev.getRawY(pointerIndex); mLastDelta.set(x - mLastTouch.x, y - mLastTouch.y); mDownDelta.set(x - mDownTouch.x, y - mDownTouch.y); boolean hasMovedBeyondTap = mDownDelta.length() > mViewConfig.getScaledTouchSlop(); if (!mIsDragging) { if (hasMovedBeyondTap) { mIsDragging = true; mStartedDragging = true; } } else { mStartedDragging = false; } mLastTouch.set(x, y); break; } case MotionEvent.ACTION_POINTER_UP: { // Skip event if we did not start processing this touch gesture if (!mIsUserInteracting) { break; } // Update the velocity tracker addMovementToVelocityTracker(ev); int pointerIndex = ev.getActionIndex(); int pointerId = ev.getPointerId(pointerIndex); if (pointerId == mActivePointerId) { // Select a new active pointer id and reset the movement state final int newPointerIndex = (pointerIndex == 0) ? 1 : 0; mActivePointerId = ev.getPointerId(newPointerIndex); if (DEBUG) { Log.e(TAG, "Relinquish active pointer id on POINTER_UP: " + mActivePointerId); } mLastTouch.set(ev.getRawX(newPointerIndex), ev.getRawY(newPointerIndex)); } break; } case MotionEvent.ACTION_UP: { // Skip event if we did not start processing this touch gesture if (!mIsUserInteracting) { break; } // Update the velocity tracker addMovementToVelocityTracker(ev); mVelocityTracker.computeCurrentVelocity(1000, mViewConfig.getScaledMaximumFlingVelocity()); mVelocity.set(mVelocityTracker.getXVelocity(), mVelocityTracker.getYVelocity()); int pointerIndex = ev.findPointerIndex(mActivePointerId); if (pointerIndex == -1) { Log.e(TAG, "Invalid active pointer id on UP: " + mActivePointerId); break; } mUpTouchTime = ev.getEventTime(); mLastTouch.set(ev.getRawX(pointerIndex), ev.getRawY(pointerIndex)); mPreviouslyDragging = mIsDragging; mIsWaitingForDoubleTap = !mIsDoubleTap && !mIsDragging && (mUpTouchTime - mDownTouchTime) < DOUBLE_TAP_TIMEOUT; // Fall through to clean up } case MotionEvent.ACTION_CANCEL: { recycleVelocityTracker(); break; } case MotionEvent.ACTION_BUTTON_PRESS: { removeHoverExitTimeoutCallback(); break; } } }
Processes a given touch event and updates the state.
PipTouchState::onTouchEvent
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public PointF getVelocity() { return mVelocity; }
@return the velocity of the active touch pointer at the point it is lifted off the screen.
PipTouchState::getVelocity
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public PointF getLastTouchPosition() { return mLastTouch; }
@return the last touch position of the active pointer.
PipTouchState::getLastTouchPosition
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public PointF getLastTouchDelta() { return mLastDelta; }
@return the movement delta between the last handled touch event and the previous touch position.
PipTouchState::getLastTouchDelta
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public PointF getDownTouchPosition() { return mDownTouch; }
@return the down touch position.
PipTouchState::getDownTouchPosition
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public PointF getDownTouchDelta() { return mDownDelta; }
@return the movement delta between the last handled touch event and the down touch position.
PipTouchState::getDownTouchDelta
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public boolean isDragging() { return mIsDragging; }
@return whether the user has started dragging.
PipTouchState::isDragging
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public boolean isUserInteracting() { return mIsUserInteracting; }
@return whether the user is currently interacting with the PiP.
PipTouchState::isUserInteracting
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public boolean startedDragging() { return mStartedDragging; }
@return whether the user has started dragging just in the last handled touch event.
PipTouchState::startedDragging
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public int getLastTouchDisplayId() { return mLastTouchDisplayId; }
@return Display ID of the last touch event.
PipTouchState::getLastTouchDisplayId
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public void setAllowTouches(boolean allowTouches) { mAllowTouches = allowTouches; // If the user happens to touch down before this is sent from the system during a transition // then block any additional handling by resetting the state now if (mIsUserInteracting) { reset(); } }
Sets whether touching is currently allowed.
PipTouchState::setAllowTouches
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public void setDisallowDraggingOffscreen() { mAllowDraggingOffscreen = false; }
Disallows dragging offscreen for the duration of the current gesture.
PipTouchState::setDisallowDraggingOffscreen
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public boolean allowDraggingOffscreen() { return mAllowDraggingOffscreen; }
@return whether dragging offscreen is allowed during this gesture.
PipTouchState::allowDraggingOffscreen
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public boolean isDoubleTap() { return mIsDoubleTap; }
@return whether this gesture is a double-tap.
PipTouchState::isDoubleTap
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public boolean isWaitingForDoubleTap() { return mIsWaitingForDoubleTap; }
@return whether this gesture will potentially lead to a following double-tap.
PipTouchState::isWaitingForDoubleTap
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public void scheduleDoubleTapTimeoutCallback() { if (mIsWaitingForDoubleTap) { long delay = getDoubleTapTimeoutCallbackDelay(); mMainExecutor.removeCallbacks(mDoubleTapTimeoutCallback); mMainExecutor.executeDelayed(mDoubleTapTimeoutCallback, delay); } }
Schedules the callback to run if the next double tap does not occur. Only runs if isWaitingForDoubleTap() is true.
PipTouchState::scheduleDoubleTapTimeoutCallback
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
public void removeDoubleTapTimeoutCallback() { mIsWaitingForDoubleTap = false; mMainExecutor.removeCallbacks(mDoubleTapTimeoutCallback); }
Removes the timeout callback if it's in queue.
PipTouchState::removeDoubleTapTimeoutCallback
java
Reginer/aosp-android-jar
android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/wm/shell/pip/phone/PipTouchState.java
MIT
protected URLConnection openConnection(URL u, Proxy p) throws IOException { throw new UnsupportedOperationException("Method not implemented."); }
Same as openConnection(URL), except that the connection will be made through the specified proxy; Protocol handlers that do not support proxying will ignore the proxy parameter and make a normal connection. Calling this method preempts the system's default ProxySelector settings. @param u the URL that this connects to. @param p the proxy through which the connection will be made. If direct connection is desired, Proxy.NO_PROXY should be specified. @return a {@code URLConnection} object for the {@code URL}. @exception IOException if an I/O error occurs while opening the connection. @exception IllegalArgumentException if either u or p is null, or p has the wrong type. @exception UnsupportedOperationException if the subclass that implements the protocol doesn't support this method. @since 1.5
URLStreamHandler::openConnection
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
protected void parseURL(URL u, String spec, int start, int limit) { // These fields may receive context content if this was relative URL String protocol = u.getProtocol(); String authority = u.getAuthority(); String userInfo = u.getUserInfo(); String host = u.getHost(); int port = u.getPort(); String path = u.getPath(); String query = u.getQuery(); // This field has already been parsed String ref = u.getRef(); boolean isRelPath = false; boolean queryOnly = false; // BEGIN Android-changed: App compat. boolean querySet = false; // END Android-changed: App compat. // FIX: should not assume query if opaque // Strip off the query part if (start < limit) { int queryStart = spec.indexOf('?'); queryOnly = queryStart == start; if ((queryStart != -1) && (queryStart < limit)) { query = spec.substring(queryStart+1, limit); if (limit > queryStart) limit = queryStart; spec = spec.substring(0, queryStart); // BEGIN Android-changed: App compat. querySet = true; // END Android-changed: App compat. } } int i = 0; // Parse the authority part if any // BEGIN Android-changed: App compat. // boolean isUNCName = (start <= limit - 4) && // (spec.charAt(start) == '/') && // (spec.charAt(start + 1) == '/') && // (spec.charAt(start + 2) == '/') && // (spec.charAt(start + 3) == '/'); boolean isUNCName = false; // END Android-changed: App compat. if (!isUNCName && (start <= limit - 2) && (spec.charAt(start) == '/') && (spec.charAt(start + 1) == '/')) { start += 2; // BEGIN Android-changed: Check for all hostname termination chars. http://b/110955991 /* i = spec.indexOf('/', start); if (i < 0 || i > limit) { i = spec.indexOf('?', start); if (i < 0 || i > limit) i = limit; } */ LOOP: for (i = start; i < limit; i++) { switch (spec.charAt(i)) { case '/': // Start of path case '\\': // Start of path - see https://url.spec.whatwg.org/#host-state case '?': // Start of query case '#': // Start of fragment break LOOP; } } // END Android-changed: Check for all hostname termination chars. http://b/110955991 host = authority = spec.substring(start, i); int ind = authority.indexOf('@'); if (ind != -1) { if (ind != authority.lastIndexOf('@')) { // more than one '@' in authority. This is not server based userInfo = null; host = null; } else { userInfo = authority.substring(0, ind); host = authority.substring(ind+1); } } else { userInfo = null; } if (host != null) { // If the host is surrounded by [ and ] then its an IPv6 // literal address as specified in RFC2732 if (host.length()>0 && (host.charAt(0) == '[')) { if ((ind = host.indexOf(']')) > 2) { String nhost = host ; host = nhost.substring(0,ind+1); if (!IPAddressUtil. isIPv6LiteralAddress(host.substring(1, ind))) { throw new IllegalArgumentException( "Invalid host: "+ host); } port = -1 ; if (nhost.length() > ind+1) { if (nhost.charAt(ind+1) == ':') { ++ind ; // port can be null according to RFC2396 if (nhost.length() > (ind + 1)) { port = Integer.parseInt(nhost.substring(ind+1)); } } else { throw new IllegalArgumentException( "Invalid authority field: " + authority); } } } else { throw new IllegalArgumentException( "Invalid authority field: " + authority); } } else { ind = host.indexOf(':'); port = -1; if (ind >= 0) { // port can be null according to RFC2396 if (host.length() > (ind + 1)) { // BEGIN Android-changed: App compat. // port = Integer.parseInt(host.substring(ind + 1)); char firstPortChar = host.charAt(ind+1); if (firstPortChar >= '0' && firstPortChar <= '9') { port = Integer.parseInt(host.substring(ind + 1)); } else { throw new IllegalArgumentException("invalid port: " + host.substring(ind + 1)); } // END Android-changed: App compat. } host = host.substring(0, ind); } } } else { host = ""; } if (port < -1) throw new IllegalArgumentException("Invalid port number :" + port); start = i; // If the authority is defined then the path is defined by the // spec only; See RFC 2396 Section 5.2.4. // BEGIN Android-changed: App compat. // if (authority != null && authority.length() > 0) // path = ""; path = null; if (!querySet) { query = null; } // END Android-changed: App compat. } if (host == null) { host = ""; } // Parse the file path if any if (start < limit) { // Android-changed: Check for all hostname termination chars. http://b/110955991 // if (spec.charAt(start) == '/') { if (spec.charAt(start) == '/' || spec.charAt(start) == '\\') { path = spec.substring(start, limit); } else if (path != null && path.length() > 0) { isRelPath = true; int ind = path.lastIndexOf('/'); String seperator = ""; if (ind == -1 && authority != null) seperator = "/"; path = path.substring(0, ind + 1) + seperator + spec.substring(start, limit); } else { String seperator = (authority != null) ? "/" : ""; path = seperator + spec.substring(start, limit); } } // BEGIN Android-changed: App compat. //else if (queryOnly && path != null) { // int ind = path.lastIndexOf('/'); // if (ind < 0) // ind = 0; // path = path.substring(0, ind) + "/"; //} // END Android-changed: App compat. if (path == null) path = ""; // BEGIN Android-changed: always assume isRelPath is true. //if (isRelPath) { if (true) { // END Android-changed: always assume isRelPath is true. // Remove embedded /./ while ((i = path.indexOf("/./")) >= 0) { path = path.substring(0, i) + path.substring(i + 2); } // Remove embedded /../ if possible i = 0; while ((i = path.indexOf("/../", i)) >= 0) { // BEGIN Android-changed: App compat. /* * Trailing /../ */ if (i == 0) { path = path.substring(i + 3); i = 0; // END Android-changed: App compat. /* * A "/../" will cancel the previous segment and itself, * unless that segment is a "/../" itself * i.e. "/a/b/../c" becomes "/a/c" * but "/../../a" should stay unchanged */ // Android-changed: App compat. // if (i > 0 && (limit = path.lastIndexOf('/', i - 1)) >= 0 && } else if (i > 0 && (limit = path.lastIndexOf('/', i - 1)) >= 0 && (path.indexOf("/../", limit) != 0)) { path = path.substring(0, limit) + path.substring(i + 3); i = 0; } else { i = i + 3; } } // Remove trailing .. if possible while (path.endsWith("/..")) { i = path.indexOf("/.."); if ((limit = path.lastIndexOf('/', i - 1)) >= 0) { path = path.substring(0, limit+1); } else { break; } } // Remove starting . if (path.startsWith("./") && path.length() > 2) path = path.substring(2); // Remove trailing . if (path.endsWith("/.")) path = path.substring(0, path.length() -1); // Android-changed: App compat: Remove trailing '?'. if (path.endsWith("?")) path = path.substring(0, path.length() -1); } setURL(u, protocol, host, port, authority, userInfo, path, query, ref); }
Parses the string representation of a {@code URL} into a {@code URL} object. <p> If there is any inherited context, then it has already been copied into the {@code URL} argument. <p> The {@code parseURL} method of {@code URLStreamHandler} parses the string representation as if it were an {@code http} specification. Most URL protocol families have a similar parsing. A stream protocol handler for a protocol that has a different syntax must override this routine. @param u the {@code URL} to receive the result of parsing the spec. @param spec the {@code String} representing the URL that must be parsed. @param start the character index at which to begin parsing. This is just past the '{@code :}' (if there is one) that specifies the determination of the protocol name. @param limit the character position to stop parsing at. This is the end of the string or the position of the "{@code #}" character, if present. All information after the sharp sign indicates an anchor.
URLStreamHandler::parseURL
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
protected int getDefaultPort() { return -1; }
Returns the default port for a URL parsed by this handler. This method is meant to be overidden by handlers with default port numbers. @return the default port for a {@code URL} parsed by this handler. @since 1.3
URLStreamHandler::getDefaultPort
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
protected boolean equals(URL u1, URL u2) { // Android-changed: Avoid network I/O. return Objects.equals(u1.getRef(), u2.getRef()) && Objects.equals(u1.getQuery(), u2.getQuery()) && // sameFile compares the protocol, file, port & host components of // the URLs. sameFile(u1, u2); }
Provides the default equals calculation. May be overidden by handlers for other protocols that have different requirements for equals(). This method requires that none of its arguments is null. This is guaranteed by the fact that it is only called by java.net.URL class. @param u1 a URL object @param u2 a URL object @return {@code true} if the two urls are considered equal, ie. they refer to the same fragment in the same file. @since 1.3
URLStreamHandler::equals
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
protected int hashCode(URL u) { // Android-changed: Avoid network I/O. // Hash on the same set of fields that we compare in equals(). return Objects.hash( u.getRef(), u.getQuery(), u.getProtocol(), u.getFile(), u.getHost(), u.getPort()); }
Provides the default hash calculation. May be overidden by handlers for other protocols that have different requirements for hashCode calculation. @param u a URL object @return an {@code int} suitable for hash table indexing @since 1.3
URLStreamHandler::hashCode
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
protected boolean sameFile(URL u1, URL u2) { // Compare the protocols. if (!((u1.getProtocol() == u2.getProtocol()) || (u1.getProtocol() != null && u1.getProtocol().equalsIgnoreCase(u2.getProtocol())))) return false; // Compare the files. if (!(u1.getFile() == u2.getFile() || (u1.getFile() != null && u1.getFile().equals(u2.getFile())))) return false; // Compare the ports. int port1, port2; port1 = (u1.getPort() != -1) ? u1.getPort() : u1.handler.getDefaultPort(); port2 = (u2.getPort() != -1) ? u2.getPort() : u2.handler.getDefaultPort(); if (port1 != port2) return false; // Compare the hosts. if (!hostsEqual(u1, u2)) return false; return true; }
Compare two urls to see whether they refer to the same file, i.e., having the same protocol, host, port, and path. This method requires that none of its arguments is null. This is guaranteed by the fact that it is only called indirectly by java.net.URL class. @param u1 a URL object @param u2 a URL object @return true if u1 and u2 refer to the same file @since 1.3
URLStreamHandler::sameFile
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
protected synchronized InetAddress getHostAddress(URL u) { if (u.hostAddress != null) return u.hostAddress; String host = u.getHost(); if (host == null || host.equals("")) { return null; } else { try { u.hostAddress = InetAddress.getByName(host); } catch (UnknownHostException ex) { return null; } catch (SecurityException se) { return null; } } return u.hostAddress; }
Get the IP address of our host. An empty host field or a DNS failure will result in a null return. @param u a URL object @return an {@code InetAddress} representing the host IP address. @since 1.3
URLStreamHandler::getHostAddress
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
protected boolean hostsEqual(URL u1, URL u2) { // Android-changed: Don't compare the InetAddresses of the hosts. if (u1.getHost() != null && u2.getHost() != null) return u1.getHost().equalsIgnoreCase(u2.getHost()); else return u1.getHost() == null && u2.getHost() == null; }
Compares the host components of two URLs. @param u1 the URL of the first host to compare @param u2 the URL of the second host to compare @return {@code true} if and only if they are equal, {@code false} otherwise. @since 1.3
URLStreamHandler::hostsEqual
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
protected String toExternalForm(URL u) { // pre-compute length of StringBuffer int len = u.getProtocol().length() + 1; if (u.getAuthority() != null && u.getAuthority().length() > 0) len += 2 + u.getAuthority().length(); if (u.getPath() != null) { len += u.getPath().length(); } if (u.getQuery() != null) { len += 1 + u.getQuery().length(); } if (u.getRef() != null) len += 1 + u.getRef().length(); // BEGIN Android-changed: New toExternalForm variant that optionally escapes illegal chars. // TODO: The variant has been removed. We can potentially revert the change StringBuilder result = new StringBuilder(len); result.append(u.getProtocol()); result.append(":"); if (u.getAuthority() != null) {// ANDROID: && u.getAuthority().length() > 0) { result.append("//"); result.append(u.getAuthority()); } String fileAndQuery = u.getFile(); if (fileAndQuery != null) { result.append(fileAndQuery); } // END Android-changed: New toExternalForm variant that optionally escapes illegal chars. if (u.getRef() != null) { result.append("#"); result.append(u.getRef()); } return result.toString(); }
Converts a {@code URL} of a specific protocol to a {@code String}. @param u the URL. @return a string representation of the {@code URL} argument.
URLStreamHandler::toExternalForm
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
protected void setURL(URL u, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) { if (this != u.handler) { throw new SecurityException("handler for url different from " + "this handler"); } // ensure that no one can reset the protocol on a given URL. u.set(u.getProtocol(), host, port, authority, userInfo, path, query, ref); }
Sets the fields of the {@code URL} argument to the indicated values. Only classes derived from URLStreamHandler are able to use this method to set the values of the URL fields. @param u the URL to modify. @param protocol the protocol name. @param host the remote host value for the URL. @param port the port on the remote machine. @param authority the authority part for the URL. @param userInfo the userInfo part of the URL. @param path the path component of the URL. @param query the query part for the URL. @param ref the reference. @exception SecurityException if the protocol handler of the URL is different from this one @since 1.3
URLStreamHandler::setURL
java
Reginer/aosp-android-jar
android-31/src/java/net/URLStreamHandler.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/net/URLStreamHandler.java
MIT
public IllegalSelectorException() { }
Constructs an instance of this class.
IllegalSelectorException::IllegalSelectorException
java
Reginer/aosp-android-jar
android-35/src/java/nio/channels/IllegalSelectorException.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/java/nio/channels/IllegalSelectorException.java
MIT