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 HighSpeedVideoConfiguration( final int width, final int height, final int fpsMin, final int fpsMax, final int batchSizeMax) { if (fpsMax < HIGH_SPEED_MAX_MINIMAL_FPS) { throw new IllegalArgumentException("fpsMax must be at least " + HIGH_SPEED_MAX_MINIMAL_FPS); } mFpsMax = fpsMax; mWidth = checkArgumentPositive(width, "width must be positive"); mHeight = checkArgumentPositive(height, "height must be positive"); mFpsMin = checkArgumentPositive(fpsMin, "fpsMin must be positive"); mSize = new Size(mWidth, mHeight); mBatchSizeMax = checkArgumentPositive(batchSizeMax, "batchSizeMax must be positive"); mFpsRange = new Range<Integer>(mFpsMin, mFpsMax); }
Create a new {@link HighSpeedVideoConfiguration}. @param width image width, in pixels (positive) @param height image height, in pixels (positive) @param fpsMin minimum frames per second for the configuration (positive) @param fpsMax maximum frames per second for the configuration (larger or equal to 60) @throws IllegalArgumentException if width/height/fpsMin were not positive or fpsMax less than 60 @hide
HighSpeedVideoConfiguration::HighSpeedVideoConfiguration
java
Reginer/aosp-android-jar
android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
MIT
public int getWidth() { return mWidth; }
Return the width of the high speed video configuration. @return width > 0
HighSpeedVideoConfiguration::getWidth
java
Reginer/aosp-android-jar
android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
MIT
public int getHeight() { return mHeight; }
Return the height of the high speed video configuration. @return height > 0
HighSpeedVideoConfiguration::getHeight
java
Reginer/aosp-android-jar
android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
MIT
public int getFpsMin() { return mFpsMin; }
Return the minimum frame per second of the high speed video configuration. @return fpsMin > 0
HighSpeedVideoConfiguration::getFpsMin
java
Reginer/aosp-android-jar
android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
MIT
public int getFpsMax() { return mFpsMax; }
Return the maximum frame per second of the high speed video configuration. @return fpsMax >= 60
HighSpeedVideoConfiguration::getFpsMax
java
Reginer/aosp-android-jar
android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
MIT
public Size getSize() { return mSize; }
Convenience method to return the size of this high speed video configuration. @return a Size with positive width and height
HighSpeedVideoConfiguration::getSize
java
Reginer/aosp-android-jar
android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
MIT
public int getBatchSizeMax() { return mBatchSizeMax; }
Convenience method to return the max batch size of this high speed video configuration. @return the maximal batch size for this high speed video configuration
HighSpeedVideoConfiguration::getBatchSizeMax
java
Reginer/aosp-android-jar
android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
MIT
public Range<Integer> getFpsRange() { return mFpsRange; }
Convenience method to return the FPS range of this high speed video configuration. @return a Range with high bound >= {@value #HIGH_SPEED_MAX_MINIMAL_FPS}
HighSpeedVideoConfiguration::getFpsRange
java
Reginer/aosp-android-jar
android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/camera2/params/HighSpeedVideoConfiguration.java
MIT
public void addAreas(ILocalWallpaperColorConsumer consumer, List<RectF> areas, int displayId) { IBinder binder = consumer.asBinder(); SparseArray<ArraySet<RectF>> displays = mLocalColorAreas.get(binder); ArraySet<RectF> displayAreas = null; if (displays == null) { try { consumer.asBinder().linkToDeath(() -> mLocalColorAreas.remove(consumer.asBinder()), 0); } catch (RemoteException e) { e.printStackTrace(); } displays = new SparseArray<>(); mLocalColorAreas.put(binder, displays); } else { displayAreas = displays.get(displayId); } if (displayAreas == null) { displayAreas = new ArraySet(areas); displays.put(displayId, displayAreas); } for (int i = 0; i < areas.size(); i++) { displayAreas.add(areas.get(i)); } mCallbacks.register(consumer); }
Add areas to a consumer @param consumer @param areas @param displayId
LocalColorRepository::addAreas
java
Reginer/aosp-android-jar
android-32/src/com/android/server/wallpaper/LocalColorRepository.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/wallpaper/LocalColorRepository.java
MIT
public List<RectF> removeAreas(ILocalWallpaperColorConsumer consumer, List<RectF> areas, int displayId) { IBinder binder = consumer.asBinder(); SparseArray<ArraySet<RectF>> displays = mLocalColorAreas.get(binder); ArraySet<RectF> registeredAreas = null; if (displays != null) { registeredAreas = displays.get(displayId); if (registeredAreas == null) { mCallbacks.unregister(consumer); } else { for (int i = 0; i < areas.size(); i++) { registeredAreas.remove(areas.get(i)); } if (registeredAreas.size() == 0) { displays.remove(displayId); } } if (displays.size() == 0) { mLocalColorAreas.remove(binder); mCallbacks.unregister(consumer); } } else { mCallbacks.unregister(consumer); } ArraySet<RectF> purged = new ArraySet<>(areas); for (int i = 0; i < mLocalColorAreas.size(); i++) { for (int j = 0; j < mLocalColorAreas.valueAt(i).size(); j++) { for (int k = 0; k < mLocalColorAreas.valueAt(i).valueAt(j).size(); k++) { purged.remove(mLocalColorAreas.valueAt(i).valueAt(j).valueAt(k)); } } } return new ArrayList(purged); }
remove an area for a consumer @param consumer @param areas @param displayId @return the areas that are removed from all callbacks
LocalColorRepository::removeAreas
java
Reginer/aosp-android-jar
android-32/src/com/android/server/wallpaper/LocalColorRepository.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/wallpaper/LocalColorRepository.java
MIT
public List<RectF> getAreasByDisplayId(int displayId) { ArrayList<RectF> areas = new ArrayList(); for (int i = 0; i < mLocalColorAreas.size(); i++) { SparseArray<ArraySet<RectF>> displays = mLocalColorAreas.valueAt(i); if (displays == null) continue; ArraySet<RectF> displayAreas = displays.get(displayId); if (displayAreas == null) continue; for (int j = 0; j < displayAreas.size(); j++) { areas.add(displayAreas.valueAt(j)); } } return areas; }
Return the local areas by display id @param displayId @return
LocalColorRepository::getAreasByDisplayId
java
Reginer/aosp-android-jar
android-32/src/com/android/server/wallpaper/LocalColorRepository.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/wallpaper/LocalColorRepository.java
MIT
public void forEachCallback(Consumer<ILocalWallpaperColorConsumer> callback, RectF area, int displayId) { mCallbacks.broadcast(cb -> { IBinder binder = cb.asBinder(); SparseArray<ArraySet<RectF>> displays = mLocalColorAreas.get(binder); if (displays == null) return; ArraySet<RectF> displayAreas = displays.get(displayId); if (displayAreas != null && displayAreas.contains(area)) callback.accept(cb); }); }
invoke a callback for each area of interest @param callback @param area @param displayId
LocalColorRepository::forEachCallback
java
Reginer/aosp-android-jar
android-32/src/com/android/server/wallpaper/LocalColorRepository.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/wallpaper/LocalColorRepository.java
MIT
public AlgorithmId(ObjectIdentifier oid) { algid = oid; }
Constructs a parameterless algorithm ID. @param oid the identifier for the algorithm
AlgorithmId::AlgorithmId
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public AlgorithmId(ObjectIdentifier oid, AlgorithmParameters algparams) { algid = oid; algParams = algparams; constructedFromDer = false; }
Constructs an algorithm ID with algorithm parameters. @param oid the identifier for the algorithm. @param algparams the associated algorithm parameters.
AlgorithmId::AlgorithmId
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public final void encode(DerOutputStream out) throws IOException { derEncode(out); }
Marshal a DER-encoded "AlgorithmID" sequence on the DER stream. @param out {@link DerInputStream} to write encoded data to @throws IOException on encoding error
AlgorithmId::encode
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public void derEncode (OutputStream out) throws IOException { DerOutputStream bytes = new DerOutputStream(); DerOutputStream tmp = new DerOutputStream(); bytes.putOID(algid); // Setup params from algParams since no DER encoding is given if (constructedFromDer == false) { if (algParams != null) { params = new DerValue(algParams.getEncoded()); } else { params = null; } } if (params == null) { // Changes backed out for compatibility with Solaris // Several AlgorithmId should omit the whole parameter part when // it's NULL. They are --- // rfc3370 2.1: Implementations SHOULD generate SHA-1 // AlgorithmIdentifiers with absent parameters. // rfc3447 C1: When id-sha1, id-sha224, id-sha256, id-sha384 and // id-sha512 are used in an AlgorithmIdentifier the parameters // (which are optional) SHOULD be omitted. // rfc3279 2.3.2: The id-dsa algorithm syntax includes optional // domain parameters... When omitted, the parameters component // MUST be omitted entirely // rfc3370 3.1: When the id-dsa-with-sha1 algorithm identifier // is used, the AlgorithmIdentifier parameters field MUST be absent. /*if ( algid.equals((Object)SHA_oid) || algid.equals((Object)SHA224_oid) || algid.equals((Object)SHA256_oid) || algid.equals((Object)SHA384_oid) || algid.equals((Object)SHA512_oid) || algid.equals((Object)DSA_oid) || algid.equals((Object)sha1WithDSA_oid)) { ; // no parameter part encoded } else { bytes.putNull(); }*/ bytes.putNull(); } else { bytes.putDerValue(params); } tmp.write(DerValue.tag_Sequence, bytes); out.write(tmp.toByteArray()); }
DER encode this object onto an output stream. Implements the <code>DerEncoder</code> interface. @param out the output stream on which to write the DER encoding. @exception IOException on encoding error.
AlgorithmId::derEncode
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public final byte[] encode() throws IOException { DerOutputStream out = new DerOutputStream(); derEncode(out); return out.toByteArray(); }
Returns the DER-encoded X.509 AlgorithmId as a byte array.
AlgorithmId::encode
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public final ObjectIdentifier getOID () { return algid; }
Returns the ISO OID for this algorithm. This is usually converted to a string and used as part of an algorithm name, for example "OID.1.3.14.3.2.13" style notation. Use the <code>getName</code> call when you do not need to ensure cross-system portability of algorithm names, or need a user friendly name.
AlgorithmId::getOID
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public String getName() { String algName = nameTable.get(algid); if (algName != null) { return algName; } if ((params != null) && algid.equals((Object)specifiedWithECDSA_oid)) { try { AlgorithmId paramsId = AlgorithmId.parse(new DerValue(getEncodedParams())); String paramsName = paramsId.getName(); algName = makeSigAlg(paramsName, "EC"); } catch (IOException e) { // ignore } } // BEGIN Android-added: Update algorithm mapping tables for names when OID is used // Try to update the name <-> OID mapping table. synchronized (oidTable) { reinitializeMappingTableLocked(); algName = nameTable.get(algid); } // END Android-added: Update algorithm mapping tables for names when OID is used return (algName == null) ? algid.toString() : algName; }
Returns a name for the algorithm which may be more intelligible to humans than the algorithm's OID, but which won't necessarily be comprehensible on other systems. For example, this might return a name such as "MD5withRSA" for a signature algorithm on some systems. It also returns names like "OID.1.2.3.4", when no particular name for the algorithm is known. @return name of the algorithm
AlgorithmId::getName
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public byte[] getEncodedParams() throws IOException { return (params == null) ? null : params.toByteArray(); }
Returns the DER encoded parameter, which can then be used to initialize java.security.AlgorithmParamters. @return DER encoded parameters, or null not present.
AlgorithmId::getEncodedParams
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public boolean equals(AlgorithmId other) { boolean paramsEqual = (params == null ? other.params == null : params.equals(other.params)); return (algid.equals((Object)other.algid) && paramsEqual); }
Returns true iff the argument indicates the same algorithm with the same parameters.
AlgorithmId::equals
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public boolean equals(Object other) { if (this == other) { return true; } if (other instanceof AlgorithmId) { return equals((AlgorithmId) other); } else if (other instanceof ObjectIdentifier) { return equals((ObjectIdentifier) other); } else { return false; } }
Compares this AlgorithmID to another. If algorithm parameters are available, they are compared. Otherwise, just the object IDs for the algorithm are compared. @param other preferably an AlgorithmId, else an ObjectIdentifier
AlgorithmId::equals
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public final boolean equals(ObjectIdentifier id) { return algid.equals((Object)id); }
Compares two algorithm IDs for equality. Returns true iff they are the same algorithm, ignoring algorithm parameters.
AlgorithmId::equals
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public int hashCode() { StringBuilder sbuf = new StringBuilder(); sbuf.append(algid.toString()); sbuf.append(paramsToString()); return sbuf.toString().hashCode(); }
Returns a hashcode for this AlgorithmId. @return a hashcode for this AlgorithmId.
AlgorithmId::hashCode
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
protected String paramsToString() { if (params == null) { return ""; } else if (algParams != null) { return algParams.toString(); } else { return ", params unparsed"; } }
Provides a human-readable description of the algorithm parameters. This may be redefined by subclasses which parse those parameters.
AlgorithmId::paramsToString
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public String toString() { return getName() + paramsToString(); }
Returns a string describing the algorithm and its parameters.
AlgorithmId::toString
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public static AlgorithmId parse(DerValue val) throws IOException { if (val.tag != DerValue.tag_Sequence) { throw new IOException("algid parse error, not a sequence"); } /* * Get the algorithm ID and any parameters. */ ObjectIdentifier algid; DerValue params; DerInputStream in = val.toDerInputStream(); algid = in.getOID(); if (in.available() == 0) { params = null; } else { params = in.getDerValue(); if (params.tag == DerValue.tag_Null) { if (params.length() != 0) { throw new IOException("invalid NULL"); } params = null; } if (in.available() != 0) { throw new IOException("Invalid AlgorithmIdentifier: extra data"); } } return new AlgorithmId(algid, params); }
Parse (unmarshal) an ID from a DER sequence input value. This form parsing might be used when expanding a value which has already been partially unmarshaled as a set or sequence member. @exception IOException on error. @param val the input value, which contains the algid and, if there are any parameters, those parameters. @return an ID for the algorithm. If the system is configured appropriately, this may be an instance of a class with some kind of special support for this algorithm. In that case, you may "narrow" the type of the ID.
AlgorithmId::parse
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public static AlgorithmId get(String algname) throws NoSuchAlgorithmException { ObjectIdentifier oid; try { oid = algOID(algname); } catch (IOException ioe) { throw new NoSuchAlgorithmException ("Invalid ObjectIdentifier " + algname); } if (oid == null) { throw new NoSuchAlgorithmException ("unrecognized algorithm name: " + algname); } return new AlgorithmId(oid); }
Returns one of the algorithm IDs most commonly associated with this algorithm name. @param algname the name being used @exception NoSuchAlgorithmException on error.
AlgorithmId::get
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public static AlgorithmId get(AlgorithmParameters algparams) throws NoSuchAlgorithmException { ObjectIdentifier oid; String algname = algparams.getAlgorithm(); try { oid = algOID(algname); } catch (IOException ioe) { throw new NoSuchAlgorithmException ("Invalid ObjectIdentifier " + algname); } if (oid == null) { throw new NoSuchAlgorithmException ("unrecognized algorithm name: " + algname); } return new AlgorithmId(oid, algparams); }
Returns one of the algorithm IDs most commonly associated with this algorithm parameters. @param algparams the associated algorithm parameters. @exception NoSuchAlgorithmException on error.
AlgorithmId::get
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
private static ObjectIdentifier algOID(String name) throws IOException { // See if algname is in printable OID ("dot-dot") notation if (name.indexOf('.') != -1) { if (name.startsWith("OID.")) { return new ObjectIdentifier(name.substring("OID.".length())); } else { return new ObjectIdentifier(name); } } // Digesting algorithms if (name.equalsIgnoreCase("MD5")) { return AlgorithmId.MD5_oid; } if (name.equalsIgnoreCase("MD2")) { return AlgorithmId.MD2_oid; } if (name.equalsIgnoreCase("SHA") || name.equalsIgnoreCase("SHA1") || name.equalsIgnoreCase("SHA-1")) { return AlgorithmId.SHA_oid; } if (name.equalsIgnoreCase("SHA-256") || name.equalsIgnoreCase("SHA256")) { return AlgorithmId.SHA256_oid; } if (name.equalsIgnoreCase("SHA-384") || name.equalsIgnoreCase("SHA384")) { return AlgorithmId.SHA384_oid; } if (name.equalsIgnoreCase("SHA-512") || name.equalsIgnoreCase("SHA512")) { return AlgorithmId.SHA512_oid; } if (name.equalsIgnoreCase("SHA-224") || name.equalsIgnoreCase("SHA224")) { return AlgorithmId.SHA224_oid; } // Various public key algorithms if (name.equalsIgnoreCase("RSA")) { return AlgorithmId.RSAEncryption_oid; } if (name.equalsIgnoreCase("Diffie-Hellman") || name.equalsIgnoreCase("DH")) { return AlgorithmId.DH_oid; } if (name.equalsIgnoreCase("DSA")) { return AlgorithmId.DSA_oid; } if (name.equalsIgnoreCase("EC")) { return EC_oid; } if (name.equalsIgnoreCase("ECDH")) { return AlgorithmId.ECDH_oid; } // Secret key algorithms if (name.equalsIgnoreCase("AES")) { return AlgorithmId.AES_oid; } // Common signature types if (name.equalsIgnoreCase("MD5withRSA") || name.equalsIgnoreCase("MD5/RSA")) { return AlgorithmId.md5WithRSAEncryption_oid; } if (name.equalsIgnoreCase("MD2withRSA") || name.equalsIgnoreCase("MD2/RSA")) { return AlgorithmId.md2WithRSAEncryption_oid; } if (name.equalsIgnoreCase("SHAwithDSA") || name.equalsIgnoreCase("SHA1withDSA") || name.equalsIgnoreCase("SHA/DSA") || name.equalsIgnoreCase("SHA1/DSA") || name.equalsIgnoreCase("DSAWithSHA1") || name.equalsIgnoreCase("DSS") || name.equalsIgnoreCase("SHA-1/DSA")) { return AlgorithmId.sha1WithDSA_oid; } if (name.equalsIgnoreCase("SHA224WithDSA")) { return AlgorithmId.sha224WithDSA_oid; } if (name.equalsIgnoreCase("SHA256WithDSA")) { return AlgorithmId.sha256WithDSA_oid; } if (name.equalsIgnoreCase("SHA1WithRSA") || name.equalsIgnoreCase("SHA1/RSA")) { return AlgorithmId.sha1WithRSAEncryption_oid; } if (name.equalsIgnoreCase("SHA1withECDSA") || name.equalsIgnoreCase("ECDSA")) { return AlgorithmId.sha1WithECDSA_oid; } if (name.equalsIgnoreCase("SHA224withECDSA")) { return AlgorithmId.sha224WithECDSA_oid; } if (name.equalsIgnoreCase("SHA256withECDSA")) { return AlgorithmId.sha256WithECDSA_oid; } if (name.equalsIgnoreCase("SHA384withECDSA")) { return AlgorithmId.sha384WithECDSA_oid; } if (name.equalsIgnoreCase("SHA512withECDSA")) { return AlgorithmId.sha512WithECDSA_oid; } // See if any of the installed providers supply a mapping from // the given algorithm name to an OID string // BEGIN Android-changed: Update algorithm mapping tables for names when OID is used synchronized (oidTable) { reinitializeMappingTableLocked(); return oidTable.get(name.toUpperCase(Locale.ENGLISH)); } }
Returns one of the algorithm IDs most commonly associated with this algorithm parameters. @param algparams the associated algorithm parameters. @exception NoSuchAlgorithmException on error. public static AlgorithmId get(AlgorithmParameters algparams) throws NoSuchAlgorithmException { ObjectIdentifier oid; String algname = algparams.getAlgorithm(); try { oid = algOID(algname); } catch (IOException ioe) { throw new NoSuchAlgorithmException ("Invalid ObjectIdentifier " + algname); } if (oid == null) { throw new NoSuchAlgorithmException ("unrecognized algorithm name: " + algname); } return new AlgorithmId(oid, algparams); } /* Translates from some common algorithm names to the OID with which they're usually associated ... this mapping is the reverse of the one below, except in those cases where synonyms are supported or where a given algorithm is commonly associated with multiple OIDs. XXX This method needs to be enhanced so that we can also pass the scope of the algorithm name to it, e.g., the algorithm name "DSA" may have a different OID when used as a "Signature" algorithm than when used as a "KeyPairGenerator" algorithm.
AlgorithmId::algOID
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public static String makeSigAlg(String digAlg, String encAlg) { digAlg = digAlg.replace("-", ""); if (encAlg.equalsIgnoreCase("EC")) encAlg = "ECDSA"; return digAlg + "with" + encAlg; }
Creates a signature algorithm name from a digest algorithm name and a encryption algorithm name.
AlgorithmId::makeSigAlg
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public static String getEncAlgFromSigAlg(String signatureAlgorithm) { signatureAlgorithm = signatureAlgorithm.toUpperCase(Locale.ENGLISH); int with = signatureAlgorithm.indexOf("WITH"); String keyAlgorithm = null; if (with > 0) { int and = signatureAlgorithm.indexOf("AND", with + 4); if (and > 0) { keyAlgorithm = signatureAlgorithm.substring(with + 4, and); } else { keyAlgorithm = signatureAlgorithm.substring(with + 4); } if (keyAlgorithm.equalsIgnoreCase("ECDSA")) { keyAlgorithm = "EC"; } } return keyAlgorithm; }
Extracts the encryption algorithm name from a signature algorithm name.
AlgorithmId::getEncAlgFromSigAlg
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
public static String getDigAlgFromSigAlg(String signatureAlgorithm) { signatureAlgorithm = signatureAlgorithm.toUpperCase(Locale.ENGLISH); int with = signatureAlgorithm.indexOf("WITH"); if (with > 0) { return signatureAlgorithm.substring(0, with); } return null; }
Extracts the digest algorithm name from a signature algorithm name.
AlgorithmId::getDigAlgFromSigAlg
java
Reginer/aosp-android-jar
android-35/src/sun/security/x509/AlgorithmId.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/sun/security/x509/AlgorithmId.java
MIT
private AnyTransliterator(String id, String theTarget, String theVariant, int theTargetScript) { super(id, null); targetScript = theTargetScript; cache = new ConcurrentHashMap<Integer, Transliterator>(); target = theTarget; if (theVariant.length() > 0) { target = theTarget + VARIANT_SEP + theVariant; } }
Private constructor @param id the ID of the form S-T or S-T/V, where T is theTarget and V is theVariant. Must not be empty. @param theTarget the target name. Must not be empty, and must name a script corresponding to theTargetScript. @param theVariant the variant name, or the empty string if there is no variant @param theTargetScript the script code corresponding to theTarget.
WidthFix::AnyTransliterator
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
public AnyTransliterator(String id, UnicodeFilter filter, String target2, int targetScript2, Transliterator widthFix2, ConcurrentHashMap<Integer, Transliterator> cache2) { super(id, filter); targetScript = targetScript2; cache = cache2; target = target2; }
@param id the ID of the form S-T or S-T/V, where T is theTarget and V is theVariant. Must not be empty. @param filter The Unicode filter. @param target2 the target name. @param targetScript2 the script code corresponding to theTarget. @param widthFix2 Not used. This parameter is deprecated. @param cache2 The Map object for cache.
WidthFix::AnyTransliterator
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
private Transliterator getTransliterator(int source) { if (source == targetScript || source == UScript.INVALID_CODE) { if (isWide(targetScript)) { return null; } else { return WidthFix.INSTANCE; } } Integer key = source; Transliterator t = cache.get(key); if (t == null) { String sourceName = UScript.getName(source); String id = sourceName + TARGET_SEP + target; try { t = Transliterator.getInstance(id, FORWARD); } catch (RuntimeException e) { } if (t == null) { // Try to pivot around Latin, our most common script id = sourceName + LATIN_PIVOT + target; try { t = Transliterator.getInstance(id, FORWARD); } catch (RuntimeException e) { } } if (t != null) { if (!isWide(targetScript)) { List<Transliterator> v = new ArrayList<Transliterator>(); v.add(WidthFix.INSTANCE); v.add(t); t = new CompoundTransliterator(v); } Transliterator prevCachedT = cache.putIfAbsent(key, t); if (prevCachedT != null) { t = prevCachedT; } } else if (!isWide(targetScript)) { return WidthFix.INSTANCE; } } return t; }
Returns a transliterator from the given source to our target or target/variant. Returns NULL if the source is the same as our target script, or if the source is USCRIPT_INVALID_CODE. Caches the result and returns the same transliterator the next time. The caller does NOT own the result and must not delete it.
WidthFix::getTransliterator
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
private boolean isWide(int script) { return script == UScript.BOPOMOFO || script == UScript.HAN || script == UScript.HANGUL || script == UScript.HIRAGANA || script == UScript.KATAKANA; }
@param targetScript2 @return
WidthFix::isWide
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
static void register() { HashMap<String, Set<String>> seen = new HashMap<String, Set<String>>(); // old code used set, but was dependent on order for (Enumeration<String> s = Transliterator.getAvailableSources(); s.hasMoreElements(); ) { String source = s.nextElement(); // Ignore the "Any" source if (source.equalsIgnoreCase(ANY)) continue; for (Enumeration<String> t = Transliterator.getAvailableTargets(source); t.hasMoreElements(); ) { String target = t.nextElement(); // Get the script code for the target. If not a script, ignore. int targetScript = scriptNameToCode(target); if (targetScript == UScript.INVALID_CODE) { continue; } Set<String> seenVariants = seen.get(target); if (seenVariants == null) { seen.put(target, seenVariants = new HashSet<String>()); } for (Enumeration<String> v = Transliterator.getAvailableVariants(source, target); v.hasMoreElements(); ) { String variant = v.nextElement(); // Only process each target/variant pair once if (seenVariants.contains(variant)) { continue; } seenVariants.add(variant); String id; id = TransliteratorIDParser.STVtoID(ANY, target, variant); AnyTransliterator trans = new AnyTransliterator(id, target, variant, targetScript); Transliterator.registerInstance(trans); Transliterator.registerSpecialInverse(target, NULL_ID, false); } } } }
Registers standard transliterators with the system. Called by Transliterator during initialization. Scan all current targets and register those that are scripts T as Any-T/V.
WidthFix::register
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
private static int scriptNameToCode(String name) { try{ int[] codes = UScript.getCode(name); return codes != null ? codes[0] : UScript.INVALID_CODE; }catch( MissingResourceException e){ ///CLOVER:OFF return UScript.INVALID_CODE; ///CLOVER:ON } }
Return the script code for a given name, or UScript.INVALID_CODE if not found.
WidthFix::scriptNameToCode
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
public ScriptRunIterator(Replaceable text, int start, int limit) { this.text = text; this.textStart = start; this.textLimit = limit; this.limit = start; }
Constructs a run iterator over the given text from start (inclusive) to limit (exclusive).
ScriptRunIterator::ScriptRunIterator
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
public boolean next() { int ch; int s; scriptCode = UScript.INVALID_CODE; // don't know script yet start = limit; // Are we done? if (start == textLimit) { return false; } // Move start back to include adjacent COMMON or INHERITED // characters while (start > textStart) { ch = text.char32At(start - 1); // look back s = UScript.getScript(ch); if (s == UScript.COMMON || s == UScript.INHERITED) { --start; } else { break; } } // Move limit ahead to include COMMON, INHERITED, and characters // of the current script. while (limit < textLimit) { ch = text.char32At(limit); // look ahead s = UScript.getScript(ch); if (s != UScript.COMMON && s != UScript.INHERITED) { if (scriptCode == UScript.INVALID_CODE) { scriptCode = s; } else if (s != scriptCode) { break; } } ++limit; } // Return true even if the entire text is COMMON / INHERITED, in // which case scriptCode will be UScript.INVALID_CODE. return true; }
Returns true if there are any more runs. true is always returned at least once. Upon return, the caller should examine scriptCode, start, and limit.
ScriptRunIterator::next
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
public void adjustLimit(int delta) { limit += delta; textLimit += delta; }
Adjusts internal indices for a change in the limit index of the given delta. A positive delta means the limit has increased.
ScriptRunIterator::adjustLimit
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
public Transliterator safeClone() { UnicodeFilter filter = getFilter(); if (filter != null && filter instanceof UnicodeSet) { filter = new UnicodeSet((UnicodeSet)filter); } return new AnyTransliterator(getID(), filter, target, targetScript, null, cache); }
Temporary hack for registry problem. Needs to be replaced by better architecture.
ScriptRunIterator::safeClone
java
Reginer/aosp-android-jar
android-35/src/android/icu/text/AnyTransliterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/text/AnyTransliterator.java
MIT
public static Locale getLocaleFromMcc(Context context, int mcc, String simLanguage) { boolean hasSimLanguage = !TextUtils.isEmpty(simLanguage); String language = hasSimLanguage ? simLanguage : defaultLanguageForMcc(mcc); String country = MccTable.countryCodeForMcc(mcc); Rlog.d(LOG_TAG, "getLocaleFromMcc(" + language + ", " + country + ", " + mcc); final Locale locale = getLocaleForLanguageCountry(context, language, country); // If we couldn't find a locale that matches the SIM language, give it a go again // with the "likely" language for the given country. if (locale == null && hasSimLanguage) { language = defaultLanguageForMcc(mcc); Rlog.d(LOG_TAG, "[retry ] getLocaleFromMcc(" + language + ", " + country + ", " + mcc); return getLocaleForLanguageCountry(context, language, country); } return locale; }
Get Locale based on the MCC of the SIM. @param context Context to act on. @param mcc Mobile Country Code of the SIM or SIM-like entity (build prop on CDMA) @param simLanguage (nullable) the language from the SIM records (if present). @return locale for the mcc or null if none
LocaleUtils::getLocaleFromMcc
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/LocaleUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/LocaleUtils.java
MIT
private static Locale getLocaleForLanguageCountry(Context context, String language, String country) { if (language == null) { Rlog.d(LOG_TAG, "getLocaleForLanguageCountry: skipping no language"); return null; // no match possible } if (country == null) { country = ""; // The Locale constructor throws if passed null. } final Locale target = new Locale(language, country); try { String[] localeArray = context.getAssets().getLocales(); List<String> locales = new ArrayList<>(Arrays.asList(localeArray)); // Even in developer mode, you don't want the pseudolocales. locales.remove("ar-XB"); locales.remove("en-XA"); List<Locale> languageMatches = new ArrayList<>(); for (String locale : locales) { final Locale l = Locale.forLanguageTag(locale.replace('_', '-')); // Only consider locales with both language and country. if (l == null || "und".equals(l.getLanguage()) || l.getLanguage().isEmpty() || l.getCountry().isEmpty()) { continue; } if (l.getLanguage().equals(target.getLanguage())) { // If we got a perfect match, we're done. if (l.getCountry().equals(target.getCountry())) { Rlog.d(LOG_TAG, "getLocaleForLanguageCountry: got perfect match: " + l.toLanguageTag()); return l; } // We've only matched the language, not the country. languageMatches.add(l); } } if (languageMatches.isEmpty()) { Rlog.d(LOG_TAG, "getLocaleForLanguageCountry: no locales for language " + language); return null; } Locale bestMatch = lookupFallback(target, languageMatches); if (bestMatch != null) { Rlog.d(LOG_TAG, "getLocaleForLanguageCountry: got a fallback match: " + bestMatch.toLanguageTag()); return bestMatch; } else { // If a locale is "translated", it is selectable in setup wizard, and can therefore // be considered a valid result for this method. if (!TextUtils.isEmpty(target.getCountry())) { if (isTranslated(context, target)) { Rlog.d(LOG_TAG, "getLocaleForLanguageCountry: " + "target locale is translated: " + target); return target; } } // Somewhat arbitrarily take the first locale for the language, // unless we get a perfect match later. Note that these come back in no // particular order, so there's no reason to think the first match is // a particularly good match. Rlog.d(LOG_TAG, "getLocaleForLanguageCountry: got language-only match: " + language); return languageMatches.get(0); } } catch (Exception e) { Rlog.d(LOG_TAG, "getLocaleForLanguageCountry: exception", e); } return null; }
Return Locale for the language and country or null if no good match. @param context Context to act on. @param language Two character language code desired @param country Two character country code desired @return Locale or null if no appropriate value
LocaleUtils::getLocaleForLanguageCountry
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/LocaleUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/LocaleUtils.java
MIT
public static String defaultLanguageForMcc(int mcc) { MccTable.MccEntry entry = MccTable.entryForMcc(mcc); if (entry == null) { Rlog.d(LOG_TAG, "defaultLanguageForMcc(" + mcc + "): no country for mcc"); return null; } final String country = entry.mIso; // Choose English as the default language for India. if ("in".equals(country)) { return "en"; } // Ask CLDR for the language this country uses... ULocale likelyLocale = ULocale.addLikelySubtags(new ULocale("und", country)); String likelyLanguage = likelyLocale.getLanguage(); Rlog.d(LOG_TAG, "defaultLanguageForMcc(" + mcc + "): country " + country + " uses " + likelyLanguage); return likelyLanguage; }
Given a GSM Mobile Country Code, returns an ISO 2-3 character language code if available. Returns null if unavailable.
LocaleUtils::defaultLanguageForMcc
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/LocaleUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/LocaleUtils.java
MIT
private static Locale lookupFallback(Locale target, List<Locale> candidates) { Locale fallback = target; while ((fallback = MccTable.FALLBACKS.get(fallback)) != null) { if (candidates.contains(fallback)) { return fallback; } } return null; }
Finds a suitable locale among {@code candidates} to use as the fallback locale for {@code target}. This looks through the list of {@link MccTable#FALLBACKS}, and follows the chain until a locale in {@code candidates} is found. This function assumes that {@code target} is not in {@code candidates}. TODO: This should really follow the CLDR chain of parent locales! That might be a bit of a problem because we don't really have an en-001 locale on android. @return The fallback locale or {@code null} if there is no suitable fallback defined in the lookup.
LocaleUtils::lookupFallback
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/LocaleUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/LocaleUtils.java
MIT
protected HttpEngine() {}
{@hide}
HttpEngine::HttpEngine
java
Reginer/aosp-android-jar
android-35/src/android/net/http/HttpEngine.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/net/http/HttpEngine.java
MIT
public Builder(@NonNull Context context) { this(createBuilderDelegate(context)); }
Constructs a {@link Builder} object that facilitates creating a {@link HttpEngine}. The default configuration enables HTTP/2 and QUIC, but disables the HTTP cache. @param context Android {@link Context}, which is used by {@link Builder} to retrieve the application context. A reference to only the application context will be kept, so as to avoid extending the lifetime of {@code context} unnecessarily.
Builder::Builder
java
Reginer/aosp-android-jar
android-35/src/android/net/http/HttpEngine.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/net/http/HttpEngine.java
MIT
public static SmsMessageBase.SubmitPduBase getSubmitPdu(boolean isCdma, String scAddr, String destAddr, String message, boolean statusReportRequested, SmsHeader smsHeader) { if (isCdma) { return getSubmitPduCdma(scAddr, destAddr, message, statusReportRequested, smsHeader); } else { return getSubmitPduGsm(scAddr, destAddr, message, statusReportRequested); } }
Trigger the proper implementation for getting submit pdu for text sms based on format. @param isCdma true if cdma format should be used. @param scAddr is the service center address or null to use the current default SMSC @param destAddr the address to send the message to @param message the body of the message. @param statusReportRequested whether or not a status report is requested. @param smsHeader message header. @return the submit pdu.
SMSDispatcherUtil::getSubmitPdu
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static SmsMessageBase.SubmitPduBase getSubmitPdu(boolean isCdma, String scAddr, String destAddr, String message, boolean statusReportRequested, SmsHeader smsHeader, int priority, int validityPeriod) { if (isCdma) { return getSubmitPduCdma(scAddr, destAddr, message, statusReportRequested, smsHeader, priority); } else { return getSubmitPduGsm(scAddr, destAddr, message, statusReportRequested, validityPeriod); } }
Trigger the proper implementation for getting submit pdu for text sms based on format. @param isCdma true if cdma format should be used. @param scAddr is the service center address or null to use the current default SMSC @param destAddr the address to send the message to @param message the body of the message. @param statusReportRequested whether or not a status report is requested. @param smsHeader message header. @param priority Priority level of the message Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1 --------------------------------- PRIORITY | Level of Priority --------------------------------- '00' | Normal '01' | Interactive '10' | Urgent '11' | Emergency ---------------------------------- Any Other values included Negative considered as Invalid Priority Indicator of the message. @param validityPeriod Validity Period of the message in mins. Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1. Validity Period(Minimum) -> 5 mins Validity Period(Maximum) -> 635040 mins(i.e.63 weeks). Any Other values included Negative considered as Invalid Validity Period of the message. @return the submit pdu.
SMSDispatcherUtil::getSubmitPdu
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static SmsMessageBase.SubmitPduBase getSubmitPduGsm(String scAddr, String destAddr, String message, boolean statusReportRequested) { return com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu(scAddr, destAddr, message, statusReportRequested); }
Gsm implementation for {@link #getSubmitPdu(boolean, String, String, String, boolean)} @param scAddr is the service center address or null to use the current default SMSC @param destAddr the address to send the message to @param message the body of the message. @param statusReportRequested whether or not a status report is requested. @return the submit pdu.
SMSDispatcherUtil::getSubmitPduGsm
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static SmsMessageBase.SubmitPduBase getSubmitPduGsm(String scAddr, String destAddr, String message, boolean statusReportRequested, int validityPeriod) { return com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu(scAddr, destAddr, message, statusReportRequested, validityPeriod); }
Gsm implementation for {@link #getSubmitPdu(boolean, String, String, String, boolean, int)} @param scAddr is the service center address or null to use the current default SMSC @param destAddr the address to send the message to @param message the body of the message. @param statusReportRequested whether or not a status report is requested. @param validityPeriod Validity Period of the message in mins. Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1. Validity Period(Minimum) -> 5 mins Validity Period(Maximum) -> 635040 mins(i.e.63 weeks). Any Other values included Negative considered as Invalid Validity Period of the message. @return the submit pdu.
SMSDispatcherUtil::getSubmitPduGsm
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static SmsMessageBase.SubmitPduBase getSubmitPduCdma(String scAddr, String destAddr, String message, boolean statusReportRequested, SmsHeader smsHeader) { return com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddr, destAddr, message, statusReportRequested, smsHeader); }
Cdma implementation for {@link #getSubmitPdu(boolean, String, String, String, boolean, SmsHeader)} @param scAddr is the service center address or null to use the current default SMSC @param destAddr the address to send the message to @param message the body of the message. @param statusReportRequested whether or not a status report is requested. @param smsHeader message header. @return the submit pdu.
SMSDispatcherUtil::getSubmitPduCdma
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static SmsMessageBase.SubmitPduBase getSubmitPduCdma(String scAddr, String destAddr, String message, boolean statusReportRequested, SmsHeader smsHeader, int priority) { return com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddr, destAddr, message, statusReportRequested, smsHeader, priority); }
Cdma implementation for {@link #getSubmitPdu(boolean, String, String, String, boolean, SmsHeader)} @param scAddr is the service center address or null to use the current default SMSC @param destAddr the address to send the message to @param message the body of the message. @param statusReportRequested whether or not a status report is requested. @param smsHeader message header. @param priority Priority level of the message Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1 --------------------------------- PRIORITY | Level of Priority --------------------------------- '00' | Normal '01' | Interactive '10' | Urgent '11' | Emergency ---------------------------------- Any Other values included Negative considered as Invalid Priority Indicator of the message. @return the submit pdu.
SMSDispatcherUtil::getSubmitPduCdma
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static SmsMessageBase.SubmitPduBase getSubmitPdu(boolean isCdma, String scAddr, String destAddr, int destPort, byte[] message, boolean statusReportRequested) { if (isCdma) { return getSubmitPduCdma(scAddr, destAddr, destPort, message, statusReportRequested); } else { return getSubmitPduGsm(scAddr, destAddr, destPort, message, statusReportRequested); } }
Trigger the proper implementation for getting submit pdu for data sms based on format. @param isCdma true if cdma format should be used. @param destAddr the address to send the message to @param scAddr is the service center address or null to use the current default SMSC @param destPort the port to deliver the message to @param message the body of the message to send @param statusReportRequested whether or not a status report is requested. @return the submit pdu.
SMSDispatcherUtil::getSubmitPdu
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static SmsMessageBase.SubmitPduBase getSubmitPduCdma(String scAddr, String destAddr, int destPort, byte[] message, boolean statusReportRequested) { return com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddr, destAddr, destPort, message, statusReportRequested); }
Cdma implementation of {@link #getSubmitPdu(boolean, String, String, int, byte[], boolean)} @param destAddr the address to send the message to @param scAddr is the service center address or null to use the current default SMSC @param destPort the port to deliver the message to @param message the body of the message to send @param statusReportRequested whether or not a status report is requested. @return the submit pdu.
SMSDispatcherUtil::getSubmitPduCdma
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static SmsMessageBase.SubmitPduBase getSubmitPduGsm(String scAddr, String destAddr, int destPort, byte[] message, boolean statusReportRequested) { return com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu(scAddr, destAddr, destPort, message, statusReportRequested); }
Gsm implementation of {@link #getSubmitPdu(boolean, String, String, int, byte[], boolean)} @param destAddr the address to send the message to @param scAddr is the service center address or null to use the current default SMSC @param destPort the port to deliver the message to @param message the body of the message to send @param statusReportRequested whether or not a status report is requested. @return the submit pdu.
SMSDispatcherUtil::getSubmitPduGsm
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static TextEncodingDetails calculateLength(boolean isCdma, CharSequence messageBody, boolean use7bitOnly) { if (isCdma) { return calculateLengthCdma(messageBody, use7bitOnly); } else { return calculateLengthGsm(messageBody, use7bitOnly); } }
Calculate the number of septets needed to encode the message. This function should only be called for individual segments of multipart message. @param isCdma true if cdma format should be used. @param messageBody the message to encode @param use7bitOnly ignore (but still count) illegal characters if true @return TextEncodingDetails
SMSDispatcherUtil::calculateLength
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static TextEncodingDetails calculateLengthGsm(CharSequence messageBody, boolean use7bitOnly) { return com.android.internal.telephony.gsm.SmsMessage.calculateLength(messageBody, use7bitOnly); }
Gsm implementation for {@link #calculateLength(boolean, CharSequence, boolean)} @param messageBody the message to encode @param use7bitOnly ignore (but still count) illegal characters if true @return TextEncodingDetails
SMSDispatcherUtil::calculateLengthGsm
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public static TextEncodingDetails calculateLengthCdma(CharSequence messageBody, boolean use7bitOnly) { return com.android.internal.telephony.cdma.SmsMessage.calculateLength(messageBody, use7bitOnly, false); }
Cdma implementation for {@link #calculateLength(boolean, CharSequence, boolean)} @param messageBody the message to encode @param use7bitOnly ignore (but still count) illegal characters if true @return TextEncodingDetails
SMSDispatcherUtil::calculateLengthCdma
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/util/SMSDispatcherUtil.java
MIT
public void replaceTouchableRegionWithCrop(@Nullable SurfaceControl bounds) { setTouchableRegionCrop(bounds); replaceTouchableRegionWithCrop = true; }
Set the window's touchable region to the bounds of {@link #touchableRegionSurfaceControl} and ignore the value of {@link #touchableRegion}. @param bounds surface to set the touchable region to. Set to {@code null} to set the touchable region as the current surface bounds.
InputWindowHandle::replaceTouchableRegionWithCrop
java
Reginer/aosp-android-jar
android-34/src/android/view/InputWindowHandle.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/InputWindowHandle.java
MIT
public void setTouchableRegionCrop(@Nullable SurfaceControl bounds) { touchableRegionSurfaceControl = new WeakReference<>(bounds); }
Crop the window touchable region to the bounds of the surface provided.
InputWindowHandle::setTouchableRegionCrop
java
Reginer/aosp-android-jar
android-34/src/android/view/InputWindowHandle.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/InputWindowHandle.java
MIT
public void setInputConfig(@InputConfigFlags int inputConfig, boolean value) { if (value) { this.inputConfig |= inputConfig; return; } this.inputConfig &= ~inputConfig; }
Set the provided inputConfig flag values. @param inputConfig the flag values to change @param value the provided flag values are set when true, and cleared when false
InputWindowHandle::setInputConfig
java
Reginer/aosp-android-jar
android-34/src/android/view/InputWindowHandle.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/InputWindowHandle.java
MIT
public HwBinder() { native_setup(); sNativeRegistry.registerNativeAllocation( this, mNativeContext); }
Create and initialize a HwBinder object and the native objects used to allow this to participate in hwbinder transactions.
HwBinder::HwBinder
java
Reginer/aosp-android-jar
android-32/src/android/os/HwBinder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/HwBinder.java
MIT
public static final IHwBinder getService( String iface, String serviceName) throws RemoteException, NoSuchElementException { return getService(iface, serviceName, false /* retry */); }
Returns the specified service from the hwservicemanager. Does not retry. @param iface fully-qualified interface name for example [email protected]::IBaz @param serviceName the instance name of the service for example default. @throws NoSuchElementException when the service is unavailable
HwBinder::getService
java
Reginer/aosp-android-jar
android-32/src/android/os/HwBinder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/HwBinder.java
MIT
public static void enableInstrumentation() { native_report_sysprop_change(); }
Enable instrumentation if available. On a non-user build, this method: - tries to enable atracing (if enabled) - tries to enable coverage dumps (if running in VTS) - tries to enable record and replay (if running in VTS)
HwBinder::enableInstrumentation
java
Reginer/aosp-android-jar
android-32/src/android/os/HwBinder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/HwBinder.java
MIT
public static android.hardware.gnss.visibility_control.IGnssVisibilityControl asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof android.hardware.gnss.visibility_control.IGnssVisibilityControl))) { return ((android.hardware.gnss.visibility_control.IGnssVisibilityControl)iin); } return new android.hardware.gnss.visibility_control.IGnssVisibilityControl.Stub.Proxy(obj); }
Cast an IBinder object into an android.hardware.gnss.visibility_control.IGnssVisibilityControl interface, generating a proxy if needed.
Stub::asInterface
java
Reginer/aosp-android-jar
android-35/src/android/hardware/gnss/visibility_control/IGnssVisibilityControl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/hardware/gnss/visibility_control/IGnssVisibilityControl.java
MIT
public static java.lang.String getDefaultTransactionName(int transactionCode) { switch (transactionCode) { case TRANSACTION_enableNfwLocationAccess: { return "enableNfwLocationAccess"; } case TRANSACTION_setCallback: { return "setCallback"; } case TRANSACTION_getInterfaceVersion: { return "getInterfaceVersion"; } case TRANSACTION_getInterfaceHash: { return "getInterfaceHash"; } default: { return null; } } }
Cast an IBinder object into an android.hardware.gnss.visibility_control.IGnssVisibilityControl interface, generating a proxy if needed. public static android.hardware.gnss.visibility_control.IGnssVisibilityControl asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof android.hardware.gnss.visibility_control.IGnssVisibilityControl))) { return ((android.hardware.gnss.visibility_control.IGnssVisibilityControl)iin); } return new android.hardware.gnss.visibility_control.IGnssVisibilityControl.Stub.Proxy(obj); } @Override public android.os.IBinder asBinder() { return this; } /** @hide
Stub::getDefaultTransactionName
java
Reginer/aosp-android-jar
android-35/src/android/hardware/gnss/visibility_control/IGnssVisibilityControl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/hardware/gnss/visibility_control/IGnssVisibilityControl.java
MIT
public java.lang.String getTransactionName(int transactionCode) { return this.getDefaultTransactionName(transactionCode); }
Cast an IBinder object into an android.hardware.gnss.visibility_control.IGnssVisibilityControl interface, generating a proxy if needed. public static android.hardware.gnss.visibility_control.IGnssVisibilityControl asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof android.hardware.gnss.visibility_control.IGnssVisibilityControl))) { return ((android.hardware.gnss.visibility_control.IGnssVisibilityControl)iin); } return new android.hardware.gnss.visibility_control.IGnssVisibilityControl.Stub.Proxy(obj); } @Override public android.os.IBinder asBinder() { return this; } /** @hide public static java.lang.String getDefaultTransactionName(int transactionCode) { switch (transactionCode) { case TRANSACTION_enableNfwLocationAccess: { return "enableNfwLocationAccess"; } case TRANSACTION_setCallback: { return "setCallback"; } case TRANSACTION_getInterfaceVersion: { return "getInterfaceVersion"; } case TRANSACTION_getInterfaceHash: { return "getInterfaceHash"; } default: { return null; } } } /** @hide
Stub::getTransactionName
java
Reginer/aosp-android-jar
android-35/src/android/hardware/gnss/visibility_control/IGnssVisibilityControl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/hardware/gnss/visibility_control/IGnssVisibilityControl.java
MIT
public int getMaxTransactionId() { return 16777214; }
Cast an IBinder object into an android.hardware.gnss.visibility_control.IGnssVisibilityControl interface, generating a proxy if needed. public static android.hardware.gnss.visibility_control.IGnssVisibilityControl asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof android.hardware.gnss.visibility_control.IGnssVisibilityControl))) { return ((android.hardware.gnss.visibility_control.IGnssVisibilityControl)iin); } return new android.hardware.gnss.visibility_control.IGnssVisibilityControl.Stub.Proxy(obj); } @Override public android.os.IBinder asBinder() { return this; } /** @hide public static java.lang.String getDefaultTransactionName(int transactionCode) { switch (transactionCode) { case TRANSACTION_enableNfwLocationAccess: { return "enableNfwLocationAccess"; } case TRANSACTION_setCallback: { return "setCallback"; } case TRANSACTION_getInterfaceVersion: { return "getInterfaceVersion"; } case TRANSACTION_getInterfaceHash: { return "getInterfaceHash"; } default: { return null; } } } /** @hide public java.lang.String getTransactionName(int transactionCode) { return this.getDefaultTransactionName(transactionCode); } @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { data.enforceInterface(descriptor); } if (code == INTERFACE_TRANSACTION) { reply.writeString(descriptor); return true; } else if (code == TRANSACTION_getInterfaceVersion) { reply.writeNoException(); reply.writeInt(getInterfaceVersion()); return true; } else if (code == TRANSACTION_getInterfaceHash) { reply.writeNoException(); reply.writeString(getInterfaceHash()); return true; } switch (code) { case TRANSACTION_enableNfwLocationAccess: { java.lang.String[] _arg0; _arg0 = data.createStringArray(); data.enforceNoDataAvail(); this.enableNfwLocationAccess(_arg0); reply.writeNoException(); break; } case TRANSACTION_setCallback: { android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback _arg0; _arg0 = android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.Stub.asInterface(data.readStrongBinder()); data.enforceNoDataAvail(); this.setCallback(_arg0); reply.writeNoException(); break; } default: { return super.onTransact(code, data, reply, flags); } } return true; } private static class Proxy implements android.hardware.gnss.visibility_control.IGnssVisibilityControl { private android.os.IBinder mRemote; Proxy(android.os.IBinder remote) { mRemote = remote; } private int mCachedVersion = -1; private String mCachedHash = "-1"; @Override public android.os.IBinder asBinder() { return mRemote; } public java.lang.String getInterfaceDescriptor() { return DESCRIPTOR; } @Override public void enableNfwLocationAccess(java.lang.String[] proxyApps) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(asBinder()); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeStringArray(proxyApps); boolean _status = mRemote.transact(Stub.TRANSACTION_enableNfwLocationAccess, _data, _reply, 0); if (!_status) { throw new android.os.RemoteException("Method enableNfwLocationAccess is unimplemented."); } _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void setCallback(android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback callback) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(asBinder()); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeStrongInterface(callback); boolean _status = mRemote.transact(Stub.TRANSACTION_setCallback, _data, _reply, 0); if (!_status) { throw new android.os.RemoteException("Method setCallback is unimplemented."); } _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public int getInterfaceVersion() throws android.os.RemoteException { if (mCachedVersion == -1) { android.os.Parcel data = android.os.Parcel.obtain(asBinder()); android.os.Parcel reply = android.os.Parcel.obtain(); try { data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0); reply.readException(); mCachedVersion = reply.readInt(); } finally { reply.recycle(); data.recycle(); } } return mCachedVersion; } @Override public synchronized String getInterfaceHash() throws android.os.RemoteException { if ("-1".equals(mCachedHash)) { android.os.Parcel data = android.os.Parcel.obtain(asBinder()); android.os.Parcel reply = android.os.Parcel.obtain(); try { data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0); reply.readException(); mCachedHash = reply.readString(); } finally { reply.recycle(); data.recycle(); } } return mCachedHash; } } static final int TRANSACTION_enableNfwLocationAccess = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_setCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214); static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213); /** @hide
Proxy::getMaxTransactionId
java
Reginer/aosp-android-jar
android-35/src/android/hardware/gnss/visibility_control/IGnssVisibilityControl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/hardware/gnss/visibility_control/IGnssVisibilityControl.java
MIT
public PhonePrefixMap() {}
Creates an empty {@link PhonePrefixMap}. The default constructor is necessary for implementing {@link Externalizable}. The empty map could later be populated by {@link #readPhonePrefixMap(java.util.SortedMap)} or {@link #readExternal(java.io.ObjectInput)}.
PhonePrefixMap::PhonePrefixMap
java
Reginer/aosp-android-jar
android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
MIT
private static int getSizeOfPhonePrefixMapStorage(PhonePrefixMapStorageStrategy mapStorage, SortedMap<Integer, String> phonePrefixMap) throws IOException { mapStorage.readFromSortedMap(phonePrefixMap); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream); mapStorage.writeExternal(objectOutputStream); objectOutputStream.flush(); int sizeOfStorage = byteArrayOutputStream.size(); objectOutputStream.close(); return sizeOfStorage; }
Gets the size of the provided phone prefix map storage. The map storage passed-in will be filled as a result.
PhonePrefixMap::getSizeOfPhonePrefixMapStorage
java
Reginer/aosp-android-jar
android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
MIT
public void readPhonePrefixMap(SortedMap<Integer, String> sortedPhonePrefixMap) { phonePrefixMapStorage = getSmallerMapStorage(sortedPhonePrefixMap); }
Creates an {@link PhonePrefixMap} initialized with {@code sortedPhonePrefixMap}. Note that the underlying implementation of this method is expensive thus should not be called by time-critical applications. @param sortedPhonePrefixMap a map from phone number prefixes to descriptions of those prefixes sorted in ascending order of the phone number prefixes as integers.
PhonePrefixMap::readPhonePrefixMap
java
Reginer/aosp-android-jar
android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
MIT
public void readExternal(ObjectInput objectInput) throws IOException { // Read the phone prefix map storage strategy flag. boolean useFlyweightMapStorage = objectInput.readBoolean(); if (useFlyweightMapStorage) { phonePrefixMapStorage = new FlyweightMapStorage(); } else { phonePrefixMapStorage = new DefaultMapStorage(); } phonePrefixMapStorage.readExternal(objectInput); }
Supports Java Serialization.
PhonePrefixMap::readExternal
java
Reginer/aosp-android-jar
android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
MIT
public void writeExternal(ObjectOutput objectOutput) throws IOException { objectOutput.writeBoolean(phonePrefixMapStorage instanceof FlyweightMapStorage); phonePrefixMapStorage.writeExternal(objectOutput); }
Supports Java Serialization.
PhonePrefixMap::writeExternal
java
Reginer/aosp-android-jar
android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
MIT
String lookup(long number) { int numOfEntries = phonePrefixMapStorage.getNumOfEntries(); if (numOfEntries == 0) { return null; } long phonePrefix = number; int currentIndex = numOfEntries - 1; SortedSet<Integer> currentSetOfLengths = phonePrefixMapStorage.getPossibleLengths(); while (currentSetOfLengths.size() > 0) { Integer possibleLength = currentSetOfLengths.last(); String phonePrefixStr = String.valueOf(phonePrefix); if (phonePrefixStr.length() > possibleLength) { phonePrefix = Long.parseLong(phonePrefixStr.substring(0, possibleLength)); } currentIndex = binarySearch(0, currentIndex, phonePrefix); if (currentIndex < 0) { return null; } int currentPrefix = phonePrefixMapStorage.getPrefix(currentIndex); if (phonePrefix == currentPrefix) { return phonePrefixMapStorage.getDescription(currentIndex); } currentSetOfLengths = currentSetOfLengths.headSet(possibleLength); } return null; }
Returns the description of the {@code number}. This method distinguishes the case of an invalid prefix and a prefix for which the name is not available in the current language. If the description is not available in the current language an empty string is returned. If no description was found for the provided number, null is returned. @param number the phone number to look up @return the description of the number
PhonePrefixMap::lookup
java
Reginer/aosp-android-jar
android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
MIT
public String lookup(PhoneNumber number) { long phonePrefix = Long.parseLong(number.getCountryCode() + phoneUtil.getNationalSignificantNumber(number)); return lookup(phonePrefix); }
As per {@link #lookup(long)}, but receives the number as a PhoneNumber instead of a long. @param number the phone number to look up @return the description corresponding to the prefix that best matches this phone number
PhonePrefixMap::lookup
java
Reginer/aosp-android-jar
android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
MIT
private int binarySearch(int start, int end, long value) { int current = 0; while (start <= end) { current = (start + end) >>> 1; int currentValue = phonePrefixMapStorage.getPrefix(current); if (currentValue == value) { return current; } else if (currentValue > value) { current--; end = current; } else { start = current + 1; } } return current; }
Does a binary search for {@code value} in the provided array from {@code start} to {@code end} (inclusive). Returns the position if {@code value} is found; otherwise, returns the position which has the largest value that is less than {@code value}. This means if {@code value} is the smallest, -1 will be returned.
PhonePrefixMap::binarySearch
java
Reginer/aosp-android-jar
android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/i18n/phonenumbers/prefixmapper/PhonePrefixMap.java
MIT
protected void handleInitialize() { }
Performs initialization of the tile Use this to perform initialization of the tile. Empty by default.
QSTileImpl::handleInitialize
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
MIT
public void setListening(Object listener, boolean listening) { mHandler.obtainMessage(H.SET_LISTENING, listening ? 1 : 0, 0, listener).sendToTarget(); }
Adds or removes a listening client for the tile. If the tile has one or more listening client it will go into the listening state.
QSTileImpl::setListening
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
MIT
public QSIconView createTileView(Context context) { return new QSIconViewImpl(context); }
Return the {@link QSIconView} to be used by this tile's view. @param context view context for the view @return icon view for this tile
QSTileImpl::createTileView
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
MIT
public boolean isAvailable() { return true; }
Is a startup check whether this device currently supports this tile. Should not be used to conditionally hide tiles. Only checked on tile creation or whether should be shown in edit screen.
QSTileImpl::isAvailable
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
MIT
public void initialize() { mHandler.sendEmptyMessage(H.INITIALIZE); }
Schedules initialization of the tile. Should be called upon creation of the tile, before performing other operations
QSTileImpl::initialize
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
MIT
public void postStale() { mHandler.sendEmptyMessage(H.STALE); }
Posts a stale message to the background thread.
QSTileImpl::postStale
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
MIT
protected void handleSecondaryClick(@Nullable View view) { // Default to normal click. handleClick(view); }
Handles secondary click on the tile. Defaults to {@link QSTileImpl#handleClick} @param view The view that was clicked.
QSTileImpl::handleSecondaryClick
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
MIT
protected void handleLongClick(@Nullable View view) { ActivityLaunchAnimator.Controller animationController = view != null ? ActivityLaunchAnimator.Controller.fromView(view, InteractionJankMonitor.CUJ_SHADE_APP_LAUNCH_FROM_QS_TILE) : null; mActivityStarter.postStartActivityDismissingKeyguard(getLongClickIntent(), 0, animationController); }
Handles long click on the tile by launching the {@link Intent} defined in {@link QSTileImpl#getLongClickIntent}. @param view The view from which the opening window will be animated.
QSTileImpl::handleLongClick
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
MIT
public SoundTriggerFailure(@SoundTriggerErrorCode int errorCode, @NonNull String errorMessage, @FailureSuggestedAction.FailureSuggestedActionDef int suggestedAction) { if (TextUtils.isEmpty(errorMessage)) { throw new IllegalArgumentException("errorMessage is empty or null."); } switch (errorCode) { case ERROR_CODE_UNKNOWN: case ERROR_CODE_MODULE_DIED: case ERROR_CODE_RECOGNITION_RESUME_FAILED: case ERROR_CODE_UNEXPECTED_PREEMPTION: mErrorCode = errorCode; break; default: throw new IllegalArgumentException("Invalid ErrorCode: " + errorCode); } if (suggestedAction != getSuggestedActionBasedOnErrorCode(errorCode) && errorCode != ERROR_CODE_UNKNOWN) { throw new IllegalArgumentException("Invalid suggested next action: " + "errorCode=" + errorCode + ", suggestedAction=" + suggestedAction); } mErrorMessage = errorMessage; mSuggestedAction = suggestedAction; }
@hide
SoundTriggerFailure::SoundTriggerFailure
java
Reginer/aosp-android-jar
android-35/src/android/service/voice/SoundTriggerFailure.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/voice/SoundTriggerFailure.java
MIT
public OutputStream getOutputStream() { return outputStream; }
Enables using ParcelFileDescriptor.createSocketPair in robolectric tests. <p>Uses in-memory input and output streams for the descriptor. @Implements(ParcelFileDescriptor.class) public class ShadowParcelFileDescriptor { private @RealObject ParcelFileDescriptor realObject; private PipedOutputStream outputStream; private PipedInputStream inputStream; /** Returns the stream that is used to write data to this descriptor.
public::getOutputStream
java
Reginer/aosp-android-jar
android-34/src/com/android/clockwork/bluetooth/ShadowParcelFileDescriptor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/clockwork/bluetooth/ShadowParcelFileDescriptor.java
MIT
public InputStream getInputStream() { return inputStream; }
Enables using ParcelFileDescriptor.createSocketPair in robolectric tests. <p>Uses in-memory input and output streams for the descriptor. @Implements(ParcelFileDescriptor.class) public class ShadowParcelFileDescriptor { private @RealObject ParcelFileDescriptor realObject; private PipedOutputStream outputStream; private PipedInputStream inputStream; /** Returns the stream that is used to write data to this descriptor. public OutputStream getOutputStream() { return outputStream; } /** Returns the stream that is used to read data from this descriptor.
public::getInputStream
java
Reginer/aosp-android-jar
android-34/src/com/android/clockwork/bluetooth/ShadowParcelFileDescriptor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/clockwork/bluetooth/ShadowParcelFileDescriptor.java
MIT
static ShadowParcelFileDescriptor findShadow(FileDescriptor fd) { for (ShadowParcelFileDescriptor shadow : shadows) { if (shadow.realObject.getFileDescriptor() == fd) { return shadow; } } return null; }
Returns the shadow that wraps the given file descriptor or null if the shadow is not found. <p>NOTE: Only works if the descriptor was created with {@link #create} function.
public::findShadow
java
Reginer/aosp-android-jar
android-34/src/com/android/clockwork/bluetooth/ShadowParcelFileDescriptor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/clockwork/bluetooth/ShadowParcelFileDescriptor.java
MIT
static void disableWebView() { synchronized (sProviderLock) { if (sProviderInstance != null) { throw new IllegalStateException( "Can't disable WebView: WebView already initialized"); } sWebViewDisabled = true; } }
@hide
MissingWebViewPackageException::disableWebView
java
Reginer/aosp-android-jar
android-33/src/android/webkit/WebViewFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/webkit/WebViewFactory.java
MIT
static void setDataDirectorySuffix(String suffix) { synchronized (sProviderLock) { if (sProviderInstance != null) { throw new IllegalStateException( "Can't set data directory suffix: WebView already initialized"); } if (suffix.indexOf(File.separatorChar) >= 0) { throw new IllegalArgumentException("Suffix " + suffix + " contains a path separator"); } sDataDirectorySuffix = suffix; } }
@hide
MissingWebViewPackageException::setDataDirectorySuffix
java
Reginer/aosp-android-jar
android-33/src/android/webkit/WebViewFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/webkit/WebViewFactory.java
MIT
static String getDataDirectorySuffix() { synchronized (sProviderLock) { return sDataDirectorySuffix; } }
@hide
MissingWebViewPackageException::getDataDirectorySuffix
java
Reginer/aosp-android-jar
android-33/src/android/webkit/WebViewFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/webkit/WebViewFactory.java
MIT
public static String getWebViewLibrary(ApplicationInfo ai) { if (ai.metaData != null) return ai.metaData.getString("com.android.webview.WebViewLibrary"); return null; }
@hide
MissingWebViewPackageException::getWebViewLibrary
java
Reginer/aosp-android-jar
android-33/src/android/webkit/WebViewFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/webkit/WebViewFactory.java
MIT
public static Class<WebViewFactoryProvider> getWebViewProviderClass(ClassLoader clazzLoader) throws ClassNotFoundException { return (Class<WebViewFactoryProvider>) Class.forName(CHROMIUM_WEBVIEW_FACTORY, true, clazzLoader); }
@hide
MissingWebViewPackageException::getWebViewProviderClass
java
Reginer/aosp-android-jar
android-33/src/android/webkit/WebViewFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/webkit/WebViewFactory.java
MIT
public static int loadWebViewNativeLibraryFromPackage(String packageName, ClassLoader clazzLoader) { if (!isWebViewSupported()) { return LIBLOAD_WRONG_PACKAGE_NAME; } WebViewProviderResponse response = null; try { response = getUpdateService().waitForAndGetProvider(); } catch (RemoteException e) { Log.e(LOGTAG, "error waiting for relro creation", e); return LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN; } if (response.status != LIBLOAD_SUCCESS && response.status != LIBLOAD_FAILED_WAITING_FOR_RELRO) { return response.status; } if (!response.packageInfo.packageName.equals(packageName)) { return LIBLOAD_WRONG_PACKAGE_NAME; } PackageManager packageManager = AppGlobals.getInitialApplication().getPackageManager(); String libraryFileName; try { PackageInfo packageInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_META_DATA | PackageManager.MATCH_DEBUG_TRIAGED_MISSING); libraryFileName = getWebViewLibrary(packageInfo.applicationInfo); } catch (PackageManager.NameNotFoundException e) { Log.e(LOGTAG, "Couldn't find package " + packageName); return LIBLOAD_WRONG_PACKAGE_NAME; } int loadNativeRet = WebViewLibraryLoader.loadNativeLibrary(clazzLoader, libraryFileName); // If we failed waiting for relro we want to return that fact even if we successfully // load the relro file. if (loadNativeRet == LIBLOAD_SUCCESS) return response.status; return loadNativeRet; }
Load the native library for the given package name if that package name is the same as the one providing the webview.
MissingWebViewPackageException::loadWebViewNativeLibraryFromPackage
java
Reginer/aosp-android-jar
android-33/src/android/webkit/WebViewFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/webkit/WebViewFactory.java
MIT
public String getFormat() { return "PKCS#8"; }
return the encoding format we produce in getEncoded(). @return the string "PKCS#8"
BCECPrivateKey::getFormat
java
Reginer/aosp-android-jar
android-35/src/com/android/org/bouncycastle/jcajce/provider/asymmetric/ec/BCECPrivateKey.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/org/bouncycastle/jcajce/provider/asymmetric/ec/BCECPrivateKey.java
MIT
public byte[] getEncoded() { X962Parameters params = ECUtils.getDomainParametersFromName(ecSpec, withCompression); int orderBitLength; if (ecSpec == null) { orderBitLength = ECUtil.getOrderBitLength(configuration, null, this.getS()); } else { orderBitLength = ECUtil.getOrderBitLength(configuration, ecSpec.getOrder(), this.getS()); } PrivateKeyInfo info; com.android.org.bouncycastle.asn1.sec.ECPrivateKey keyStructure; if (publicKey != null) { keyStructure = new com.android.org.bouncycastle.asn1.sec.ECPrivateKey(orderBitLength, this.getS(), publicKey, params); } else { keyStructure = new com.android.org.bouncycastle.asn1.sec.ECPrivateKey(orderBitLength, this.getS(), params); } try { info = new PrivateKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, params), keyStructure); return info.getEncoded(ASN1Encoding.DER); } catch (IOException e) { return null; } }
Return a PKCS8 representation of the key. The sequence returned represents a full PrivateKeyInfo object. @return a PKCS8 representation of the key.
BCECPrivateKey::getEncoded
java
Reginer/aosp-android-jar
android-35/src/com/android/org/bouncycastle/jcajce/provider/asymmetric/ec/BCECPrivateKey.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/org/bouncycastle/jcajce/provider/asymmetric/ec/BCECPrivateKey.java
MIT
public int getChainId() { return chainId; }
Return an identifier for this radio chain. This is an arbitrary ID which is consistent for the same device. @return The radio chain ID.
RadioChainInfo::getChainId
java
Reginer/aosp-android-jar
android-35/src/android/net/wifi/nl80211/RadioChainInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/net/wifi/nl80211/RadioChainInfo.java
MIT