code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
844 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
String getLppProfile() { return mProperties.getProperty(CONFIG_LPP_PROFILE); }
Returns the value of config parameter LPP_PROFILE or {@code null} if no value is provided.
HalInterfaceVersion::getLppProfile
java
Reginer/aosp-android-jar
android-32/src/com/android/server/location/gnss/GnssConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/location/gnss/GnssConfiguration.java
MIT
List<String> getProxyApps() { // Space separated list of Android proxy app package names. String proxyAppsStr = mProperties.getProperty(CONFIG_NFW_PROXY_APPS); if (TextUtils.isEmpty(proxyAppsStr)) { return Collections.emptyList(); } String[] proxyAppsArray = proxyAppsStr.trim().split("\\s+"); if (proxyAppsArray.length == 0) { return Collections.emptyList(); } return Arrays.asList(proxyAppsArray); }
Returns the list of proxy apps from the value of config parameter NFW_PROXY_APPS.
HalInterfaceVersion::getProxyApps
java
Reginer/aosp-android-jar
android-32/src/com/android/server/location/gnss/GnssConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/location/gnss/GnssConfiguration.java
MIT
void setSatelliteBlocklist(int[] constellations, int[] svids) { native_set_satellite_blocklist(constellations, svids); }
Updates the GNSS HAL satellite denylist.
HalInterfaceVersion::setSatelliteBlocklist
java
Reginer/aosp-android-jar
android-32/src/com/android/server/location/gnss/GnssConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/location/gnss/GnssConfiguration.java
MIT
void reloadGpsProperties() { if (DEBUG) Log.d(TAG, "Reset GPS properties, previous size = " + mProperties.size()); loadPropertiesFromCarrierConfig(); String lpp_prof = SystemProperties.get(LPP_PROFILE); if (!TextUtils.isEmpty(lpp_prof)) { // override default value of this if lpp_prof is not empty mProperties.setProperty(CONFIG_LPP_PROFILE, lpp_prof); } /* * Overlay carrier properties from a debug configuration file. */ loadPropertiesFromGpsDebugConfig(mProperties); mEsExtensionSec = getRangeCheckedConfigEsExtensionSec(); logConfigurations(); final HalInterfaceVersion gnssConfigurationIfaceVersion = getHalInterfaceVersion(); if (gnssConfigurationIfaceVersion != null) { // Set to a range checked value. if (isConfigEsExtensionSecSupported(gnssConfigurationIfaceVersion) && !native_set_es_extension_sec(mEsExtensionSec)) { Log.e(TAG, "Unable to set " + CONFIG_ES_EXTENSION_SEC + ": " + mEsExtensionSec); } Map<String, SetCarrierProperty> map = new HashMap<String, SetCarrierProperty>() { { put(CONFIG_SUPL_VER, GnssConfiguration::native_set_supl_version); put(CONFIG_SUPL_MODE, GnssConfiguration::native_set_supl_mode); if (isConfigSuplEsSupported(gnssConfigurationIfaceVersion)) { put(CONFIG_SUPL_ES, GnssConfiguration::native_set_supl_es); } put(CONFIG_LPP_PROFILE, GnssConfiguration::native_set_lpp_profile); put(CONFIG_A_GLONASS_POS_PROTOCOL_SELECT, GnssConfiguration::native_set_gnss_pos_protocol_select); put(CONFIG_USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, GnssConfiguration::native_set_emergency_supl_pdn); if (isConfigGpsLockSupported(gnssConfigurationIfaceVersion)) { put(CONFIG_GPS_LOCK, GnssConfiguration::native_set_gps_lock); } } }; for (Entry<String, SetCarrierProperty> entry : map.entrySet()) { String propertyName = entry.getKey(); String propertyValueString = mProperties.getProperty(propertyName); if (propertyValueString != null) { try { int propertyValueInt = Integer.decode(propertyValueString); boolean result = entry.getValue().set(propertyValueInt); if (!result) { Log.e(TAG, "Unable to set " + propertyName); } } catch (NumberFormatException e) { Log.e(TAG, "Unable to parse propertyName: " + propertyValueString); } } } } else if (DEBUG) { Log.d(TAG, "Skipped configuration update because GNSS configuration in GPS HAL is not" + " supported"); } }
Loads the GNSS properties from carrier config file followed by the properties from gps debug config file.
GnssConfiguration::reloadGpsProperties
java
Reginer/aosp-android-jar
android-32/src/com/android/server/location/gnss/GnssConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/location/gnss/GnssConfiguration.java
MIT
void loadPropertiesFromCarrierConfig() { CarrierConfigManager configManager = (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE); if (configManager == null) { return; } int ddSubId = SubscriptionManager.getDefaultDataSubscriptionId(); PersistableBundle configs = SubscriptionManager.isValidSubscriptionId(ddSubId) ? configManager.getConfigForSubId(ddSubId) : configManager.getConfig(); if (configs == null) { if (DEBUG) Log.d(TAG, "SIM not ready, use default carrier config."); configs = CarrierConfigManager.getDefaultConfig(); } for (String configKey : configs.keySet()) { if (configKey.startsWith(CarrierConfigManager.Gps.KEY_PREFIX)) { String key = configKey .substring(CarrierConfigManager.Gps.KEY_PREFIX.length()) .toUpperCase(); Object value = configs.get(configKey); if (DEBUG) Log.d(TAG, "Gps config: " + key + " = " + value); if (value instanceof String) { // Most GPS properties are of String type; convert so. mProperties.setProperty(key, (String) value); } else if (value != null) { mProperties.setProperty(key, value.toString()); } } } }
Loads GNSS properties from carrier config file.
GnssConfiguration::loadPropertiesFromCarrierConfig
java
Reginer/aosp-android-jar
android-32/src/com/android/server/location/gnss/GnssConfiguration.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/location/gnss/GnssConfiguration.java
MIT
public SubscribeConfig(byte[] serviceName, byte[] serviceSpecificInfo, byte[] matchFilter, int subscribeType, int ttlSec, boolean enableTerminateNotification, boolean minDistanceMmSet, int minDistanceMm, boolean maxDistanceMmSet, int maxDistanceMm) { mServiceName = serviceName; mServiceSpecificInfo = serviceSpecificInfo; mMatchFilter = matchFilter; mSubscribeType = subscribeType; mTtlSec = ttlSec; mEnableTerminateNotification = enableTerminateNotification; mMinDistanceMm = minDistanceMm; mMinDistanceMmSet = minDistanceMmSet; mMaxDistanceMm = maxDistanceMm; mMaxDistanceMmSet = maxDistanceMmSet; }
Defines an active subscribe session - a subscribe session where subscribe packets are transmitted over-the-air. Configuration is done using {@link SubscribeConfig.Builder#setSubscribeType(int)}. public static final int SUBSCRIBE_TYPE_ACTIVE = 1; /** @hide public final byte[] mServiceName; /** @hide public final byte[] mServiceSpecificInfo; /** @hide public final byte[] mMatchFilter; /** @hide public final int mSubscribeType; /** @hide public final int mTtlSec; /** @hide public final boolean mEnableTerminateNotification; /** @hide public final boolean mMinDistanceMmSet; /** @hide public final int mMinDistanceMm; /** @hide public final boolean mMaxDistanceMmSet; /** @hide public final int mMaxDistanceMm; /** @hide
SubscribeConfig::SubscribeConfig
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public void assertValid(Characteristics characteristics, boolean rttSupported) throws IllegalArgumentException { WifiAwareUtils.validateServiceName(mServiceName); if (!TlvBufferUtils.isValid(mMatchFilter, 0, 1)) { throw new IllegalArgumentException( "Invalid matchFilter configuration - LV fields do not match up to length"); } if (mSubscribeType < SUBSCRIBE_TYPE_PASSIVE || mSubscribeType > SUBSCRIBE_TYPE_ACTIVE) { throw new IllegalArgumentException("Invalid subscribeType - " + mSubscribeType); } if (mTtlSec < 0) { throw new IllegalArgumentException("Invalid ttlSec - must be non-negative"); } if (characteristics != null) { int maxServiceNameLength = characteristics.getMaxServiceNameLength(); if (maxServiceNameLength != 0 && mServiceName.length > maxServiceNameLength) { throw new IllegalArgumentException( "Service name longer than supported by device characteristics"); } int maxServiceSpecificInfoLength = characteristics.getMaxServiceSpecificInfoLength(); if (maxServiceSpecificInfoLength != 0 && mServiceSpecificInfo != null && mServiceSpecificInfo.length > maxServiceSpecificInfoLength) { throw new IllegalArgumentException( "Service specific info longer than supported by device characteristics"); } int maxMatchFilterLength = characteristics.getMaxMatchFilterLength(); if (maxMatchFilterLength != 0 && mMatchFilter != null && mMatchFilter.length > maxMatchFilterLength) { throw new IllegalArgumentException( "Match filter longer than supported by device characteristics"); } } if (mMinDistanceMmSet && mMinDistanceMm < 0) { throw new IllegalArgumentException("Minimum distance must be non-negative"); } if (mMaxDistanceMmSet && mMaxDistanceMm < 0) { throw new IllegalArgumentException("Maximum distance must be non-negative"); } if (mMinDistanceMmSet && mMaxDistanceMmSet && mMaxDistanceMm <= mMinDistanceMm) { throw new IllegalArgumentException( "Maximum distance must be greater than minimum distance"); } if (!rttSupported && (mMinDistanceMmSet || mMaxDistanceMmSet)) { throw new IllegalArgumentException("Ranging is not supported"); } }
Verifies that the contents of the SubscribeConfig are valid. Otherwise throws an IllegalArgumentException. @hide
SubscribeConfig::assertValid
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public Builder setServiceName(@NonNull String serviceName) { if (serviceName == null) { throw new IllegalArgumentException("Invalid service name - must be non-null"); } mServiceName = serviceName.getBytes(StandardCharsets.UTF_8); return this; }
Specify the service name of the subscribe session. The actual on-air value is a 6 byte hashed representation of this string. <p> The Service Name is a UTF-8 encoded string from 1 to 255 bytes in length. The only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric values (A-Z, a-z, 0-9), the hyphen ('-'), and the period ('.'). All valid multi-byte UTF-8 characters are acceptable in a Service Name. <p> Must be called - an empty ServiceName is not valid. @param serviceName The service name for the subscribe session. @return The builder to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
Builder::setServiceName
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public Builder setServiceSpecificInfo(@Nullable byte[] serviceSpecificInfo) { mServiceSpecificInfo = serviceSpecificInfo; return this; }
Specify service specific information for the subscribe session. This is a free-form byte array available to the application to send additional information as part of the discovery operation - i.e. it will not be used to determine whether a publish/subscribe match occurs. <p> Optional. Empty by default. @param serviceSpecificInfo A byte-array for the service-specific information field. @return The builder to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
Builder::setServiceSpecificInfo
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public Builder setMatchFilter(@Nullable List<byte[]> matchFilter) { mMatchFilter = new TlvBufferUtils.TlvConstructor(0, 1).allocateAndPut( matchFilter).getArray(); return this; }
The match filter for a subscribe session. Used to determine whether a service discovery occurred - in addition to relying on the service name. <p> Optional. Empty by default. @param matchFilter A list of match filter entries (each of which is an arbitrary byte array). @return The builder to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
Builder::setMatchFilter
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public Builder setSubscribeType(@SubscribeTypes int subscribeType) { if (subscribeType < SUBSCRIBE_TYPE_PASSIVE || subscribeType > SUBSCRIBE_TYPE_ACTIVE) { throw new IllegalArgumentException("Invalid subscribeType - " + subscribeType); } mSubscribeType = subscribeType; return this; }
Sets the type of the subscribe session: active (subscribe packets are transmitted over-the-air), or passive (no subscribe packets are transmitted, a match is made against a solicited/active publish session whose packets are transmitted over-the-air). @param subscribeType Subscribe session type: {@link SubscribeConfig#SUBSCRIBE_TYPE_ACTIVE} or {@link SubscribeConfig#SUBSCRIBE_TYPE_PASSIVE}. @return The builder to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
Builder::setSubscribeType
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public Builder setTtlSec(int ttlSec) { if (ttlSec < 0) { throw new IllegalArgumentException("Invalid ttlSec - must be non-negative"); } mTtlSec = ttlSec; return this; }
Sets the time interval (in seconds) an active ( {@link SubscribeConfig.Builder#setSubscribeType(int)}) subscribe session will be alive - i.e. broadcasting a packet. When the TTL is reached an event will be generated for {@link DiscoverySessionCallback#onSessionTerminated()}. <p> Optional. 0 by default - indicating the session doesn't terminate on its own. Session will be terminated when {@link DiscoverySession#close()} is called. @param ttlSec Lifetime of a subscribe session in seconds. @return The builder to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
Builder::setTtlSec
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public Builder setTerminateNotificationEnabled(boolean enable) { mEnableTerminateNotification = enable; return this; }
Configure whether a subscribe terminate notification {@link DiscoverySessionCallback#onSessionTerminated()} is reported back to the callback. @param enable If true the terminate callback will be called when the subscribe is terminated. Otherwise it will not be called. @return The builder to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
Builder::setTerminateNotificationEnabled
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public Builder setMinDistanceMm(int minDistanceMm) { mMinDistanceMm = minDistanceMm; mMinDistanceMmSet = true; return this; }
Configure the minimum distance to a discovered publisher at which to trigger a discovery notification. I.e. discovery will be triggered if we've found a matching publisher (based on the other criteria in this configuration) <b>and</b> the distance to the publisher is larger than the value specified in this API. Can be used in conjunction with {@link #setMaxDistanceMm(int)} to specify a geofence, i.e. discovery with min <= distance <= max. <p> For ranging to be used in discovery it must also be enabled on the publisher using {@link PublishConfig.Builder#setRangingEnabled(boolean)}. However, ranging may not be available or enabled on the publisher or may be temporarily disabled on either subscriber or publisher - in such cases discovery will proceed without ranging. <p> When ranging is enabled and available on both publisher and subscriber and a service is discovered based on geofence constraints the {@link DiscoverySessionCallback#onServiceDiscoveredWithinRange(PeerHandle, byte[], List, int)} is called, otherwise the {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], List)} is called. <p> The device must support Wi-Fi RTT for this feature to be used. Feature support is checked as described in {@link android.net.wifi.rtt}. @param minDistanceMm Minimum distance, in mm, to the publisher above which to trigger discovery. @return The builder to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
Builder::setMinDistanceMm
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public Builder setMaxDistanceMm(int maxDistanceMm) { mMaxDistanceMm = maxDistanceMm; mMaxDistanceMmSet = true; return this; }
Configure the maximum distance to a discovered publisher at which to trigger a discovery notification. I.e. discovery will be triggered if we've found a matching publisher (based on the other criteria in this configuration) <b>and</b> the distance to the publisher is smaller than the value specified in this API. Can be used in conjunction with {@link #setMinDistanceMm(int)} to specify a geofence, i.e. discovery with min <= distance <= max. <p> For ranging to be used in discovery it must also be enabled on the publisher using {@link PublishConfig.Builder#setRangingEnabled(boolean)}. However, ranging may not be available or enabled on the publisher or may be temporarily disabled on either subscriber or publisher - in such cases discovery will proceed without ranging. <p> When ranging is enabled and available on both publisher and subscriber and a service is discovered based on geofence constraints the {@link DiscoverySessionCallback#onServiceDiscoveredWithinRange(PeerHandle, byte[], List, int)} is called, otherwise the {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], List)} is called. <p> The device must support Wi-Fi RTT for this feature to be used. Feature support is checked as described in {@link android.net.wifi.rtt}. @param maxDistanceMm Maximum distance, in mm, to the publisher below which to trigger discovery. @return The builder to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
Builder::setMaxDistanceMm
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public SubscribeConfig build() { return new SubscribeConfig(mServiceName, mServiceSpecificInfo, mMatchFilter, mSubscribeType, mTtlSec, mEnableTerminateNotification, mMinDistanceMmSet, mMinDistanceMm, mMaxDistanceMmSet, mMaxDistanceMm); }
Build {@link SubscribeConfig} given the current requests made on the builder.
Builder::build
java
Reginer/aosp-android-jar
android-31/src/android/net/wifi/aware/SubscribeConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/net/wifi/aware/SubscribeConfig.java
MIT
public BluetoothLeBroadcastReceiveState(@IntRange(from = 0x00, to = 0xFF) int sourceId, @BluetoothDevice.AddressType int sourceAddressType, @NonNull BluetoothDevice sourceDevice, int sourceAdvertisingSid, int broadcastId, @PaSyncState int paSyncState, @BigEncryptionState int bigEncryptionState, byte[] badCode, @IntRange(from = 0x00) int numSubgroups, @NonNull List<Long> bisSyncState, @NonNull List<BluetoothLeAudioContentMetadata> subgroupMetadata) { if (sourceId < 0x00 || sourceId > 0xFF) { throw new IllegalArgumentException("sourceId " + sourceId + " does not fall between 0x00 and 0xFF"); } Objects.requireNonNull(sourceDevice, "sourceDevice cannot be null"); if (sourceAddressType == BluetoothDevice.ADDRESS_TYPE_UNKNOWN) { throw new IllegalArgumentException("sourceAddressType cannot be ADDRESS_TYPE_UNKNOWN"); } if (sourceAddressType != BluetoothDevice.ADDRESS_TYPE_RANDOM && sourceAddressType != BluetoothDevice.ADDRESS_TYPE_PUBLIC) { throw new IllegalArgumentException("sourceAddressType " + sourceAddressType + " is invalid"); } Objects.requireNonNull(bisSyncState, "bisSyncState cannot be null"); if (bisSyncState.size() != numSubgroups) { throw new IllegalArgumentException("bisSyncState.size() " + bisSyncState.size() + " must be equal to numSubgroups " + numSubgroups); } Objects.requireNonNull(subgroupMetadata, "subgroupMetadata cannot be null"); if (subgroupMetadata.size() != numSubgroups) { throw new IllegalArgumentException("subgroupMetadata.size() " + subgroupMetadata.size() + " must be equal to numSubgroups " + numSubgroups); } if (paSyncState != PA_SYNC_STATE_IDLE && paSyncState != PA_SYNC_STATE_SYNCINFO_REQUEST && paSyncState != PA_SYNC_STATE_SYNCHRONIZED && paSyncState != PA_SYNC_STATE_FAILED_TO_SYNCHRONIZE && paSyncState != PA_SYNC_STATE_NO_PAST && paSyncState != PA_SYNC_STATE_INVALID) { throw new IllegalArgumentException("unrecognized paSyncState " + paSyncState); } if (bigEncryptionState != BIG_ENCRYPTION_STATE_NOT_ENCRYPTED && bigEncryptionState != BIG_ENCRYPTION_STATE_CODE_REQUIRED && bigEncryptionState != BIG_ENCRYPTION_STATE_DECRYPTING && bigEncryptionState != BIG_ENCRYPTION_STATE_BAD_CODE && bigEncryptionState != BIG_ENCRYPTION_STATE_INVALID) { throw new IllegalArgumentException("unrecognized bigEncryptionState " + bigEncryptionState); } if (badCode != null && badCode.length != 16) { throw new IllegalArgumentException("badCode must be 16 bytes long of null, but is " + badCode.length + " + bytes long"); } mSourceId = sourceId; mSourceAddressType = sourceAddressType; mSourceDevice = sourceDevice; mSourceAdvertisingSid = sourceAdvertisingSid; mBroadcastId = broadcastId; mPaSyncState = paSyncState; mBigEncryptionState = bigEncryptionState; mBadCode = badCode; mNumSubgroups = numSubgroups; mBisSyncState = bisSyncState; mSubgroupMetadata = subgroupMetadata; }
Constructor to create a read-only {@link BluetoothLeBroadcastReceiveState} instance. @throws NullPointerException if sourceDevice, bisSyncState, or subgroupMetadata is null @throws IllegalArgumentException if sourceID is not [0, 0xFF] or if sourceAddressType is invalid or if bisSyncState.size() != numSubgroups or if subgroupMetadata.size() != numSubgroups or if paSyncState or bigEncryptionState is not recognized bye IntDef @hide
BluetoothLeBroadcastReceiveState::BluetoothLeBroadcastReceiveState
java
Reginer/aosp-android-jar
android-34/src/android/bluetooth/BluetoothLeBroadcastReceiveState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/bluetooth/BluetoothLeBroadcastReceiveState.java
MIT
public int getNumSubgroups() { return mNumSubgroups; }
Get number of Broadcast subgroups being added to this sink @return number of Broadcast subgroups being added to this sink
BluetoothLeBroadcastReceiveState::getNumSubgroups
java
Reginer/aosp-android-jar
android-34/src/android/bluetooth/BluetoothLeBroadcastReceiveState.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/bluetooth/BluetoothLeBroadcastReceiveState.java
MIT
boolean onMotionEvent(MotionEvent event, MotionEvent rawEvent, int policyFlags) { if (mState.isClear()) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { // Validity safeguard: if touch state is clear, then matchers should always be clear // before processing the next down event. clear(); } else { // If for some reason other events come through while in the clear state they could // compromise the state of particular matchers, so we just ignore them. return false; } } if (mSendMotionEventsEnabled) { mEvents.add(MotionEvent.obtainNoHistory(rawEvent)); } for (GestureMatcher matcher : mGestures) { if (matcher.getState() != GestureMatcher.STATE_GESTURE_CANCELED) { if (DEBUG) { Slog.d(LOG_TAG, matcher.toString()); } matcher.onMotionEvent(event, rawEvent, policyFlags); if (DEBUG) { Slog.d(LOG_TAG, matcher.toString()); } if (matcher.getState() == GestureMatcher.STATE_GESTURE_COMPLETED) { // Here we just return. The actual gesture dispatch is done in // onStateChanged(). // No need to process this event any further. return true; } } } return false; }
Processes a motion event. @param event The event as received from the previous entry in the event stream. @param rawEvent The event without any transformations e.g. magnification. @param policyFlags @return True if the event has been appropriately handled by the gesture manifold and related callback functions, false if it should be handled further by the calling function.
GestureManifold::onMotionEvent
java
Reginer/aosp-android-jar
android-32/src/com/android/server/accessibility/gestures/GestureManifold.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/accessibility/gestures/GestureManifold.java
MIT
public List<MotionEvent> getMotionEvents() { return mEvents; }
Returns the current list of motion events. It is the caller's responsibility to copy the list if they want it to persist after a call to clear().
GestureManifold::getMotionEvents
java
Reginer/aosp-android-jar
android-32/src/com/android/server/accessibility/gestures/GestureManifold.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/accessibility/gestures/GestureManifold.java
MIT
default boolean disallowPanelTouches() { return isShowingDetail(); }
Should touches from the notification panel be disallowed? The notification panel might grab any touches rom QS at any time to collapse the shade. We should disallow that in case we are showing the detail panel.
public::disallowPanelTouches
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/plugins/qs/QS.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/plugins/qs/QS.java
MIT
default void setTransitionToFullShadeAmount(float pxAmount, float progress) {}
Set the amount of pixels we have currently dragged down if we're transitioning to the full shade. 0.0f means we're not transitioning yet.
public::setTransitionToFullShadeAmount
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/plugins/qs/QS.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/plugins/qs/QS.java
MIT
default boolean isFullyCollapsed() { return true; }
@return if quick settings is fully collapsed currently
public::isFullyCollapsed
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/plugins/qs/QS.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/plugins/qs/QS.java
MIT
default void setScrollListener(ScrollListener scrollListener) {}
Set a scroll listener for the QSPanel container
public::setScrollListener
java
Reginer/aosp-android-jar
android-32/src/com/android/systemui/plugins/qs/QS.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/systemui/plugins/qs/QS.java
MIT
static boolean isChangeEnabled(@CachedCompatChangeId int cachedCompatChangeId, ApplicationInfo app, boolean defaultValue) { return getInstance().isChangeEnabled( CACHED_COMPAT_CHANGE_IDS_MAPPING[cachedCompatChangeId], app, defaultValue); }
@return If the given cached compat change id is enabled.
PlatformCompatCache::isChangeEnabled
java
Reginer/aosp-android-jar
android-34/src/com/android/server/am/PlatformCompatCache.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/am/PlatformCompatCache.java
MIT
void invalidate(ApplicationInfo app) { for (int i = mCaches.size() - 1; i >= 0; i--) { mCaches.valueAt(i).invalidate(app); } }
Invalidate the cache for the given app.
PlatformCompatCache::invalidate
java
Reginer/aosp-android-jar
android-34/src/com/android/server/am/PlatformCompatCache.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/am/PlatformCompatCache.java
MIT
void onApplicationInfoChanged(ApplicationInfo app) { for (int i = mCaches.size() - 1; i >= 0; i--) { mCaches.valueAt(i).onApplicationInfoChanged(app); } }
Update the cache due to application info changes.
PlatformCompatCache::onApplicationInfoChanged
java
Reginer/aosp-android-jar
android-34/src/com/android/server/am/PlatformCompatCache.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/am/PlatformCompatCache.java
MIT
public QName getName() { return m_name; }
Get the key name from a key declaration this iterator will process @return Key name
KeyIterator::getName
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/transformer/KeyIterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/transformer/KeyIterator.java
MIT
public Vector getKeyDeclarations() { return m_keyDeclarations; }
Get the key declarations from the stylesheet @return Vector containing the key declarations from the stylesheet
KeyIterator::getKeyDeclarations
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/transformer/KeyIterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/transformer/KeyIterator.java
MIT
KeyIterator(QName name, Vector keyDeclarations) { super(Axis.ALL); m_keyDeclarations = keyDeclarations; // m_prefixResolver = nscontext; m_name = name; }
Create a KeyIterator object. @throws javax.xml.transform.TransformerException
KeyIterator::KeyIterator
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/transformer/KeyIterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/transformer/KeyIterator.java
MIT
public short acceptNode(int testNode) { boolean foundKey = false; KeyIterator ki = (KeyIterator) m_lpi; org.apache.xpath.XPathContext xctxt = ki.getXPathContext(); Vector keys = ki.getKeyDeclarations(); QName name = ki.getName(); try { // System.out.println("lookupKey: "+lookupKey); int nDeclarations = keys.size(); // Walk through each of the declarations made with xsl:key for (int i = 0; i < nDeclarations; i++) { KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i); // Only continue if the name on this key declaration // matches the name on the iterator for this walker. if (!kd.getName().equals(name)) continue; foundKey = true; // xctxt.setNamespaceContext(ki.getPrefixResolver()); // See if our node matches the given key declaration according to // the match attribute on xsl:key. XPath matchExpr = kd.getMatch(); double score = matchExpr.getMatchScore(xctxt, testNode); if (score == kd.getMatch().MATCH_SCORE_NONE) continue; return DTMIterator.FILTER_ACCEPT; } // end for(int i = 0; i < nDeclarations; i++) } catch (TransformerException se) { // TODO: What to do? } if (!foundKey) throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_NO_XSLKEY_DECLARATION, new Object[] { name.getLocalName()})); return DTMIterator.FILTER_REJECT; }
Test whether a specified node is visible in the logical view of a TreeWalker or NodeIterator. This function will be called by the implementation of TreeWalker and NodeIterator; it is not intended to be called directly from user code. @param testNode The node to check to see if it passes the filter or not. @return a constant to determine whether the node is accepted, rejected, or skipped, as defined above .
KeyIterator::acceptNode
java
Reginer/aosp-android-jar
android-34/src/org/apache/xalan/transformer/KeyIterator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xalan/transformer/KeyIterator.java
MIT
public float getAdjustBrightnessFactor() { return mAdjustBrightnessFactor; }
How much to adjust the screen brightness while in Battery Saver. This will have no effect if {@link #getEnableAdjustBrightness()} is {@code false}.
BatterySaverPolicyConfig::getAdjustBrightnessFactor
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getAdvertiseIsEnabled() { return mAdvertiseIsEnabled; }
Whether or not to tell the system (and other apps) that Battery Saver is currently enabled.
BatterySaverPolicyConfig::getAdvertiseIsEnabled
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getDeferFullBackup() { return mDeferFullBackup; }
Whether or not to tell the system (and other apps) that Battery Saver is currently enabled. public boolean getAdvertiseIsEnabled() { return mAdvertiseIsEnabled; } /** Whether or not to defer full backup while in Battery Saver.
BatterySaverPolicyConfig::getDeferFullBackup
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getDeferKeyValueBackup() { return mDeferKeyValueBackup; }
Whether or not to tell the system (and other apps) that Battery Saver is currently enabled. public boolean getAdvertiseIsEnabled() { return mAdvertiseIsEnabled; } /** Whether or not to defer full backup while in Battery Saver. public boolean getDeferFullBackup() { return mDeferFullBackup; } /** Whether or not to defer key-value backup while in Battery Saver.
BatterySaverPolicyConfig::getDeferKeyValueBackup
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getDisableAnimation() { return mDisableAnimation; }
Returns the device-specific battery saver constants. @NonNull public Map<String, String> getDeviceSpecificSettings() { return mDeviceSpecificSettings; } /** Whether or not to disable animation while in Battery Saver.
BatterySaverPolicyConfig::getDisableAnimation
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getDisableAod() { return mDisableAod; }
Returns the device-specific battery saver constants. @NonNull public Map<String, String> getDeviceSpecificSettings() { return mDeviceSpecificSettings; } /** Whether or not to disable animation while in Battery Saver. public boolean getDisableAnimation() { return mDisableAnimation; } /** Whether or not to disable Always On Display while in Battery Saver.
BatterySaverPolicyConfig::getDisableAod
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getDisableLaunchBoost() { return mDisableLaunchBoost; }
Returns the device-specific battery saver constants. @NonNull public Map<String, String> getDeviceSpecificSettings() { return mDeviceSpecificSettings; } /** Whether or not to disable animation while in Battery Saver. public boolean getDisableAnimation() { return mDisableAnimation; } /** Whether or not to disable Always On Display while in Battery Saver. public boolean getDisableAod() { return mDisableAod; } /** Whether or not to disable launch boost while in Battery Saver.
BatterySaverPolicyConfig::getDisableLaunchBoost
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getDisableOptionalSensors() { return mDisableOptionalSensors; }
Returns the device-specific battery saver constants. @NonNull public Map<String, String> getDeviceSpecificSettings() { return mDeviceSpecificSettings; } /** Whether or not to disable animation while in Battery Saver. public boolean getDisableAnimation() { return mDisableAnimation; } /** Whether or not to disable Always On Display while in Battery Saver. public boolean getDisableAod() { return mDisableAod; } /** Whether or not to disable launch boost while in Battery Saver. public boolean getDisableLaunchBoost() { return mDisableLaunchBoost; } /** Whether or not to disable optional sensors while in Battery Saver.
BatterySaverPolicyConfig::getDisableOptionalSensors
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getDisableVibration() { return mDisableVibration; }
Whether or not to disable {@link android.hardware.soundtrigger.SoundTrigger} while in Battery Saver. @deprecated Use {@link #getSoundTriggerMode()} instead. @Deprecated public boolean getDisableSoundTrigger() { return mSoundTriggerMode == PowerManager.SOUND_TRIGGER_MODE_ALL_DISABLED; } /** Whether or not to disable vibration while in Battery Saver.
BatterySaverPolicyConfig::getDisableVibration
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getEnableAdjustBrightness() { return mEnableAdjustBrightness; }
Whether or not to disable {@link android.hardware.soundtrigger.SoundTrigger} while in Battery Saver. @deprecated Use {@link #getSoundTriggerMode()} instead. @Deprecated public boolean getDisableSoundTrigger() { return mSoundTriggerMode == PowerManager.SOUND_TRIGGER_MODE_ALL_DISABLED; } /** Whether or not to disable vibration while in Battery Saver. public boolean getDisableVibration() { return mDisableVibration; } /** Whether or not to enable brightness adjustment while in Battery Saver.
BatterySaverPolicyConfig::getEnableAdjustBrightness
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getEnableDataSaver() { return mEnableDataSaver; }
Whether or not to disable {@link android.hardware.soundtrigger.SoundTrigger} while in Battery Saver. @deprecated Use {@link #getSoundTriggerMode()} instead. @Deprecated public boolean getDisableSoundTrigger() { return mSoundTriggerMode == PowerManager.SOUND_TRIGGER_MODE_ALL_DISABLED; } /** Whether or not to disable vibration while in Battery Saver. public boolean getDisableVibration() { return mDisableVibration; } /** Whether or not to enable brightness adjustment while in Battery Saver. public boolean getEnableAdjustBrightness() { return mEnableAdjustBrightness; } /** Whether or not to enable Data Saver while in Battery Saver.
BatterySaverPolicyConfig::getEnableDataSaver
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getEnableFirewall() { return mEnableFirewall; }
Whether or not to enable network firewall rules to restrict background network use while in Battery Saver.
BatterySaverPolicyConfig::getEnableFirewall
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getEnableNightMode() { return mEnableNightMode; }
Whether or not to enable network firewall rules to restrict background network use while in Battery Saver. public boolean getEnableFirewall() { return mEnableFirewall; } /** Whether or not to enable night mode while in Battery Saver.
BatterySaverPolicyConfig::getEnableNightMode
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getEnableQuickDoze() { return mEnableQuickDoze; }
Whether or not to enable network firewall rules to restrict background network use while in Battery Saver. public boolean getEnableFirewall() { return mEnableFirewall; } /** Whether or not to enable night mode while in Battery Saver. public boolean getEnableNightMode() { return mEnableNightMode; } /** Whether or not to enable Quick Doze while in Battery Saver.
BatterySaverPolicyConfig::getEnableQuickDoze
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getForceAllAppsStandby() { return mForceAllAppsStandby; }
Whether or not to enable network firewall rules to restrict background network use while in Battery Saver. public boolean getEnableFirewall() { return mEnableFirewall; } /** Whether or not to enable night mode while in Battery Saver. public boolean getEnableNightMode() { return mEnableNightMode; } /** Whether or not to enable Quick Doze while in Battery Saver. public boolean getEnableQuickDoze() { return mEnableQuickDoze; } /** Whether or not to force all apps to standby mode while in Battery Saver.
BatterySaverPolicyConfig::getForceAllAppsStandby
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public boolean getForceBackgroundCheck() { return mForceBackgroundCheck; }
Whether or not to force background check (disallow background services and manifest broadcast receivers) on all apps (not just apps targeting Android {@link Build.VERSION_CODES#O} and above) while in Battery Saver.
BatterySaverPolicyConfig::getForceBackgroundCheck
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public int getLocationMode() { return mLocationMode; }
Whether or not to force background check (disallow background services and manifest broadcast receivers) on all apps (not just apps targeting Android {@link Build.VERSION_CODES#O} and above) while in Battery Saver. public boolean getForceBackgroundCheck() { return mForceBackgroundCheck; } /** The location mode while in Battery Saver.
BatterySaverPolicyConfig::getLocationMode
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public Builder(@NonNull BatterySaverPolicyConfig batterySaverPolicyConfig) { mAdjustBrightnessFactor = batterySaverPolicyConfig.getAdjustBrightnessFactor(); mAdvertiseIsEnabled = batterySaverPolicyConfig.getAdvertiseIsEnabled(); mDeferFullBackup = batterySaverPolicyConfig.getDeferFullBackup(); mDeferKeyValueBackup = batterySaverPolicyConfig.getDeferKeyValueBackup(); for (String key : batterySaverPolicyConfig.getDeviceSpecificSettings().keySet()) { mDeviceSpecificSettings.put(key, batterySaverPolicyConfig.getDeviceSpecificSettings().get(key)); } mDisableAnimation = batterySaverPolicyConfig.getDisableAnimation(); mDisableAod = batterySaverPolicyConfig.getDisableAod(); mDisableLaunchBoost = batterySaverPolicyConfig.getDisableLaunchBoost(); mDisableOptionalSensors = batterySaverPolicyConfig.getDisableOptionalSensors(); mDisableVibration = batterySaverPolicyConfig.getDisableVibration(); mEnableAdjustBrightness = batterySaverPolicyConfig.getEnableAdjustBrightness(); mEnableDataSaver = batterySaverPolicyConfig.getEnableDataSaver(); mEnableFirewall = batterySaverPolicyConfig.getEnableFirewall(); mEnableNightMode = batterySaverPolicyConfig.getEnableNightMode(); mEnableQuickDoze = batterySaverPolicyConfig.getEnableQuickDoze(); mForceAllAppsStandby = batterySaverPolicyConfig.getForceAllAppsStandby(); mForceBackgroundCheck = batterySaverPolicyConfig.getForceBackgroundCheck(); mLocationMode = batterySaverPolicyConfig.getLocationMode(); mSoundTriggerMode = batterySaverPolicyConfig.getSoundTriggerMode(); }
Creates a Builder prepopulated with the values from the passed in {@link BatterySaverPolicyConfig}.
Builder::Builder
java
Reginer/aosp-android-jar
android-34/src/android/os/BatterySaverPolicyConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/BatterySaverPolicyConfig.java
MIT
public IrisManager(Context context, IIrisService service) { }
@hide
IrisManager::IrisManager
java
Reginer/aosp-android-jar
android-32/src/android/hardware/iris/IrisManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/hardware/iris/IrisManager.java
MIT
public hc_nodelistindexequalzero(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException { super(factory); // // check if loaded documents are supported for content type // String contentType = getContentType(); preload(contentType, "hc_staff", false); }
Constructor. @param factory document factory, may not be null @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
hc_nodelistindexequalzero::hc_nodelistindexequalzero
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
MIT
public void runTest() throws Throwable { Document doc; NodeList elementList; Node employeeNode; NodeList employeeList; Node child; String childName; int length; doc = (Document) load("hc_staff", false); elementList = doc.getElementsByTagName("p"); employeeNode = elementList.item(2); employeeList = employeeNode.getChildNodes(); length = (int) employeeList.getLength(); child = employeeList.item(0); childName = child.getNodeName(); if (equals(13, length)) { assertEquals("childName_w_whitespace", "#text", childName); } else { assertEqualsAutoCase("element", "childName_wo_whitespace", "em", childName); } }
Runs the test case. @throws Throwable Any uncaught exception causes test to fail
hc_nodelistindexequalzero::runTest
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
MIT
public String getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexequalzero"; }
Gets URI that identifies the test. @return uri identifier of test
hc_nodelistindexequalzero::getTargetURI
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
MIT
public static void main(final String[] args) { DOMTestCase.doMain(hc_nodelistindexequalzero.class, args); }
Runs this test from the command line. @param args command line arguments
hc_nodelistindexequalzero::main
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/hc_nodelistindexequalzero.java
MIT
private static long cvt(long d, long dst, long src) { long r, m; if (src == dst) return d; else if (src < dst) return d / (dst / src); else if (d > (m = Long.MAX_VALUE / (r = src / dst))) return Long.MAX_VALUE; else if (d < -m) return Long.MIN_VALUE; else return d * r; }
General conversion utility. @param d duration @param dst result unit scale @param src source unit scale
TimeUnit::cvt
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public long convert(long sourceDuration, TimeUnit sourceUnit) { switch (this) { case NANOSECONDS: return sourceUnit.toNanos(sourceDuration); case MICROSECONDS: return sourceUnit.toMicros(sourceDuration); case MILLISECONDS: return sourceUnit.toMillis(sourceDuration); case SECONDS: return sourceUnit.toSeconds(sourceDuration); default: return cvt(sourceDuration, scale, sourceUnit.scale); } }
Converts the given time duration in the given unit to this unit. Conversions from finer to coarser granularities truncate, so lose precision. For example, converting {@code 999} milliseconds to seconds results in {@code 0}. Conversions from coarser to finer granularities with arguments that would numerically overflow saturate to {@code Long.MIN_VALUE} if negative or {@code Long.MAX_VALUE} if positive. <p>For example, to convert 10 minutes to milliseconds, use: {@code TimeUnit.MILLISECONDS.convert(10L, TimeUnit.MINUTES)} @param sourceDuration the time duration in the given {@code sourceUnit} @param sourceUnit the unit of the {@code sourceDuration} argument @return the converted duration in this unit, or {@code Long.MIN_VALUE} if conversion would negatively overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
TimeUnit::convert
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public long convert(Duration duration) { long secs = duration.getSeconds(); int nano = duration.getNano(); if (secs < 0 && nano > 0) { // use representation compatible with integer division secs++; nano -= (int) SECOND_SCALE; } final long s, nanoVal; // Optimize for the common case - NANOSECONDS without overflow if (this == NANOSECONDS) nanoVal = nano; else if ((s = scale) < SECOND_SCALE) nanoVal = nano / s; else if (this == SECONDS) return secs; else return secs / secRatio; long val = secs * secRatio + nanoVal; return ((secs < maxSecs && secs > -maxSecs) || (secs == maxSecs && val > 0) || (secs == -maxSecs && val < 0)) ? val : (secs > 0) ? Long.MAX_VALUE : Long.MIN_VALUE; }
Converts the given time duration to this unit. <p>For any TimeUnit {@code unit}, {@code unit.convert(Duration.ofNanos(n))} is equivalent to {@code unit.convert(n, NANOSECONDS)}, and {@code unit.convert(Duration.of(n, unit.toChronoUnit()))} is equivalent to {@code n} (in the absence of overflow). @apiNote This method differs from {@link Duration#toNanos()} in that it does not throw {@link ArithmeticException} on numeric overflow. @param duration the time duration @return the converted duration in this unit, or {@code Long.MIN_VALUE} if conversion would negatively overflow, or {@code Long.MAX_VALUE} if it would positively overflow. @throws NullPointerException if {@code duration} is null @see Duration#of(long,TemporalUnit) @since 11
TimeUnit::convert
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public long toNanos(long duration) { long s, m; if ((s = scale) == NANO_SCALE) return duration; else if (duration > (m = maxNanos)) return Long.MAX_VALUE; else if (duration < -m) return Long.MIN_VALUE; else return duration * s; }
Equivalent to {@link #convert(long, TimeUnit) NANOSECONDS.convert(duration, this)}. @param duration the duration @return the converted duration, or {@code Long.MIN_VALUE} if conversion would negatively overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
TimeUnit::toNanos
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public long toMicros(long duration) { long s, m; if ((s = scale) <= MICRO_SCALE) return (s == MICRO_SCALE) ? duration : duration / microRatio; else if (duration > (m = maxMicros)) return Long.MAX_VALUE; else if (duration < -m) return Long.MIN_VALUE; else return duration * microRatio; }
Equivalent to {@link #convert(long, TimeUnit) MICROSECONDS.convert(duration, this)}. @param duration the duration @return the converted duration, or {@code Long.MIN_VALUE} if conversion would negatively overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
TimeUnit::toMicros
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public long toMillis(long duration) { long s, m; if ((s = scale) <= MILLI_SCALE) return (s == MILLI_SCALE) ? duration : duration / milliRatio; else if (duration > (m = maxMillis)) return Long.MAX_VALUE; else if (duration < -m) return Long.MIN_VALUE; else return duration * milliRatio; }
Equivalent to {@link #convert(long, TimeUnit) MILLISECONDS.convert(duration, this)}. @param duration the duration @return the converted duration, or {@code Long.MIN_VALUE} if conversion would negatively overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
TimeUnit::toMillis
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public long toSeconds(long duration) { long s, m; if ((s = scale) <= SECOND_SCALE) return (s == SECOND_SCALE) ? duration : duration / secRatio; else if (duration > (m = maxSecs)) return Long.MAX_VALUE; else if (duration < -m) return Long.MIN_VALUE; else return duration * secRatio; }
Equivalent to {@link #convert(long, TimeUnit) SECONDS.convert(duration, this)}. @param duration the duration @return the converted duration, or {@code Long.MIN_VALUE} if conversion would negatively overflow, or {@code Long.MAX_VALUE} if it would positively overflow.
TimeUnit::toSeconds
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public long toMinutes(long duration) { return cvt(duration, MINUTE_SCALE, scale); }
Equivalent to {@link #convert(long, TimeUnit) MINUTES.convert(duration, this)}. @param duration the duration @return the converted duration, or {@code Long.MIN_VALUE} if conversion would negatively overflow, or {@code Long.MAX_VALUE} if it would positively overflow. @since 1.6
TimeUnit::toMinutes
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public long toHours(long duration) { return cvt(duration, HOUR_SCALE, scale); }
Equivalent to {@link #convert(long, TimeUnit) HOURS.convert(duration, this)}. @param duration the duration @return the converted duration, or {@code Long.MIN_VALUE} if conversion would negatively overflow, or {@code Long.MAX_VALUE} if it would positively overflow. @since 1.6
TimeUnit::toHours
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public long toDays(long duration) { return cvt(duration, DAY_SCALE, scale); }
Equivalent to {@link #convert(long, TimeUnit) DAYS.convert(duration, this)}. @param duration the duration @return the converted duration @since 1.6
TimeUnit::toDays
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
private int excessNanos(long d, long m) { long s; if ((s = scale) == NANO_SCALE) return (int)(d - (m * MILLI_SCALE)); else if (s == MICRO_SCALE) return (int)((d * 1000L) - (m * MILLI_SCALE)); else return 0; }
Utility to compute the excess-nanosecond argument to wait, sleep, join. @param d the duration @param m the number of milliseconds @return the number of nanoseconds
TimeUnit::excessNanos
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public void timedWait(Object obj, long timeout) throws InterruptedException { if (timeout > 0) { long ms = toMillis(timeout); int ns = excessNanos(timeout, ms); obj.wait(ms, ns); } }
Performs a timed {@link Object#wait(long, int) Object.wait} using this time unit. This is a convenience method that converts timeout arguments into the form required by the {@code Object.wait} method. <p>For example, you could implement a blocking {@code poll} method (see {@link BlockingQueue#poll(long, TimeUnit) BlockingQueue.poll}) using: <pre> {@code public E poll(long timeout, TimeUnit unit) throws InterruptedException { synchronized (lock) { while (isEmpty()) { unit.timedWait(lock, timeout); ... } } }}</pre> @param obj the object to wait on @param timeout the maximum time to wait. If less than or equal to zero, do not wait at all. @throws InterruptedException if interrupted while waiting
TimeUnit::timedWait
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public void timedJoin(Thread thread, long timeout) throws InterruptedException { if (timeout > 0) { long ms = toMillis(timeout); int ns = excessNanos(timeout, ms); thread.join(ms, ns); } }
Performs a timed {@link Thread#join(long, int) Thread.join} using this time unit. This is a convenience method that converts time arguments into the form required by the {@code Thread.join} method. @param thread the thread to wait for @param timeout the maximum time to wait. If less than or equal to zero, do not wait at all. @throws InterruptedException if interrupted while waiting
TimeUnit::timedJoin
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public void sleep(long timeout) throws InterruptedException { if (timeout > 0) { long ms = toMillis(timeout); int ns = excessNanos(timeout, ms); Thread.sleep(ms, ns); } }
Performs a {@link Thread#sleep(long, int) Thread.sleep} using this time unit. This is a convenience method that converts time arguments into the form required by the {@code Thread.sleep} method. @param timeout the minimum time to sleep. If less than or equal to zero, do not sleep at all. @throws InterruptedException if interrupted while sleeping
TimeUnit::sleep
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public ChronoUnit toChronoUnit() { switch (this) { case NANOSECONDS: return ChronoUnit.NANOS; case MICROSECONDS: return ChronoUnit.MICROS; case MILLISECONDS: return ChronoUnit.MILLIS; case SECONDS: return ChronoUnit.SECONDS; case MINUTES: return ChronoUnit.MINUTES; case HOURS: return ChronoUnit.HOURS; case DAYS: return ChronoUnit.DAYS; default: throw new AssertionError(); } }
Converts this {@code TimeUnit} to the equivalent {@code ChronoUnit}. @return the converted equivalent ChronoUnit @since 9
TimeUnit::toChronoUnit
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public static TimeUnit of(ChronoUnit chronoUnit) { switch (Objects.requireNonNull(chronoUnit, "chronoUnit")) { case NANOS: return TimeUnit.NANOSECONDS; case MICROS: return TimeUnit.MICROSECONDS; case MILLIS: return TimeUnit.MILLISECONDS; case SECONDS: return TimeUnit.SECONDS; case MINUTES: return TimeUnit.MINUTES; case HOURS: return TimeUnit.HOURS; case DAYS: return TimeUnit.DAYS; default: throw new IllegalArgumentException( "No TimeUnit equivalent for " + chronoUnit); } }
Converts a {@code ChronoUnit} to the equivalent {@code TimeUnit}. @param chronoUnit the ChronoUnit to convert @return the converted equivalent TimeUnit @throws IllegalArgumentException if {@code chronoUnit} has no equivalent TimeUnit @throws NullPointerException if {@code chronoUnit} is null @since 9
TimeUnit::of
java
Reginer/aosp-android-jar
android-33/src/java/util/concurrent/TimeUnit.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/util/concurrent/TimeUnit.java
MIT
public void setOnRatingBarChangeListener(OnRatingBarChangeListener listener) { mOnRatingBarChangeListener = listener; }
Sets the listener to be called when the rating changes. @param listener The listener.
RatingBar::setOnRatingBarChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/widget/RatingBar.java
MIT
public OnRatingBarChangeListener getOnRatingBarChangeListener() { return mOnRatingBarChangeListener; }
@return The listener (may be null) that is listening for rating change events.
RatingBar::getOnRatingBarChangeListener
java
Reginer/aosp-android-jar
android-33/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/widget/RatingBar.java
MIT
public void setIsIndicator(boolean isIndicator) { mIsUserSeekable = !isIndicator; if (isIndicator) { setFocusable(FOCUSABLE_AUTO); } else { setFocusable(FOCUSABLE); } }
Whether this rating bar should only be an indicator (thus non-changeable by the user). @param isIndicator Whether it should be an indicator. @attr ref android.R.styleable#RatingBar_isIndicator
RatingBar::setIsIndicator
java
Reginer/aosp-android-jar
android-33/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/widget/RatingBar.java
MIT
public void setNumStars(final int numStars) { if (numStars <= 0) { return; } mNumStars = numStars; // This causes the width to change, so re-layout requestLayout(); }
Sets the number of stars to show. In order for these to be shown properly, it is recommended the layout width of this widget be wrap content. @param numStars The number of stars.
RatingBar::setNumStars
java
Reginer/aosp-android-jar
android-33/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/widget/RatingBar.java
MIT
public void setRating(float rating) { setProgress(Math.round(rating * getProgressPerStar())); }
Sets the rating (the number of stars filled). @param rating The rating to set.
RatingBar::setRating
java
Reginer/aosp-android-jar
android-33/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/widget/RatingBar.java
MIT
public void setStepSize(float stepSize) { if (stepSize <= 0) { return; } final float newMax = mNumStars / stepSize; final int newProgress = (int) (newMax / getMax() * getProgress()); setMax((int) newMax); setProgress(newProgress); }
Sets the step size (granularity) of this rating bar. @param stepSize The step size of this rating bar. For example, if half-star granularity is wanted, this would be 0.5.
RatingBar::setStepSize
java
Reginer/aosp-android-jar
android-33/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/widget/RatingBar.java
MIT
private float getProgressPerStar() { if (mNumStars > 0) { return 1f * getMax() / mNumStars; } else { return 1; } }
@return The amount of progress that fits into a star
RatingBar::getProgressPerStar
java
Reginer/aosp-android-jar
android-33/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/widget/RatingBar.java
MIT
private void updateSecondaryProgress(int progress) { final float ratio = getProgressPerStar(); if (ratio > 0) { final float progressInStars = progress / ratio; final int secondaryProgress = (int) (Math.ceil(progressInStars) * ratio); setSecondaryProgress(secondaryProgress); } }
The secondary progress is used to differentiate the background of a partially filled star. This method keeps the secondary progress in sync with the progress. @param progress The primary progress level.
RatingBar::updateSecondaryProgress
java
Reginer/aosp-android-jar
android-33/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/widget/RatingBar.java
MIT
public static InteractionJankMonitor getInstance() { // Use DCL here since this method might be invoked very often. if (sInstance == null) { synchronized (InteractionJankMonitor.class) { if (sInstance == null) { sInstance = new InteractionJankMonitor(new HandlerThread(DEFAULT_WORKER_NAME)); } } } return sInstance; }
Get the singleton of InteractionJankMonitor. @return instance of InteractionJankMonitor
InteractionJankMonitor::getInstance
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/jank/InteractionJankMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/jank/InteractionJankMonitor.java
MIT
public Builder(@CujType int cuj) { mAttrCujType = cuj; }
@param cuj The enum defined in {@link InteractionJankMonitor.CujType}.
Builder::Builder
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/jank/InteractionJankMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/jank/InteractionJankMonitor.java
MIT
public Builder setView(@NonNull View view) { mAttrView = view; return this; }
@param view an attached view @return builder
Builder::setView
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/jank/InteractionJankMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/jank/InteractionJankMonitor.java
MIT
public Builder setTimeout(long timeout) { mAttrTimeout = timeout; return this; }
@param timeout duration to cancel the instrumentation in ms @return builder
Builder::setTimeout
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/jank/InteractionJankMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/jank/InteractionJankMonitor.java
MIT
public Builder setTag(@NonNull String tag) { mAttrTag = tag; return this; }
@param tag The postfix of the CUJ in the output trace. It provides a brief description for the CUJ like the concrete class who is dealing with the CUJ or the important state with the CUJ, etc. @return builder
Builder::setTag
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/jank/InteractionJankMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/jank/InteractionJankMonitor.java
MIT
public Configuration build() throws IllegalArgumentException { return new Configuration(mAttrCujType, mAttrView, mAttrTag, mAttrTimeout); }
Build the {@link Configuration} instance @return the instance of {@link Configuration} @throws IllegalArgumentException if any invalid attribute is set
Builder::build
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/jank/InteractionJankMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/jank/InteractionJankMonitor.java
MIT
public boolean logToStatsd() { return getStatsdInteractionType() != NO_STATSD_LOGGING; }
A class to represent a session. public static class Session { @CujType private final int mCujType; private final long mTimeStamp; @FrameTracker.Reasons private int mReason = FrameTracker.REASON_END_UNKNOWN; private final boolean mShouldNotify; private final String mName; public Session(@CujType int cujType, @NonNull String postfix) { mCujType = cujType; mTimeStamp = System.nanoTime(); mShouldNotify = SystemProperties.getBoolean(PROP_NOTIFY_CUJ_EVENT, false); mName = TextUtils.isEmpty(postfix) ? String.format("J<%s>", getNameOfCuj(mCujType)) : String.format("J<%s::%s>", getNameOfCuj(mCujType), postfix); } @CujType public int getCuj() { return mCujType; } public int getStatsdInteractionType() { return CUJ_TO_STATSD_INTERACTION_TYPE[mCujType]; } /** Describes whether the measurement from this session should be written to statsd.
Session::logToStatsd
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/jank/InteractionJankMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/jank/InteractionJankMonitor.java
MIT
public boolean shouldNotify() { return mShouldNotify; }
A class to represent a session. public static class Session { @CujType private final int mCujType; private final long mTimeStamp; @FrameTracker.Reasons private int mReason = FrameTracker.REASON_END_UNKNOWN; private final boolean mShouldNotify; private final String mName; public Session(@CujType int cujType, @NonNull String postfix) { mCujType = cujType; mTimeStamp = System.nanoTime(); mShouldNotify = SystemProperties.getBoolean(PROP_NOTIFY_CUJ_EVENT, false); mName = TextUtils.isEmpty(postfix) ? String.format("J<%s>", getNameOfCuj(mCujType)) : String.format("J<%s::%s>", getNameOfCuj(mCujType), postfix); } @CujType public int getCuj() { return mCujType; } public int getStatsdInteractionType() { return CUJ_TO_STATSD_INTERACTION_TYPE[mCujType]; } /** Describes whether the measurement from this session should be written to statsd. public boolean logToStatsd() { return getStatsdInteractionType() != NO_STATSD_LOGGING; } public String getPerfettoTrigger() { return String.format(Locale.US, "com.android.telemetry.interaction-jank-monitor-%d", mCujType); } public String getName() { return mName; } public long getTimeStamp() { return mTimeStamp; } public void setReason(@FrameTracker.Reasons int reason) { mReason = reason; } public int getReason() { return mReason; } /** Determine if should notify the receivers of cuj events
Session::shouldNotify
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/jank/InteractionJankMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/jank/InteractionJankMonitor.java
MIT
public boolean isPluggedIn() { return plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB || plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS || plugged == BatteryManager.BATTERY_PLUGGED_DOCK; }
Determine whether the device is plugged in (USB, power, wireless or dock). @return true if the device is plugged in.
BatteryStatus::isPluggedIn
java
Reginer/aosp-android-jar
android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
MIT
public boolean isPluggedInWired() { return plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB; }
Determine whether the device is plugged in (USB, power). @return true if the device is plugged in wired (as opposed to wireless)
BatteryStatus::isPluggedInWired
java
Reginer/aosp-android-jar
android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
MIT
public boolean isPluggedInWireless() { return plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS; }
Determine whether the device is plugged in wireless. @return true if the device is plugged in wireless
BatteryStatus::isPluggedInWireless
java
Reginer/aosp-android-jar
android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
MIT
public boolean isPluggedInDock() { return plugged == BatteryManager.BATTERY_PLUGGED_DOCK; }
Determine whether the device is plugged in dock. @return true if the device is plugged in dock
BatteryStatus::isPluggedInDock
java
Reginer/aosp-android-jar
android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
MIT
public boolean isCharged() { return status == BATTERY_STATUS_FULL || level >= 100; }
Whether or not the device is charged. Note that some devices never return 100% for battery level, so this allows either battery level or status to determine if the battery is charged. @return true if the device is charged
BatteryStatus::isCharged
java
Reginer/aosp-android-jar
android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
MIT
public boolean isBatteryLow() { return level < LOW_BATTERY_THRESHOLD; }
Whether battery is low and needs to be charged. @return true if battery is low
BatteryStatus::isBatteryLow
java
Reginer/aosp-android-jar
android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
MIT
public boolean isOverheated() { return health == BATTERY_HEALTH_OVERHEAT; }
Whether battery is overheated. @return true if battery is overheated
BatteryStatus::isOverheated
java
Reginer/aosp-android-jar
android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
MIT
public final int getChargingSpeed(Context context) { final int slowThreshold = context.getResources().getInteger( R.integer.config_chargingSlowlyThreshold); final int fastThreshold = context.getResources().getInteger( R.integer.config_chargingFastThreshold); return maxChargingWattage <= 0 ? CHARGING_UNKNOWN : maxChargingWattage < slowThreshold ? CHARGING_SLOWLY : maxChargingWattage > fastThreshold ? CHARGING_FAST : CHARGING_REGULAR; }
Return current chargin speed is fast, slow or normal. @return the charing speed
BatteryStatus::getChargingSpeed
java
Reginer/aosp-android-jar
android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/settingslib/fuelgauge/BatteryStatus.java
MIT
protected NullCipherSpi() {}
This class provides a delegate for the identity cipher - one that does not transform the plain text. @author Li Gong @see NullCipher @since 1.4 final class NullCipherSpi extends CipherSpi { /* Do not let anybody instantiate this directly (protected).
NullCipherSpi::NullCipherSpi
java
Reginer/aosp-android-jar
android-32/src/javax/crypto/NullCipherSpi.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/crypto/NullCipherSpi.java
MIT
protected SimpleInflater(@NonNull Resources resources) { mResources = resources; }
Create a new inflater instance associated with a particular Resources bundle. @param resources The Resources class used to resolve given resource IDs.
SimpleInflater::SimpleInflater
java
Reginer/aosp-android-jar
android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
MIT
public T inflate(int resId) { XmlResourceParser parser = getResources().getXml(resId); try { return inflate(parser); } finally { parser.close(); } }
Inflate a new hierarchy from the specified XML resource. Throws InflaterException if there is an error. @param resId ID for an XML resource to load (e.g. <code>R.xml.my_xml</code>) @return The root of the inflated hierarchy.
SimpleInflater::inflate
java
Reginer/aosp-android-jar
android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
MIT
public T inflate(XmlPullParser parser) { final AttributeSet attrs = Xml.asAttributeSet(parser); T createdItem; try { // Look for the root node. int type; while ((type = parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) { // continue } if (type != XmlPullParser.START_TAG) { throw new InflateException(parser.getPositionDescription() + ": No start tag found!"); } createdItem = createItemFromTag(parser.getName(), attrs); rInflate(parser, createdItem, attrs); } catch (XmlPullParserException e) { throw new InflateException(e.getMessage(), e); } catch (IOException e) { throw new InflateException(parser.getPositionDescription() + ": " + e.getMessage(), e); } return createdItem; }
Inflate a new hierarchy from the specified XML node. Throws InflaterException if there is an error. <p><em><strong>Important</strong></em>&nbsp;&nbsp;&nbsp;For performance reasons, inflation relies heavily on pre-processing of XML files that is done at build time. Therefore, it is not currently possible to use inflater with an XmlPullParser over a plain XML file at runtime. @param parser XML dom node containing the description of the hierarchy. @return The root of the inflated hierarchy.
SimpleInflater::inflate
java
Reginer/aosp-android-jar
android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
MIT
private void rInflate(XmlPullParser parser, T parent, final AttributeSet attrs) throws XmlPullParserException, IOException { final int depth = parser.getDepth(); int type; while (((type = parser.next()) != XmlPullParser.END_TAG || parser.getDepth() > depth) && type != XmlPullParser.END_DOCUMENT) { if (type != XmlPullParser.START_TAG) { continue; } if (onInterceptCreateItem(parser, parent, attrs)) { continue; } String name = parser.getName(); T item = createItemFromTag(name, attrs); onAddChildItem(parent, item); rInflate(parser, item, attrs); } }
Recursive method used to descend down the xml hierarchy and instantiate items, instantiate their children, and then call onFinishInflate().
SimpleInflater::rInflate
java
Reginer/aosp-android-jar
android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
MIT
protected boolean onInterceptCreateItem(XmlPullParser parser, T parent, AttributeSet attrs) throws XmlPullParserException { return false; }
Whether item creation should be intercepted to perform custom handling on the parser rather than creating an object from it. This is used in rare cases where a tag doesn't correspond to creation of an object. <p>The parser will be pointing to the start of a tag, you must stop parsing and return when you reach the end of this element. That is, this method is responsible for parsing the element at the given position together with all of its child tags. <p>Note that parsing of the root tag cannot be intercepted. @param parser XML dom node containing the description of the hierarchy. @param parent The item that should be the parent of whatever you create. @param attrs An AttributeSet of attributes to apply to the item. @return True to continue parsing without calling {@link #onCreateItem(String, AttributeSet)}, or false if this inflater should proceed to create an item.
SimpleInflater::onInterceptCreateItem
java
Reginer/aosp-android-jar
android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/setupwizardlib/items/SimpleInflater.java
MIT