code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
844 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public int getManagedProfileUserId() { List<UserHandle> allProfiles = mUserManager.getAllProfiles(); for (UserHandle uh : allProfiles) { int id = uh.getIdentifier(); if (mUserManager.isManagedProfile(id)) { return id; } } return USER_NULL; }
Returns the user id of the managed profile, and returns {@code USER_NULL} otherwise
WorkPolicyUtils::getManagedProfileUserId
java
Reginer/aosp-android-jar
android-34/src/com/android/settingslib/utils/WorkPolicyUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/settingslib/utils/WorkPolicyUtils.java
MIT
public static IntentBroadcaster getInstance(Context context) { if (sIntentBroadcaster == null) { sIntentBroadcaster = new IntentBroadcaster(context); } return sIntentBroadcaster; }
Method to get an instance of IntentBroadcaster after creating one if needed. @return IntentBroadcaster instance
IntentBroadcaster::getInstance
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/telephony/IntentBroadcaster.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/telephony/IntentBroadcaster.java
MIT
public void broadcastStickyIntent(Context context, Intent intent, int phoneId) { logd("Broadcasting and adding intent for rebroadcast: " + intent.getAction() + " " + intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE) + " for phoneId " + phoneId); synchronized (mRebroadcastIntents) { context.sendStickyBroadcastAsUser(intent, UserHandle.ALL); mRebroadcastIntents.put(phoneId, intent); } }
Wrapper for ActivityManager.broadcastStickyIntent() that also stores intent to be rebroadcast on USER_UNLOCKED
IntentBroadcaster::broadcastStickyIntent
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/telephony/IntentBroadcaster.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/telephony/IntentBroadcaster.java
MIT
public OverlayIdentifier getIdentifier() { return new OverlayIdentifier( mOverlay.packageName, TextUtils.nullIfEmpty(mOverlay.overlayName)); }
Fabricated Runtime Resource Overlays (FRROs) are overlays generated ar runtime. Fabricated overlays are enabled, disabled, and reordered just like normal overlays. The overlayable policies a fabricated overlay fulfills are the same policies the creator of the overlay fulfill. For example, a fabricated overlay created by a platform signed package on the system partition would fulfil the {@code system} and {@code signature} policies. The owner of a fabricated overlay is the UID that created it. Overlays commit to the overlay manager persist across reboots. When the UID is uninstalled, its fabricated overlays are wiped. Processes with {@link Android.Manifest.permission.CHANGE_OVERLAY_PACKAGES} can manage normal overlays and fabricated overlays. @hide public class FabricatedOverlay { /** Retrieves the identifier for this fabricated overlay.
FabricatedOverlay::getIdentifier
java
Reginer/aosp-android-jar
android-33/src/android/content/om/FabricatedOverlay.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/om/FabricatedOverlay.java
MIT
public Builder(@NonNull String owningPackage, @NonNull String name, @NonNull String targetPackage) { Preconditions.checkStringNotEmpty(owningPackage, "'owningPackage' must not be empty nor null"); Preconditions.checkStringNotEmpty(name, "'name'' must not be empty nor null"); Preconditions.checkStringNotEmpty(targetPackage, "'targetPackage' must not be empty nor null"); mOwningPackage = owningPackage; mName = name; mTargetPackage = targetPackage; }
Constructs a build for a fabricated overlay. @param owningPackage the name of the package that owns the fabricated overlay (must be a package name of this UID). @param name a name used to uniquely identify the fabricated overlay owned by {@param owningPackageName} @param targetPackage the name of the package to overlay
Builder::Builder
java
Reginer/aosp-android-jar
android-33/src/android/content/om/FabricatedOverlay.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/om/FabricatedOverlay.java
MIT
public Builder setTargetOverlayable(@Nullable String targetOverlayable) { mTargetOverlayable = TextUtils.emptyIfNull(targetOverlayable); return this; }
Sets the name of the overlayable resources to overlay (can be null).
Builder::setTargetOverlayable
java
Reginer/aosp-android-jar
android-33/src/android/content/om/FabricatedOverlay.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/om/FabricatedOverlay.java
MIT
public Builder setResourceValue(@NonNull String resourceName, int dataType, int value) { final FabricatedOverlayInternalEntry entry = new FabricatedOverlayInternalEntry(); entry.resourceName = resourceName; entry.dataType = dataType; entry.data = value; mEntries.add(entry); return this; }
Sets the value of @param resourceName name of the target resource to overlay (in the form [package]:type/entry) @param dataType the data type of the new value @param value the unsigned 32 bit integer representing the new value @see android.util.TypedValue#type
Builder::setResourceValue
java
Reginer/aosp-android-jar
android-33/src/android/content/om/FabricatedOverlay.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/om/FabricatedOverlay.java
MIT
public FabricatedOverlay build() { final FabricatedOverlayInternal overlay = new FabricatedOverlayInternal(); overlay.packageName = mOwningPackage; overlay.overlayName = mName; overlay.targetPackageName = mTargetPackage; overlay.targetOverlayable = mTargetOverlayable; overlay.entries = new ArrayList<>(); overlay.entries.addAll(mEntries); return new FabricatedOverlay(overlay); }
Sets the value of @param resourceName name of the target resource to overlay (in the form [package]:type/entry) @param dataType the data type of the new value @param value the unsigned 32 bit integer representing the new value @see android.util.TypedValue#type public Builder setResourceValue(@NonNull String resourceName, int dataType, int value) { final FabricatedOverlayInternalEntry entry = new FabricatedOverlayInternalEntry(); entry.resourceName = resourceName; entry.dataType = dataType; entry.data = value; mEntries.add(entry); return this; } /** Builds an immutable fabricated overlay.
Builder::build
java
Reginer/aosp-android-jar
android-33/src/android/content/om/FabricatedOverlay.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/content/om/FabricatedOverlay.java
MIT
public CertificateException() { super(); }
Constructs a certificate exception with no detail message. A detail message is a String that describes this particular exception.
CertificateException::CertificateException
java
Reginer/aosp-android-jar
android-31/src/java/security/cert/CertificateException.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/security/cert/CertificateException.java
MIT
public CertificateException(String msg) { super(msg); }
Constructs a certificate exception with the given detail message. A detail message is a String that describes this particular exception. @param msg the detail message.
CertificateException::CertificateException
java
Reginer/aosp-android-jar
android-31/src/java/security/cert/CertificateException.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/security/cert/CertificateException.java
MIT
public CertificateException(String message, Throwable cause) { super(message, cause); }
Creates a {@code CertificateException} with the specified detail message and cause. @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method). @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.) @since 1.5
CertificateException::CertificateException
java
Reginer/aosp-android-jar
android-31/src/java/security/cert/CertificateException.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/security/cert/CertificateException.java
MIT
public CertificateException(Throwable cause) { super(cause); }
Creates a {@code CertificateException} with the specified cause and a detail message of {@code (cause==null ? null : cause.toString())} (which typically contains the class and detail message of {@code cause}). @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.) @since 1.5
CertificateException::CertificateException
java
Reginer/aosp-android-jar
android-31/src/java/security/cert/CertificateException.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/security/cert/CertificateException.java
MIT
public static float[] flatBound(float[] poly, int dimension) { int polySize = poly.length/dimension; float left = poly[0]; float right = poly[0]; float top = poly[1]; float bottom = poly[1]; for (int i = 0; i < polySize; i++) { float x = poly[i * dimension + 0]; float y = poly[i * dimension + 1]; if (left > x) { left = x; } else if (right < x) { right = x; } if (top > y) { top = y; } else if (bottom < y) { bottom = y; } } return new float[]{left, top, right, bottom}; }
@return Rect bound of flattened (ignoring z). LTRB @param dimension - 2D or 3D
Math3DHelper::flatBound
java
Reginer/aosp-android-jar
android-32/src/android/view/math/Math3DHelper.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/view/math/Math3DHelper.java
MIT
public static void translate(float[] poly, float translateX, float translateY, int dimension) { int polySize = poly.length/dimension; for (int i = 0; i < polySize; i++) { poly[i * dimension + 0] += translateX; poly[i * dimension + 1] += translateY; } }
Translate the polygon to x and y @param dimension in what dimension is polygon represented (supports 2 or 3D).
Math3DHelper::translate
java
Reginer/aosp-android-jar
android-32/src/android/view/math/Math3DHelper.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/view/math/Math3DHelper.java
MIT
public void appendDataTo(StringBuilder stringBuilder) { stringBuilder.append(buffer); }
Appends this node's text content to the given builder.
CharacterDataImpl::appendDataTo
java
Reginer/aosp-android-jar
android-33/src/org/apache/harmony/xml/dom/CharacterDataImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/apache/harmony/xml/dom/CharacterDataImpl.java
MIT
public DecryptedChunkKvOutput(ChunkHasher chunkHasher) { mChunkHasher = chunkHasher; }
Builds a key value backup set from plaintext chunks. Computes a digest over the sorted SHA-256 hashes of the chunks. public class DecryptedChunkKvOutput implements DecryptedChunkOutput { @VisibleForTesting static final String DIGEST_ALGORITHM = "SHA-256"; private final ChunkHasher mChunkHasher; private final List<KeyValuePairProto.KeyValuePair> mUnsortedPairs = new ArrayList<>(); private final List<ChunkHash> mUnsortedHashes = new ArrayList<>(); private boolean mClosed; /** Constructs a new instance which computers the digest using the given hasher.
DecryptedChunkKvOutput::DecryptedChunkKvOutput
java
Reginer/aosp-android-jar
android-31/src/com/android/server/backup/encryption/kv/DecryptedChunkKvOutput.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/backup/encryption/kv/DecryptedChunkKvOutput.java
MIT
public List<KeyValuePairProto.KeyValuePair> getPairs() { checkState(mClosed, "Must close() before getPairs()"); Collections.sort( mUnsortedPairs, new Comparator<KeyValuePairProto.KeyValuePair>() { @Override public int compare( KeyValuePairProto.KeyValuePair o1, KeyValuePairProto.KeyValuePair o2) { return o1.key.compareTo(o2.key); } }); return mUnsortedPairs; }
Returns the key value pairs from the backup, sorted lexicographically by key. <p>You must call {@link #close} first.
DecryptedChunkKvOutput::getPairs
java
Reginer/aosp-android-jar
android-31/src/com/android/server/backup/encryption/kv/DecryptedChunkKvOutput.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/backup/encryption/kv/DecryptedChunkKvOutput.java
MIT
public Stub() { this.markVintfStability(); this.attachInterface(this, DESCRIPTOR); }
The version of this interface that the caller is built against. This might be different from what {@link #getInterfaceVersion() getInterfaceVersion} returns as that is the version of the interface that the remote object is implementing. public static final int VERSION = 2; public static final String HASH = "0be135cf3de9586d6aabb58cb6af0ba425431743"; /** Default implementation for IRadioConfigIndication. public static class Default implements android.hardware.radio.config.IRadioConfigIndication { @Override public void simSlotsStatusChanged(int type, android.hardware.radio.config.SimSlotStatus[] slotStatus) 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.radio.config.IRadioConfigIndication { /** Construct the stub at attach it to the interface.
Stub::Stub
java
Reginer/aosp-android-jar
android-34/src/android/hardware/radio/config/IRadioConfigIndication.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/radio/config/IRadioConfigIndication.java
MIT
public static android.hardware.radio.config.IRadioConfigIndication asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof android.hardware.radio.config.IRadioConfigIndication))) { return ((android.hardware.radio.config.IRadioConfigIndication)iin); } return new android.hardware.radio.config.IRadioConfigIndication.Stub.Proxy(obj); }
Cast an IBinder object into an android.hardware.radio.config.IRadioConfigIndication interface, generating a proxy if needed.
Stub::asInterface
java
Reginer/aosp-android-jar
android-34/src/android/hardware/radio/config/IRadioConfigIndication.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/radio/config/IRadioConfigIndication.java
MIT
public static ObserverInternal read(TypedXmlPullParser parser, PackageWatchdog watchdog) { String observerName = null; if (TAG_OBSERVER.equals(parser.getName())) { observerName = parser.getAttributeValue(null, ATTR_NAME); if (TextUtils.isEmpty(observerName)) { Slog.wtf(TAG, "Unable to read observer name"); return null; } } List<MonitoredPackage> packages = new ArrayList<>(); int innerDepth = parser.getDepth(); try { while (XmlUtils.nextElementWithin(parser, innerDepth)) { if (TAG_PACKAGE.equals(parser.getName())) { try { MonitoredPackage pkg = watchdog.parseMonitoredPackage(parser); if (pkg != null) { packages.add(pkg); } } catch (NumberFormatException e) { Slog.wtf(TAG, "Skipping package for observer " + observerName, e); continue; } } } } catch (XmlPullParserException | IOException e) { Slog.wtf(TAG, "Unable to read observer " + observerName, e); return null; } if (packages.isEmpty()) { return null; } return new ObserverInternal(observerName, packages); }
Returns one ObserverInternal from the {@code parser} and advances its state. <p>Note that this method is <b>not</b> thread safe. It should only be called from #loadFromFile which in turn is only called on construction of the singleton PackageWatchdog.
ObserverInternal::read
java
Reginer/aosp-android-jar
android-33/src/com/android/server/PackageWatchdog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/PackageWatchdog.java
MIT
public void dump(IndentingPrintWriter pw) { boolean isPersistent = registeredObserver != null && registeredObserver.isPersistent(); pw.println("Persistent: " + isPersistent); for (String packageName : mPackages.keySet()) { MonitoredPackage p = getMonitoredPackage(packageName); pw.println(packageName + ": "); pw.increaseIndent(); pw.println("# Failures: " + p.mFailureHistory.size()); pw.println("Monitoring duration remaining: " + p.mDurationMs + "ms"); pw.println("Explicit health check duration: " + p.mHealthCheckDurationMs + "ms"); pw.println("Health check state: " + p.toString(p.mHealthCheckState)); pw.decreaseIndent(); } }
Returns one ObserverInternal from the {@code parser} and advances its state. <p>Note that this method is <b>not</b> thread safe. It should only be called from #loadFromFile which in turn is only called on construction of the singleton PackageWatchdog. public static ObserverInternal read(TypedXmlPullParser parser, PackageWatchdog watchdog) { String observerName = null; if (TAG_OBSERVER.equals(parser.getName())) { observerName = parser.getAttributeValue(null, ATTR_NAME); if (TextUtils.isEmpty(observerName)) { Slog.wtf(TAG, "Unable to read observer name"); return null; } } List<MonitoredPackage> packages = new ArrayList<>(); int innerDepth = parser.getDepth(); try { while (XmlUtils.nextElementWithin(parser, innerDepth)) { if (TAG_PACKAGE.equals(parser.getName())) { try { MonitoredPackage pkg = watchdog.parseMonitoredPackage(parser); if (pkg != null) { packages.add(pkg); } } catch (NumberFormatException e) { Slog.wtf(TAG, "Skipping package for observer " + observerName, e); continue; } } } } catch (XmlPullParserException | IOException e) { Slog.wtf(TAG, "Unable to read observer " + observerName, e); return null; } if (packages.isEmpty()) { return null; } return new ObserverInternal(observerName, packages); } /** Dumps information about this observer and the packages it watches.
ObserverInternal::dump
java
Reginer/aosp-android-jar
android-33/src/com/android/server/PackageWatchdog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/PackageWatchdog.java
MIT
private String getName() { return mPackageName; }
Marks the health check as passed and transitions to {@link HealthCheckState.PASSED} if not yet {@link HealthCheckState.FAILED}. @return the new {@link HealthCheckState health check state} @GuardedBy("mLock") @HealthCheckState public int tryPassHealthCheckLocked() { if (mHealthCheckState != HealthCheckState.FAILED) { // FAILED is a final state so only pass if we haven't failed // Transition to PASSED mHasPassedHealthCheck = true; } return updateHealthCheckStateLocked(); } /** Returns the monitored package name.
MonitoredPackage::getName
java
Reginer/aosp-android-jar
android-33/src/com/android/server/PackageWatchdog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/PackageWatchdog.java
MIT
private String toString(@HealthCheckState int state) { switch (state) { case HealthCheckState.ACTIVE: return "ACTIVE"; case HealthCheckState.INACTIVE: return "INACTIVE"; case HealthCheckState.PASSED: return "PASSED"; case HealthCheckState.FAILED: return "FAILED"; default: return "UNKNOWN"; } }
Updates the health check state based on {@link #mHasPassedHealthCheck} and {@link #mHealthCheckDurationMs}. @return the new {@link HealthCheckState health check state} @GuardedBy("mLock") @HealthCheckState private int updateHealthCheckStateLocked() { int oldState = mHealthCheckState; if (mHasPassedHealthCheck) { // Set final state first to avoid ambiguity mHealthCheckState = HealthCheckState.PASSED; } else if (mHealthCheckDurationMs <= 0 || mDurationMs <= 0) { // Set final state first to avoid ambiguity mHealthCheckState = HealthCheckState.FAILED; } else if (mHealthCheckDurationMs == Long.MAX_VALUE) { mHealthCheckState = HealthCheckState.INACTIVE; } else { mHealthCheckState = HealthCheckState.ACTIVE; } if (oldState != mHealthCheckState) { Slog.i(TAG, "Updated health check state for package " + getName() + ": " + toString(oldState) + " -> " + toString(mHealthCheckState)); } return mHealthCheckState; } /** Returns a {@link String} representation of the current health check state.
MonitoredPackage::toString
java
Reginer/aosp-android-jar
android-33/src/com/android/server/PackageWatchdog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/PackageWatchdog.java
MIT
private long toPositive(long value) { return value > 0 ? value : Long.MAX_VALUE; }
Updates the health check state based on {@link #mHasPassedHealthCheck} and {@link #mHealthCheckDurationMs}. @return the new {@link HealthCheckState health check state} @GuardedBy("mLock") @HealthCheckState private int updateHealthCheckStateLocked() { int oldState = mHealthCheckState; if (mHasPassedHealthCheck) { // Set final state first to avoid ambiguity mHealthCheckState = HealthCheckState.PASSED; } else if (mHealthCheckDurationMs <= 0 || mDurationMs <= 0) { // Set final state first to avoid ambiguity mHealthCheckState = HealthCheckState.FAILED; } else if (mHealthCheckDurationMs == Long.MAX_VALUE) { mHealthCheckState = HealthCheckState.INACTIVE; } else { mHealthCheckState = HealthCheckState.ACTIVE; } if (oldState != mHealthCheckState) { Slog.i(TAG, "Updated health check state for package " + getName() + ": " + toString(oldState) + " -> " + toString(mHealthCheckState)); } return mHealthCheckState; } /** Returns a {@link String} representation of the current health check state. private String toString(@HealthCheckState int state) { switch (state) { case HealthCheckState.ACTIVE: return "ACTIVE"; case HealthCheckState.INACTIVE: return "INACTIVE"; case HealthCheckState.PASSED: return "PASSED"; case HealthCheckState.FAILED: return "FAILED"; default: return "UNKNOWN"; } } /** Returns {@code value} if it is greater than 0 or {@link Long#MAX_VALUE} otherwise.
MonitoredPackage::toPositive
java
Reginer/aosp-android-jar
android-33/src/com/android/server/PackageWatchdog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/PackageWatchdog.java
MIT
public boolean incrementAndTest() { readMitigationCountFromMetadataIfNecessary(); final long now = mSystemClock.uptimeMillis(); if (now - getStart() < 0) { Slog.e(TAG, "Window was less than zero. Resetting start to current time."); setStart(now); setMitigationStart(now); } if (now - getMitigationStart() > DEFAULT_DEESCALATION_WINDOW_MS) { setMitigationCount(0); setMitigationStart(now); } final long window = now - getStart(); if (window >= mTriggerWindow) { setCount(1); setStart(now); return false; } else { int count = getCount() + 1; setCount(count); EventLogTags.writeRescueNote(Process.ROOT_UID, count, window); return count >= mBootTriggerCount; } }
Handles the thresholding logic for system server boots. class BootThreshold { private final int mBootTriggerCount; private final long mTriggerWindow; BootThreshold(int bootTriggerCount, long triggerWindow) { this.mBootTriggerCount = bootTriggerCount; this.mTriggerWindow = triggerWindow; } public void reset() { setStart(0); setCount(0); } private int getCount() { return SystemProperties.getInt(PROP_RESCUE_BOOT_COUNT, 0); } private void setCount(int count) { SystemProperties.set(PROP_RESCUE_BOOT_COUNT, Integer.toString(count)); } public long getStart() { return SystemProperties.getLong(PROP_RESCUE_BOOT_START, 0); } public int getMitigationCount() { return SystemProperties.getInt(PROP_BOOT_MITIGATION_COUNT, 0); } public void setStart(long start) { setPropertyStart(PROP_RESCUE_BOOT_START, start); } public void setMitigationStart(long start) { setPropertyStart(PROP_BOOT_MITIGATION_WINDOW_START, start); } public long getMitigationStart() { return SystemProperties.getLong(PROP_BOOT_MITIGATION_WINDOW_START, 0); } public void setMitigationCount(int count) { SystemProperties.set(PROP_BOOT_MITIGATION_COUNT, Integer.toString(count)); } public void setPropertyStart(String property, long start) { final long now = mSystemClock.uptimeMillis(); final long newStart = MathUtils.constrain(start, 0, now); SystemProperties.set(property, Long.toString(newStart)); } public void saveMitigationCountToMetadata() { try (BufferedWriter writer = new BufferedWriter(new FileWriter(METADATA_FILE))) { writer.write(String.valueOf(getMitigationCount())); } catch (Exception e) { Slog.e(TAG, "Could not save metadata to file: " + e); } } public void readMitigationCountFromMetadataIfNecessary() { File bootPropsFile = new File(METADATA_FILE); if (bootPropsFile.exists()) { try (BufferedReader reader = new BufferedReader(new FileReader(METADATA_FILE))) { String mitigationCount = reader.readLine(); setMitigationCount(Integer.parseInt(mitigationCount)); bootPropsFile.delete(); } catch (Exception e) { Slog.i(TAG, "Could not read metadata file: " + e); } } } /** Increments the boot counter, and returns whether the device is bootlooping.
BootThreshold::incrementAndTest
java
Reginer/aosp-android-jar
android-33/src/com/android/server/PackageWatchdog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/PackageWatchdog.java
MIT
public static CrossWindowBlurListeners getInstance() { CrossWindowBlurListeners instance = sInstance; if (instance == null) { synchronized (sLock) { instance = sInstance; if (instance == null) { instance = new CrossWindowBlurListeners(); sInstance = instance; } } } return instance; }
Returns a CrossWindowBlurListeners instance
CrossWindowBlurListeners::getInstance
java
Reginer/aosp-android-jar
android-33/src/android/view/CrossWindowBlurListeners.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/CrossWindowBlurListeners.java
MIT
public DrmInfoRequest(int infoType, String mimeType) { mInfoType = infoType; mMimeType = mimeType; if (!isValid()) { final String msg = "infoType: " + infoType + "," + "mimeType: " + mimeType; throw new IllegalArgumentException(msg); } }
Creates a <code>DrmInfoRequest</code> object with type and MIME type. @param infoType Type of information. @param mimeType MIME type.
DrmInfoRequest::DrmInfoRequest
java
Reginer/aosp-android-jar
android-33/src/android/drm/DrmInfoRequest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/drm/DrmInfoRequest.java
MIT
public String getMimeType() { return mMimeType; }
Retrieves the MIME type associated with this object. @return The MIME type.
DrmInfoRequest::getMimeType
java
Reginer/aosp-android-jar
android-33/src/android/drm/DrmInfoRequest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/drm/DrmInfoRequest.java
MIT
public int getInfoType() { return mInfoType; }
Retrieves the information type associated with this object. @return The information type.
DrmInfoRequest::getInfoType
java
Reginer/aosp-android-jar
android-33/src/android/drm/DrmInfoRequest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/drm/DrmInfoRequest.java
MIT
public void put(String key, Object value) { mRequestInformation.put(key, value); }
Adds optional information as key-value pairs to this object. @param key The key to add. @param value The value to add.
DrmInfoRequest::put
java
Reginer/aosp-android-jar
android-33/src/android/drm/DrmInfoRequest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/drm/DrmInfoRequest.java
MIT
public Object get(String key) { return mRequestInformation.get(key); }
Retrieves the value of a given key. @param key The key whose value is being retrieved. @return The value of the key that is being retrieved. Returns null if the key cannot be found.
DrmInfoRequest::get
java
Reginer/aosp-android-jar
android-33/src/android/drm/DrmInfoRequest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/drm/DrmInfoRequest.java
MIT
public Iterator<String> keyIterator() { return mRequestInformation.keySet().iterator(); }
Retrieves an iterator object that you can use to iterate over the keys associated with this <code>DrmInfoRequest</code> object. @return The iterator object.
DrmInfoRequest::keyIterator
java
Reginer/aosp-android-jar
android-33/src/android/drm/DrmInfoRequest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/drm/DrmInfoRequest.java
MIT
public Iterator<Object> iterator() { return mRequestInformation.values().iterator(); }
Retrieves an iterator object that you can use to iterate over the values associated with this <code>DrmInfoRequest</code> object. @return The iterator object.
DrmInfoRequest::iterator
java
Reginer/aosp-android-jar
android-33/src/android/drm/DrmInfoRequest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/drm/DrmInfoRequest.java
MIT
boolean isValid() { return (null != mMimeType && !mMimeType.equals("") && null != mRequestInformation && isValidType(mInfoType)); }
Returns whether this instance is valid or not @return true if valid false if invalid
DrmInfoRequest::isValid
java
Reginer/aosp-android-jar
android-33/src/android/drm/DrmInfoRequest.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/drm/DrmInfoRequest.java
MIT
public static String computeId(@NonNull ResolveInfo service) { final ServiceInfo si = service.serviceInfo; return new ComponentName(si.packageName, si.name).flattenToShortString(); }
@param service the {@link ResolveInfo} corresponds in which the IME is implemented. @return a unique ID to be returned by {@link #getId()}. We have used {@link ComponentName#flattenToShortString()} for this purpose (and it is already unrealistic to switch to a different scheme as it is already implicitly assumed in many places). @hide
InputMethodInfo::computeId
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public InputMethodInfo(Context context, ResolveInfo service) throws XmlPullParserException, IOException { this(context, service, null); }
Constructor. @param context The Context in which we are parsing the input method. @param service The ResolveInfo returned from the package manager about this input method's component.
InputMethodInfo::InputMethodInfo
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public InputMethodInfo(Context context, ResolveInfo service, List<InputMethodSubtype> additionalSubtypes) throws XmlPullParserException, IOException { mService = service; ServiceInfo si = service.serviceInfo; mId = computeId(service); boolean isAuxIme = true; boolean supportsSwitchingToNextInputMethod = false; // false as default boolean inlineSuggestionsEnabled = false; // false as default boolean supportsInlineSuggestionsWithTouchExploration = false; // false as default boolean suppressesSpellChecker = false; // false as default boolean showInInputMethodPicker = true; // true as default mForceDefault = false; PackageManager pm = context.getPackageManager(); String settingsActivityComponent = null; String languageSettingsActivityComponent = null; String stylusHandwritingSettingsActivity = null; boolean isVrOnly; boolean isVirtualDeviceOnly; int isDefaultResId = 0; XmlResourceParser parser = null; final ArrayList<InputMethodSubtype> subtypes = new ArrayList<InputMethodSubtype>(); try { parser = si.loadXmlMetaData(pm, InputMethod.SERVICE_META_DATA); if (parser == null) { throw new XmlPullParserException("No " + InputMethod.SERVICE_META_DATA + " meta-data"); } Resources res = pm.getResourcesForApplication(si.applicationInfo); AttributeSet attrs = Xml.asAttributeSet(parser); int type; while ((type=parser.next()) != XmlPullParser.END_DOCUMENT && type != XmlPullParser.START_TAG) { } String nodeName = parser.getName(); if (!"input-method".equals(nodeName)) { throw new XmlPullParserException( "Meta-data does not start with input-method tag"); } TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.InputMethod); settingsActivityComponent = sa.getString( com.android.internal.R.styleable.InputMethod_settingsActivity); if (Flags.imeSwitcherRevamp()) { languageSettingsActivityComponent = sa.getString( com.android.internal.R.styleable.InputMethod_languageSettingsActivity); } if ((si.name != null && si.name.length() > COMPONENT_NAME_MAX_LENGTH) || (settingsActivityComponent != null && settingsActivityComponent.length() > COMPONENT_NAME_MAX_LENGTH) || (languageSettingsActivityComponent != null && languageSettingsActivityComponent.length() > COMPONENT_NAME_MAX_LENGTH)) { throw new XmlPullParserException( "Activity name exceeds maximum of 1000 characters"); } isVrOnly = sa.getBoolean(com.android.internal.R.styleable.InputMethod_isVrOnly, false); isVirtualDeviceOnly = sa.getBoolean( com.android.internal.R.styleable.InputMethod_isVirtualDeviceOnly, false); isDefaultResId = sa.getResourceId( com.android.internal.R.styleable.InputMethod_isDefault, 0); supportsSwitchingToNextInputMethod = sa.getBoolean( com.android.internal.R.styleable.InputMethod_supportsSwitchingToNextInputMethod, false); inlineSuggestionsEnabled = sa.getBoolean( com.android.internal.R.styleable.InputMethod_supportsInlineSuggestions, false); supportsInlineSuggestionsWithTouchExploration = sa.getBoolean( com.android.internal.R.styleable .InputMethod_supportsInlineSuggestionsWithTouchExploration, false); suppressesSpellChecker = sa.getBoolean( com.android.internal.R.styleable.InputMethod_suppressesSpellChecker, false); showInInputMethodPicker = sa.getBoolean( com.android.internal.R.styleable.InputMethod_showInInputMethodPicker, true); mHandledConfigChanges = sa.getInt( com.android.internal.R.styleable.InputMethod_configChanges, 0); mSupportsStylusHandwriting = sa.getBoolean( com.android.internal.R.styleable.InputMethod_supportsStylusHandwriting, false); mSupportsConnectionlessStylusHandwriting = sa.getBoolean( com.android.internal.R.styleable .InputMethod_supportsConnectionlessStylusHandwriting, false); stylusHandwritingSettingsActivity = sa.getString( com.android.internal.R.styleable.InputMethod_stylusHandwritingSettingsActivity); sa.recycle(); final int depth = parser.getDepth(); // Parse all subtypes while (((type = parser.next()) != XmlPullParser.END_TAG || parser.getDepth() > depth) && type != XmlPullParser.END_DOCUMENT) { if (type == XmlPullParser.START_TAG) { nodeName = parser.getName(); if (!"subtype".equals(nodeName)) { throw new XmlPullParserException( "Meta-data in input-method does not start with subtype tag"); } final TypedArray a = res.obtainAttributes( attrs, com.android.internal.R.styleable.InputMethod_Subtype); String pkLanguageTag = a.getString(com.android.internal.R.styleable .InputMethod_Subtype_physicalKeyboardHintLanguageTag); String pkLayoutType = a.getString(com.android.internal.R.styleable .InputMethod_Subtype_physicalKeyboardHintLayoutType); final InputMethodSubtype subtype = new InputMethodSubtypeBuilder() .setSubtypeNameResId(a.getResourceId(com.android.internal.R.styleable .InputMethod_Subtype_label, 0)) .setSubtypeIconResId(a.getResourceId(com.android.internal.R.styleable .InputMethod_Subtype_icon, 0)) .setPhysicalKeyboardHint( pkLanguageTag == null ? null : new ULocale(pkLanguageTag), pkLayoutType == null ? "" : pkLayoutType) .setLanguageTag(a.getString(com.android.internal.R.styleable .InputMethod_Subtype_languageTag)) .setSubtypeLocale(a.getString(com.android.internal.R.styleable .InputMethod_Subtype_imeSubtypeLocale)) .setSubtypeMode(a.getString(com.android.internal.R.styleable .InputMethod_Subtype_imeSubtypeMode)) .setSubtypeExtraValue(a.getString(com.android.internal.R.styleable .InputMethod_Subtype_imeSubtypeExtraValue)) .setIsAuxiliary(a.getBoolean(com.android.internal.R.styleable .InputMethod_Subtype_isAuxiliary, false)) .setOverridesImplicitlyEnabledSubtype(a.getBoolean( com.android.internal.R.styleable .InputMethod_Subtype_overridesImplicitlyEnabledSubtype, false)) .setSubtypeId(a.getInt(com.android.internal.R.styleable .InputMethod_Subtype_subtypeId, 0 /* use Arrays.hashCode */)) .setIsAsciiCapable(a.getBoolean(com.android.internal.R.styleable .InputMethod_Subtype_isAsciiCapable, false)).build(); a.recycle(); if (!subtype.isAuxiliary()) { isAuxIme = false; } subtypes.add(subtype); } } } catch (NameNotFoundException | IndexOutOfBoundsException | NumberFormatException e) { throw new XmlPullParserException( "Unable to create context for: " + si.packageName); } finally { if (parser != null) parser.close(); } if (subtypes.size() == 0) { isAuxIme = false; } if (additionalSubtypes != null) { final int N = additionalSubtypes.size(); for (int i = 0; i < N; ++i) { final InputMethodSubtype subtype = additionalSubtypes.get(i); if (!subtypes.contains(subtype)) { subtypes.add(subtype); } else { Slog.w(TAG, "Duplicated subtype definition found: " + subtype.getLocale() + ", " + subtype.getMode()); } } } mSubtypes = new InputMethodSubtypeArray(subtypes); mSettingsActivityName = settingsActivityComponent; mLanguageSettingsActivityName = languageSettingsActivityComponent; mStylusHandwritingSettingsActivityAttr = stylusHandwritingSettingsActivity; mIsDefaultResId = isDefaultResId; mIsAuxIme = isAuxIme; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; mInlineSuggestionsEnabled = inlineSuggestionsEnabled; mSupportsInlineSuggestionsWithTouchExploration = supportsInlineSuggestionsWithTouchExploration; mSuppressesSpellChecker = suppressesSpellChecker; mShowInInputMethodPicker = showInInputMethodPicker; mIsVrOnly = isVrOnly; mIsVirtualDeviceOnly = isVirtualDeviceOnly; }
Constructor. @param context The Context in which we are parsing the input method. @param service The ResolveInfo returned from the package manager about this input method's component. @param additionalSubtypes additional subtypes being added to this InputMethodInfo @hide
InputMethodInfo::InputMethodInfo
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public InputMethodInfo(InputMethodInfo source) { this(source, Collections.emptyList()); }
@hide
InputMethodInfo::InputMethodInfo
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public InputMethodInfo(@NonNull InputMethodInfo source, @NonNull List<InputMethodSubtype> additionalSubtypes) { mId = source.mId; mSettingsActivityName = source.mSettingsActivityName; mLanguageSettingsActivityName = source.mLanguageSettingsActivityName; mIsDefaultResId = source.mIsDefaultResId; mIsAuxIme = source.mIsAuxIme; mSupportsSwitchingToNextInputMethod = source.mSupportsSwitchingToNextInputMethod; mInlineSuggestionsEnabled = source.mInlineSuggestionsEnabled; mSupportsInlineSuggestionsWithTouchExploration = source.mSupportsInlineSuggestionsWithTouchExploration; mSuppressesSpellChecker = source.mSuppressesSpellChecker; mShowInInputMethodPicker = source.mShowInInputMethodPicker; mIsVrOnly = source.mIsVrOnly; mIsVirtualDeviceOnly = source.mIsVirtualDeviceOnly; mService = source.mService; if (additionalSubtypes.isEmpty()) { mSubtypes = source.mSubtypes; } else { final ArrayList<InputMethodSubtype> subtypes = source.mSubtypes.toList(); final int additionalSubtypeCount = additionalSubtypes.size(); for (int i = 0; i < additionalSubtypeCount; ++i) { final InputMethodSubtype additionalSubtype = additionalSubtypes.get(i); if (!subtypes.contains(additionalSubtype)) { subtypes.add(additionalSubtype); } } mSubtypes = new InputMethodSubtypeArray(subtypes); } mHandledConfigChanges = source.mHandledConfigChanges; mSupportsStylusHandwriting = source.mSupportsStylusHandwriting; mSupportsConnectionlessStylusHandwriting = source.mSupportsConnectionlessStylusHandwriting; mForceDefault = source.mForceDefault; mStylusHandwritingSettingsActivityAttr = source.mStylusHandwritingSettingsActivityAttr; }
@hide
InputMethodInfo::InputMethodInfo
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public InputMethodInfo(String packageName, String className, CharSequence label, String settingsActivity) { this(buildFakeResolveInfo(packageName, className, label), false /* isAuxIme */, settingsActivity, null /* languageSettingsActivity */, null /* subtypes */, 0 /* isDefaultResId */, false /* forceDefault */, true /* supportsSwitchingToNextInputMethod */, false /* inlineSuggestionsEnabled */, false /* isVrOnly */, false /* isVirtualDeviceOnly */, 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */, false /* supportConnectionlessStylusHandwriting */, null /* stylusHandwritingSettingsActivityAttr */, false /* inlineSuggestionsEnabled */); }
Temporary API for creating a built-in input method for test.
InputMethodInfo::InputMethodInfo
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public InputMethodInfo(ResolveInfo ri, boolean isAuxIme, String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault) { this(ri, isAuxIme, settingsActivity, null /* languageSettingsActivity */, subtypes, isDefaultResId, forceDefault, true /* supportsSwitchingToNextInputMethod */, false /* inlineSuggestionsEnabled */, false /* isVrOnly */, false /* isVirtualDeviceOnly */, 0 /* handledconfigChanges */, false /* supportsStylusHandwriting */, false /* supportConnectionlessStylusHandwriting */, null /* stylusHandwritingSettingsActivityAttr */, false /* inlineSuggestionsEnabled */); }
Temporary API for creating a built-in input method for test. @hide
InputMethodInfo::InputMethodInfo
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public InputMethodInfo(ResolveInfo ri, boolean isAuxIme, String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault, boolean supportsSwitchingToNextInputMethod, boolean isVrOnly) { this(ri, isAuxIme, settingsActivity, null /* languageSettingsActivity */, subtypes, isDefaultResId, forceDefault, supportsSwitchingToNextInputMethod, false /* inlineSuggestionsEnabled */, isVrOnly, false /* isVirtualDeviceOnly */, 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */, false /* supportConnectionlessStylusHandwriting */, null /* stylusHandwritingSettingsActivityAttr */, false /* inlineSuggestionsEnabled */); }
Temporary API for creating a built-in input method for test. @hide
InputMethodInfo::InputMethodInfo
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public InputMethodInfo(ResolveInfo ri, boolean isAuxIme, String settingsActivity, @Nullable String languageSettingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault, boolean supportsSwitchingToNextInputMethod, boolean inlineSuggestionsEnabled, boolean isVrOnly, boolean isVirtualDeviceOnly, int handledConfigChanges, boolean supportsStylusHandwriting, boolean supportsConnectionlessStylusHandwriting, String stylusHandwritingSettingsActivityAttr, boolean supportsInlineSuggestionsWithTouchExploration) { final ServiceInfo si = ri.serviceInfo; mService = ri; mId = new ComponentName(si.packageName, si.name).flattenToShortString(); mSettingsActivityName = settingsActivity; mLanguageSettingsActivityName = languageSettingsActivity; mIsDefaultResId = isDefaultResId; mIsAuxIme = isAuxIme; mSubtypes = new InputMethodSubtypeArray(subtypes); mForceDefault = forceDefault; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; mInlineSuggestionsEnabled = inlineSuggestionsEnabled; mSupportsInlineSuggestionsWithTouchExploration = supportsInlineSuggestionsWithTouchExploration; mSuppressesSpellChecker = false; mShowInInputMethodPicker = true; mIsVrOnly = isVrOnly; mIsVirtualDeviceOnly = isVirtualDeviceOnly; mHandledConfigChanges = handledConfigChanges; mSupportsStylusHandwriting = supportsStylusHandwriting; mSupportsConnectionlessStylusHandwriting = supportsConnectionlessStylusHandwriting; mStylusHandwritingSettingsActivityAttr = stylusHandwritingSettingsActivityAttr; }
Temporary API for creating a built-in input method for test. @hide
InputMethodInfo::InputMethodInfo
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public String getId() { return mId; }
@return a unique ID for this input method, which is guaranteed to be the same as the result of {@code getComponent().flattenToShortString()}. @see ComponentName#unflattenFromString(String)
InputMethodInfo::getId
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public String getPackageName() { return mService.serviceInfo.packageName; }
Return the .apk package that implements this input method.
InputMethodInfo::getPackageName
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public String getServiceName() { return mService.serviceInfo.name; }
Return the class name of the service component that implements this input method.
InputMethodInfo::getServiceName
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public ServiceInfo getServiceInfo() { return mService.serviceInfo; }
Return the raw information about the Service implementing this input method. Do not modify the returned object.
InputMethodInfo::getServiceInfo
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public ComponentName getComponent() { return new ComponentName(mService.serviceInfo.packageName, mService.serviceInfo.name); }
Return the component of the service that implements this input method.
InputMethodInfo::getComponent
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public CharSequence loadLabel(PackageManager pm) { return mService.loadLabel(pm); }
Load the user-displayed label for this input method. @param pm Supply a PackageManager used to load the input method's resources.
InputMethodInfo::loadLabel
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public Drawable loadIcon(PackageManager pm) { return mService.loadIcon(pm); }
Load the user-displayed icon for this input method. @param pm Supply a PackageManager used to load the input method's resources.
InputMethodInfo::loadIcon
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public String getSettingsActivity() { return mSettingsActivityName; }
Return the class name of an activity that provides a settings UI for the input method. You can launch this activity be starting it with an {@link android.content.Intent} whose action is MAIN and with an explicit {@link android.content.ComponentName} composed of {@link #getPackageName} and the class name returned here. <p>A null will be returned if there is no settings activity associated with the input method.</p> @see #createStylusHandwritingSettingsActivityIntent()
InputMethodInfo::getSettingsActivity
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public boolean isVrOnly() { return mIsVrOnly; }
Returns true if IME supports VR mode only. @hide
InputMethodInfo::isVrOnly
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public int getSubtypeCount() { return mSubtypes.getCount(); }
Return the count of the subtypes of Input Method.
InputMethodInfo::getSubtypeCount
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public InputMethodSubtype getSubtypeAt(int index) { return mSubtypes.get(index); }
Return the Input Method's subtype at the specified index. @param index the index of the subtype to return.
InputMethodInfo::getSubtypeAt
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public int getIsDefaultResourceId() { return mIsDefaultResId; }
Return the resource identifier of a resource inside of this input method's .apk that determines whether it should be considered a default input method for the system.
InputMethodInfo::getIsDefaultResourceId
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public boolean supportsStylusHandwriting() { return mSupportsStylusHandwriting; }
Returns if IME supports handwriting using stylus input. @attr ref android.R.styleable#InputMethod_supportsStylusHandwriting @see #createStylusHandwritingSettingsActivityIntent()
InputMethodInfo::supportsStylusHandwriting
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public boolean isSystem() { return (mService.serviceInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0; }
@hide @return {@code true} if the IME is a trusted system component (e.g. pre-installed)
InputMethodInfo::isSystem
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public boolean isAuxiliaryIme() { return mIsAuxIme; }
@hide
InputMethodInfo::isAuxiliaryIme
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public boolean supportsSwitchingToNextInputMethod() { return mSupportsSwitchingToNextInputMethod; }
@return true if this input method supports ways to switch to a next input method. @hide
InputMethodInfo::supportsSwitchingToNextInputMethod
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public boolean isInlineSuggestionsEnabled() { return mInlineSuggestionsEnabled; }
@return true if this input method supports inline suggestions. @hide
InputMethodInfo::isInlineSuggestionsEnabled
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public boolean supportsInlineSuggestionsWithTouchExploration() { return mSupportsInlineSuggestionsWithTouchExploration; }
Returns {@code true} if this input method supports inline suggestions when touch exploration is enabled. @hide
InputMethodInfo::supportsInlineSuggestionsWithTouchExploration
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public boolean suppressesSpellChecker() { return mSuppressesSpellChecker; }
Return {@code true} if this input method suppresses spell checker.
InputMethodInfo::suppressesSpellChecker
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public boolean shouldShowInInputMethodPicker() { return mShowInInputMethodPicker; }
Returns {@code true} if this input method should be shown in menus for selecting an Input Method, such as the system Input Method Picker. This is {@code false} if the IME is intended to be accessed programmatically.
InputMethodInfo::shouldShowInInputMethodPicker
java
Reginer/aosp-android-jar
android-35/src/android/view/inputmethod/InputMethodInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/view/inputmethod/InputMethodInfo.java
MIT
public HeaderSet() { mUnicodeUserDefined = new String[16]; mSequenceUserDefined = new byte[16][]; mByteUserDefined = new Byte[16]; mIntegerUserDefined = new Long[16]; responseCode = -1; }
Creates new <code>HeaderSet</code> object. @param size the max packet size for this connection
HeaderSet::HeaderSet
java
Reginer/aosp-android-jar
android-32/src/javax/obex/HeaderSet.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/obex/HeaderSet.java
MIT
public void setEmptyNameHeader() { mName = null; mEmptyName = true; }
Sets flag for special "value" of NAME header which should be empty. This is not the same as NAME header with empty string in which case it will have length of 5 bytes. It should be 3 bytes with only header id and length field.
HeaderSet::setEmptyNameHeader
java
Reginer/aosp-android-jar
android-32/src/javax/obex/HeaderSet.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/obex/HeaderSet.java
MIT
public boolean getEmptyNameHeader() { return mEmptyName; }
Gets flag for special "value" of NAME header which should be empty. See above.
HeaderSet::getEmptyNameHeader
java
Reginer/aosp-android-jar
android-32/src/javax/obex/HeaderSet.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/obex/HeaderSet.java
MIT
public void setHeader(int headerID, Object headerValue) { long temp = -1; switch (headerID) { case COUNT: if (!(headerValue instanceof Long)) { if (headerValue == null) { mCount = null; break; } throw new IllegalArgumentException("Count must be a Long"); } temp = ((Long)headerValue).longValue(); if ((temp < 0L) || (temp > 0xFFFFFFFFL)) { throw new IllegalArgumentException("Count must be between 0 and 0xFFFFFFFF"); } mCount = (Long)headerValue; break; case NAME: if ((headerValue != null) && (!(headerValue instanceof String))) { throw new IllegalArgumentException("Name must be a String"); } mEmptyName = false; mName = (String)headerValue; break; case TYPE: if ((headerValue != null) && (!(headerValue instanceof String))) { throw new IllegalArgumentException("Type must be a String"); } mType = (String)headerValue; break; case LENGTH: if (!(headerValue instanceof Long)) { if (headerValue == null) { mLength = null; break; } throw new IllegalArgumentException("Length must be a Long"); } temp = ((Long)headerValue).longValue(); if ((temp < 0L) || (temp > 0xFFFFFFFFL)) { throw new IllegalArgumentException("Length must be between 0 and 0xFFFFFFFF"); } mLength = (Long)headerValue; break; case TIME_ISO_8601: if ((headerValue != null) && (!(headerValue instanceof Calendar))) { throw new IllegalArgumentException("Time ISO 8601 must be a Calendar"); } mIsoTime = (Calendar)headerValue; break; case TIME_4_BYTE: if ((headerValue != null) && (!(headerValue instanceof Calendar))) { throw new IllegalArgumentException("Time 4 Byte must be a Calendar"); } mByteTime = (Calendar)headerValue; break; case DESCRIPTION: if ((headerValue != null) && (!(headerValue instanceof String))) { throw new IllegalArgumentException("Description must be a String"); } mDescription = (String)headerValue; break; case TARGET: if (headerValue == null) { mTarget = null; } else { if (!(headerValue instanceof byte[])) { throw new IllegalArgumentException("Target must be a byte array"); } else { mTarget = new byte[((byte[])headerValue).length]; System.arraycopy(headerValue, 0, mTarget, 0, mTarget.length); } } break; case HTTP: if (headerValue == null) { mHttpHeader = null; } else { if (!(headerValue instanceof byte[])) { throw new IllegalArgumentException("HTTP must be a byte array"); } else { mHttpHeader = new byte[((byte[])headerValue).length]; System.arraycopy(headerValue, 0, mHttpHeader, 0, mHttpHeader.length); } } break; case WHO: if (headerValue == null) { mWho = null; } else { if (!(headerValue instanceof byte[])) { throw new IllegalArgumentException("WHO must be a byte array"); } else { mWho = new byte[((byte[])headerValue).length]; System.arraycopy(headerValue, 0, mWho, 0, mWho.length); } } break; case OBJECT_CLASS: if (headerValue == null) { mObjectClass = null; } else { if (!(headerValue instanceof byte[])) { throw new IllegalArgumentException("Object Class must be a byte array"); } else { mObjectClass = new byte[((byte[])headerValue).length]; System.arraycopy(headerValue, 0, mObjectClass, 0, mObjectClass.length); } } break; case APPLICATION_PARAMETER: if (headerValue == null) { mAppParam = null; } else { if (!(headerValue instanceof byte[])) { throw new IllegalArgumentException( "Application Parameter must be a byte array"); } else { mAppParam = new byte[((byte[])headerValue).length]; System.arraycopy(headerValue, 0, mAppParam, 0, mAppParam.length); } } break; case SINGLE_RESPONSE_MODE: if (headerValue == null) { mSingleResponseMode = null; } else { if (!(headerValue instanceof Byte)) { throw new IllegalArgumentException( "Single Response Mode must be a Byte"); } else { mSingleResponseMode = (Byte)headerValue; } } break; case SINGLE_RESPONSE_MODE_PARAMETER: if (headerValue == null) { mSrmParam = null; } else { if (!(headerValue instanceof Byte)) { throw new IllegalArgumentException( "Single Response Mode Parameter must be a Byte"); } else { mSrmParam = (Byte)headerValue; } } break; default: // Verify that it was not a Unicode String user Defined if ((headerID >= 0x30) && (headerID <= 0x3F)) { if ((headerValue != null) && (!(headerValue instanceof String))) { throw new IllegalArgumentException( "Unicode String User Defined must be a String"); } mUnicodeUserDefined[headerID - 0x30] = (String)headerValue; break; } // Verify that it was not a byte sequence user defined value if ((headerID >= 0x70) && (headerID <= 0x7F)) { if (headerValue == null) { mSequenceUserDefined[headerID - 0x70] = null; } else { if (!(headerValue instanceof byte[])) { throw new IllegalArgumentException( "Byte Sequence User Defined must be a byte array"); } else { mSequenceUserDefined[headerID - 0x70] = new byte[((byte[])headerValue).length]; System.arraycopy(headerValue, 0, mSequenceUserDefined[headerID - 0x70], 0, mSequenceUserDefined[headerID - 0x70].length); } } break; } // Verify that it was not a Byte user Defined if ((headerID >= 0xB0) && (headerID <= 0xBF)) { if ((headerValue != null) && (!(headerValue instanceof Byte))) { throw new IllegalArgumentException("ByteUser Defined must be a Byte"); } mByteUserDefined[headerID - 0xB0] = (Byte)headerValue; break; } // Verify that is was not the 4 byte unsigned integer user // defined header if ((headerID >= 0xF0) && (headerID <= 0xFF)) { if (!(headerValue instanceof Long)) { if (headerValue == null) { mIntegerUserDefined[headerID - 0xF0] = null; break; } throw new IllegalArgumentException("Integer User Defined must be a Long"); } temp = ((Long)headerValue).longValue(); if ((temp < 0L) || (temp > 0xFFFFFFFFL)) { throw new IllegalArgumentException( "Integer User Defined must be between 0 and 0xFFFFFFFF"); } mIntegerUserDefined[headerID - 0xF0] = (Long)headerValue; break; } throw new IllegalArgumentException("Invalid Header Identifier"); } }
Sets the value of the header identifier to the value provided. The type of object must correspond to the Java type defined in the description of this interface. If <code>null</code> is passed as the <code>headerValue</code> then the header will be removed from the set of headers to include in the next request. @param headerID the identifier to include in the message @param headerValue the value of the header identifier @throws IllegalArgumentException if the header identifier provided is not one defined in this interface or a user-defined header; if the type of <code>headerValue</code> is not the correct Java type as defined in the description of this interface\
HeaderSet::setHeader
java
Reginer/aosp-android-jar
android-32/src/javax/obex/HeaderSet.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/obex/HeaderSet.java
MIT
public Object getHeader(int headerID) throws IOException { switch (headerID) { case COUNT: return mCount; case NAME: return mName; case TYPE: return mType; case LENGTH: return mLength; case TIME_ISO_8601: return mIsoTime; case TIME_4_BYTE: return mByteTime; case DESCRIPTION: return mDescription; case TARGET: return mTarget; case HTTP: return mHttpHeader; case WHO: return mWho; case CONNECTION_ID: return mConnectionID; case OBJECT_CLASS: return mObjectClass; case APPLICATION_PARAMETER: return mAppParam; case SINGLE_RESPONSE_MODE: return mSingleResponseMode; case SINGLE_RESPONSE_MODE_PARAMETER: return mSrmParam; default: // Verify that it was not a Unicode String user Defined if ((headerID >= 0x30) && (headerID <= 0x3F)) { return mUnicodeUserDefined[headerID - 0x30]; } // Verify that it was not a byte sequence user defined header if ((headerID >= 0x70) && (headerID <= 0x7F)) { return mSequenceUserDefined[headerID - 0x70]; } // Verify that it was not a byte user defined header if ((headerID >= 0xB0) && (headerID <= 0xBF)) { return mByteUserDefined[headerID - 0xB0]; } // Verify that it was not a integer user defined header if ((headerID >= 0xF0) && (headerID <= 0xFF)) { return mIntegerUserDefined[headerID - 0xF0]; } throw new IllegalArgumentException("Invalid Header Identifier"); } }
Retrieves the value of the header identifier provided. The type of the Object returned is defined in the description of this interface. @param headerID the header identifier whose value is to be returned @return the value of the header provided or <code>null</code> if the header identifier specified is not part of this <code>HeaderSet</code> object @throws IllegalArgumentException if the <code>headerID</code> is not one defined in this interface or any of the user-defined headers @throws IOException if an error occurred in the transport layer during the operation or if the connection has been closed
HeaderSet::getHeader
java
Reginer/aosp-android-jar
android-32/src/javax/obex/HeaderSet.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/obex/HeaderSet.java
MIT
public int[] getHeaderList() throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); if (mCount != null) { out.write(COUNT); } if (mName != null) { out.write(NAME); } if (mType != null) { out.write(TYPE); } if (mLength != null) { out.write(LENGTH); } if (mIsoTime != null) { out.write(TIME_ISO_8601); } if (mByteTime != null) { out.write(TIME_4_BYTE); } if (mDescription != null) { out.write(DESCRIPTION); } if (mTarget != null) { out.write(TARGET); } if (mHttpHeader != null) { out.write(HTTP); } if (mWho != null) { out.write(WHO); } if (mAppParam != null) { out.write(APPLICATION_PARAMETER); } if (mObjectClass != null) { out.write(OBJECT_CLASS); } if(mSingleResponseMode != null) { out.write(SINGLE_RESPONSE_MODE); } if(mSrmParam != null) { out.write(SINGLE_RESPONSE_MODE_PARAMETER); } for (int i = 0x30; i < 0x40; i++) { if (mUnicodeUserDefined[i - 0x30] != null) { out.write(i); } } for (int i = 0x70; i < 0x80; i++) { if (mSequenceUserDefined[i - 0x70] != null) { out.write(i); } } for (int i = 0xB0; i < 0xC0; i++) { if (mByteUserDefined[i - 0xB0] != null) { out.write(i); } } for (int i = 0xF0; i < 0x100; i++) { if (mIntegerUserDefined[i - 0xF0] != null) { out.write(i); } } byte[] headers = out.toByteArray(); out.close(); if ((headers == null) || (headers.length == 0)) { return null; } int[] result = new int[headers.length]; for (int i = 0; i < headers.length; i++) { // Convert the byte to a positive integer. That is, an integer // between 0 and 256. result[i] = headers[i] & 0xFF; } return result; }
Retrieves the list of headers that may be retrieved via the <code>getHeader</code> method that will not return <code>null</code>. In other words, this method returns all the headers that are available in this object. @see #getHeader @return the array of headers that are set in this object or <code>null</code> if no headers are available @throws IOException if an error occurred in the transport layer during the operation or the connection has been closed
HeaderSet::getHeaderList
java
Reginer/aosp-android-jar
android-32/src/javax/obex/HeaderSet.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/obex/HeaderSet.java
MIT
public void createAuthenticationChallenge(String realm, boolean userID, boolean access) throws IOException { nonce = new byte[16]; if(mRandom == null) { mRandom = new SecureRandom(); } for (int i = 0; i < 16; i++) { nonce[i] = (byte)mRandom.nextInt(); } mAuthChall = ObexHelper.computeAuthenticationChallenge(nonce, realm, access, userID); }
Sets the authentication challenge header. The <code>realm</code> will be encoded based upon the default encoding scheme used by the implementation to encode strings. Therefore, the encoding scheme used to encode the <code>realm</code> is application dependent. @param realm a short description that describes what password to use; if <code>null</code> no realm will be sent in the authentication challenge header @param userID if <code>true</code>, a user ID is required in the reply; if <code>false</code>, no user ID is required @param access if <code>true</code> then full access will be granted if successful; if <code>false</code> then read-only access will be granted if successful @throws IOException
HeaderSet::createAuthenticationChallenge
java
Reginer/aosp-android-jar
android-32/src/javax/obex/HeaderSet.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/obex/HeaderSet.java
MIT
public int getResponseCode() throws IOException { if (responseCode == -1) { throw new IOException("May not be called on a server"); } else { return responseCode; } }
Returns the response code received from the server. Response codes are defined in the <code>ResponseCodes</code> class. @see ResponseCodes @return the response code retrieved from the server @throws IOException if an error occurred in the transport layer during the transaction; if this method is called on a <code>HeaderSet</code> object created by calling <code>createHeaderSet()</code> in a <code>ClientSession</code> object; if this object was created by an OBEX server
HeaderSet::getResponseCode
java
Reginer/aosp-android-jar
android-32/src/javax/obex/HeaderSet.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/obex/HeaderSet.java
MIT
private final Runnable mDeferHide = new Runnable() { @Override public void run() { setState(STATE_NONE); } };
Used to delay hiding fast scroll decorations.
FastScroller::Runnable
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private final AnimatorListener mSwitchPrimaryListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mShowingPrimary = !mShowingPrimary; } };
Used to effect a transition from primary to secondary text.
FastScroller::AnimatorListenerAdapter
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
public void setEnabled(boolean enabled) { if (mEnabled != enabled) { mEnabled = enabled; onStateDependencyChanged(true); } }
@param enabled Whether the fast scroll thumb is enabled.
FastScroller::setEnabled
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
public boolean isEnabled() { return mEnabled && (mLongList || mAlwaysShow); }
@return Whether the fast scroll thumb is enabled.
FastScroller::isEnabled
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
public void setAlwaysShow(boolean alwaysShow) { if (mAlwaysShow != alwaysShow) { mAlwaysShow = alwaysShow; onStateDependencyChanged(false); } }
@param alwaysShow Whether the fast scroll thumb should always be shown
FastScroller::setAlwaysShow
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
public boolean isAlwaysShowEnabled() { return mAlwaysShow; }
@return Whether the fast scroll thumb will always be shown @see #setAlwaysShow(boolean)
FastScroller::isAlwaysShowEnabled
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void onStateDependencyChanged(boolean peekIfEnabled) { if (isEnabled()) { if (isAlwaysShowEnabled()) { setState(STATE_VISIBLE); } else if (mState == STATE_VISIBLE) { postAutoHide(); } else if (peekIfEnabled) { setState(STATE_VISIBLE); postAutoHide(); } } else { stop(); } mList.resolvePadding(); }
Called when one of the variables affecting enabled state changes. @param peekIfEnabled whether the thumb should peek, if enabled
FastScroller::onStateDependencyChanged
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
public void stop() { setState(STATE_NONE); }
Immediately transitions the fast scroller decorations to a hidden state.
FastScroller::stop
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private TextView createPreviewTextView(Context context) { final LayoutParams params = new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); final TextView textView = new TextView(context); textView.setLayoutParams(params); textView.setSingleLine(true); textView.setEllipsize(TruncateAt.MIDDLE); textView.setGravity(Gravity.CENTER); textView.setAlpha(0f); // Manually propagate inherited layout direction. textView.setLayoutDirection(mList.getLayoutDirection()); return textView; }
Creates a view into which preview text can be placed.
FastScroller::createPreviewTextView
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
public void updateLayout() { // Prevent re-entry when RTL properties change as a side-effect of // resolving padding. if (mUpdatingLayout) { return; } mUpdatingLayout = true; updateContainerRect(); layoutThumb(); layoutTrack(); updateOffsetAndRange(); final Rect bounds = mTempBounds; measurePreview(mPrimaryText, bounds); applyLayout(mPrimaryText, bounds); measurePreview(mSecondaryText, bounds); applyLayout(mSecondaryText, bounds); if (mPreviewImage != null) { // Apply preview image padding. bounds.left -= mPreviewImage.getPaddingLeft(); bounds.top -= mPreviewImage.getPaddingTop(); bounds.right += mPreviewImage.getPaddingRight(); bounds.bottom += mPreviewImage.getPaddingBottom(); applyLayout(mPreviewImage, bounds); } mUpdatingLayout = false; }
Measures and layouts the scrollbar and decorations.
FastScroller::updateLayout
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void applyLayout(View view, Rect bounds) { view.layout(bounds.left, bounds.top, bounds.right, bounds.bottom); view.setPivotX(mLayoutFromRight ? bounds.right - bounds.left : 0); }
Layouts a view within the specified bounds and pins the pivot point to the appropriate edge. @param view The view to layout. @param bounds Bounds at which to layout the view.
FastScroller::applyLayout
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void measurePreview(View v, Rect out) { // Apply the preview image's padding as layout margins. final Rect margins = mTempMargins; margins.left = mPreviewImage.getPaddingLeft(); margins.top = mPreviewImage.getPaddingTop(); margins.right = mPreviewImage.getPaddingRight(); margins.bottom = mPreviewImage.getPaddingBottom(); if (mOverlayPosition == OVERLAY_FLOATING) { measureFloating(v, margins, out); } else { measureViewToSide(v, mThumbImage, margins, out); } }
Measures the preview text bounds, taking preview image padding into account. This method should only be called after {@link #layoutThumb()} and {@link #layoutTrack()} have both been called at least once. @param v The preview text view to measure. @param out Rectangle into which measured bounds are placed.
FastScroller::measurePreview
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void measureViewToSide(View view, View adjacent, Rect margins, Rect out) { final int marginLeft; final int marginTop; final int marginRight; if (margins == null) { marginLeft = 0; marginTop = 0; marginRight = 0; } else { marginLeft = margins.left; marginTop = margins.top; marginRight = margins.right; } final Rect container = mContainerRect; final int containerWidth = container.width(); final int maxWidth; if (adjacent == null) { maxWidth = containerWidth; } else if (mLayoutFromRight) { maxWidth = adjacent.getLeft(); } else { maxWidth = containerWidth - adjacent.getRight(); } final int adjMaxHeight = Math.max(0, container.height()); final int adjMaxWidth = Math.max(0, maxWidth - marginLeft - marginRight); final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(adjMaxWidth, MeasureSpec.AT_MOST); final int heightMeasureSpec = MeasureSpec.makeSafeMeasureSpec( adjMaxHeight, MeasureSpec.UNSPECIFIED); view.measure(widthMeasureSpec, heightMeasureSpec); // Align to the left or right. final int width = Math.min(adjMaxWidth, view.getMeasuredWidth()); final int left; final int right; if (mLayoutFromRight) { right = (adjacent == null ? container.right : adjacent.getLeft()) - marginRight; left = right - width; } else { left = (adjacent == null ? container.left : adjacent.getRight()) + marginLeft; right = left + width; } // Don't adjust the vertical position. final int top = marginTop; final int bottom = top + view.getMeasuredHeight(); out.set(left, top, right, bottom); }
Measures the bounds for a view that should be laid out against the edge of an adjacent view. If no adjacent view is provided, lays out against the list edge. @param view The view to measure for layout. @param adjacent (Optional) The adjacent view, may be null to align to the list edge. @param margins Layout margins to apply to the view. @param out Rectangle into which measured bounds are placed.
FastScroller::measureViewToSide
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void updateContainerRect() { final AbsListView list = mList; list.resolvePadding(); final Rect container = mContainerRect; container.left = 0; container.top = 0; container.right = list.getWidth(); container.bottom = list.getHeight(); final int scrollbarStyle = mScrollBarStyle; if (scrollbarStyle == View.SCROLLBARS_INSIDE_INSET || scrollbarStyle == View.SCROLLBARS_INSIDE_OVERLAY) { container.left += list.getPaddingLeft(); container.top += list.getPaddingTop(); container.right -= list.getPaddingRight(); container.bottom -= list.getPaddingBottom(); // In inset mode, we need to adjust for padded scrollbar width. if (scrollbarStyle == View.SCROLLBARS_INSIDE_INSET) { final int width = getWidth(); if (mScrollbarPosition == View.SCROLLBAR_POSITION_RIGHT) { container.right += width; } else { container.left -= width; } } } }
Updates the container rectangle used for layout.
FastScroller::updateContainerRect
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void layoutThumb() { final Rect bounds = mTempBounds; measureViewToSide(mThumbImage, null, null, bounds); applyLayout(mThumbImage, bounds); }
Lays out the thumb according to the current scrollbar position.
FastScroller::layoutThumb
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void layoutTrack() { final View track = mTrackImage; final View thumb = mThumbImage; final Rect container = mContainerRect; final int maxWidth = Math.max(0, container.width()); final int maxHeight = Math.max(0, container.height()); final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(maxWidth, MeasureSpec.AT_MOST); final int heightMeasureSpec = MeasureSpec.makeSafeMeasureSpec( maxHeight, MeasureSpec.UNSPECIFIED); track.measure(widthMeasureSpec, heightMeasureSpec); final int top; final int bottom; if (mThumbPosition == THUMB_POSITION_INSIDE) { top = container.top; bottom = container.bottom; } else { final int thumbHalfHeight = thumb.getHeight() / 2; top = container.top + thumbHalfHeight; bottom = container.bottom - thumbHalfHeight; } final int trackWidth = track.getMeasuredWidth(); final int left = thumb.getLeft() + (thumb.getWidth() - trackWidth) / 2; final int right = left + trackWidth; track.layout(left, top, right, bottom); }
Lays out the track centered on the thumb. Must be called after {@link #layoutThumb}.
FastScroller::layoutTrack
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void updateOffsetAndRange() { final View trackImage = mTrackImage; final View thumbImage = mThumbImage; final float min; final float max; if (mThumbPosition == THUMB_POSITION_INSIDE) { final float halfThumbHeight = thumbImage.getHeight() / 2f; min = trackImage.getTop() + halfThumbHeight; max = trackImage.getBottom() - halfThumbHeight; } else{ min = trackImage.getTop(); max = trackImage.getBottom(); } mThumbOffset = min; mThumbRange = max - min; }
Updates the offset and range used to convert from absolute y-position to thumb position within the track.
FastScroller::updateOffsetAndRange
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void transitionToHidden() { if (mDecorAnimation != null) { mDecorAnimation.cancel(); } final Animator fadeOut = groupAnimatorOfFloat(View.ALPHA, 0f, mThumbImage, mTrackImage, mPreviewImage, mPrimaryText, mSecondaryText).setDuration(DURATION_FADE_OUT); // Push the thumb and track outside the list bounds. final float offset = mLayoutFromRight ? mThumbImage.getWidth() : -mThumbImage.getWidth(); final Animator slideOut = groupAnimatorOfFloat( View.TRANSLATION_X, offset, mThumbImage, mTrackImage) .setDuration(DURATION_FADE_OUT); mDecorAnimation = new AnimatorSet(); mDecorAnimation.playTogether(fadeOut, slideOut); mDecorAnimation.start(); mShowingPreview = false; }
Shows nothing.
FastScroller::transitionToHidden
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void transitionToVisible() { if (mDecorAnimation != null) { mDecorAnimation.cancel(); } final Animator fadeIn = groupAnimatorOfFloat(View.ALPHA, 1f, mThumbImage, mTrackImage) .setDuration(DURATION_FADE_IN); final Animator fadeOut = groupAnimatorOfFloat( View.ALPHA, 0f, mPreviewImage, mPrimaryText, mSecondaryText) .setDuration(DURATION_FADE_OUT); final Animator slideIn = groupAnimatorOfFloat( View.TRANSLATION_X, 0f, mThumbImage, mTrackImage).setDuration(DURATION_FADE_IN); mDecorAnimation = new AnimatorSet(); mDecorAnimation.playTogether(fadeIn, fadeOut, slideIn); mDecorAnimation.start(); mShowingPreview = false; }
Shows the thumb and track.
FastScroller::transitionToVisible
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void transitionToDragging() { if (mDecorAnimation != null) { mDecorAnimation.cancel(); } final Animator fadeIn = groupAnimatorOfFloat( View.ALPHA, 1f, mThumbImage, mTrackImage, mPreviewImage) .setDuration(DURATION_FADE_IN); final Animator slideIn = groupAnimatorOfFloat( View.TRANSLATION_X, 0f, mThumbImage, mTrackImage).setDuration(DURATION_FADE_IN); mDecorAnimation = new AnimatorSet(); mDecorAnimation.playTogether(fadeIn, slideIn); mDecorAnimation.start(); mShowingPreview = true; }
Shows the thumb, preview, and track.
FastScroller::transitionToDragging
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void scrollTo(float position) { mScrollCompleted = false; final int count = mList.getCount(); final Object[] sections = mSections; final int sectionCount = sections == null ? 0 : sections.length; int sectionIndex; if (sections != null && sectionCount > 1) { final int exactSection = MathUtils.constrain( (int) (position * sectionCount), 0, sectionCount - 1); int targetSection = exactSection; int targetIndex = mSectionIndexer.getPositionForSection(targetSection); sectionIndex = targetSection; // Given the expected section and index, the following code will // try to account for missing sections (no names starting with..) // It will compute the scroll space of surrounding empty sections // and interpolate the currently visible letter's range across the // available space, so that there is always some list movement while // the user moves the thumb. int nextIndex = count; int prevIndex = targetIndex; int prevSection = targetSection; int nextSection = targetSection + 1; // Assume the next section is unique if (targetSection < sectionCount - 1) { nextIndex = mSectionIndexer.getPositionForSection(targetSection + 1); } // Find the previous index if we're slicing the previous section if (nextIndex == targetIndex) { // Non-existent letter while (targetSection > 0) { targetSection--; prevIndex = mSectionIndexer.getPositionForSection(targetSection); if (prevIndex != targetIndex) { prevSection = targetSection; sectionIndex = targetSection; break; } else if (targetSection == 0) { // When section reaches 0 here, sectionIndex must follow it. // Assuming mSectionIndexer.getPositionForSection(0) == 0. sectionIndex = 0; break; } } } // Find the next index, in case the assumed next index is not // unique. For instance, if there is no P, then request for P's // position actually returns Q's. So we need to look ahead to make // sure that there is really a Q at Q's position. If not, move // further down... int nextNextSection = nextSection + 1; while (nextNextSection < sectionCount && mSectionIndexer.getPositionForSection(nextNextSection) == nextIndex) { nextNextSection++; nextSection++; } // Compute the beginning and ending scroll range percentage of the // currently visible section. This could be equal to or greater than // (1 / nSections). If the target position is near the previous // position, snap to the previous position. final float prevPosition = (float) prevSection / sectionCount; final float nextPosition = (float) nextSection / sectionCount; final float snapThreshold = (count == 0) ? Float.MAX_VALUE : .125f / count; if (prevSection == exactSection && position - prevPosition < snapThreshold) { targetIndex = prevIndex; } else { targetIndex = prevIndex + (int) ((nextIndex - prevIndex) * (position - prevPosition) / (nextPosition - prevPosition)); } // Clamp to valid positions. targetIndex = MathUtils.constrain(targetIndex, 0, count - 1); if (mList instanceof ExpandableListView) { final ExpandableListView expList = (ExpandableListView) mList; expList.setSelectionFromTop(expList.getFlatListPosition( ExpandableListView.getPackedPositionForGroup(targetIndex + mHeaderCount)), 0); } else if (mList instanceof ListView) { ((ListView) mList).setSelectionFromTop(targetIndex + mHeaderCount, 0); } else { mList.setSelection(targetIndex + mHeaderCount); } } else { final int index = MathUtils.constrain((int) (position * count), 0, count - 1); if (mList instanceof ExpandableListView) { ExpandableListView expList = (ExpandableListView) mList; expList.setSelectionFromTop(expList.getFlatListPosition( ExpandableListView.getPackedPositionForGroup(index + mHeaderCount)), 0); } else if (mList instanceof ListView) { ((ListView)mList).setSelectionFromTop(index + mHeaderCount, 0); } else { mList.setSelection(index + mHeaderCount); } sectionIndex = -1; } if (mCurrentSection != sectionIndex) { mCurrentSection = sectionIndex; final boolean hasPreview = transitionPreviewLayout(sectionIndex); if (!mShowingPreview && hasPreview) { transitionToDragging(); } else if (mShowingPreview && !hasPreview) { transitionToVisible(); } } }
Scrolls to a specific position within the section @param position
FastScroller::scrollTo
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private boolean transitionPreviewLayout(int sectionIndex) { final Object[] sections = mSections; String text = null; if (sections != null && sectionIndex >= 0 && sectionIndex < sections.length) { final Object section = sections[sectionIndex]; if (section != null) { text = section.toString(); } } final Rect bounds = mTempBounds; final View preview = mPreviewImage; final TextView showing; final TextView target; if (mShowingPrimary) { showing = mPrimaryText; target = mSecondaryText; } else { showing = mSecondaryText; target = mPrimaryText; } // Set and layout target immediately. target.setText(text); measurePreview(target, bounds); applyLayout(target, bounds); if (mPreviewAnimation != null) { mPreviewAnimation.cancel(); } // Cross-fade preview text. final Animator showTarget = animateAlpha(target, 1f).setDuration(DURATION_CROSS_FADE); final Animator hideShowing = animateAlpha(showing, 0f).setDuration(DURATION_CROSS_FADE); hideShowing.addListener(mSwitchPrimaryListener); // Apply preview image padding and animate bounds, if necessary. bounds.left -= preview.getPaddingLeft(); bounds.top -= preview.getPaddingTop(); bounds.right += preview.getPaddingRight(); bounds.bottom += preview.getPaddingBottom(); final Animator resizePreview = animateBounds(preview, bounds); resizePreview.setDuration(DURATION_RESIZE); mPreviewAnimation = new AnimatorSet(); final AnimatorSet.Builder builder = mPreviewAnimation.play(hideShowing).with(showTarget); builder.with(resizePreview); // The current preview size is unaffected by hidden or showing. It's // used to set starting scales for things that need to be scaled down. final int previewWidth = preview.getWidth() - preview.getPaddingLeft() - preview.getPaddingRight(); // If target is too large, shrink it immediately to fit and expand to // target size. Otherwise, start at target size. final int targetWidth = target.getWidth(); if (targetWidth > previewWidth) { target.setScaleX((float) previewWidth / targetWidth); final Animator scaleAnim = animateScaleX(target, 1f).setDuration(DURATION_RESIZE); builder.with(scaleAnim); } else { target.setScaleX(1f); } // If showing is larger than target, shrink to target size. final int showingWidth = showing.getWidth(); if (showingWidth > targetWidth) { final float scale = (float) targetWidth / showingWidth; final Animator scaleAnim = animateScaleX(showing, scale).setDuration(DURATION_RESIZE); builder.with(scaleAnim); } mPreviewAnimation.start(); return !TextUtils.isEmpty(text); }
Transitions the preview text to a new section. Handles animation, measurement, and layout. If the new preview text is empty, returns false. @param sectionIndex The section index to which the preview should transition. @return False if the new preview text is empty.
FastScroller::transitionPreviewLayout
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void setThumbPos(float position) { final float thumbMiddle = position * mThumbRange + mThumbOffset; mThumbImage.setTranslationY(thumbMiddle - mThumbImage.getHeight() / 2f); final View previewImage = mPreviewImage; final float previewHalfHeight = previewImage.getHeight() / 2f; final float previewPos; switch (mOverlayPosition) { case OVERLAY_AT_THUMB: previewPos = thumbMiddle; break; case OVERLAY_ABOVE_THUMB: previewPos = thumbMiddle - previewHalfHeight; break; case OVERLAY_FLOATING: default: previewPos = 0; break; } // Center the preview on the thumb, constrained to the list bounds. final Rect container = mContainerRect; final int top = container.top; final int bottom = container.bottom; final float minP = top + previewHalfHeight; final float maxP = bottom - previewHalfHeight; final float previewMiddle = MathUtils.constrain(previewPos, minP, maxP); final float previewTop = previewMiddle - previewHalfHeight; previewImage.setTranslationY(previewTop); mPrimaryText.setTranslationY(previewTop); mSecondaryText.setTranslationY(previewTop); }
Positions the thumb and preview widgets. @param position The position, between 0 and 1, along the track at which to place the thumb.
FastScroller::setThumbPos
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private float getPosFromItemCount( int firstVisibleItem, int visibleItemCount, int totalItemCount) { final SectionIndexer sectionIndexer = mSectionIndexer; if (sectionIndexer == null || mListAdapter == null) { getSectionsFromIndexer(); } if (visibleItemCount == 0 || totalItemCount == 0) { // No items are visible. return 0; } final boolean hasSections = sectionIndexer != null && mSections != null && mSections.length > 0; if (!hasSections || !mMatchDragPosition) { if (visibleItemCount == totalItemCount) { // All items are visible. return 0; } else { return (float) firstVisibleItem / (totalItemCount - visibleItemCount); } } // Ignore headers. firstVisibleItem -= mHeaderCount; if (firstVisibleItem < 0) { return 0; } totalItemCount -= mHeaderCount; // Hidden portion of the first visible row. final View child = mList.getChildAt(0); final float incrementalPos; if (child == null || child.getHeight() == 0) { incrementalPos = 0; } else { incrementalPos = (float) (mList.getPaddingTop() - child.getTop()) / child.getHeight(); } // Number of rows in this section. final int section = sectionIndexer.getSectionForPosition(firstVisibleItem); final int sectionPos = sectionIndexer.getPositionForSection(section); final int sectionCount = mSections.length; final int positionsInSection; if (section < sectionCount - 1) { final int nextSectionPos; if (section + 1 < sectionCount) { nextSectionPos = sectionIndexer.getPositionForSection(section + 1); } else { nextSectionPos = totalItemCount - 1; } positionsInSection = nextSectionPos - sectionPos; } else { positionsInSection = totalItemCount - sectionPos; } // Position within this section. final float posWithinSection; if (positionsInSection == 0) { posWithinSection = 0; } else { posWithinSection = (firstVisibleItem + incrementalPos - sectionPos) / positionsInSection; } float result = (section + posWithinSection) / sectionCount; // Fake out the scroll bar for the last item. Since the section indexer // won't ever actually move the list in this end space, make scrolling // across the last item account for whatever space is remaining. if (firstVisibleItem > 0 && firstVisibleItem + visibleItemCount == totalItemCount) { final View lastChild = mList.getChildAt(visibleItemCount - 1); final int bottomPadding = mList.getPaddingBottom(); final int maxSize; final int currentVisibleSize; if (mList.getClipToPadding()) { maxSize = lastChild.getHeight(); currentVisibleSize = mList.getHeight() - bottomPadding - lastChild.getTop(); } else { maxSize = lastChild.getHeight() + bottomPadding; currentVisibleSize = mList.getHeight() - lastChild.getTop(); } if (currentVisibleSize > 0 && maxSize > 0) { result += (1 - result) * ((float) currentVisibleSize / maxSize ); } } return result; }
Calculates the thumb position based on the visible items. @param firstVisibleItem First visible item, >= 0. @param visibleItemCount Number of visible items, >= 0. @param totalItemCount Total number of items, >= 0. @return
FastScroller::getPosFromItemCount
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void cancelFling() { final MotionEvent cancelFling = MotionEvent.obtain( 0, 0, MotionEvent.ACTION_CANCEL, 0, 0, 0); mList.onTouchEvent(cancelFling); cancelFling.recycle(); }
Cancels an ongoing fling event by injecting a {@link MotionEvent#ACTION_CANCEL} into the host view.
FastScroller::cancelFling
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void cancelPendingDrag() { mPendingDrag = -1; }
Cancels a pending drag. @see #startPendingDrag()
FastScroller::cancelPendingDrag
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private void startPendingDrag() { mPendingDrag = SystemClock.uptimeMillis() + TAP_TIMEOUT; }
Delays dragging until after the framework has determined that the user is scrolling, rather than tapping.
FastScroller::startPendingDrag
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private boolean isPointInside(float x, float y) { return isPointInsideX(x) && (mTrackDrawable != null || isPointInsideY(y)); }
Returns whether a coordinate is inside the scroller's activation area. If there is a track image, touching anywhere within the thumb-width of the track activates scrolling. Otherwise, the user has to touch inside thumb itself. @param x The x-coordinate. @param y The y-coordinate. @return Whether the coordinate is inside the scroller's activation area.
FastScroller::isPointInside
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT
private static Animator groupAnimatorOfFloat( Property<View, Float> property, float value, View... views) { AnimatorSet animSet = new AnimatorSet(); AnimatorSet.Builder builder = null; for (int i = views.length - 1; i >= 0; i--) { final Animator anim = ObjectAnimator.ofFloat(views[i], property, value); if (builder == null) { builder = animSet.play(anim); } else { builder.with(anim); } } return animSet; }
Constructs an animator for the specified property on a group of views. See {@link ObjectAnimator#ofFloat(Object, String, float...)} for implementation details. @param property The property being animated. @param value The value to which that property should animate. @param views The target views to animate. @return An animator for all the specified views.
FastScroller::groupAnimatorOfFloat
java
Reginer/aosp-android-jar
android-34/src/android/widget/FastScroller.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/widget/FastScroller.java
MIT