code
stringlengths 11
173k
| docstring
stringlengths 2
593k
| func_name
stringlengths 2
189
| language
stringclasses 1
value | repo
stringclasses 833
values | path
stringlengths 11
294
| url
stringlengths 60
339
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public void setExtras(Bundle extras) {
mExtras = (extras == null) ? null : new Bundle(extras);
} |
Sets the extra information associated with this fix to the
given Bundle.
| Address::setExtras | java | Reginer/aosp-android-jar | android-33/src/android/location/Address.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/location/Address.java | MIT |
default void init() {
// Do nothing
} |
Initializes all the SysUI components.
| DependencyProvider::init | java | Reginer/aosp-android-jar | android-31/src/com/android/systemui/dagger/SysUIComponent.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/systemui/dagger/SysUIComponent.java | MIT |
public void copyFrom(BrightnessEvent that) {
mReason.set(that.getReason());
mDisplayId = that.getDisplayId();
mPhysicalDisplayId = that.getPhysicalDisplayId();
mTime = that.getTime();
// Lux values
mLux = that.getLux();
mPreThresholdLux = that.getPreThresholdLux();
// Brightness values
mInitialBrightness = that.getInitialBrightness();
mBrightness = that.getBrightness();
mRecommendedBrightness = that.getRecommendedBrightness();
mPreThresholdBrightness = that.getPreThresholdBrightness();
// Different brightness modulations
mHbmMode = that.getHbmMode();
mHbmMax = that.getHbmMax();
mRbcStrength = that.getRbcStrength();
mThermalMax = that.getThermalMax();
mPowerFactor = that.getPowerFactor();
mWasShortTermModelActive = that.wasShortTermModelActive();
mFlags = that.getFlags();
mAdjustmentFlags = that.getAdjustmentFlags();
// Auto-brightness setting
mAutomaticBrightnessEnabled = that.isAutomaticBrightnessEnabled();
mDisplayBrightnessStrategyName = that.getDisplayBrightnessStrategyName();
} |
A utility to clone a brightness event into another event
@param that BrightnessEvent which is to be copied
| BrightnessEvent::copyFrom | java | Reginer/aosp-android-jar | android-34/src/com/android/server/display/brightness/BrightnessEvent.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/display/brightness/BrightnessEvent.java | MIT |
public void reset() {
mReason = new BrightnessReason();
mTime = SystemClock.uptimeMillis();
mPhysicalDisplayId = "";
// Lux values
mLux = 0;
mPreThresholdLux = 0;
// Brightness values
mInitialBrightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
mBrightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
mRecommendedBrightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
mPreThresholdBrightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
// Different brightness modulations
mHbmMode = BrightnessInfo.HIGH_BRIGHTNESS_MODE_OFF;
mHbmMax = PowerManager.BRIGHTNESS_MAX;
mRbcStrength = 0;
mThermalMax = PowerManager.BRIGHTNESS_MAX;
mPowerFactor = 1f;
mWasShortTermModelActive = false;
mFlags = 0;
mAdjustmentFlags = 0;
// Auto-brightness setting
mAutomaticBrightnessEnabled = true;
mDisplayBrightnessStrategyName = "";
} |
A utility to reset the BrightnessEvent to default values
| BrightnessEvent::reset | java | Reginer/aosp-android-jar | android-34/src/com/android/server/display/brightness/BrightnessEvent.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/display/brightness/BrightnessEvent.java | MIT |
public boolean equalsMainData(BrightnessEvent that) {
// This equals comparison purposefully ignores time since it is regularly changing and
// we don't want to log a brightness event just because the time changed.
return mReason.equals(that.mReason)
&& mDisplayId == that.mDisplayId
&& mPhysicalDisplayId.equals(that.mPhysicalDisplayId)
&& Float.floatToRawIntBits(mLux) == Float.floatToRawIntBits(that.mLux)
&& Float.floatToRawIntBits(mPreThresholdLux)
== Float.floatToRawIntBits(that.mPreThresholdLux)
&& Float.floatToRawIntBits(mBrightness)
== Float.floatToRawIntBits(that.mBrightness)
&& Float.floatToRawIntBits(mRecommendedBrightness)
== Float.floatToRawIntBits(that.mRecommendedBrightness)
&& Float.floatToRawIntBits(mPreThresholdBrightness)
== Float.floatToRawIntBits(that.mPreThresholdBrightness)
&& mHbmMode == that.mHbmMode
&& Float.floatToRawIntBits(mHbmMax) == Float.floatToRawIntBits(that.mHbmMax)
&& mRbcStrength == that.mRbcStrength
&& Float.floatToRawIntBits(mThermalMax)
== Float.floatToRawIntBits(that.mThermalMax)
&& Float.floatToRawIntBits(mPowerFactor)
== Float.floatToRawIntBits(that.mPowerFactor)
&& mWasShortTermModelActive == that.mWasShortTermModelActive
&& mFlags == that.mFlags
&& mAdjustmentFlags == that.mAdjustmentFlags
&& mAutomaticBrightnessEnabled == that.mAutomaticBrightnessEnabled
&& mDisplayBrightnessStrategyName.equals(that.mDisplayBrightnessStrategyName);
} |
A utility to compare two BrightnessEvents. This purposefully ignores comparing time as the
two events might have been created at different times, but essentially hold the same
underlying values
@param that The brightnessEvent with which the current brightnessEvent is to be compared
@return A boolean value representing if the two events are same or not.
| BrightnessEvent::equalsMainData | java | Reginer/aosp-android-jar | android-34/src/com/android/server/display/brightness/BrightnessEvent.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/display/brightness/BrightnessEvent.java | MIT |
public String toString(boolean includeTime) {
return (includeTime ? TimeUtils.formatForLogging(mTime) + " - " : "")
+ "BrightnessEvent: "
+ "disp=" + mDisplayId
+ ", physDisp=" + mPhysicalDisplayId
+ ", brt=" + mBrightness + ((mFlags & FLAG_USER_SET) != 0 ? "(user_set)" : "")
+ ", initBrt=" + mInitialBrightness
+ ", rcmdBrt=" + mRecommendedBrightness
+ ", preBrt=" + mPreThresholdBrightness
+ ", lux=" + mLux
+ ", preLux=" + mPreThresholdLux
+ ", hbmMax=" + mHbmMax
+ ", hbmMode=" + BrightnessInfo.hbmToString(mHbmMode)
+ ", rbcStrength=" + mRbcStrength
+ ", thrmMax=" + mThermalMax
+ ", powerFactor=" + mPowerFactor
+ ", wasShortTermModelActive=" + mWasShortTermModelActive
+ ", flags=" + flagsToString()
+ ", reason=" + mReason.toString(mAdjustmentFlags)
+ ", autoBrightness=" + mAutomaticBrightnessEnabled
+ ", strategy=" + mDisplayBrightnessStrategyName;
} |
A utility to stringify a BrightnessEvent
@param includeTime Indicates if the time field is to be added in the stringify version of the
BrightnessEvent
@return A stringified BrightnessEvent
| BrightnessEvent::toString | java | Reginer/aosp-android-jar | android-34/src/com/android/server/display/brightness/BrightnessEvent.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/display/brightness/BrightnessEvent.java | MIT |
public boolean setWasShortTermModelActive(boolean wasShortTermModelActive) {
return this.mWasShortTermModelActive = wasShortTermModelActive;
} |
Set whether the short term model was active before the brightness event.
| BrightnessEvent::setWasShortTermModelActive | java | Reginer/aosp-android-jar | android-34/src/com/android/server/display/brightness/BrightnessEvent.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/display/brightness/BrightnessEvent.java | MIT |
public boolean wasShortTermModelActive() {
return this.mWasShortTermModelActive;
} |
Returns whether the short term model was active before the brightness event.
| BrightnessEvent::wasShortTermModelActive | java | Reginer/aosp-android-jar | android-34/src/com/android/server/display/brightness/BrightnessEvent.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/display/brightness/BrightnessEvent.java | MIT |
public UsbPortStatus(int currentMode, int currentPowerRole, int currentDataRole,
int supportedRoleCombinations, int contaminantProtectionStatus,
int contaminantDetectionStatus) {
mCurrentMode = currentMode;
mCurrentPowerRole = currentPowerRole;
mCurrentDataRole = currentDataRole;
mSupportedRoleCombinations = supportedRoleCombinations;
mContaminantProtectionStatus = contaminantProtectionStatus;
mContaminantDetectionStatus = contaminantDetectionStatus;
} |
Contaminant protection - Port is disabled upon detection of
contaminant presence.
@hide
public static final int CONTAMINANT_PROTECTION_DISABLED =
android.hardware.usb.V1_2.Constants.ContaminantProtectionStatus.DISABLED;
@IntDef(prefix = { "CONTAMINANT_DETECTION_" }, value = {
CONTAMINANT_DETECTION_NOT_SUPPORTED,
CONTAMINANT_DETECTION_DISABLED,
CONTAMINANT_DETECTION_NOT_DETECTED,
CONTAMINANT_DETECTION_DETECTED,
})
@Retention(RetentionPolicy.SOURCE)
@interface ContaminantDetectionStatus{}
@IntDef(prefix = { "CONTAMINANT_PROTECTION_" }, flag = true, value = {
CONTAMINANT_PROTECTION_NONE,
CONTAMINANT_PROTECTION_SINK,
CONTAMINANT_PROTECTION_SOURCE,
CONTAMINANT_PROTECTION_FORCE_DISABLE,
CONTAMINANT_PROTECTION_DISABLED,
})
@Retention(RetentionPolicy.SOURCE)
@interface ContaminantProtectionStatus{}
@IntDef(prefix = { "MODE_" }, value = {
MODE_NONE,
MODE_DFP,
MODE_UFP,
MODE_AUDIO_ACCESSORY,
MODE_DEBUG_ACCESSORY,
})
@Retention(RetentionPolicy.SOURCE)
@interface UsbPortMode{}
/** @hide | UsbPortStatus::UsbPortStatus | java | Reginer/aosp-android-jar | android-31/src/android/hardware/usb/UsbPortStatus.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/usb/UsbPortStatus.java | MIT |
public boolean isConnected() {
return mCurrentMode != 0;
} |
Returns true if there is anything connected to the port.
@return {@code true} iff there is anything connected to the port.
| UsbPortStatus::isConnected | java | Reginer/aosp-android-jar | android-31/src/android/hardware/usb/UsbPortStatus.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/usb/UsbPortStatus.java | MIT |
public @UsbPortMode int getCurrentMode() {
return mCurrentMode;
} |
Gets the current mode of the port.
@return The current mode: {@link #MODE_DFP}, {@link #MODE_UFP},
{@link #MODE_AUDIO_ACCESSORY}, {@link #MODE_DEBUG_ACCESSORY}, or {@link {@link #MODE_NONE} if
nothing is connected.
| UsbPortStatus::getCurrentMode | java | Reginer/aosp-android-jar | android-31/src/android/hardware/usb/UsbPortStatus.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/usb/UsbPortStatus.java | MIT |
public @UsbPowerRole int getCurrentPowerRole() {
return mCurrentPowerRole;
} |
Gets the current power role of the port.
@return The current power role: {@link #POWER_ROLE_SOURCE}, {@link #POWER_ROLE_SINK}, or
{@link #POWER_ROLE_NONE} if nothing is connected.
| UsbPortStatus::getCurrentPowerRole | java | Reginer/aosp-android-jar | android-31/src/android/hardware/usb/UsbPortStatus.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/usb/UsbPortStatus.java | MIT |
public @UsbDataRole int getCurrentDataRole() {
return mCurrentDataRole;
} |
Gets the current data role of the port.
@return The current data role: {@link #DATA_ROLE_HOST}, {@link #DATA_ROLE_DEVICE}, or
{@link #DATA_ROLE_NONE} if nothing is connected.
| UsbPortStatus::getCurrentDataRole | java | Reginer/aosp-android-jar | android-31/src/android/hardware/usb/UsbPortStatus.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/usb/UsbPortStatus.java | MIT |
public boolean isRoleCombinationSupported(@UsbPowerRole int powerRole,
@UsbDataRole int dataRole) {
return (mSupportedRoleCombinations &
UsbPort.combineRolesAsBit(powerRole, dataRole)) != 0;
} |
Returns true if the specified power and data role combination is supported
given what is currently connected to the port.
@param powerRole The power role to check: {@link #POWER_ROLE_SOURCE} or
{@link #POWER_ROLE_SINK}, or {@link #POWER_ROLE_NONE} if no power role.
@param dataRole The data role to check: either {@link #DATA_ROLE_HOST} or
{@link #DATA_ROLE_DEVICE}, or {@link #DATA_ROLE_NONE} if no data role.
| UsbPortStatus::isRoleCombinationSupported | java | Reginer/aosp-android-jar | android-31/src/android/hardware/usb/UsbPortStatus.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/usb/UsbPortStatus.java | MIT |
public int getSupportedRoleCombinations() {
return mSupportedRoleCombinations;
} |
Get the supported role combinations.
| UsbPortStatus::getSupportedRoleCombinations | java | Reginer/aosp-android-jar | android-31/src/android/hardware/usb/UsbPortStatus.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/usb/UsbPortStatus.java | MIT |
public @ContaminantDetectionStatus int getContaminantDetectionStatus() {
return mContaminantDetectionStatus;
} |
Returns contaminant detection status.
@hide
| UsbPortStatus::getContaminantDetectionStatus | java | Reginer/aosp-android-jar | android-31/src/android/hardware/usb/UsbPortStatus.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/usb/UsbPortStatus.java | MIT |
public @ContaminantProtectionStatus int getContaminantProtectionStatus() {
return mContaminantProtectionStatus;
} |
Returns contamiant protection status.
@hide
| UsbPortStatus::getContaminantProtectionStatus | java | Reginer/aosp-android-jar | android-31/src/android/hardware/usb/UsbPortStatus.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/usb/UsbPortStatus.java | MIT |
public void addProvider(@NonNull ResourcesProvider resourcesProvider) {
synchronized (mLock) {
mProviders = ArrayUtils.appendElement(ResourcesProvider.class, mProviders,
resourcesProvider);
notifyProvidersChangedLocked();
}
} |
Appends a provider to the end of the provider list. If the provider is already present in the
loader list, the list will not be modified.
<p>This should only be called from the UI thread to avoid lock contention when propagating
provider changes.
@param resourcesProvider the provider to add
| ResourcesLoader::addProvider | java | Reginer/aosp-android-jar | android-32/src/android/content/res/loader/ResourcesLoader.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/content/res/loader/ResourcesLoader.java | MIT |
public static TestSuite suite() throws Exception {
Class testClass = ClassLoader.getSystemClassLoader().loadClass(
"org.w3c.domts.level3.validation.alltests");
Constructor testConstructor = testClass
.getConstructor(new Class[]{DOMTestDocumentBuilderFactory.class});
DOMTestDocumentBuilderFactory factory = new BatikTestDocumentBuilderFactory(
new DocumentBuilderSetting[0]);
Object test = testConstructor.newInstance(new Object[]{factory});
return new JUnitTestSuiteAdapter((DOMTestSuite) test);
} |
Factory method for suite.
@return suite
@throws Exception if Batik is not available or could not be instantiated
| TestBatik::suite | java | Reginer/aosp-android-jar | android-32/src/org/w3c/domts/level3/validation/TestBatik.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level3/validation/TestBatik.java | MIT |
public boolean getDeletionPropagation() {
return mDeletionPropagation;
} |
Class to hold property configuration for one property defined in {@link AppSearchSchema}.
<p>It is defined as same as PropertyConfigProto for the native code to handle different property
types in one class.
<p>Currently it can handle String, long, double, boolean, bytes and document type.
@hide
@SafeParcelable.Class(creator = "PropertyConfigParcelCreator")
public final class PropertyConfigParcel extends AbstractSafeParcelable {
@NonNull
public static final Parcelable.Creator<PropertyConfigParcel> CREATOR =
new PropertyConfigParcelCreator();
@Field(id = 1, getter = "getName")
private final String mName;
@AppSearchSchema.PropertyConfig.DataType
@Field(id = 2, getter = "getDataType")
private final int mDataType;
@AppSearchSchema.PropertyConfig.Cardinality
@Field(id = 3, getter = "getCardinality")
private final int mCardinality;
@Field(id = 4, getter = "getSchemaType")
@Nullable
private final String mSchemaType;
@Field(id = 5, getter = "getStringIndexingConfigParcel")
@Nullable
private final StringIndexingConfigParcel mStringIndexingConfigParcel;
@Field(id = 6, getter = "getDocumentIndexingConfigParcel")
@Nullable
private final DocumentIndexingConfigParcel mDocumentIndexingConfigParcel;
@Field(id = 7, getter = "getIntegerIndexingConfigParcel")
@Nullable
private final IntegerIndexingConfigParcel mIntegerIndexingConfigParcel;
@Field(id = 8, getter = "getJoinableConfigParcel")
@Nullable
private final JoinableConfigParcel mJoinableConfigParcel;
@Field(id = 9, getter = "getDescription")
private final String mDescription;
@Nullable private Integer mHashCode;
/** Constructor for {@link PropertyConfigParcel}.
@Constructor
PropertyConfigParcel(
@Param(id = 1) @NonNull String name,
@Param(id = 2) @DataType int dataType,
@Param(id = 3) @Cardinality int cardinality,
@Param(id = 4) @Nullable String schemaType,
@Param(id = 5) @Nullable StringIndexingConfigParcel stringIndexingConfigParcel,
@Param(id = 6) @Nullable DocumentIndexingConfigParcel documentIndexingConfigParcel,
@Param(id = 7) @Nullable IntegerIndexingConfigParcel integerIndexingConfigParcel,
@Param(id = 8) @Nullable JoinableConfigParcel joinableConfigParcel,
@Param(id = 9) @NonNull String description) {
mName = Objects.requireNonNull(name);
mDataType = dataType;
mCardinality = cardinality;
mSchemaType = schemaType;
mStringIndexingConfigParcel = stringIndexingConfigParcel;
mDocumentIndexingConfigParcel = documentIndexingConfigParcel;
mIntegerIndexingConfigParcel = integerIndexingConfigParcel;
mJoinableConfigParcel = joinableConfigParcel;
mDescription = Objects.requireNonNull(description);
}
/** Creates a {@link PropertyConfigParcel} for String.
@NonNull
public static PropertyConfigParcel createForString(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality,
@NonNull StringIndexingConfigParcel stringIndexingConfigParcel,
@NonNull JoinableConfigParcel joinableConfigParcel) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_STRING,
cardinality,
/* schemaType= */ null,
Objects.requireNonNull(stringIndexingConfigParcel),
/* documentIndexingConfigParcel= */ null,
/* integerIndexingConfigParcel= */ null,
Objects.requireNonNull(joinableConfigParcel),
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Long.
@NonNull
public static PropertyConfigParcel createForLong(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality,
@AppSearchSchema.LongPropertyConfig.IndexingType int indexingType) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_LONG,
cardinality,
/* schemaType= */ null,
/* stringIndexingConfigParcel= */ null,
/* documentIndexingConfigParcel= */ null,
new IntegerIndexingConfigParcel(indexingType),
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Double.
@NonNull
public static PropertyConfigParcel createForDouble(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_DOUBLE,
cardinality,
/* schemaType= */ null,
/* stringIndexingConfigParcel= */ null,
/* documentIndexingConfigParcel= */ null,
/* integerIndexingConfigParcel= */ null,
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Boolean.
@NonNull
public static PropertyConfigParcel createForBoolean(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_BOOLEAN,
cardinality,
/* schemaType= */ null,
/* stringIndexingConfigParcel= */ null,
/* documentIndexingConfigParcel= */ null,
/* integerIndexingConfigParcel= */ null,
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Bytes.
@NonNull
public static PropertyConfigParcel createForBytes(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_BYTES,
cardinality,
/* schemaType= */ null,
/* stringIndexingConfigParcel= */ null,
/* documentIndexingConfigParcel= */ null,
/* integerIndexingConfigParcel= */ null,
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Document.
@NonNull
public static PropertyConfigParcel createForDocument(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality,
@NonNull String schemaType,
@NonNull DocumentIndexingConfigParcel documentIndexingConfigParcel) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_DOCUMENT,
cardinality,
Objects.requireNonNull(schemaType),
/* stringIndexingConfigParcel= */ null,
Objects.requireNonNull(documentIndexingConfigParcel),
/* integerIndexingConfigParcel= */ null,
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Gets name for the property.
@NonNull
public String getName() {
return mName;
}
/** Gets description for the property.
@NonNull
public String getDescription() {
return mDescription;
}
/** Gets data type for the property.
@DataType
public int getDataType() {
return mDataType;
}
/** Gets cardinality for the property.
@Cardinality
public int getCardinality() {
return mCardinality;
}
/** Gets schema type.
@Nullable
public String getSchemaType() {
return mSchemaType;
}
/** Gets the {@link StringIndexingConfigParcel}.
@Nullable
public StringIndexingConfigParcel getStringIndexingConfigParcel() {
return mStringIndexingConfigParcel;
}
/** Gets the {@link DocumentIndexingConfigParcel}.
@Nullable
public DocumentIndexingConfigParcel getDocumentIndexingConfigParcel() {
return mDocumentIndexingConfigParcel;
}
/** Gets the {@link IntegerIndexingConfigParcel}.
@Nullable
public IntegerIndexingConfigParcel getIntegerIndexingConfigParcel() {
return mIntegerIndexingConfigParcel;
}
/** Gets the {@link JoinableConfigParcel}.
@Nullable
public JoinableConfigParcel getJoinableConfigParcel() {
return mJoinableConfigParcel;
}
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
PropertyConfigParcelCreator.writeToParcel(this, dest, flags);
}
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof PropertyConfigParcel)) {
return false;
}
PropertyConfigParcel otherProperty = (PropertyConfigParcel) other;
return Objects.equals(mName, otherProperty.mName)
&& Objects.equals(mDescription, otherProperty.mDescription)
&& Objects.equals(mDataType, otherProperty.mDataType)
&& Objects.equals(mCardinality, otherProperty.mCardinality)
&& Objects.equals(mSchemaType, otherProperty.mSchemaType)
&& Objects.equals(
mStringIndexingConfigParcel, otherProperty.mStringIndexingConfigParcel)
&& Objects.equals(
mDocumentIndexingConfigParcel, otherProperty.mDocumentIndexingConfigParcel)
&& Objects.equals(
mIntegerIndexingConfigParcel, otherProperty.mIntegerIndexingConfigParcel)
&& Objects.equals(mJoinableConfigParcel, otherProperty.mJoinableConfigParcel);
}
@Override
public int hashCode() {
if (mHashCode == null) {
mHashCode =
Objects.hash(
mName,
mDescription,
mDataType,
mCardinality,
mSchemaType,
mStringIndexingConfigParcel,
mDocumentIndexingConfigParcel,
mIntegerIndexingConfigParcel,
mJoinableConfigParcel);
}
return mHashCode;
}
@Override
@NonNull
public String toString() {
return "{name: "
+ mName
+ ", description: "
+ mDescription
+ ", dataType: "
+ mDataType
+ ", cardinality: "
+ mCardinality
+ ", schemaType: "
+ mSchemaType
+ ", stringIndexingConfigParcel: "
+ mStringIndexingConfigParcel
+ ", documentIndexingConfigParcel: "
+ mDocumentIndexingConfigParcel
+ ", integerIndexingConfigParcel: "
+ mIntegerIndexingConfigParcel
+ ", joinableConfigParcel: "
+ mJoinableConfigParcel
+ "}";
}
/** Class to hold join configuration for a String type.
@SafeParcelable.Class(creator = "JoinableConfigParcelCreator")
public static class JoinableConfigParcel extends AbstractSafeParcelable {
@NonNull
public static final Parcelable.Creator<JoinableConfigParcel> CREATOR =
new JoinableConfigParcelCreator();
@JoinableValueType
@Field(id = 1, getter = "getJoinableValueType")
private final int mJoinableValueType;
@Field(id = 2, getter = "getDeletionPropagation")
private final boolean mDeletionPropagation;
/** Constructor for {@link JoinableConfigParcel}.
@Constructor
public JoinableConfigParcel(
@Param(id = 1) @JoinableValueType int joinableValueType,
@Param(id = 2) boolean deletionPropagation) {
mJoinableValueType = joinableValueType;
mDeletionPropagation = deletionPropagation;
}
/** Gets {@link JoinableValueType} of the join.
@JoinableValueType
public int getJoinableValueType() {
return mJoinableValueType;
}
/** Gets whether delete will be propagated. | JoinableConfigParcel::getDeletionPropagation | java | Reginer/aosp-android-jar | android-35/src/android/app/appsearch/safeparcel/PropertyConfigParcel.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/appsearch/safeparcel/PropertyConfigParcel.java | MIT |
public boolean shouldIndexNestedProperties() {
return mIndexNestedProperties;
} |
Class to hold property configuration for one property defined in {@link AppSearchSchema}.
<p>It is defined as same as PropertyConfigProto for the native code to handle different property
types in one class.
<p>Currently it can handle String, long, double, boolean, bytes and document type.
@hide
@SafeParcelable.Class(creator = "PropertyConfigParcelCreator")
public final class PropertyConfigParcel extends AbstractSafeParcelable {
@NonNull
public static final Parcelable.Creator<PropertyConfigParcel> CREATOR =
new PropertyConfigParcelCreator();
@Field(id = 1, getter = "getName")
private final String mName;
@AppSearchSchema.PropertyConfig.DataType
@Field(id = 2, getter = "getDataType")
private final int mDataType;
@AppSearchSchema.PropertyConfig.Cardinality
@Field(id = 3, getter = "getCardinality")
private final int mCardinality;
@Field(id = 4, getter = "getSchemaType")
@Nullable
private final String mSchemaType;
@Field(id = 5, getter = "getStringIndexingConfigParcel")
@Nullable
private final StringIndexingConfigParcel mStringIndexingConfigParcel;
@Field(id = 6, getter = "getDocumentIndexingConfigParcel")
@Nullable
private final DocumentIndexingConfigParcel mDocumentIndexingConfigParcel;
@Field(id = 7, getter = "getIntegerIndexingConfigParcel")
@Nullable
private final IntegerIndexingConfigParcel mIntegerIndexingConfigParcel;
@Field(id = 8, getter = "getJoinableConfigParcel")
@Nullable
private final JoinableConfigParcel mJoinableConfigParcel;
@Field(id = 9, getter = "getDescription")
private final String mDescription;
@Nullable private Integer mHashCode;
/** Constructor for {@link PropertyConfigParcel}.
@Constructor
PropertyConfigParcel(
@Param(id = 1) @NonNull String name,
@Param(id = 2) @DataType int dataType,
@Param(id = 3) @Cardinality int cardinality,
@Param(id = 4) @Nullable String schemaType,
@Param(id = 5) @Nullable StringIndexingConfigParcel stringIndexingConfigParcel,
@Param(id = 6) @Nullable DocumentIndexingConfigParcel documentIndexingConfigParcel,
@Param(id = 7) @Nullable IntegerIndexingConfigParcel integerIndexingConfigParcel,
@Param(id = 8) @Nullable JoinableConfigParcel joinableConfigParcel,
@Param(id = 9) @NonNull String description) {
mName = Objects.requireNonNull(name);
mDataType = dataType;
mCardinality = cardinality;
mSchemaType = schemaType;
mStringIndexingConfigParcel = stringIndexingConfigParcel;
mDocumentIndexingConfigParcel = documentIndexingConfigParcel;
mIntegerIndexingConfigParcel = integerIndexingConfigParcel;
mJoinableConfigParcel = joinableConfigParcel;
mDescription = Objects.requireNonNull(description);
}
/** Creates a {@link PropertyConfigParcel} for String.
@NonNull
public static PropertyConfigParcel createForString(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality,
@NonNull StringIndexingConfigParcel stringIndexingConfigParcel,
@NonNull JoinableConfigParcel joinableConfigParcel) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_STRING,
cardinality,
/* schemaType= */ null,
Objects.requireNonNull(stringIndexingConfigParcel),
/* documentIndexingConfigParcel= */ null,
/* integerIndexingConfigParcel= */ null,
Objects.requireNonNull(joinableConfigParcel),
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Long.
@NonNull
public static PropertyConfigParcel createForLong(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality,
@AppSearchSchema.LongPropertyConfig.IndexingType int indexingType) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_LONG,
cardinality,
/* schemaType= */ null,
/* stringIndexingConfigParcel= */ null,
/* documentIndexingConfigParcel= */ null,
new IntegerIndexingConfigParcel(indexingType),
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Double.
@NonNull
public static PropertyConfigParcel createForDouble(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_DOUBLE,
cardinality,
/* schemaType= */ null,
/* stringIndexingConfigParcel= */ null,
/* documentIndexingConfigParcel= */ null,
/* integerIndexingConfigParcel= */ null,
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Boolean.
@NonNull
public static PropertyConfigParcel createForBoolean(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_BOOLEAN,
cardinality,
/* schemaType= */ null,
/* stringIndexingConfigParcel= */ null,
/* documentIndexingConfigParcel= */ null,
/* integerIndexingConfigParcel= */ null,
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Bytes.
@NonNull
public static PropertyConfigParcel createForBytes(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_BYTES,
cardinality,
/* schemaType= */ null,
/* stringIndexingConfigParcel= */ null,
/* documentIndexingConfigParcel= */ null,
/* integerIndexingConfigParcel= */ null,
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Creates a {@link PropertyConfigParcel} for Document.
@NonNull
public static PropertyConfigParcel createForDocument(
@NonNull String propertyName,
@NonNull String description,
@Cardinality int cardinality,
@NonNull String schemaType,
@NonNull DocumentIndexingConfigParcel documentIndexingConfigParcel) {
return new PropertyConfigParcel(
Objects.requireNonNull(propertyName),
AppSearchSchema.PropertyConfig.DATA_TYPE_DOCUMENT,
cardinality,
Objects.requireNonNull(schemaType),
/* stringIndexingConfigParcel= */ null,
Objects.requireNonNull(documentIndexingConfigParcel),
/* integerIndexingConfigParcel= */ null,
/* joinableConfigParcel= */ null,
Objects.requireNonNull(description));
}
/** Gets name for the property.
@NonNull
public String getName() {
return mName;
}
/** Gets description for the property.
@NonNull
public String getDescription() {
return mDescription;
}
/** Gets data type for the property.
@DataType
public int getDataType() {
return mDataType;
}
/** Gets cardinality for the property.
@Cardinality
public int getCardinality() {
return mCardinality;
}
/** Gets schema type.
@Nullable
public String getSchemaType() {
return mSchemaType;
}
/** Gets the {@link StringIndexingConfigParcel}.
@Nullable
public StringIndexingConfigParcel getStringIndexingConfigParcel() {
return mStringIndexingConfigParcel;
}
/** Gets the {@link DocumentIndexingConfigParcel}.
@Nullable
public DocumentIndexingConfigParcel getDocumentIndexingConfigParcel() {
return mDocumentIndexingConfigParcel;
}
/** Gets the {@link IntegerIndexingConfigParcel}.
@Nullable
public IntegerIndexingConfigParcel getIntegerIndexingConfigParcel() {
return mIntegerIndexingConfigParcel;
}
/** Gets the {@link JoinableConfigParcel}.
@Nullable
public JoinableConfigParcel getJoinableConfigParcel() {
return mJoinableConfigParcel;
}
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
PropertyConfigParcelCreator.writeToParcel(this, dest, flags);
}
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof PropertyConfigParcel)) {
return false;
}
PropertyConfigParcel otherProperty = (PropertyConfigParcel) other;
return Objects.equals(mName, otherProperty.mName)
&& Objects.equals(mDescription, otherProperty.mDescription)
&& Objects.equals(mDataType, otherProperty.mDataType)
&& Objects.equals(mCardinality, otherProperty.mCardinality)
&& Objects.equals(mSchemaType, otherProperty.mSchemaType)
&& Objects.equals(
mStringIndexingConfigParcel, otherProperty.mStringIndexingConfigParcel)
&& Objects.equals(
mDocumentIndexingConfigParcel, otherProperty.mDocumentIndexingConfigParcel)
&& Objects.equals(
mIntegerIndexingConfigParcel, otherProperty.mIntegerIndexingConfigParcel)
&& Objects.equals(mJoinableConfigParcel, otherProperty.mJoinableConfigParcel);
}
@Override
public int hashCode() {
if (mHashCode == null) {
mHashCode =
Objects.hash(
mName,
mDescription,
mDataType,
mCardinality,
mSchemaType,
mStringIndexingConfigParcel,
mDocumentIndexingConfigParcel,
mIntegerIndexingConfigParcel,
mJoinableConfigParcel);
}
return mHashCode;
}
@Override
@NonNull
public String toString() {
return "{name: "
+ mName
+ ", description: "
+ mDescription
+ ", dataType: "
+ mDataType
+ ", cardinality: "
+ mCardinality
+ ", schemaType: "
+ mSchemaType
+ ", stringIndexingConfigParcel: "
+ mStringIndexingConfigParcel
+ ", documentIndexingConfigParcel: "
+ mDocumentIndexingConfigParcel
+ ", integerIndexingConfigParcel: "
+ mIntegerIndexingConfigParcel
+ ", joinableConfigParcel: "
+ mJoinableConfigParcel
+ "}";
}
/** Class to hold join configuration for a String type.
@SafeParcelable.Class(creator = "JoinableConfigParcelCreator")
public static class JoinableConfigParcel extends AbstractSafeParcelable {
@NonNull
public static final Parcelable.Creator<JoinableConfigParcel> CREATOR =
new JoinableConfigParcelCreator();
@JoinableValueType
@Field(id = 1, getter = "getJoinableValueType")
private final int mJoinableValueType;
@Field(id = 2, getter = "getDeletionPropagation")
private final boolean mDeletionPropagation;
/** Constructor for {@link JoinableConfigParcel}.
@Constructor
public JoinableConfigParcel(
@Param(id = 1) @JoinableValueType int joinableValueType,
@Param(id = 2) boolean deletionPropagation) {
mJoinableValueType = joinableValueType;
mDeletionPropagation = deletionPropagation;
}
/** Gets {@link JoinableValueType} of the join.
@JoinableValueType
public int getJoinableValueType() {
return mJoinableValueType;
}
/** Gets whether delete will be propagated.
public boolean getDeletionPropagation() {
return mDeletionPropagation;
}
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
JoinableConfigParcelCreator.writeToParcel(this, dest, flags);
}
@Override
public int hashCode() {
return Objects.hash(mJoinableValueType, mDeletionPropagation);
}
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof JoinableConfigParcel)) {
return false;
}
JoinableConfigParcel otherObject = (JoinableConfigParcel) other;
return Objects.equals(mJoinableValueType, otherObject.mJoinableValueType)
&& Objects.equals(mDeletionPropagation, otherObject.mDeletionPropagation);
}
@Override
@NonNull
public String toString() {
return "{joinableValueType: "
+ mJoinableValueType
+ ", deletePropagation "
+ mDeletionPropagation
+ "}";
}
}
/** Class to hold configuration a string type.
@SafeParcelable.Class(creator = "StringIndexingConfigParcelCreator")
public static class StringIndexingConfigParcel extends AbstractSafeParcelable {
@NonNull
public static final Parcelable.Creator<StringIndexingConfigParcel> CREATOR =
new StringIndexingConfigParcelCreator();
@AppSearchSchema.StringPropertyConfig.IndexingType
@Field(id = 1, getter = "getIndexingType")
private final int mIndexingType;
@TokenizerType
@Field(id = 2, getter = "getTokenizerType")
private final int mTokenizerType;
/** Constructor for {@link StringIndexingConfigParcel}.
@Constructor
public StringIndexingConfigParcel(
@Param(id = 1) @AppSearchSchema.StringPropertyConfig.IndexingType int indexingType,
@Param(id = 2) @TokenizerType int tokenizerType) {
mIndexingType = indexingType;
mTokenizerType = tokenizerType;
}
/** Gets the indexing type for this property.
@AppSearchSchema.StringPropertyConfig.IndexingType
public int getIndexingType() {
return mIndexingType;
}
/** Gets the tokenization type for this property.
@TokenizerType
public int getTokenizerType() {
return mTokenizerType;
}
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
StringIndexingConfigParcelCreator.writeToParcel(this, dest, flags);
}
@Override
public int hashCode() {
return Objects.hash(mIndexingType, mTokenizerType);
}
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof StringIndexingConfigParcel)) {
return false;
}
StringIndexingConfigParcel otherObject = (StringIndexingConfigParcel) other;
return Objects.equals(mIndexingType, otherObject.mIndexingType)
&& Objects.equals(mTokenizerType, otherObject.mTokenizerType);
}
@Override
@NonNull
public String toString() {
return "{indexingType: " + mIndexingType + ", tokenizerType " + mTokenizerType + "}";
}
}
/** Class to hold configuration for integer property type.
@SafeParcelable.Class(creator = "IntegerIndexingConfigParcelCreator")
public static class IntegerIndexingConfigParcel extends AbstractSafeParcelable {
@NonNull
public static final Parcelable.Creator<IntegerIndexingConfigParcel> CREATOR =
new IntegerIndexingConfigParcelCreator();
@AppSearchSchema.LongPropertyConfig.IndexingType
@Field(id = 1, getter = "getIndexingType")
private final int mIndexingType;
/** Constructor for {@link IntegerIndexingConfigParcel}.
@Constructor
public IntegerIndexingConfigParcel(
@Param(id = 1) @AppSearchSchema.LongPropertyConfig.IndexingType int indexingType) {
mIndexingType = indexingType;
}
/** Gets the indexing type for this integer property.
@AppSearchSchema.LongPropertyConfig.IndexingType
public int getIndexingType() {
return mIndexingType;
}
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
IntegerIndexingConfigParcelCreator.writeToParcel(this, dest, flags);
}
@Override
public int hashCode() {
return Objects.hash(mIndexingType);
}
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof IntegerIndexingConfigParcel)) {
return false;
}
IntegerIndexingConfigParcel otherObject = (IntegerIndexingConfigParcel) other;
return Objects.equals(mIndexingType, otherObject.mIndexingType);
}
@Override
@NonNull
public String toString() {
return "{indexingType: " + mIndexingType + "}";
}
}
/** Class to hold configuration for document property type.
@SafeParcelable.Class(creator = "DocumentIndexingConfigParcelCreator")
public static class DocumentIndexingConfigParcel extends AbstractSafeParcelable {
@NonNull
public static final Parcelable.Creator<DocumentIndexingConfigParcel> CREATOR =
new DocumentIndexingConfigParcelCreator();
@Field(id = 1, getter = "shouldIndexNestedProperties")
private final boolean mIndexNestedProperties;
@NonNull
@Field(id = 2, getter = "getIndexableNestedPropertiesList")
private final List<String> mIndexableNestedPropertiesList;
/** Constructor for {@link DocumentIndexingConfigParcel}.
@Constructor
public DocumentIndexingConfigParcel(
@Param(id = 1) boolean indexNestedProperties,
@Param(id = 2) @NonNull List<String> indexableNestedPropertiesList) {
mIndexNestedProperties = indexNestedProperties;
mIndexableNestedPropertiesList = Objects.requireNonNull(indexableNestedPropertiesList);
}
/** Nested properties should be indexed. | DocumentIndexingConfigParcel::shouldIndexNestedProperties | java | Reginer/aosp-android-jar | android-35/src/android/app/appsearch/safeparcel/PropertyConfigParcel.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/appsearch/safeparcel/PropertyConfigParcel.java | MIT |
public TransformerFactoryImpl()
{
} |
Constructor TransformerFactoryImpl
| TransformerFactoryImpl::TransformerFactoryImpl | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
String getDOMsystemID()
{
return m_DOMsystemID;
} |
The systemID that was specified in
processFromNode(Node node, String systemID).
@return The systemID, or null.
| TransformerFactoryImpl::getDOMsystemID | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
javax.xml.transform.Templates processFromNode(Node node, String systemID)
throws TransformerConfigurationException
{
m_DOMsystemID = systemID;
return processFromNode(node);
} |
Process the stylesheet from a DOM tree, if the
processor supports the "http://xml.org/trax/features/dom/input"
feature.
@param node A DOM tree which must contain
valid transform instructions that this processor understands.
@param systemID The systemID from where xsl:includes and xsl:imports
should be resolved from.
@return A Templates object capable of being used for transformation purposes.
@throws TransformerConfigurationException
| TransformerFactoryImpl::processFromNode | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public Source getAssociatedStylesheet(
Source source, String media, String title, String charset)
throws TransformerConfigurationException
{
String baseID;
InputSource isource = null;
Node node = null;
XMLReader reader = null;
if (source instanceof DOMSource)
{
DOMSource dsource = (DOMSource) source;
node = dsource.getNode();
baseID = dsource.getSystemId();
}
else
{
isource = SAXSource.sourceToInputSource(source);
baseID = isource.getSystemId();
}
// What I try to do here is parse until the first startElement
// is found, then throw a special exception in order to terminate
// the parse.
StylesheetPIHandler handler = new StylesheetPIHandler(baseID, media,
title, charset);
// Use URIResolver. Patch from Dmitri Ilyin
if (m_uriResolver != null)
{
handler.setURIResolver(m_uriResolver);
}
try
{
if (null != node)
{
TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), baseID);
walker.traverse(node);
}
else
{
// Use JAXP1.1 ( if possible )
try
{
javax.xml.parsers.SAXParserFactory factory =
javax.xml.parsers.SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
if (m_isSecureProcessing)
{
try
{
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
}
catch (org.xml.sax.SAXException e) {}
}
javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser();
reader = jaxpParser.getXMLReader();
}
catch (javax.xml.parsers.ParserConfigurationException ex)
{
throw new org.xml.sax.SAXException(ex);
}
catch (javax.xml.parsers.FactoryConfigurationError ex1)
{
throw new org.xml.sax.SAXException(ex1.toString());
}
catch (NoSuchMethodError ex2){}
catch (AbstractMethodError ame){}
if (null == reader)
{
reader = XMLReaderFactory.createXMLReader();
}
if(m_isSecureProcessing)
{
reader.setFeature("http://xml.org/sax/features/external-general-entities",false);
}
// Need to set options!
reader.setContentHandler(handler);
reader.parse(isource);
}
}
catch (StopParseException spe)
{
// OK, good.
}
catch (org.xml.sax.SAXException se)
{
throw new TransformerConfigurationException(
"getAssociatedStylesheets failed", se);
}
catch (IOException ioe)
{
throw new TransformerConfigurationException(
"getAssociatedStylesheets failed", ioe);
}
return handler.getAssociatedStylesheet();
} |
Get InputSource specification(s) that are associated with the
given document specified in the source param,
via the xml-stylesheet processing instruction
(see http://www.w3.org/TR/xml-stylesheet/), and that matches
the given criteria. Note that it is possible to return several stylesheets
that match the criteria, in which case they are applied as if they were
a list of imports or cascades.
<p>Note that DOM2 has it's own mechanism for discovering stylesheets.
Therefore, there isn't a DOM version of this method.</p>
@param source The XML source that is to be searched.
@param media The media attribute to be matched. May be null, in which
case the prefered templates will be used (i.e. alternate = no).
@param title The value of the title attribute to match. May be null.
@param charset The value of the charset attribute to match. May be null.
@return A Source object capable of being used to create a Templates object.
@throws TransformerConfigurationException
| TransformerFactoryImpl::getAssociatedStylesheet | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public TemplatesHandler newTemplatesHandler()
throws TransformerConfigurationException
{
return new StylesheetHandler(this);
} |
Create a new Transformer object that performs a copy
of the source to the result.
@return A Transformer object that may be used to perform a transformation
in a single thread, never null.
@throws TransformerConfigurationException May throw this during
the parse when it is constructing the
Templates object and fails.
| TransformerFactoryImpl::newTemplatesHandler | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public void setFeature(String name, boolean value)
throws TransformerConfigurationException {
// feature name cannot be null
if (name == null) {
throw new NullPointerException(
XSLMessages.createMessage(
XSLTErrorResources.ER_SET_FEATURE_NULL_NAME, null));
}
// secure processing?
if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
m_isSecureProcessing = value;
}
// This implementation does not support the setting of a feature other than
// the secure processing feature.
else
{
throw new TransformerConfigurationException(
XSLMessages.createMessage(
XSLTErrorResources.ER_UNSUPPORTED_FEATURE,
new Object[] {name}));
}
} |
<p>Set a feature for this <code>TransformerFactory</code> and <code>Transformer</code>s
or <code>Template</code>s created by this factory.</p>
<p>
Feature names are fully qualified {@link java.net.URI}s.
Implementations may define their own features.
An {@link TransformerConfigurationException} is thrown if this <code>TransformerFactory</code> or the
<code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
</p>
<p>See {@link javax.xml.transform.TransformerFactory} for full documentation of specific features.</p>
@param name Feature name.
@param value Is feature state <code>true</code> or <code>false</code>.
@throws TransformerConfigurationException if this <code>TransformerFactory</code>
or the <code>Transformer</code>s or <code>Template</code>s it creates cannot support this feature.
@throws NullPointerException If the <code>name</code> parameter is null.
| TransformerFactoryImpl::setFeature | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public boolean getFeature(String name) {
// feature name cannot be null
if (name == null)
{
throw new NullPointerException(
XSLMessages.createMessage(
XSLTErrorResources.ER_GET_FEATURE_NULL_NAME, null));
}
// Try first with identity comparison, which
// will be faster.
if ((DOMResult.FEATURE == name) || (DOMSource.FEATURE == name)
|| (SAXResult.FEATURE == name) || (SAXSource.FEATURE == name)
|| (StreamResult.FEATURE == name)
|| (StreamSource.FEATURE == name)
|| (SAXTransformerFactory.FEATURE == name)
|| (SAXTransformerFactory.FEATURE_XMLFILTER == name))
return true;
else if ((DOMResult.FEATURE.equals(name))
|| (DOMSource.FEATURE.equals(name))
|| (SAXResult.FEATURE.equals(name))
|| (SAXSource.FEATURE.equals(name))
|| (StreamResult.FEATURE.equals(name))
|| (StreamSource.FEATURE.equals(name))
|| (SAXTransformerFactory.FEATURE.equals(name))
|| (SAXTransformerFactory.FEATURE_XMLFILTER.equals(name)))
return true;
// secure processing?
else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING))
return m_isSecureProcessing;
else
// unknown feature
return false;
} |
Look up the value of a feature.
<p>The feature name is any fully-qualified URI. It is
possible for an TransformerFactory to recognize a feature name but
to be unable to return its value; this is especially true
in the case of an adapter for a SAX1 Parser, which has
no way of knowing whether the underlying parser is
validating, for example.</p>
@param name The feature name, which is a fully-qualified URI.
@return The current state of the feature (true or false).
| TransformerFactoryImpl::getFeature | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public void setAttribute(String name, Object value)
throws IllegalArgumentException
{
if (name.equals(FEATURE_INCREMENTAL))
{
if(value instanceof Boolean)
{
// Accept a Boolean object..
m_incremental = ((Boolean)value).booleanValue();
}
else if(value instanceof String)
{
// .. or a String object
m_incremental = (new Boolean((String)value)).booleanValue();
}
else
{
// Give a more meaningful error message
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value);
}
}
else if (name.equals(FEATURE_OPTIMIZE))
{
if(value instanceof Boolean)
{
// Accept a Boolean object..
m_optimize = ((Boolean)value).booleanValue();
}
else if(value instanceof String)
{
// .. or a String object
m_optimize = (new Boolean((String)value)).booleanValue();
}
else
{
// Give a more meaningful error message
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value);
}
}
// Custom Xalan feature: annotate DTM with SAX source locator fields.
// This gets used during SAX2DTM instantiation.
//
// %REVIEW% Should the name of this field really be in XalanProperties?
// %REVIEW% I hate that it's a global static, but didn't want to change APIs yet.
else if(name.equals(FEATURE_SOURCE_LOCATION))
{
if(value instanceof Boolean)
{
// Accept a Boolean object..
m_source_location = ((Boolean)value).booleanValue();
}
else if(value instanceof String)
{
// .. or a String object
m_source_location = (new Boolean((String)value)).booleanValue();
}
else
{
// Give a more meaningful error message
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value);
}
}
else
{
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUPPORTED, new Object[]{name})); //name + "not supported");
}
} |
Allows the user to set specific attributes on the underlying
implementation.
@param name The name of the attribute.
@param value The value of the attribute; Boolean or String="true"|"false"
@throws IllegalArgumentException thrown if the underlying
implementation doesn't recognize the attribute.
| TransformerFactoryImpl::setAttribute | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public Object getAttribute(String name) throws IllegalArgumentException
{
if (name.equals(FEATURE_INCREMENTAL))
{
return new Boolean(m_incremental);
}
else if (name.equals(FEATURE_OPTIMIZE))
{
return new Boolean(m_optimize);
}
else if (name.equals(FEATURE_SOURCE_LOCATION))
{
return new Boolean(m_source_location);
}
else
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_RECOGNIZED, new Object[]{name})); //name + " attribute not recognized");
} |
Allows the user to retrieve specific attributes on the underlying
implementation.
@param name The name of the attribute.
@return value The value of the attribute.
@throws IllegalArgumentException thrown if the underlying
implementation doesn't recognize the attribute.
| TransformerFactoryImpl::getAttribute | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public XMLFilter newXMLFilter(Source src)
throws TransformerConfigurationException
{
Templates templates = newTemplates(src);
if( templates==null ) return null;
return newXMLFilter(templates);
} |
Create an XMLFilter that uses the given source as the
transformation instructions.
@param src The source of the transformation instructions.
@return An XMLFilter object, or null if this feature is not supported.
@throws TransformerConfigurationException
| TransformerFactoryImpl::newXMLFilter | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public XMLFilter newXMLFilter(Templates templates)
throws TransformerConfigurationException
{
try
{
return new TrAXFilter(templates);
}
catch( TransformerConfigurationException ex )
{
if( m_errorListener != null)
{
try
{
m_errorListener.fatalError( ex );
return null;
}
catch( TransformerConfigurationException ex1 )
{
throw ex1;
}
catch( TransformerException ex1 )
{
throw new TransformerConfigurationException(ex1);
}
}
throw ex;
}
} |
Create an XMLFilter that uses the given source as the
transformation instructions.
@param templates non-null reference to Templates object.
@return An XMLFilter object, or null if this feature is not supported.
@throws TransformerConfigurationException
| TransformerFactoryImpl::newXMLFilter | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public TransformerHandler newTransformerHandler(Source src)
throws TransformerConfigurationException
{
Templates templates = newTemplates(src);
if( templates==null ) return null;
return newTransformerHandler(templates);
} |
Get a TransformerHandler object that can process SAX
ContentHandler events into a Result, based on the transformation
instructions specified by the argument.
@param src The source of the transformation instructions.
@return TransformerHandler ready to transform SAX events.
@throws TransformerConfigurationException
| TransformerFactoryImpl::newTransformerHandler | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public TransformerHandler newTransformerHandler(Templates templates)
throws TransformerConfigurationException
{
try {
TransformerImpl transformer =
(TransformerImpl) templates.newTransformer();
transformer.setURIResolver(m_uriResolver);
TransformerHandler th =
(TransformerHandler) transformer.getInputContentHandler(true);
return th;
}
catch( TransformerConfigurationException ex )
{
if( m_errorListener != null )
{
try
{
m_errorListener.fatalError( ex );
return null;
}
catch (TransformerConfigurationException ex1 )
{
throw ex1;
}
catch (TransformerException ex1 )
{
throw new TransformerConfigurationException(ex1);
}
}
throw ex;
}
} |
Get a TransformerHandler object that can process SAX
ContentHandler events into a Result, based on the Templates argument.
@param templates The source of the transformation instructions.
@return TransformerHandler ready to transform SAX events.
@throws TransformerConfigurationException
| TransformerFactoryImpl::newTransformerHandler | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public TransformerHandler newTransformerHandler()
throws TransformerConfigurationException
{
return new TransformerIdentityImpl(m_isSecureProcessing);
} |
Get a TransformerHandler object that can process SAX
ContentHandler events into a Result.
@return TransformerHandler ready to transform SAX events.
@throws TransformerConfigurationException
| TransformerFactoryImpl::newTransformerHandler | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public Transformer newTransformer(Source source)
throws TransformerConfigurationException
{
try
{
Templates tmpl=newTemplates( source );
/* this can happen if an ErrorListener is present and it doesn't
throw any exception in fatalError.
The spec says: "a Transformer must use this interface
instead of throwing an exception" - the newTemplates() does
that, and returns null.
*/
if( tmpl==null ) return null;
Transformer transformer = tmpl.newTransformer();
transformer.setURIResolver(m_uriResolver);
return transformer;
}
catch( TransformerConfigurationException ex )
{
if( m_errorListener != null )
{
try
{
m_errorListener.fatalError( ex );
return null; // TODO: but the API promises to never return null...
}
catch( TransformerConfigurationException ex1 )
{
throw ex1;
}
catch( TransformerException ex1 )
{
throw new TransformerConfigurationException( ex1 );
}
}
throw ex;
}
} |
Process the source into a Transformer object. Care must
be given to know that this object can not be used concurrently
in multiple threads.
@param source An object that holds a URL, input stream, etc.
@return A Transformer object capable of
being used for transformation purposes in a single thread.
@throws TransformerConfigurationException May throw this during the parse when it
is constructing the Templates object and fails.
| TransformerFactoryImpl::newTransformer | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public Transformer newTransformer() throws TransformerConfigurationException
{
return new TransformerIdentityImpl(m_isSecureProcessing);
} |
Create a new Transformer object that performs a copy
of the source to the result.
@return A Transformer object capable of
being used for transformation purposes in a single thread.
@throws TransformerConfigurationException May throw this during
the parse when it is constructing the
Templates object and it fails.
| TransformerFactoryImpl::newTransformer | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public Templates newTemplates(Source source)
throws TransformerConfigurationException
{
String baseID = source.getSystemId();
if (null != baseID) {
baseID = SystemIDResolver.getAbsoluteURI(baseID);
}
if (source instanceof DOMSource)
{
DOMSource dsource = (DOMSource) source;
Node node = dsource.getNode();
if (null != node)
return processFromNode(node, baseID);
else
{
String messageStr = XSLMessages.createMessage(
XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null);
throw new IllegalArgumentException(messageStr);
}
}
TemplatesHandler builder = newTemplatesHandler();
builder.setSystemId(baseID);
try
{
InputSource isource = SAXSource.sourceToInputSource(source);
isource.setSystemId(baseID);
XMLReader reader = null;
if (source instanceof SAXSource)
reader = ((SAXSource) source).getXMLReader();
if (null == reader)
{
// Use JAXP1.1 ( if possible )
try
{
javax.xml.parsers.SAXParserFactory factory =
javax.xml.parsers.SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
if (m_isSecureProcessing)
{
try
{
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
}
catch (org.xml.sax.SAXException se) {}
}
javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser();
reader = jaxpParser.getXMLReader();
}
catch (javax.xml.parsers.ParserConfigurationException ex)
{
throw new org.xml.sax.SAXException(ex);
}
catch (javax.xml.parsers.FactoryConfigurationError ex1)
{
throw new org.xml.sax.SAXException(ex1.toString());
}
catch (NoSuchMethodError ex2){}
catch (AbstractMethodError ame){}
}
if (null == reader)
reader = XMLReaderFactory.createXMLReader();
// If you set the namespaces to true, we'll end up getting double
// xmlns attributes. Needs to be fixed. -sb
// reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
reader.setContentHandler(builder);
reader.parse(isource);
}
catch (org.xml.sax.SAXException se)
{
if (m_errorListener != null)
{
try
{
m_errorListener.fatalError(new TransformerException(se));
}
catch (TransformerConfigurationException ex1)
{
throw ex1;
}
catch (TransformerException ex1)
{
throw new TransformerConfigurationException(ex1);
}
}
else
{
throw new TransformerConfigurationException(se.getMessage(), se);
}
}
catch (Exception e)
{
if (m_errorListener != null)
{
try
{
m_errorListener.fatalError(new TransformerException(e));
return null;
}
catch (TransformerConfigurationException ex1)
{
throw ex1;
}
catch (TransformerException ex1)
{
throw new TransformerConfigurationException(ex1);
}
}
else
{
throw new TransformerConfigurationException(e.getMessage(), e);
}
}
return builder.getTemplates();
} |
Process the source into a Templates object, which is likely
a compiled representation of the source. This Templates object
may then be used concurrently across multiple threads. Creating
a Templates object allows the TransformerFactory to do detailed
performance optimization of transformation instructions, without
penalizing runtime transformation.
@param source An object that holds a URL, input stream, etc.
@return A Templates object capable of being used for transformation purposes.
@throws TransformerConfigurationException May throw this during the parse when it
is constructing the Templates object and fails.
| TransformerFactoryImpl::newTemplates | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public void setURIResolver(URIResolver resolver)
{
m_uriResolver = resolver;
} |
Set an object that will be used to resolve URIs used in
xsl:import, etc. This will be used as the default for the
transformation.
@param resolver An object that implements the URIResolver interface,
or null.
| TransformerFactoryImpl::setURIResolver | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public URIResolver getURIResolver()
{
return m_uriResolver;
} |
Get the object that will be used to resolve URIs used in
xsl:import, etc. This will be used as the default for the
transformation.
@return The URIResolver that was set with setURIResolver.
| TransformerFactoryImpl::getURIResolver | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public ErrorListener getErrorListener()
{
return m_errorListener;
} |
Get the error listener in effect for the TransformerFactory.
@return A non-null reference to an error listener.
| TransformerFactoryImpl::getErrorListener | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public void setErrorListener(ErrorListener listener)
throws IllegalArgumentException
{
if (null == listener)
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORLISTENER, null));
// "ErrorListener");
m_errorListener = listener;
} |
Set an error listener for the TransformerFactory.
@param listener Must be a non-null reference to an ErrorListener.
@throws IllegalArgumentException if the listener argument is null.
| TransformerFactoryImpl::setErrorListener | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public boolean isSecureProcessing()
{
return m_isSecureProcessing;
} |
Return the state of the secure processing feature.
@return state of the secure processing feature.
| TransformerFactoryImpl::isSecureProcessing | java | Reginer/aosp-android-jar | android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/org/apache/xalan/processor/TransformerFactoryImpl.java | MIT |
public static void setCleanerImplAccess(Function<Cleaner, CleanerImpl> access) {
if (cleanerImplAccess == null) {
cleanerImplAccess = access;
} else {
throw new InternalError("cleanerImplAccess");
}
} |
Called by Cleaner static initialization to provide the function
to map from Cleaner to CleanerImpl.
@param access a function to map from Cleaner to CleanerImpl
| CleanerImpl::setCleanerImplAccess | java | Reginer/aosp-android-jar | android-35/src/jdk/internal/ref/CleanerImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/jdk/internal/ref/CleanerImpl.java | MIT |
static CleanerImpl getCleanerImpl(Cleaner cleaner) {
return cleanerImplAccess.apply(cleaner);
} |
Called to get the CleanerImpl for a Cleaner.
@param cleaner the cleaner
@return the corresponding CleanerImpl
| CleanerImpl::getCleanerImpl | java | Reginer/aosp-android-jar | android-35/src/jdk/internal/ref/CleanerImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/jdk/internal/ref/CleanerImpl.java | MIT |
public CleanerImpl() {
queue = new ReferenceQueue<>();
phantomCleanableList = new PhantomCleanableRef();
// Android-removed: WeakCleanable and SoftCleanable. b/198792576
// weakCleanableList = new WeakCleanableRef();
// softCleanableList = new SoftCleanableRef();
} |
Constructor for CleanerImpl.
| CleanerImpl::CleanerImpl | java | Reginer/aosp-android-jar | android-35/src/jdk/internal/ref/CleanerImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/jdk/internal/ref/CleanerImpl.java | MIT |
public void start(Cleaner cleaner, ThreadFactory threadFactory) {
if (getCleanerImpl(cleaner) != this) {
throw new AssertionError("wrong cleaner");
}
// schedule a nop cleaning action for the cleaner, so the associated thread
// will continue to run at least until the cleaner is reclaimable.
new CleanerCleanable(cleaner);
if (threadFactory == null) {
threadFactory = CleanerImpl.InnocuousThreadFactory.factory();
}
// now that there's at least one cleaning action, for the cleaner,
// we can start the associated thread, which runs until
// all cleaning actions have been run.
Thread thread = threadFactory.newThread(this);
thread.setDaemon(true);
thread.start();
} |
Starts the Cleaner implementation.
Ensure this is the CleanerImpl for the Cleaner.
When started waits for Cleanables to be queued.
@param cleaner the cleaner
@param threadFactory the thread factory
| CleanerImpl::start | java | Reginer/aosp-android-jar | android-35/src/jdk/internal/ref/CleanerImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/jdk/internal/ref/CleanerImpl.java | MIT |
public void start(Cleaner cleaner) {
if (getCleanerImpl(cleaner) != this) {
throw new AssertionError("wrong cleaner");
}
} |
Starts the Cleaner implementation. Does not need a thread factory as it
should be used in the system cleaner only.
@param cleaner the cleaner
@hide
| CleanerImpl::start | java | Reginer/aosp-android-jar | android-35/src/jdk/internal/ref/CleanerImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/jdk/internal/ref/CleanerImpl.java | MIT |
public PhantomCleanableRef(Object obj, Cleaner cleaner, Runnable action) {
super(obj, cleaner);
this.action = action;
} |
Constructor for a phantom cleanable reference.
@param obj the object to monitor
@param cleaner the cleaner
@param action the action Runnable
| PhantomCleanableRef::PhantomCleanableRef | java | Reginer/aosp-android-jar | android-35/src/jdk/internal/ref/CleanerImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/jdk/internal/ref/CleanerImpl.java | MIT |
PhantomCleanableRef() {
super();
this.action = null;
} |
Constructor used only for root of phantom cleanable list.
| PhantomCleanableRef::PhantomCleanableRef | java | Reginer/aosp-android-jar | android-35/src/jdk/internal/ref/CleanerImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/jdk/internal/ref/CleanerImpl.java | MIT |
public PlatformEncryptionKey(int generationId, SecretKey key) {
mGenerationId = generationId;
mKey = key;
} |
A new instance.
@param generationId The generation ID of the key.
@param key The secret key handle. Can be used to encrypt WITHOUT requiring screen unlock.
| PlatformEncryptionKey::PlatformEncryptionKey | java | Reginer/aosp-android-jar | android-35/src/com/android/server/locksettings/recoverablekeystore/PlatformEncryptionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/locksettings/recoverablekeystore/PlatformEncryptionKey.java | MIT |
public int getGenerationId() {
return mGenerationId;
} |
Returns the generation ID of the key.
| PlatformEncryptionKey::getGenerationId | java | Reginer/aosp-android-jar | android-35/src/com/android/server/locksettings/recoverablekeystore/PlatformEncryptionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/locksettings/recoverablekeystore/PlatformEncryptionKey.java | MIT |
public SecretKey getKey() {
return mKey;
} |
Returns the actual key, which can only be used to encrypt.
| PlatformEncryptionKey::getKey | java | Reginer/aosp-android-jar | android-35/src/com/android/server/locksettings/recoverablekeystore/PlatformEncryptionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/locksettings/recoverablekeystore/PlatformEncryptionKey.java | MIT |
protected ServerSocketChannel(SelectorProvider provider) {
super(provider);
} |
Initializes a new instance of this class.
@param provider
The provider that created this channel
| ServerSocketChannel::ServerSocketChannel | java | Reginer/aosp-android-jar | android-34/src/java/nio/channels/ServerSocketChannel.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/nio/channels/ServerSocketChannel.java | MIT |
public static ServerSocketChannel open() throws IOException {
return SelectorProvider.provider().openServerSocketChannel();
} |
Opens a server-socket channel.
<p> The new channel is created by invoking the {@link
java.nio.channels.spi.SelectorProvider#openServerSocketChannel
openServerSocketChannel} method of the system-wide default {@link
java.nio.channels.spi.SelectorProvider} object.
<p> The new channel's socket is initially unbound; it must be bound to a
specific address via one of its socket's {@link
java.net.ServerSocket#bind(SocketAddress) bind} methods before
connections can be accepted. </p>
@return A new socket channel
@throws IOException
If an I/O error occurs
| ServerSocketChannel::open | java | Reginer/aosp-android-jar | android-34/src/java/nio/channels/ServerSocketChannel.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/nio/channels/ServerSocketChannel.java | MIT |
public final int validOps() {
return SelectionKey.OP_ACCEPT;
} |
Returns an operation set identifying this channel's supported
operations.
<p> Server-socket channels only support the accepting of new
connections, so this method returns {@link SelectionKey#OP_ACCEPT}.
</p>
@return The valid-operation set
| ServerSocketChannel::validOps | java | Reginer/aosp-android-jar | android-34/src/java/nio/channels/ServerSocketChannel.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/nio/channels/ServerSocketChannel.java | MIT |
public final ServerSocketChannel bind(SocketAddress local)
throws IOException
{
return bind(local, 0);
} |
Binds the channel's socket to a local address and configures the socket
to listen for connections.
<p> An invocation of this method is equivalent to the following:
<blockquote><pre>
bind(local, 0);
</pre></blockquote>
@param local
The local address to bind the socket, or {@code null} to bind
to an automatically assigned socket address
@return This channel
@throws AlreadyBoundException {@inheritDoc}
@throws UnsupportedAddressTypeException {@inheritDoc}
@throws ClosedChannelException {@inheritDoc}
@throws IOException {@inheritDoc}
@throws SecurityException
If a security manager has been installed and its {@link
SecurityManager#checkListen checkListen} method denies the
operation
@since 1.7
| ServerSocketChannel::bind | java | Reginer/aosp-android-jar | android-34/src/java/nio/channels/ServerSocketChannel.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/nio/channels/ServerSocketChannel.java | MIT |
private MbmsStreamingSession(Context context, Executor executor, int subscriptionId,
MbmsStreamingSessionCallback callback) {
mContext = context;
mSubscriptionId = subscriptionId;
mInternalCallback = new InternalStreamingSessionCallback(callback, executor);
} |
Metadata key that specifies the component name of the service to bind to for file-download.
@hide
@TestApi
public static final String MBMS_STREAMING_SERVICE_OVERRIDE_METADATA =
"mbms-streaming-service-override";
private static AtomicBoolean sIsInitialized = new AtomicBoolean(false);
private AtomicReference<IMbmsStreamingService> mService = new AtomicReference<>(null);
private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() {
@Override
public void binderDied() {
sIsInitialized.set(false);
sendErrorToApp(MbmsErrors.ERROR_MIDDLEWARE_LOST, "Received death notification");
}
};
private InternalStreamingSessionCallback mInternalCallback;
private ServiceConnection mServiceConnection;
private Set<StreamingService> mKnownActiveStreamingServices = new ArraySet<>();
private final Context mContext;
private int mSubscriptionId = INVALID_SUBSCRIPTION_ID;
/** @hide | MbmsStreamingSession::MbmsStreamingSession | java | Reginer/aosp-android-jar | android-35/src/android/telephony/MbmsStreamingSession.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telephony/MbmsStreamingSession.java | MIT |
public static @Nullable MbmsStreamingSession create(@NonNull Context context,
@NonNull Executor executor, int subscriptionId,
final @NonNull MbmsStreamingSessionCallback callback) {
if (!sIsInitialized.compareAndSet(false, true)) {
throw new IllegalStateException("Cannot create two instances of MbmsStreamingSession");
}
MbmsStreamingSession session = new MbmsStreamingSession(context, executor,
subscriptionId, callback);
final int result = session.bindAndInitialize();
if (result != MbmsErrors.SUCCESS) {
sIsInitialized.set(false);
executor.execute(new Runnable() {
@Override
public void run() {
callback.onError(result, null);
}
});
return null;
}
return session;
} |
Create a new {@link MbmsStreamingSession} using the given subscription ID.
Note that this call will bind a remote service. You may not call this method on your app's
main thread.
You may only have one instance of {@link MbmsStreamingSession} per UID. If you call this
method while there is an active instance of {@link MbmsStreamingSession} in your process
(in other words, one that has not had {@link #close()} called on it), this method will
throw an {@link IllegalStateException}. If you call this method in a different process
running under the same UID, an error will be indicated via
{@link MbmsStreamingSessionCallback#onError(int, String)}.
Note that initialization may fail asynchronously. If you wish to try again after you
receive such an asynchronous error, you must call {@link #close()} on the instance of
{@link MbmsStreamingSession} that you received before calling this method again.
@param context The {@link Context} to use.
@param executor The executor on which you wish to execute callbacks.
@param subscriptionId The subscription ID to use.
@param callback A callback object on which you wish to receive results of asynchronous
operations.
@return An instance of {@link MbmsStreamingSession}, or null if an error occurred.
| MbmsStreamingSession::create | java | Reginer/aosp-android-jar | android-35/src/android/telephony/MbmsStreamingSession.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telephony/MbmsStreamingSession.java | MIT |
public static MbmsStreamingSession create(@NonNull Context context,
@NonNull Executor executor, @NonNull MbmsStreamingSessionCallback callback) {
return create(context, executor, SubscriptionManager.getDefaultSubscriptionId(), callback);
} |
Create a new {@link MbmsStreamingSession} using the system default data subscription ID.
See {@link #create(Context, Executor, int, MbmsStreamingSessionCallback)}.
| MbmsStreamingSession::create | java | Reginer/aosp-android-jar | android-35/src/android/telephony/MbmsStreamingSession.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telephony/MbmsStreamingSession.java | MIT |
public void close() {
try {
IMbmsStreamingService streamingService = mService.get();
if (streamingService == null || mServiceConnection == null) {
// Ignore and return, assume already disposed.
return;
}
streamingService.dispose(mSubscriptionId);
for (StreamingService s : mKnownActiveStreamingServices) {
s.getCallback().stop();
}
mKnownActiveStreamingServices.clear();
mContext.unbindService(mServiceConnection);
} catch (RemoteException e) {
// Ignore for now
} finally {
mService.set(null);
sIsInitialized.set(false);
mServiceConnection = null;
mInternalCallback.stop();
}
} |
Terminates this instance. Also terminates
any streaming services spawned from this instance as if
{@link StreamingService#close()} had been called on them. After this method returns,
no further callbacks originating from the middleware will be enqueued on the provided
instance of {@link MbmsStreamingSessionCallback}, but callbacks that have already been
enqueued will still be delivered.
It is safe to call {@link #create(Context, Executor, int, MbmsStreamingSessionCallback)} to
obtain another instance of {@link MbmsStreamingSession} immediately after this method
returns.
May throw an {@link IllegalStateException}
| MbmsStreamingSession::close | java | Reginer/aosp-android-jar | android-35/src/android/telephony/MbmsStreamingSession.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telephony/MbmsStreamingSession.java | MIT |
public void requestUpdateStreamingServices(List<String> serviceClassList) {
IMbmsStreamingService streamingService = mService.get();
if (streamingService == null) {
throw new IllegalStateException("Middleware not yet bound");
}
try {
int returnCode = streamingService.requestUpdateStreamingServices(
mSubscriptionId, serviceClassList);
if (returnCode == MbmsErrors.UNKNOWN) {
// Unbind and throw an obvious error
close();
throw new IllegalStateException("Middleware must not return an unknown error code");
}
if (returnCode != MbmsErrors.SUCCESS) {
sendErrorToApp(returnCode, null);
}
} catch (RemoteException e) {
Log.w(LOG_TAG, "Remote process died");
mService.set(null);
sIsInitialized.set(false);
sendErrorToApp(MbmsErrors.ERROR_MIDDLEWARE_LOST, null);
}
} |
An inspection API to retrieve the list of streaming media currently be advertised.
The results are returned asynchronously via
{@link MbmsStreamingSessionCallback#onStreamingServicesUpdated(List)} on the callback
provided upon creation.
Multiple calls replace the list of service classes of interest.
May throw an {@link IllegalArgumentException} or an {@link IllegalStateException}.
@param serviceClassList A list of streaming service classes that the app would like updates
on. The exact names of these classes should be negotiated with the
wireless carrier separately.
| MbmsStreamingSession::requestUpdateStreamingServices | java | Reginer/aosp-android-jar | android-35/src/android/telephony/MbmsStreamingSession.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telephony/MbmsStreamingSession.java | MIT |
public @Nullable StreamingService startStreaming(StreamingServiceInfo serviceInfo,
@NonNull Executor executor, StreamingServiceCallback callback) {
IMbmsStreamingService streamingService = mService.get();
if (streamingService == null) {
throw new IllegalStateException("Middleware not yet bound");
}
InternalStreamingServiceCallback serviceCallback = new InternalStreamingServiceCallback(
callback, executor);
StreamingService serviceForApp = new StreamingService(
mSubscriptionId, streamingService, this, serviceInfo, serviceCallback);
mKnownActiveStreamingServices.add(serviceForApp);
try {
int returnCode = streamingService.startStreaming(
mSubscriptionId, serviceInfo.getServiceId(), serviceCallback);
if (returnCode == MbmsErrors.UNKNOWN) {
// Unbind and throw an obvious error
close();
throw new IllegalStateException("Middleware must not return an unknown error code");
}
if (returnCode != MbmsErrors.SUCCESS) {
sendErrorToApp(returnCode, null);
return null;
}
} catch (RemoteException e) {
Log.w(LOG_TAG, "Remote process died");
mService.set(null);
sIsInitialized.set(false);
sendErrorToApp(MbmsErrors.ERROR_MIDDLEWARE_LOST, null);
return null;
}
return serviceForApp;
} |
Starts streaming a requested service, reporting status to the indicated callback.
Returns an object used to control that stream. The stream may not be ready for consumption
immediately upon return from this method -- wait until the streaming state has been
reported via
{@link android.telephony.mbms.StreamingServiceCallback#onStreamStateUpdated(int, int)}
May throw an {@link IllegalArgumentException} or an {@link IllegalStateException}
Asynchronous errors through the callback include any of the errors in
{@link MbmsErrors.GeneralErrors} or
{@link MbmsErrors.StreamingErrors}.
@param serviceInfo The information about the service to stream.
@param executor The executor on which you wish to execute callbacks for this stream.
@param callback A callback that'll be called when something about the stream changes.
@return An instance of {@link StreamingService} through which the stream can be controlled.
May be {@code null} if an error occurred.
| MbmsStreamingSession::startStreaming | java | Reginer/aosp-android-jar | android-35/src/android/telephony/MbmsStreamingSession.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telephony/MbmsStreamingSession.java | MIT |
public void onStreamingServiceStopped(StreamingService service) {
mKnownActiveStreamingServices.remove(service);
} |
Starts streaming a requested service, reporting status to the indicated callback.
Returns an object used to control that stream. The stream may not be ready for consumption
immediately upon return from this method -- wait until the streaming state has been
reported via
{@link android.telephony.mbms.StreamingServiceCallback#onStreamStateUpdated(int, int)}
May throw an {@link IllegalArgumentException} or an {@link IllegalStateException}
Asynchronous errors through the callback include any of the errors in
{@link MbmsErrors.GeneralErrors} or
{@link MbmsErrors.StreamingErrors}.
@param serviceInfo The information about the service to stream.
@param executor The executor on which you wish to execute callbacks for this stream.
@param callback A callback that'll be called when something about the stream changes.
@return An instance of {@link StreamingService} through which the stream can be controlled.
May be {@code null} if an error occurred.
public @Nullable StreamingService startStreaming(StreamingServiceInfo serviceInfo,
@NonNull Executor executor, StreamingServiceCallback callback) {
IMbmsStreamingService streamingService = mService.get();
if (streamingService == null) {
throw new IllegalStateException("Middleware not yet bound");
}
InternalStreamingServiceCallback serviceCallback = new InternalStreamingServiceCallback(
callback, executor);
StreamingService serviceForApp = new StreamingService(
mSubscriptionId, streamingService, this, serviceInfo, serviceCallback);
mKnownActiveStreamingServices.add(serviceForApp);
try {
int returnCode = streamingService.startStreaming(
mSubscriptionId, serviceInfo.getServiceId(), serviceCallback);
if (returnCode == MbmsErrors.UNKNOWN) {
// Unbind and throw an obvious error
close();
throw new IllegalStateException("Middleware must not return an unknown error code");
}
if (returnCode != MbmsErrors.SUCCESS) {
sendErrorToApp(returnCode, null);
return null;
}
} catch (RemoteException e) {
Log.w(LOG_TAG, "Remote process died");
mService.set(null);
sIsInitialized.set(false);
sendErrorToApp(MbmsErrors.ERROR_MIDDLEWARE_LOST, null);
return null;
}
return serviceForApp;
}
/** @hide | MbmsStreamingSession::onStreamingServiceStopped | java | Reginer/aosp-android-jar | android-35/src/android/telephony/MbmsStreamingSession.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/telephony/MbmsStreamingSession.java | MIT |
public static Set<Locale> getAvailableLocales() {
Locale[] l = DecimalFormatSymbols.getAvailableLocales();
Set<Locale> locales = new HashSet<>(l.length);
Collections.addAll(locales, l);
return locales;
} |
Lists all the locales that are supported.
<p>
The locale 'en_US' will always be present.
@return a Set of Locales for which localization is supported
| DecimalStyle::getAvailableLocales | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public static DecimalStyle ofDefaultLocale() {
return of(Locale.getDefault(Locale.Category.FORMAT));
} |
Obtains the DecimalStyle for the default
{@link java.util.Locale.Category#FORMAT FORMAT} locale.
<p>
This method provides access to locale sensitive decimal style symbols.
<p>
This is equivalent to calling
{@link #of(Locale)
of(Locale.getDefault(Locale.Category.FORMAT))}.
@see java.util.Locale.Category#FORMAT
@return the decimal style, not null
| DecimalStyle::ofDefaultLocale | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public static DecimalStyle of(Locale locale) {
Objects.requireNonNull(locale, "locale");
DecimalStyle info = CACHE.get(locale);
if (info == null) {
info = create(locale);
CACHE.putIfAbsent(locale, info);
info = CACHE.get(locale);
}
return info;
} |
Obtains the DecimalStyle for the specified locale.
<p>
This method provides access to locale sensitive decimal style symbols.
@param locale the locale, not null
@return the decimal style, not null
| DecimalStyle::of | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
private DecimalStyle(char zeroChar, char positiveSignChar, char negativeSignChar, char decimalPointChar) {
this.zeroDigit = zeroChar;
this.positiveSign = positiveSignChar;
this.negativeSign = negativeSignChar;
this.decimalSeparator = decimalPointChar;
} |
Restricted constructor.
@param zeroChar the character to use for the digit of zero
@param positiveSignChar the character to use for the positive sign
@param negativeSignChar the character to use for the negative sign
@param decimalPointChar the character to use for the decimal point
| DecimalStyle::DecimalStyle | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public char getZeroDigit() {
return zeroDigit;
} |
Gets the character that represents zero.
<p>
The character used to represent digits may vary by culture.
This method specifies the zero character to use, which implies the characters for one to nine.
@return the character for zero
| DecimalStyle::getZeroDigit | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public DecimalStyle withZeroDigit(char zeroDigit) {
if (zeroDigit == this.zeroDigit) {
return this;
}
return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
} |
Returns a copy of the info with a new character that represents zero.
<p>
The character used to represent digits may vary by culture.
This method specifies the zero character to use, which implies the characters for one to nine.
@param zeroDigit the character for zero
@return a copy with a new character that represents zero, not null
| DecimalStyle::withZeroDigit | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public char getPositiveSign() {
return positiveSign;
} |
Gets the character that represents the positive sign.
<p>
The character used to represent a positive number may vary by culture.
This method specifies the character to use.
@return the character for the positive sign
| DecimalStyle::getPositiveSign | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public DecimalStyle withPositiveSign(char positiveSign) {
if (positiveSign == this.positiveSign) {
return this;
}
return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
} |
Returns a copy of the info with a new character that represents the positive sign.
<p>
The character used to represent a positive number may vary by culture.
This method specifies the character to use.
@param positiveSign the character for the positive sign
@return a copy with a new character that represents the positive sign, not null
| DecimalStyle::withPositiveSign | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public char getNegativeSign() {
return negativeSign;
} |
Gets the character that represents the negative sign.
<p>
The character used to represent a negative number may vary by culture.
This method specifies the character to use.
@return the character for the negative sign
| DecimalStyle::getNegativeSign | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public DecimalStyle withNegativeSign(char negativeSign) {
if (negativeSign == this.negativeSign) {
return this;
}
return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
} |
Returns a copy of the info with a new character that represents the negative sign.
<p>
The character used to represent a negative number may vary by culture.
This method specifies the character to use.
@param negativeSign the character for the negative sign
@return a copy with a new character that represents the negative sign, not null
| DecimalStyle::withNegativeSign | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public char getDecimalSeparator() {
return decimalSeparator;
} |
Gets the character that represents the decimal point.
<p>
The character used to represent a decimal point may vary by culture.
This method specifies the character to use.
@return the character for the decimal point
| DecimalStyle::getDecimalSeparator | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public DecimalStyle withDecimalSeparator(char decimalSeparator) {
if (decimalSeparator == this.decimalSeparator) {
return this;
}
return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
} |
Returns a copy of the info with a new character that represents the decimal point.
<p>
The character used to represent a decimal point may vary by culture.
This method specifies the character to use.
@param decimalSeparator the character for the decimal point
@return a copy with a new character that represents the decimal point, not null
| DecimalStyle::withDecimalSeparator | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
int convertToDigit(char ch) {
int val = ch - zeroDigit;
return (val >= 0 && val <= 9) ? val : -1;
} |
Checks whether the character is a digit, based on the currently set zero character.
@param ch the character to check
@return the value, 0 to 9, of the character, or -1 if not a digit
| DecimalStyle::convertToDigit | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
String convertNumberToI18N(String numericText) {
if (zeroDigit == '0') {
return numericText;
}
int diff = zeroDigit - '0';
char[] array = numericText.toCharArray();
for (int i = 0; i < array.length; i++) {
array[i] = (char) (array[i] + diff);
}
return new String(array);
} |
Converts the input numeric text to the internationalized form using the zero character.
@param numericText the text, consisting of digits 0 to 9, to convert, not null
@return the internationalized text, not null
| DecimalStyle::convertNumberToI18N | java | Reginer/aosp-android-jar | android-31/src/java/time/format/DecimalStyle.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/time/format/DecimalStyle.java | MIT |
public MtpDevice(@NonNull UsbDevice device) {
Preconditions.checkNotNull(device);
mDevice = device;
} |
MtpClient constructor
@param device the {@link android.hardware.usb.UsbDevice} for the MTP or PTP device
| MtpDevice::MtpDevice | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public boolean open(@NonNull UsbDeviceConnection connection) {
boolean result = false;
Context context = connection.getContext();
synchronized (mLock) {
if (context != null) {
UserManager userManager = (UserManager) context
.getSystemService(Context.USER_SERVICE);
if (!userManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER)) {
result = native_open(mDevice.getDeviceName(), connection.getFileDescriptor());
}
}
if (!result) {
connection.close();
} else {
mConnection = connection;
mCloseGuard.open("close");
}
}
return result;
} |
Opens the MTP device. Once the device is open it takes ownership of the
{@link android.hardware.usb.UsbDeviceConnection}.
The connection will be closed when you call {@link #close()}
The connection will also be closed if this method fails.
@param connection an open {@link android.hardware.usb.UsbDeviceConnection} for the device
@return true if the device was successfully opened.
| MtpDevice::open | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public void close() {
synchronized (mLock) {
if (mConnection != null) {
mCloseGuard.close();
native_close();
mConnection.close();
mConnection = null;
}
}
} |
Closes all resources related to the MtpDevice object.
After this is called, the object can not be used until {@link #open} is called again
with a new {@link android.hardware.usb.UsbDeviceConnection}.
| MtpDevice::close | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public @NonNull String getDeviceName() {
return mDevice.getDeviceName();
} |
Returns the name of the USB device
This returns the same value as {@link android.hardware.usb.UsbDevice#getDeviceName}
for the device's {@link android.hardware.usb.UsbDevice}
@return the device name
| MtpDevice::getDeviceName | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public int getDeviceId() {
return mDevice.getDeviceId();
} |
Returns the USB ID of the USB device.
This returns the same value as {@link android.hardware.usb.UsbDevice#getDeviceId}
for the device's {@link android.hardware.usb.UsbDevice}
@return the device ID
| MtpDevice::getDeviceId | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public @Nullable MtpDeviceInfo getDeviceInfo() {
return native_get_device_info();
} |
Returns the {@link MtpDeviceInfo} for this device
@return the device info, or null if fetching device info fails
| MtpDevice::getDeviceInfo | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public int setDevicePropertyInitVersion(@NonNull String propertyStr) {
return native_set_device_property_init_version(propertyStr);
} |
Set device property SESSION_INITIATOR_VERSION_INFO
@param propertyStr string value for device property SESSION_INITIATOR_VERSION_INFO
@return -1 for error, 0 for success
{@hide}
| MtpDevice::setDevicePropertyInitVersion | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public @Nullable int[] getStorageIds() {
return native_get_storage_ids();
} |
Returns the list of IDs for all storage units on this device
Information about each storage unit can be accessed via {@link #getStorageInfo}.
@return the list of storage IDs, or null if fetching storage IDs fails
| MtpDevice::getStorageIds | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public @Nullable int[] getObjectHandles(int storageId, int format, int objectHandle) {
return native_get_object_handles(storageId, format, objectHandle);
} |
Returns the list of object handles for all objects on the given storage unit,
with the given format and parent.
Information about each object can be accessed via {@link #getObjectInfo}.
@param storageId the storage unit to query
@param format the format of the object to return, or zero for all formats
@param objectHandle the parent object to query, -1 for the storage root,
or zero for all objects
@return the object handles, or null if fetching object handles fails
| MtpDevice::getObjectHandles | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public @Nullable byte[] getObject(int objectHandle, int objectSize) {
Preconditions.checkArgumentNonnegative(objectSize, "objectSize should not be negative");
return native_get_object(objectHandle, objectSize);
} |
Returns the data for an object as a byte array.
This call may block for an arbitrary amount of time depending on the size
of the data and speed of the devices.
@param objectHandle handle of the object to read
@param objectSize the size of the object (this should match
{@link MtpObjectInfo#getCompressedSize})
@return the object's data, or null if reading fails
| MtpDevice::getObject | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public long getPartialObject(int objectHandle, long offset, long size, @NonNull byte[] buffer)
throws IOException {
return native_get_partial_object(objectHandle, offset, size, buffer);
} |
Obtains object bytes in the specified range and writes it to an array.
This call may block for an arbitrary amount of time depending on the size
of the data and speed of the devices.
@param objectHandle handle of the object to read
@param offset Start index of reading range. It must be a non-negative value at most
0xffffffff.
@param size Size of reading range. It must be a non-negative value at most Integer.MAX_VALUE
or 0xffffffff. If 0xffffffff is specified, the method obtains the full bytes of object.
@param buffer Array to write data.
@return Size of bytes that are actually read.
| MtpDevice::getPartialObject | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public long getPartialObject64(int objectHandle, long offset, long size, @NonNull byte[] buffer)
throws IOException {
return native_get_partial_object_64(objectHandle, offset, size, buffer);
} |
Obtains object bytes in the specified range and writes it to an array.
This call may block for an arbitrary amount of time depending on the size
of the data and speed of the devices.
This is a vender-extended operation supported by Android that enables us to pass
unsigned 64-bit offset. Check if the MTP device supports the operation by using
{@link MtpDeviceInfo#getOperationsSupported()}.
@param objectHandle handle of the object to read
@param offset Start index of reading range. It must be a non-negative value.
@param size Size of reading range. It must be a non-negative value at most Integer.MAX_VALUE.
@param buffer Array to write data.
@return Size of bytes that are actually read.
@see MtpConstants#OPERATION_GET_PARTIAL_OBJECT_64
| MtpDevice::getPartialObject64 | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public @Nullable byte[] getThumbnail(int objectHandle) {
return native_get_thumbnail(objectHandle);
} |
Returns the thumbnail data for an object as a byte array.
The size and format of the thumbnail data can be determined via
{@link MtpObjectInfo#getThumbCompressedSize} and
{@link MtpObjectInfo#getThumbFormat}.
For typical devices the format is JPEG.
@param objectHandle handle of the object to read
@return the object's thumbnail, or null if reading fails
| MtpDevice::getThumbnail | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public @Nullable MtpStorageInfo getStorageInfo(int storageId) {
return native_get_storage_info(storageId);
} |
Retrieves the {@link MtpStorageInfo} for a storage unit.
@param storageId the ID of the storage unit
@return the MtpStorageInfo, or null if fetching storage info fails
| MtpDevice::getStorageInfo | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public @Nullable MtpObjectInfo getObjectInfo(int objectHandle) {
return native_get_object_info(objectHandle);
} |
Retrieves the {@link MtpObjectInfo} for an object.
@param objectHandle the handle of the object
@return the MtpObjectInfo, or null if fetching object info fails
| MtpDevice::getObjectInfo | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public boolean deleteObject(int objectHandle) {
return native_delete_object(objectHandle);
} |
Deletes an object on the device. This call may block, since
deleting a directory containing many files may take a long time
on some devices.
@param objectHandle handle of the object to delete
@return true if the deletion succeeds
| MtpDevice::deleteObject | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public long getParent(int objectHandle) {
return native_get_parent(objectHandle);
} |
Retrieves the object handle for the parent of an object on the device.
@param objectHandle handle of the object to query
@return the parent's handle, or zero if it is in the root of the storage
| MtpDevice::getParent | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public long getStorageId(int objectHandle) {
return native_get_storage_id(objectHandle);
} |
Retrieves the ID of the storage unit containing the given object on the device.
@param objectHandle handle of the object to query
@return the object's storage unit ID
| MtpDevice::getStorageId | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public boolean importFile(int objectHandle, @NonNull String destPath) {
return native_import_file(objectHandle, destPath);
} |
Copies the data for an object to a file in external storage.
This call may block for an arbitrary amount of time depending on the size
of the data and speed of the devices.
@param objectHandle handle of the object to read
@param destPath path to destination for the file transfer.
This path should be in the external storage as defined by
{@link android.os.Environment#getExternalStorageDirectory}
@return true if the file transfer succeeds
| MtpDevice::importFile | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public boolean importFile(int objectHandle, @NonNull ParcelFileDescriptor descriptor) {
return native_import_file(objectHandle, descriptor.getFd());
} |
Copies the data for an object to a file descriptor.
This call may block for an arbitrary amount of time depending on the size
of the data and speed of the devices. The file descriptor is not closed
on completion, and must be done by the caller.
@param objectHandle handle of the object to read
@param descriptor file descriptor to write the data to for the file transfer.
@return true if the file transfer succeeds
| MtpDevice::importFile | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public boolean sendObject(
int objectHandle, long size, @NonNull ParcelFileDescriptor descriptor) {
return native_send_object(objectHandle, size, descriptor.getFd());
} |
Copies the data for an object from a file descriptor.
This call may block for an arbitrary amount of time depending on the size
of the data and speed of the devices. The file descriptor is not closed
on completion, and must be done by the caller.
@param objectHandle handle of the target file
@param size size of the file in bytes
@param descriptor file descriptor to read the data from.
@return true if the file transfer succeeds
| MtpDevice::sendObject | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
public @Nullable MtpObjectInfo sendObjectInfo(@NonNull MtpObjectInfo info) {
return native_send_object_info(info);
} |
Uploads an object metadata for a new entry. The {@link MtpObjectInfo} can be
created with the {@link MtpObjectInfo.Builder} class.
The returned {@link MtpObjectInfo} has the new object handle field filled in.
@param info metadata of the entry
@return object info of the created entry, or null if sending object info fails
| MtpDevice::sendObjectInfo | java | Reginer/aosp-android-jar | android-31/src/android/mtp/MtpDevice.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/mtp/MtpDevice.java | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.