code
stringlengths 11
173k
| docstring
stringlengths 2
593k
| func_name
stringlengths 2
189
| language
stringclasses 1
value | repo
stringclasses 844
values | path
stringlengths 11
294
| url
stringlengths 60
339
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public static String getDisplayLocaleList(
LocaleList locales, Locale displayLocale, @IntRange(from=1) int maxLocales) {
final Locale dispLocale = displayLocale == null ? Locale.getDefault() : displayLocale;
final boolean ellipsisNeeded = locales.size() > maxLocales;
final int localeCount, listCount;
if (ellipsisNeeded) {
localeCount = maxLocales;
listCount = maxLocales + 1; // One extra slot for the ellipsis
} else {
listCount = localeCount = locales.size();
}
final String[] localeNames = new String[listCount];
for (int i = 0; i < localeCount; i++) {
localeNames[i] = LocaleHelper.getDisplayName(locales.get(i), dispLocale, false);
}
if (ellipsisNeeded) {
// Theoretically, we want to extract this from ICU's Resource Bundle for
// "Ellipsis/final", which seems to have different strings than the normal ellipsis for
// Hong Kong Traditional Chinese (zh_Hant_HK) and Dzongkha (dz). But that has two
// problems: it's expensive to extract it, and in case the output string becomes
// automatically ellipsized, it can result in weird output.
localeNames[maxLocales] = TextUtils.getEllipsisString(TextUtils.TruncateAt.END);
}
ListFormatter lfn = ListFormatter.getInstance(dispLocale);
return lfn.format((Object[]) localeNames);
} |
Returns the locale list localized for display in the provided locale.
@param locales the list of locales whose names is to be displayed.
@param displayLocale the locale in which to display the names.
If this is null, it will use the default locale.
@param maxLocales maximum number of locales to display. Generates ellipsis after that.
@return the locale aware list of locale names
| LocaleHelper::getDisplayLocaleList | java | Reginer/aosp-android-jar | android-31/src/com/android/internal/app/LocaleHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/app/LocaleHelper.java | MIT |
public static Locale addLikelySubtags(Locale locale) {
return ULocale.addLikelySubtags(ULocale.forLocale(locale)).toLocale();
} |
Adds the likely subtags for a provided locale ID.
@param locale the locale to maximize.
@return the maximized Locale instance.
| LocaleHelper::addLikelySubtags | java | Reginer/aosp-android-jar | android-31/src/com/android/internal/app/LocaleHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/app/LocaleHelper.java | MIT |
private String removePrefixForCompare(Locale locale, String str) {
if ("ar".equals(locale.getLanguage()) && str.startsWith(PREFIX_ARABIC)) {
return str.substring(PREFIX_ARABIC.length());
}
return str;
} |
Constructor.
@param sortLocale the locale to be used for sorting.
@UnsupportedAppUsage
public LocaleInfoComparator(Locale sortLocale, boolean countryMode) {
mCollator = Collator.getInstance(sortLocale);
mCountryMode = countryMode;
}
/*
The Arabic collation should ignore Alef-Lam at the beginning (b/26277596)
We look at the label's locale, not the current system locale.
This is because the name of the Arabic language itself is in Arabic,
and starts with Alef-Lam, no matter what the system locale is.
| LocaleInfoComparator::removePrefixForCompare | java | Reginer/aosp-android-jar | android-31/src/com/android/internal/app/LocaleHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/app/LocaleHelper.java | MIT |
public DataConnectionRealTimeInfo(long time, int dcPowerState) {
mTime = time;
mDcPowerState = dcPowerState;
} |
Constructor
@hide
| DataConnectionRealTimeInfo::DataConnectionRealTimeInfo | java | Reginer/aosp-android-jar | android-32/src/android/telephony/DataConnectionRealTimeInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/DataConnectionRealTimeInfo.java | MIT |
public DataConnectionRealTimeInfo() {
mTime = Long.MAX_VALUE;
mDcPowerState = DC_POWER_STATE_UNKNOWN;
} |
Constructor
@hide
| DataConnectionRealTimeInfo::DataConnectionRealTimeInfo | java | Reginer/aosp-android-jar | android-32/src/android/telephony/DataConnectionRealTimeInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/DataConnectionRealTimeInfo.java | MIT |
private DataConnectionRealTimeInfo(Parcel in) {
mTime = in.readLong();
mDcPowerState = in.readInt();
} |
Construct a PreciseCallState object from the given parcel.
| DataConnectionRealTimeInfo::DataConnectionRealTimeInfo | java | Reginer/aosp-android-jar | android-32/src/android/telephony/DataConnectionRealTimeInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/DataConnectionRealTimeInfo.java | MIT |
public long getTime() {
return mTime;
} |
@return time the information was collected or Long.MAX_VALUE if unknown
| DataConnectionRealTimeInfo::getTime | java | Reginer/aosp-android-jar | android-32/src/android/telephony/DataConnectionRealTimeInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/DataConnectionRealTimeInfo.java | MIT |
public int getDcPowerState() {
return mDcPowerState;
} |
@return DC_POWER_STATE_[LOW | MEDIUM | HIGH | UNKNOWN]
| DataConnectionRealTimeInfo::getDcPowerState | java | Reginer/aosp-android-jar | android-32/src/android/telephony/DataConnectionRealTimeInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/telephony/DataConnectionRealTimeInfo.java | MIT |
protected ServerSocketFactory() { /* NOTHING */ } |
Creates a server socket factory.
| ServerSocketFactory::ServerSocketFactory | java | Reginer/aosp-android-jar | android-32/src/javax/net/ServerSocketFactory.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/net/ServerSocketFactory.java | MIT |
public static ServerSocketFactory getDefault()
{
synchronized (ServerSocketFactory.class) {
if (theFactory == null) {
//
// Different implementations of this method could
// work rather differently. For example, driving
// this from a system property, or using a different
// implementation than JavaSoft's.
//
theFactory = new DefaultServerSocketFactory();
}
}
return theFactory;
} |
Returns a copy of the environment's default socket factory.
@return the <code>ServerSocketFactory</code>
| ServerSocketFactory::getDefault | java | Reginer/aosp-android-jar | android-32/src/javax/net/ServerSocketFactory.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/net/ServerSocketFactory.java | MIT |
public int getStreamId() {
return mStreamId;
} |
Gets stream ID.
| PesSettings::getStreamId | java | Reginer/aosp-android-jar | android-34/src/android/media/tv/tuner/filter/PesSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/media/tv/tuner/filter/PesSettings.java | MIT |
public boolean isRaw() {
return mIsRaw;
} |
Returns whether the data is raw.
@return {@code true} if the data is raw. Filter sends onFilterStatus callback
instead of onFilterEvent for raw data. {@code false} otherwise.
| PesSettings::isRaw | java | Reginer/aosp-android-jar | android-34/src/android/media/tv/tuner/filter/PesSettings.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/media/tv/tuner/filter/PesSettings.java | MIT |
public Builder() {
this.mData = new PersonalizationData();
} |
Creates a new builder for a given namespace.
| Builder::Builder | java | Reginer/aosp-android-jar | android-35/src/android/security/identity/PersonalizationData.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/security/identity/PersonalizationData.java | MIT |
public @NonNull Builder putEntry(@NonNull String namespace, @NonNull String name,
@NonNull Collection<AccessControlProfileId> accessControlProfileIds,
@NonNull byte[] value) {
NamespaceData namespaceData = mData.mNamespaces.get(namespace);
if (namespaceData == null) {
namespaceData = new NamespaceData(namespace);
mData.mNamespaces.put(namespace, namespaceData);
}
// TODO: validate/verify that value is proper CBOR.
namespaceData.mEntries.put(name, new EntryData(value, accessControlProfileIds));
return this;
} |
Adds a new entry to the builder.
@param namespace The namespace to use, e.g. {@code org.iso.18013-5.2019}.
@param name The name of the entry, e.g. {@code height}.
@param accessControlProfileIds A set of access control profiles to use.
@param value The value to add, in CBOR encoding.
@return The builder.
| Builder::putEntry | java | Reginer/aosp-android-jar | android-35/src/android/security/identity/PersonalizationData.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/security/identity/PersonalizationData.java | MIT |
public @NonNull Builder addAccessControlProfile(@NonNull AccessControlProfile profile) {
mData.mProfiles.add(profile);
return this;
} |
Adds a new access control profile to the builder.
@param profile The access control profile.
@return The builder.
| Builder::addAccessControlProfile | java | Reginer/aosp-android-jar | android-35/src/android/security/identity/PersonalizationData.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/security/identity/PersonalizationData.java | MIT |
public @NonNull PersonalizationData build() {
return mData;
} |
Creates a new {@link PersonalizationData} with all the entries added to the builder.
@return A new {@link PersonalizationData} instance.
| Builder::build | java | Reginer/aosp-android-jar | android-35/src/android/security/identity/PersonalizationData.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/security/identity/PersonalizationData.java | MIT |
public static InterfaceConfigurationParcel getInterfaceConfigParcel(@NonNull INetd netd,
@NonNull String iface) {
try {
return netd.interfaceGetCfg(iface);
} catch (RemoteException | ServiceSpecificException e) {
throw new IllegalStateException(e);
}
} |
Get InterfaceConfigurationParcel from netd.
| getSimpleName::getInterfaceConfigParcel | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static boolean hasFlag(@NonNull final InterfaceConfigurationParcel config,
@NonNull final String flag) {
validateFlag(flag);
final Set<String> flagList = new HashSet<String>(Arrays.asList(config.flags));
return flagList.contains(flag);
} |
Check whether the InterfaceConfigurationParcel contains the target flag or not.
@param config The InterfaceConfigurationParcel instance.
@param flag Target flag string to be checked.
| getSimpleName::hasFlag | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static void setInterfaceConfig(INetd netd, InterfaceConfigurationParcel configParcel) {
try {
netd.interfaceSetCfg(configParcel);
} catch (RemoteException | ServiceSpecificException e) {
throw new IllegalStateException(e);
}
} |
Set interface configuration to netd by passing InterfaceConfigurationParcel.
| getSimpleName::setInterfaceConfig | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static void setInterfaceUp(INetd netd, String iface) {
final InterfaceConfigurationParcel configParcel = getInterfaceConfigParcel(netd, iface);
configParcel.flags = removeAndAddFlags(configParcel.flags, IF_STATE_DOWN /* remove */,
IF_STATE_UP /* add */);
setInterfaceConfig(netd, configParcel);
} |
Set the given interface up.
| getSimpleName::setInterfaceUp | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static void setInterfaceDown(INetd netd, String iface) {
final InterfaceConfigurationParcel configParcel = getInterfaceConfigParcel(netd, iface);
configParcel.flags = removeAndAddFlags(configParcel.flags, IF_STATE_UP /* remove */,
IF_STATE_DOWN /* add */);
setInterfaceConfig(netd, configParcel);
} |
Set the given interface down.
| getSimpleName::setInterfaceDown | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static void tetherStart(final INetd netd, final boolean usingLegacyDnsProxy,
final String[] dhcpRange) throws RemoteException, ServiceSpecificException {
final TetherConfigParcel config = new TetherConfigParcel();
config.usingLegacyDnsProxy = usingLegacyDnsProxy;
config.dhcpRanges = dhcpRange;
netd.tetherStartWithConfiguration(config);
} |
Set the given interface down.
public static void setInterfaceDown(INetd netd, String iface) {
final InterfaceConfigurationParcel configParcel = getInterfaceConfigParcel(netd, iface);
configParcel.flags = removeAndAddFlags(configParcel.flags, IF_STATE_UP /* remove */,
IF_STATE_DOWN /* add */);
setInterfaceConfig(netd, configParcel);
}
/** Start tethering. | getSimpleName::tetherStart | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static void tetherInterface(final INetd netd, final String iface, final IpPrefix dest)
throws RemoteException, ServiceSpecificException {
tetherInterface(netd, iface, dest, 20 /* maxAttempts */, 50 /* pollingIntervalMs */);
} |
Set the given interface down.
public static void setInterfaceDown(INetd netd, String iface) {
final InterfaceConfigurationParcel configParcel = getInterfaceConfigParcel(netd, iface);
configParcel.flags = removeAndAddFlags(configParcel.flags, IF_STATE_UP /* remove */,
IF_STATE_DOWN /* add */);
setInterfaceConfig(netd, configParcel);
}
/** Start tethering.
public static void tetherStart(final INetd netd, final boolean usingLegacyDnsProxy,
final String[] dhcpRange) throws RemoteException, ServiceSpecificException {
final TetherConfigParcel config = new TetherConfigParcel();
config.usingLegacyDnsProxy = usingLegacyDnsProxy;
config.dhcpRanges = dhcpRange;
netd.tetherStartWithConfiguration(config);
}
/** Setup interface for tethering. | getSimpleName::tetherInterface | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static void tetherInterface(final INetd netd, final String iface, final IpPrefix dest,
int maxAttempts, int pollingIntervalMs)
throws RemoteException, ServiceSpecificException {
netd.tetherInterfaceAdd(iface);
networkAddInterface(netd, iface, maxAttempts, pollingIntervalMs);
List<RouteInfo> routes = new ArrayList<>();
routes.add(new RouteInfo(dest, null, iface, RTN_UNICAST));
addRoutesToLocalNetwork(netd, iface, routes);
} |
Set the given interface down.
public static void setInterfaceDown(INetd netd, String iface) {
final InterfaceConfigurationParcel configParcel = getInterfaceConfigParcel(netd, iface);
configParcel.flags = removeAndAddFlags(configParcel.flags, IF_STATE_UP /* remove */,
IF_STATE_DOWN /* add */);
setInterfaceConfig(netd, configParcel);
}
/** Start tethering.
public static void tetherStart(final INetd netd, final boolean usingLegacyDnsProxy,
final String[] dhcpRange) throws RemoteException, ServiceSpecificException {
final TetherConfigParcel config = new TetherConfigParcel();
config.usingLegacyDnsProxy = usingLegacyDnsProxy;
config.dhcpRanges = dhcpRange;
netd.tetherStartWithConfiguration(config);
}
/** Setup interface for tethering.
public static void tetherInterface(final INetd netd, final String iface, final IpPrefix dest)
throws RemoteException, ServiceSpecificException {
tetherInterface(netd, iface, dest, 20 /* maxAttempts */, 50 /* pollingIntervalMs */);
}
/** Setup interface with configurable retries for tethering. | getSimpleName::tetherInterface | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
private static void networkAddInterface(final INetd netd, final String iface,
int maxAttempts, int pollingIntervalMs)
throws ServiceSpecificException, RemoteException {
for (int i = 1; i <= maxAttempts; i++) {
try {
netd.networkAddInterface(INetd.LOCAL_NET_ID, iface);
return;
} catch (ServiceSpecificException e) {
if (e.errorCode == EBUSY && i < maxAttempts) {
SystemClock.sleep(pollingIntervalMs);
continue;
}
Log.e(TAG, "Retry Netd#networkAddInterface failure: " + e);
throw e;
}
}
} |
Retry Netd#networkAddInterface for EBUSY error code.
If the same interface (e.g., wlan0) is in client mode and then switches to tethered mode.
There can be a race where puts the interface into the local network but interface is still
in use in netd because the ConnectivityService thread hasn't processed the disconnect yet.
See b/158269544 for detail.
| getSimpleName::networkAddInterface | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static void untetherInterface(final INetd netd, String iface)
throws RemoteException, ServiceSpecificException {
try {
netd.tetherInterfaceRemove(iface);
} finally {
netd.networkRemoveInterface(INetd.LOCAL_NET_ID, iface);
}
} |
Retry Netd#networkAddInterface for EBUSY error code.
If the same interface (e.g., wlan0) is in client mode and then switches to tethered mode.
There can be a race where puts the interface into the local network but interface is still
in use in netd because the ConnectivityService thread hasn't processed the disconnect yet.
See b/158269544 for detail.
private static void networkAddInterface(final INetd netd, final String iface,
int maxAttempts, int pollingIntervalMs)
throws ServiceSpecificException, RemoteException {
for (int i = 1; i <= maxAttempts; i++) {
try {
netd.networkAddInterface(INetd.LOCAL_NET_ID, iface);
return;
} catch (ServiceSpecificException e) {
if (e.errorCode == EBUSY && i < maxAttempts) {
SystemClock.sleep(pollingIntervalMs);
continue;
}
Log.e(TAG, "Retry Netd#networkAddInterface failure: " + e);
throw e;
}
}
}
/** Reset interface for tethering. | getSimpleName::untetherInterface | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static void addRoutesToLocalNetwork(final INetd netd, final String iface,
final List<RouteInfo> routes) {
for (RouteInfo route : routes) {
if (!route.isDefaultRoute()) {
modifyRoute(netd, ModifyOperation.ADD, INetd.LOCAL_NET_ID, route);
}
}
// IPv6 link local should be activated always.
modifyRoute(netd, ModifyOperation.ADD, INetd.LOCAL_NET_ID,
new RouteInfo(new IpPrefix("fe80::/64"), null, iface, RTN_UNICAST));
} |
Retry Netd#networkAddInterface for EBUSY error code.
If the same interface (e.g., wlan0) is in client mode and then switches to tethered mode.
There can be a race where puts the interface into the local network but interface is still
in use in netd because the ConnectivityService thread hasn't processed the disconnect yet.
See b/158269544 for detail.
private static void networkAddInterface(final INetd netd, final String iface,
int maxAttempts, int pollingIntervalMs)
throws ServiceSpecificException, RemoteException {
for (int i = 1; i <= maxAttempts; i++) {
try {
netd.networkAddInterface(INetd.LOCAL_NET_ID, iface);
return;
} catch (ServiceSpecificException e) {
if (e.errorCode == EBUSY && i < maxAttempts) {
SystemClock.sleep(pollingIntervalMs);
continue;
}
Log.e(TAG, "Retry Netd#networkAddInterface failure: " + e);
throw e;
}
}
}
/** Reset interface for tethering.
public static void untetherInterface(final INetd netd, String iface)
throws RemoteException, ServiceSpecificException {
try {
netd.tetherInterfaceRemove(iface);
} finally {
netd.networkRemoveInterface(INetd.LOCAL_NET_ID, iface);
}
}
/** Add |routes| to local network. | getSimpleName::addRoutesToLocalNetwork | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static int removeRoutesFromLocalNetwork(final INetd netd, final List<RouteInfo> routes) {
int failures = 0;
for (RouteInfo route : routes) {
try {
modifyRoute(netd, ModifyOperation.REMOVE, INetd.LOCAL_NET_ID, route);
} catch (IllegalStateException e) {
failures++;
}
}
return failures;
} |
Retry Netd#networkAddInterface for EBUSY error code.
If the same interface (e.g., wlan0) is in client mode and then switches to tethered mode.
There can be a race where puts the interface into the local network but interface is still
in use in netd because the ConnectivityService thread hasn't processed the disconnect yet.
See b/158269544 for detail.
private static void networkAddInterface(final INetd netd, final String iface,
int maxAttempts, int pollingIntervalMs)
throws ServiceSpecificException, RemoteException {
for (int i = 1; i <= maxAttempts; i++) {
try {
netd.networkAddInterface(INetd.LOCAL_NET_ID, iface);
return;
} catch (ServiceSpecificException e) {
if (e.errorCode == EBUSY && i < maxAttempts) {
SystemClock.sleep(pollingIntervalMs);
continue;
}
Log.e(TAG, "Retry Netd#networkAddInterface failure: " + e);
throw e;
}
}
}
/** Reset interface for tethering.
public static void untetherInterface(final INetd netd, String iface)
throws RemoteException, ServiceSpecificException {
try {
netd.tetherInterfaceRemove(iface);
} finally {
netd.networkRemoveInterface(INetd.LOCAL_NET_ID, iface);
}
}
/** Add |routes| to local network.
public static void addRoutesToLocalNetwork(final INetd netd, final String iface,
final List<RouteInfo> routes) {
for (RouteInfo route : routes) {
if (!route.isDefaultRoute()) {
modifyRoute(netd, ModifyOperation.ADD, INetd.LOCAL_NET_ID, route);
}
}
// IPv6 link local should be activated always.
modifyRoute(netd, ModifyOperation.ADD, INetd.LOCAL_NET_ID,
new RouteInfo(new IpPrefix("fe80::/64"), null, iface, RTN_UNICAST));
}
/** Remove routes from local network. | getSimpleName::removeRoutesFromLocalNetwork | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public static void modifyRoute(final INetd netd, final ModifyOperation op, final int netId,
final RouteInfo route) {
final String ifName = route.getInterface();
final String dst = route.getDestination().toString();
final String nextHop = findNextHop(route);
try {
switch(op) {
case ADD:
netd.networkAddRoute(netId, ifName, dst, nextHop);
break;
case REMOVE:
netd.networkRemoveRoute(netId, ifName, dst, nextHop);
break;
default:
throw new IllegalStateException("Unsupported modify operation:" + op);
}
} catch (RemoteException | ServiceSpecificException e) {
throw new IllegalStateException(e);
}
} |
Retry Netd#networkAddInterface for EBUSY error code.
If the same interface (e.g., wlan0) is in client mode and then switches to tethered mode.
There can be a race where puts the interface into the local network but interface is still
in use in netd because the ConnectivityService thread hasn't processed the disconnect yet.
See b/158269544 for detail.
private static void networkAddInterface(final INetd netd, final String iface,
int maxAttempts, int pollingIntervalMs)
throws ServiceSpecificException, RemoteException {
for (int i = 1; i <= maxAttempts; i++) {
try {
netd.networkAddInterface(INetd.LOCAL_NET_ID, iface);
return;
} catch (ServiceSpecificException e) {
if (e.errorCode == EBUSY && i < maxAttempts) {
SystemClock.sleep(pollingIntervalMs);
continue;
}
Log.e(TAG, "Retry Netd#networkAddInterface failure: " + e);
throw e;
}
}
}
/** Reset interface for tethering.
public static void untetherInterface(final INetd netd, String iface)
throws RemoteException, ServiceSpecificException {
try {
netd.tetherInterfaceRemove(iface);
} finally {
netd.networkRemoveInterface(INetd.LOCAL_NET_ID, iface);
}
}
/** Add |routes| to local network.
public static void addRoutesToLocalNetwork(final INetd netd, final String iface,
final List<RouteInfo> routes) {
for (RouteInfo route : routes) {
if (!route.isDefaultRoute()) {
modifyRoute(netd, ModifyOperation.ADD, INetd.LOCAL_NET_ID, route);
}
}
// IPv6 link local should be activated always.
modifyRoute(netd, ModifyOperation.ADD, INetd.LOCAL_NET_ID,
new RouteInfo(new IpPrefix("fe80::/64"), null, iface, RTN_UNICAST));
}
/** Remove routes from local network.
public static int removeRoutesFromLocalNetwork(final INetd netd, final List<RouteInfo> routes) {
int failures = 0;
for (RouteInfo route : routes) {
try {
modifyRoute(netd, ModifyOperation.REMOVE, INetd.LOCAL_NET_ID, route);
} catch (IllegalStateException e) {
failures++;
}
}
return failures;
}
@SuppressLint("NewApi")
private static String findNextHop(final RouteInfo route) {
final String nextHop;
switch (route.getType()) {
case RTN_UNICAST:
if (route.hasGateway()) {
nextHop = route.getGateway().getHostAddress();
} else {
nextHop = INetd.NEXTHOP_NONE;
}
break;
case RTN_UNREACHABLE:
nextHop = INetd.NEXTHOP_UNREACHABLE;
break;
case RTN_THROW:
nextHop = INetd.NEXTHOP_THROW;
break;
default:
nextHop = INetd.NEXTHOP_NONE;
break;
}
return nextHop;
}
/** Add or remove |route|. | getSimpleName::modifyRoute | java | Reginer/aosp-android-jar | android-34/src/com/android/net/module/util/NetdUtils.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/net/module/util/NetdUtils.java | MIT |
public long getLong(String key, long defaultValue) {
return mSharedPreferences.getLong(key, defaultValue);
} |
Manages shared preference, i.e. the storage used for metrics reporting.
public static class PreferencesManager {
private static final String METRICS_DIR = "recovery_system";
private static final String METRICS_PREFS_FILE = "RecoverySystemMetricsPrefs.xml";
protected final SharedPreferences mSharedPreferences;
private final File mMetricsPrefsFile;
PreferencesManager(Context context) {
File prefsDir = new File(Environment.getDataSystemCeDirectory(USER_SYSTEM),
METRICS_DIR);
mMetricsPrefsFile = new File(prefsDir, METRICS_PREFS_FILE);
mSharedPreferences = context.getSharedPreferences(mMetricsPrefsFile, 0);
}
/** Reads the value of a given key with type long. | PreferencesManager::getLong | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public int getInt(String key, int defaultValue) {
return mSharedPreferences.getInt(key, defaultValue);
} |
Manages shared preference, i.e. the storage used for metrics reporting.
public static class PreferencesManager {
private static final String METRICS_DIR = "recovery_system";
private static final String METRICS_PREFS_FILE = "RecoverySystemMetricsPrefs.xml";
protected final SharedPreferences mSharedPreferences;
private final File mMetricsPrefsFile;
PreferencesManager(Context context) {
File prefsDir = new File(Environment.getDataSystemCeDirectory(USER_SYSTEM),
METRICS_DIR);
mMetricsPrefsFile = new File(prefsDir, METRICS_PREFS_FILE);
mSharedPreferences = context.getSharedPreferences(mMetricsPrefsFile, 0);
}
/** Reads the value of a given key with type long.
public long getLong(String key, long defaultValue) {
return mSharedPreferences.getLong(key, defaultValue);
}
/** Reads the value of a given key with type int. | PreferencesManager::getInt | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public void putLong(String key, long value) {
mSharedPreferences.edit().putLong(key, value).commit();
} |
Manages shared preference, i.e. the storage used for metrics reporting.
public static class PreferencesManager {
private static final String METRICS_DIR = "recovery_system";
private static final String METRICS_PREFS_FILE = "RecoverySystemMetricsPrefs.xml";
protected final SharedPreferences mSharedPreferences;
private final File mMetricsPrefsFile;
PreferencesManager(Context context) {
File prefsDir = new File(Environment.getDataSystemCeDirectory(USER_SYSTEM),
METRICS_DIR);
mMetricsPrefsFile = new File(prefsDir, METRICS_PREFS_FILE);
mSharedPreferences = context.getSharedPreferences(mMetricsPrefsFile, 0);
}
/** Reads the value of a given key with type long.
public long getLong(String key, long defaultValue) {
return mSharedPreferences.getLong(key, defaultValue);
}
/** Reads the value of a given key with type int.
public int getInt(String key, int defaultValue) {
return mSharedPreferences.getInt(key, defaultValue);
}
/** Stores the value of a given key with type long. | PreferencesManager::putLong | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public void putInt(String key, int value) {
mSharedPreferences.edit().putInt(key, value).commit();
} |
Manages shared preference, i.e. the storage used for metrics reporting.
public static class PreferencesManager {
private static final String METRICS_DIR = "recovery_system";
private static final String METRICS_PREFS_FILE = "RecoverySystemMetricsPrefs.xml";
protected final SharedPreferences mSharedPreferences;
private final File mMetricsPrefsFile;
PreferencesManager(Context context) {
File prefsDir = new File(Environment.getDataSystemCeDirectory(USER_SYSTEM),
METRICS_DIR);
mMetricsPrefsFile = new File(prefsDir, METRICS_PREFS_FILE);
mSharedPreferences = context.getSharedPreferences(mMetricsPrefsFile, 0);
}
/** Reads the value of a given key with type long.
public long getLong(String key, long defaultValue) {
return mSharedPreferences.getLong(key, defaultValue);
}
/** Reads the value of a given key with type int.
public int getInt(String key, int defaultValue) {
return mSharedPreferences.getInt(key, defaultValue);
}
/** Stores the value of a given key with type long.
public void putLong(String key, long value) {
mSharedPreferences.edit().putLong(key, value).commit();
}
/** Stores the value of a given key with type int. | PreferencesManager::putInt | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public synchronized void incrementIntKey(String key, int defaultInitialValue) {
int oldValue = getInt(key, defaultInitialValue);
putInt(key, oldValue + 1);
} |
Manages shared preference, i.e. the storage used for metrics reporting.
public static class PreferencesManager {
private static final String METRICS_DIR = "recovery_system";
private static final String METRICS_PREFS_FILE = "RecoverySystemMetricsPrefs.xml";
protected final SharedPreferences mSharedPreferences;
private final File mMetricsPrefsFile;
PreferencesManager(Context context) {
File prefsDir = new File(Environment.getDataSystemCeDirectory(USER_SYSTEM),
METRICS_DIR);
mMetricsPrefsFile = new File(prefsDir, METRICS_PREFS_FILE);
mSharedPreferences = context.getSharedPreferences(mMetricsPrefsFile, 0);
}
/** Reads the value of a given key with type long.
public long getLong(String key, long defaultValue) {
return mSharedPreferences.getLong(key, defaultValue);
}
/** Reads the value of a given key with type int.
public int getInt(String key, int defaultValue) {
return mSharedPreferences.getInt(key, defaultValue);
}
/** Stores the value of a given key with type long.
public void putLong(String key, long value) {
mSharedPreferences.edit().putLong(key, value).commit();
}
/** Stores the value of a given key with type int.
public void putInt(String key, int value) {
mSharedPreferences.edit().putInt(key, value).commit();
}
/** Increments the value of a given key with type int. | PreferencesManager::incrementIntKey | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public void deletePrefsFile() {
if (!mMetricsPrefsFile.delete()) {
Slog.w(TAG, "Failed to delete metrics prefs");
}
} |
Manages shared preference, i.e. the storage used for metrics reporting.
public static class PreferencesManager {
private static final String METRICS_DIR = "recovery_system";
private static final String METRICS_PREFS_FILE = "RecoverySystemMetricsPrefs.xml";
protected final SharedPreferences mSharedPreferences;
private final File mMetricsPrefsFile;
PreferencesManager(Context context) {
File prefsDir = new File(Environment.getDataSystemCeDirectory(USER_SYSTEM),
METRICS_DIR);
mMetricsPrefsFile = new File(prefsDir, METRICS_PREFS_FILE);
mSharedPreferences = context.getSharedPreferences(mMetricsPrefsFile, 0);
}
/** Reads the value of a given key with type long.
public long getLong(String key, long defaultValue) {
return mSharedPreferences.getLong(key, defaultValue);
}
/** Reads the value of a given key with type int.
public int getInt(String key, int defaultValue) {
return mSharedPreferences.getInt(key, defaultValue);
}
/** Stores the value of a given key with type long.
public void putLong(String key, long value) {
mSharedPreferences.edit().putLong(key, value).commit();
}
/** Stores the value of a given key with type int.
public void putInt(String key, int value) {
mSharedPreferences.edit().putInt(key, value).commit();
}
/** Increments the value of a given key with type int.
public synchronized void incrementIntKey(String key, int defaultInitialValue) {
int oldValue = getInt(key, defaultInitialValue);
putInt(key, oldValue + 1);
}
/** Delete the preference file and cleanup all metrics storage. | PreferencesManager::deletePrefsFile | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public android.hardware.boot.V1_2.IBootControl getBootControl() throws RemoteException {
IBootControl bootControlV10 = IBootControl.getService(true);
if (bootControlV10 == null) {
throw new RemoteException("Failed to get boot control HAL V1_0.");
}
android.hardware.boot.V1_2.IBootControl bootControlV12 =
android.hardware.boot.V1_2.IBootControl.castFrom(bootControlV10);
if (bootControlV12 == null) {
Slog.w(TAG, "Device doesn't implement boot control HAL V1_2.");
return null;
}
return bootControlV12;
} |
Throws remote exception if there's an error getting the boot control HAL.
Returns null if the boot control HAL's version is older than V1_2.
| public::getBootControl | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public boolean connectService() {
mLocalSocket = new LocalSocket();
boolean done = false;
// The uncrypt socket will be created by init upon receiving the
// service request. It may not be ready by this point. So we will
// keep retrying until success or reaching timeout.
for (int retry = 0; retry < SOCKET_CONNECTION_MAX_RETRY; retry++) {
try {
mLocalSocket.connect(new LocalSocketAddress(UNCRYPT_SOCKET,
LocalSocketAddress.Namespace.RESERVED));
done = true;
break;
} catch (IOException ignored) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
Slog.w(TAG, "Interrupted:", e);
}
}
}
if (!done) {
Slog.e(TAG, "Timed out connecting to uncrypt socket");
close();
return false;
}
try {
mInputStream = new DataInputStream(mLocalSocket.getInputStream());
mOutputStream = new DataOutputStream(mLocalSocket.getOutputStream());
} catch (IOException e) {
close();
return false;
}
return true;
} |
Attempt to connect to the uncrypt service. Connection will be retried for up to
{@link #SOCKET_CONNECTION_MAX_RETRY} times. If the connection is unsuccessful, the
socket will be closed. If the connection is successful, the connection must be closed
by the caller.
@return true if connection was successful, false if unsuccessful
| UncryptSocket::connectService | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public void sendCommand(String command) throws IOException {
byte[] cmdUtf8 = command.getBytes(StandardCharsets.UTF_8);
mOutputStream.writeInt(cmdUtf8.length);
mOutputStream.write(cmdUtf8, 0, cmdUtf8.length);
} |
Sends a command to the uncrypt service.
@param command command to send to the uncrypt service
@throws IOException if there was an error writing to the socket
| UncryptSocket::sendCommand | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public int getPercentageUncrypted() throws IOException {
return mInputStream.readInt();
} |
Reads the status from the uncrypt service which is usually represented as a percentage.
@return an integer representing the percentage completed
@throws IOException if there was an error reading the socket
| UncryptSocket::getPercentageUncrypted | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public void sendAck() throws IOException {
mOutputStream.writeInt(0);
} |
Sends a confirmation to the uncrypt service.
@throws IOException if there was an error writing to the socket
| UncryptSocket::sendAck | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public void close() {
IoUtils.closeQuietly(mInputStream);
IoUtils.closeQuietly(mOutputStream);
IoUtils.closeQuietly(mLocalSocket);
} |
Closes the socket and all underlying data streams.
| UncryptSocket::close | java | Reginer/aosp-android-jar | android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/recoverysystem/RecoverySystemService.java | MIT |
public static final @NonNull ControlTemplate NO_TEMPLATE = new ControlTemplate("") {
@Override
public int getTemplateType() {
return TYPE_NO_TEMPLATE;
}
}; |
Singleton representing a {@link Control} with no input.
@hide
| ControlTemplate::ControlTemplate | java | Reginer/aosp-android-jar | android-35/src/android/service/controls/templates/ControlTemplate.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/controls/templates/ControlTemplate.java | MIT |
private static final @NonNull ControlTemplate ERROR_TEMPLATE = new ControlTemplate("") {
@Override
public int getTemplateType() {
return TYPE_ERROR;
}
}; |
Object returned when there is an unparcelling error.
@hide
| ControlTemplate::ControlTemplate | java | Reginer/aosp-android-jar | android-35/src/android/service/controls/templates/ControlTemplate.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/controls/templates/ControlTemplate.java | MIT |
ControlTemplate(@NonNull Bundle b) {
mTemplateId = b.getString(KEY_TEMPLATE_ID);
} |
@param b
@hide
| ControlTemplate::ControlTemplate | java | Reginer/aosp-android-jar | android-35/src/android/service/controls/templates/ControlTemplate.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/controls/templates/ControlTemplate.java | MIT |
ControlTemplate(@NonNull String templateId) {
Preconditions.checkNotNull(templateId);
mTemplateId = templateId;
} |
@hide
| ControlTemplate::ControlTemplate | java | Reginer/aosp-android-jar | android-35/src/android/service/controls/templates/ControlTemplate.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/controls/templates/ControlTemplate.java | MIT |
public void prepareTemplateForBinder(@NonNull Context context) {} |
Call to prepare values for Binder transport.
@hide
| ControlTemplate::prepareTemplateForBinder | java | Reginer/aosp-android-jar | android-35/src/android/service/controls/templates/ControlTemplate.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/controls/templates/ControlTemplate.java | MIT |
public NetworkInfo(int type, int subtype,
@Nullable String typeName, @Nullable String subtypeName) {
if (!ConnectivityManager.isNetworkTypeValid(type)
&& type != ConnectivityManager.TYPE_NONE) {
throw new IllegalArgumentException("Invalid network type: " + type);
}
mNetworkType = type;
mSubtype = subtype;
mTypeName = typeName;
mSubtypeName = subtypeName;
setDetailedState(DetailedState.IDLE, null, null);
mState = State.UNKNOWN;
} |
Create a new instance of NetworkInfo.
This may be useful for apps to write unit tests.
@param type the legacy type of the network, as one of the ConnectivityManager.TYPE_*
constants.
@param subtype the subtype if applicable, as one of the TelephonyManager.NETWORK_TYPE_*
constants.
@param typeName a human-readable string for the network type, or an empty string or null.
@param subtypeName a human-readable string for the subtype, or an empty string or null.
| NetworkInfo::NetworkInfo | java | Reginer/aosp-android-jar | android-35/src/android/net/NetworkInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/net/NetworkInfo.java | MIT |
public String getReason() {
synchronized (this) {
return mReason;
}
} |
Report the reason an attempt to establish connectivity failed,
if one is available.
@return the reason for failure, or null if not available
@deprecated This method does not have a consistent contract that could make it useful
to callers.
| NetworkInfo::getReason | java | Reginer/aosp-android-jar | android-35/src/android/net/NetworkInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/net/NetworkInfo.java | MIT |
public String toShortString() {
synchronized (this) {
final StringBuilder builder = new StringBuilder();
builder.append(getTypeName());
final String subtype = getSubtypeName();
if (!TextUtils.isEmpty(subtype)) {
builder.append("[").append(subtype).append("]");
}
builder.append(" ");
builder.append(mDetailedState);
if (mIsRoaming) {
builder.append(" ROAMING");
}
if (mExtraInfo != null) {
builder.append(" extra: ").append(mExtraInfo);
}
return builder.toString();
}
} |
Returns a brief summary string suitable for debugging.
@hide
| NetworkInfo::toShortString | java | Reginer/aosp-android-jar | android-35/src/android/net/NetworkInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/net/NetworkInfo.java | MIT |
public createElementNS06(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", true);
} |
Constructor.
@param factory document factory, may not be null
@throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
| createElementNS06::createElementNS06 | java | Reginer/aosp-android-jar | android-32/src/org/w3c/domts/level2/core/createElementNS06.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level2/core/createElementNS06.java | MIT |
public void runTest() throws Throwable {
String namespaceURI = "http://www.example.com/";
String qualifiedName;
Document doc;
boolean done;
Element newElement;
String charact;
doc = (Document) load("hc_staff", true);
{
boolean success = false;
try {
newElement = doc.createElementNS(namespaceURI, "");
} catch (DOMException ex) {
success = (ex.code == DOMException.INVALID_CHARACTER_ERR);
}
assertTrue("throw_INVALID_CHARACTER_ERR", success);
}
} |
Runs the test case.
@throws Throwable Any uncaught exception causes test to fail
| createElementNS06::runTest | java | Reginer/aosp-android-jar | android-32/src/org/w3c/domts/level2/core/createElementNS06.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level2/core/createElementNS06.java | MIT |
public String getTargetURI() {
return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/createElementNS06";
} |
Gets URI that identifies the test.
@return uri identifier of test
| createElementNS06::getTargetURI | java | Reginer/aosp-android-jar | android-32/src/org/w3c/domts/level2/core/createElementNS06.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level2/core/createElementNS06.java | MIT |
public static void main(final String[] args) {
DOMTestCase.doMain(createElementNS06.class, args);
} |
Runs this test from the command line.
@param args command line arguments
| createElementNS06::main | java | Reginer/aosp-android-jar | android-32/src/org/w3c/domts/level2/core/createElementNS06.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level2/core/createElementNS06.java | MIT |
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector(10);
v.add(new ASN1Integer(version)); // version
v.add(new ASN1Integer(getModulus()));
v.add(new ASN1Integer(getPublicExponent()));
v.add(new ASN1Integer(getPrivateExponent()));
v.add(new ASN1Integer(getPrime1()));
v.add(new ASN1Integer(getPrime2()));
v.add(new ASN1Integer(getExponent1()));
v.add(new ASN1Integer(getExponent2()));
v.add(new ASN1Integer(getCoefficient()));
if (otherPrimeInfos != null)
{
v.add(otherPrimeInfos);
}
return new DERSequence(v);
} |
This outputs the key in PKCS1v2 format.
<pre>
RSAPrivateKey ::= SEQUENCE {
version Version,
modulus INTEGER, -- n
publicExponent INTEGER, -- e
privateExponent INTEGER, -- d
prime1 INTEGER, -- p
prime2 INTEGER, -- q
exponent1 INTEGER, -- d mod (p-1)
exponent2 INTEGER, -- d mod (q-1)
coefficient INTEGER, -- (inverse of q) mod p
otherPrimeInfos OtherPrimeInfos OPTIONAL
}
Version ::= INTEGER { two-prime(0), multi(1) }
(CONSTRAINED BY {-- version must be multi if otherPrimeInfos present --})
</pre>
<p>
This routine is written to output PKCS1 version 2.1, private keys.
| RSAPrivateKey::toASN1Primitive | java | Reginer/aosp-android-jar | android-35/src/com/android/internal/org/bouncycastle/asn1/pkcs/RSAPrivateKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/internal/org/bouncycastle/asn1/pkcs/RSAPrivateKey.java | MIT |
public void setCustomBackground(Drawable background) {
if (mBackground != null) {
mBackground.setCallback(null);
unscheduleDrawable(mBackground);
}
mBackground = background;
mBackground.mutate();
if (mBackground != null) {
mBackground.setCallback(this);
setTint(mTintColor);
}
if (mBackground instanceof RippleDrawable) {
((RippleDrawable) mBackground).setForceSoftware(true);
}
updateBackgroundRadii();
invalidate();
} |
Sets a background drawable. As we need to change our bounds independently of layout, we need
the notion of a background independently of the regular View background..
| NotificationBackgroundView::setCustomBackground | java | Reginer/aosp-android-jar | android-31/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java | MIT |
public void setRadius(float topRoundness, float bottomRoundness) {
if (topRoundness == mCornerRadii[0] && bottomRoundness == mCornerRadii[4]) {
return;
}
mBottomIsRounded = bottomRoundness != 0.0f;
mCornerRadii[0] = topRoundness;
mCornerRadii[1] = topRoundness;
mCornerRadii[2] = topRoundness;
mCornerRadii[3] = topRoundness;
mCornerRadii[4] = bottomRoundness;
mCornerRadii[5] = bottomRoundness;
mCornerRadii[6] = bottomRoundness;
mCornerRadii[7] = bottomRoundness;
updateBackgroundRadii();
} |
Sets the current top and bottom radius for this background.
| NotificationBackgroundView::setRadius | java | Reginer/aosp-android-jar | android-31/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java | MIT |
public void setExpandAnimationSize(int actualWidth, int actualHeight) {
mActualHeight = actualHeight;
mActualWidth = actualWidth;
invalidate();
} |
Sets the current top and bottom radius for this background.
public void setRadius(float topRoundness, float bottomRoundness) {
if (topRoundness == mCornerRadii[0] && bottomRoundness == mCornerRadii[4]) {
return;
}
mBottomIsRounded = bottomRoundness != 0.0f;
mCornerRadii[0] = topRoundness;
mCornerRadii[1] = topRoundness;
mCornerRadii[2] = topRoundness;
mCornerRadii[3] = topRoundness;
mCornerRadii[4] = bottomRoundness;
mCornerRadii[5] = bottomRoundness;
mCornerRadii[6] = bottomRoundness;
mCornerRadii[7] = bottomRoundness;
updateBackgroundRadii();
}
public void setBottomAmountClips(boolean clips) {
if (clips != mBottomAmountClips) {
mBottomAmountClips = clips;
invalidate();
}
}
private void updateBackgroundRadii() {
if (mDontModifyCorners) {
return;
}
if (mBackground instanceof LayerDrawable) {
GradientDrawable gradientDrawable =
(GradientDrawable) ((LayerDrawable) mBackground).getDrawable(0);
gradientDrawable.setCornerRadii(mCornerRadii);
}
}
public void setBackgroundTop(int backgroundTop) {
mBackgroundTop = backgroundTop;
invalidate();
}
/** Set the current expand animation size. | NotificationBackgroundView::setExpandAnimationSize | java | Reginer/aosp-android-jar | android-31/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java | MIT |
public static @NonNull String digestOf(@NonNull String... keys) {
Arrays.sort(keys);
try {
final MessageDigest digest = MessageDigest.getInstance("SHA-1");
for (String key : keys) {
final String item = key + "=" + get(key) + "\n";
digest.update(item.getBytes(StandardCharsets.UTF_8));
}
return HexEncoding.encodeToString(digest.digest()).toLowerCase();
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
} |
Return a {@code SHA-1} digest of the given keys and their values as a
hex-encoded string. The ordering of the incoming keys doesn't change the
digest result.
@hide
| SystemProperties::digestOf | java | Reginer/aosp-android-jar | android-32/src/android/os/SystemProperties.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/SystemProperties.java | MIT |
@Nullable public static Handle find(@NonNull String name) {
long nativeHandle = native_find(name);
if (nativeHandle == 0) {
return null;
}
return new Handle(nativeHandle);
} |
Look up a property location by name.
@name name of the property
@return property handle or {@code null} if property isn't set
@hide
| SystemProperties::find | java | Reginer/aosp-android-jar | android-32/src/android/os/SystemProperties.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/SystemProperties.java | MIT |
@NonNull public String get() {
return native_get(mNativeHandle);
} |
@return Value of the property
| Handle::get | java | Reginer/aosp-android-jar | android-32/src/android/os/SystemProperties.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/SystemProperties.java | MIT |
public int getInt(int def) {
return native_get_int(mNativeHandle, def);
} |
@param def default value
@return value or {@code def} on parse error
| Handle::getInt | java | Reginer/aosp-android-jar | android-32/src/android/os/SystemProperties.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/SystemProperties.java | MIT |
public long getLong(long def) {
return native_get_long(mNativeHandle, def);
} |
@param def default value
@return value or {@code def} on parse error
| Handle::getLong | java | Reginer/aosp-android-jar | android-32/src/android/os/SystemProperties.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/SystemProperties.java | MIT |
public boolean getBoolean(boolean def) {
return native_get_boolean(mNativeHandle, def);
} |
@param def default value
@return value or {@code def} on parse error
| Handle::getBoolean | java | Reginer/aosp-android-jar | android-32/src/android/os/SystemProperties.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/SystemProperties.java | MIT |
public IsChunkBreakpoint(long averageNumberOfTrialsUntilBreakpoint) {
checkArgument(
averageNumberOfTrialsUntilBreakpoint >= 0,
"Average number of trials must be non-negative");
// Want n leading zeros after t trials.
// P(leading zeros = n) = 1/2^n
// Expected num trials to get n leading zeros = 1/2^-n
// t = 1/2^-n
// n = log2(t)
mLeadingZeros = (int) Math.round(log2(averageNumberOfTrialsUntilBreakpoint));
mBitmask = ~(~0L >>> mLeadingZeros);
} |
A new instance that causes a breakpoint after a given number of trials on average.
@param averageNumberOfTrialsUntilBreakpoint The number of trials after which on average to
create a new chunk. If this is not a power of 2, some precision is sacrificed (i.e., on
average, breaks will actually happen after the nearest power of 2 to the average number
of trials passed in).
| IsChunkBreakpoint::IsChunkBreakpoint | java | Reginer/aosp-android-jar | android-32/src/com/android/server/backup/encryption/chunking/cdc/IsChunkBreakpoint.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/backup/encryption/chunking/cdc/IsChunkBreakpoint.java | MIT |
public int getLeadingZeros() {
return mLeadingZeros;
} |
Returns {@code true} if {@code fingerprint} indicates that there should be a chunk
breakpoint.
@Override
public boolean isBreakpoint(long fingerprint) {
return (fingerprint & mBitmask) == 0;
}
/** Returns the number of leading zeros in the fingerprint that causes a breakpoint. | IsChunkBreakpoint::getLeadingZeros | java | Reginer/aosp-android-jar | android-32/src/com/android/server/backup/encryption/chunking/cdc/IsChunkBreakpoint.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/backup/encryption/chunking/cdc/IsChunkBreakpoint.java | MIT |
private static double log2(double x) {
return Math.log(x) / Math.log(2);
} |
Calculates log base 2 of x. Not the most efficient possible implementation, but it's simple,
obviously correct, and is only invoked on object construction.
| IsChunkBreakpoint::log2 | java | Reginer/aosp-android-jar | android-32/src/com/android/server/backup/encryption/chunking/cdc/IsChunkBreakpoint.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/backup/encryption/chunking/cdc/IsChunkBreakpoint.java | MIT |
public BluetoothLeScanner(BluetoothAdapter bluetoothAdapter) {
mBluetoothAdapter = Objects.requireNonNull(bluetoothAdapter);
mBluetoothManager = mBluetoothAdapter.getBluetoothManager();
mAttributionSource = mBluetoothAdapter.getAttributionSource();
mHandler = new Handler(Looper.getMainLooper());
mLeScanClients = new HashMap<ScanCallback, BleScanCallbackWrapper>();
} |
Use {@link BluetoothAdapter#getBluetoothLeScanner()} instead.
@param bluetoothManager BluetoothManager that conducts overall Bluetooth Management.
@param opPackageName The opPackageName of the context this object was created from
@param featureId The featureId of the context this object was created from
@hide
| BluetoothLeScanner::BluetoothLeScanner | java | Reginer/aosp-android-jar | android-32/src/android/bluetooth/le/BluetoothLeScanner.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/bluetooth/le/BluetoothLeScanner.java | MIT |
public TransitionRequestInfo(
@WindowManager.TransitionType int type,
@Nullable ActivityManager.RunningTaskInfo triggerTask,
@Nullable RemoteTransition remoteTransition) {
this(type, triggerTask, remoteTransition, null /* displayChange */);
} |
If non-null, this request was triggered by this display change. This will not be complete:
The reliable parts should be flags, rotation start/end (if rotating), and start/end bounds
(if size is changing).
private @Nullable DisplayChange mDisplayChange;
/** constructor override | TransitionRequestInfo::TransitionRequestInfo | java | Reginer/aosp-android-jar | android-34/src/android/window/TransitionRequestInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/window/TransitionRequestInfo.java | MIT |
public DisplayChange(int displayId) {
mDisplayId = displayId;
} |
If non-null, this request was triggered by this display change. This will not be complete:
The reliable parts should be flags, rotation start/end (if rotating), and start/end bounds
(if size is changing).
private @Nullable DisplayChange mDisplayChange;
/** constructor override
public TransitionRequestInfo(
@WindowManager.TransitionType int type,
@Nullable ActivityManager.RunningTaskInfo triggerTask,
@Nullable RemoteTransition remoteTransition) {
this(type, triggerTask, remoteTransition, null /* displayChange */);
}
/** Requested change to a display.
@DataClass(genToString = true, genSetters = true, genBuilder = false, genConstructor = false)
public static class DisplayChange implements Parcelable {
private final int mDisplayId;
@Nullable private Rect mStartAbsBounds = null;
@Nullable private Rect mEndAbsBounds = null;
private int mStartRotation = WindowConfiguration.ROTATION_UNDEFINED;
private int mEndRotation = WindowConfiguration.ROTATION_UNDEFINED;
private boolean mPhysicalDisplayChanged = false;
/** Create empty display-change. | DisplayChange::DisplayChange | java | Reginer/aosp-android-jar | android-34/src/android/window/TransitionRequestInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/window/TransitionRequestInfo.java | MIT |
public DisplayChange(int displayId, int startRotation, int endRotation) {
mDisplayId = displayId;
mStartRotation = startRotation;
mEndRotation = endRotation;
} |
If non-null, this request was triggered by this display change. This will not be complete:
The reliable parts should be flags, rotation start/end (if rotating), and start/end bounds
(if size is changing).
private @Nullable DisplayChange mDisplayChange;
/** constructor override
public TransitionRequestInfo(
@WindowManager.TransitionType int type,
@Nullable ActivityManager.RunningTaskInfo triggerTask,
@Nullable RemoteTransition remoteTransition) {
this(type, triggerTask, remoteTransition, null /* displayChange */);
}
/** Requested change to a display.
@DataClass(genToString = true, genSetters = true, genBuilder = false, genConstructor = false)
public static class DisplayChange implements Parcelable {
private final int mDisplayId;
@Nullable private Rect mStartAbsBounds = null;
@Nullable private Rect mEndAbsBounds = null;
private int mStartRotation = WindowConfiguration.ROTATION_UNDEFINED;
private int mEndRotation = WindowConfiguration.ROTATION_UNDEFINED;
private boolean mPhysicalDisplayChanged = false;
/** Create empty display-change.
public DisplayChange(int displayId) {
mDisplayId = displayId;
}
/** Create a display-change representing a rotation. | DisplayChange::DisplayChange | java | Reginer/aosp-android-jar | android-34/src/android/window/TransitionRequestInfo.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/window/TransitionRequestInfo.java | MIT |
public RtpHeaderExtensionType(@IntRange(from = 1, to = 14) int localIdentifier,
@NonNull Uri uri) {
if (localIdentifier < 1 || localIdentifier > 13) {
throw new IllegalArgumentException("localIdentifier must be in range 1-14");
}
if (uri == null) {
throw new NullPointerException("uri is required.");
}
mLocalIdentifier = localIdentifier;
mUri = uri;
} |
Create a new RTP header extension type.
@param localIdentifier the local identifier.
@param uri the {@link Uri} identifying the RTP header extension type.
@throws IllegalArgumentException if {@code localIdentifier} is out of the expected range.
@throws NullPointerException if {@code uri} is null.
| RtpHeaderExtensionType::RtpHeaderExtensionType | java | Reginer/aosp-android-jar | android-33/src/android/telephony/ims/RtpHeaderExtensionType.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/ims/RtpHeaderExtensionType.java | MIT |
public static final String concatGroups(Matcher matcher) {
StringBuilder b = new StringBuilder();
final int numGroups = matcher.groupCount();
for (int i = 1; i <= numGroups; i++) {
String s = matcher.group(i);
if (s != null) {
b.append(s);
}
}
return b.toString();
} |
Convenience method to take all of the non-null matching groups in a
regex Matcher and return them as a concatenated string.
@param matcher The Matcher object from which grouped text will
be extracted
@return A String comprising all of the non-null matched
groups concatenated together
| Patterns::concatGroups | java | Reginer/aosp-android-jar | android-35/src/android/util/Patterns.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/util/Patterns.java | MIT |
public static final String digitsAndPlusOnly(Matcher matcher) {
StringBuilder buffer = new StringBuilder();
String matchingRegion = matcher.group();
for (int i = 0, size = matchingRegion.length(); i < size; i++) {
char character = matchingRegion.charAt(i);
if (character == '+' || Character.isDigit(character)) {
buffer.append(character);
}
}
return buffer.toString();
} |
Convenience method to return only the digits and plus signs
in the matching string.
@param matcher The Matcher object from which digits and plus will
be extracted
@return A String comprising all of the digits and plus in
the match
| Patterns::digitsAndPlusOnly | java | Reginer/aosp-android-jar | android-35/src/android/util/Patterns.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/util/Patterns.java | MIT |
private Patterns() {} |
Do not create this static utility class.
| Patterns::Patterns | java | Reginer/aosp-android-jar | android-35/src/android/util/Patterns.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/util/Patterns.java | MIT |
protected SelectionKey() { } |
Constructs an instance of this class.
| SelectionKey::SelectionKey | java | Reginer/aosp-android-jar | android-33/src/java/nio/channels/SelectionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/channels/SelectionKey.java | MIT |
public int interestOpsOr(int ops) {
synchronized (this) {
int oldVal = interestOps();
interestOps(oldVal | ops);
return oldVal;
}
} |
Atomically sets this key's interest set to the bitwise union ("or") of
the existing interest set and the given value. This method is guaranteed
to be atomic with respect to other concurrent calls to this method or to
{@link #interestOpsAnd(int)}.
<p> This method may be invoked at any time. If this method is invoked
while a selection operation is in progress then it has no effect upon
that operation; the change to the key's interest set will be seen by the
next selection operation.
@implSpec The default implementation synchronizes on this key and invokes
{@code interestOps()} and {@code interestOps(int)} to retrieve and set
this key's interest set.
@param ops The interest set to apply
@return The previous interest set
@throws IllegalArgumentException
If a bit in the set does not correspond to an operation that
is supported by this key's channel, that is, if
{@code (ops & ~channel().validOps()) != 0}
@throws CancelledKeyException
If this key has been cancelled
@since 11
| SelectionKey::interestOpsOr | java | Reginer/aosp-android-jar | android-33/src/java/nio/channels/SelectionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/channels/SelectionKey.java | MIT |
public int interestOpsAnd(int ops) {
synchronized (this) {
int oldVal = interestOps();
interestOps(oldVal & ops);
return oldVal;
}
} |
Atomically sets this key's interest set to the bitwise intersection ("and")
of the existing interest set and the given value. This method is guaranteed
to be atomic with respect to other concurrent calls to this method or to
{@link #interestOpsOr(int)}.
<p> This method may be invoked at any time. If this method is invoked
while a selection operation is in progress then it has no effect upon
that operation; the change to the key's interest set will be seen by the
next selection operation.
@apiNote Unlike the {@code interestOps(int)} and {@code interestOpsOr(int)}
methods, this method does not throw {@code IllegalArgumentException} when
invoked with bits in the interest set that do not correspond to an
operation that is supported by this key's channel. This is to allow
operation bits in the interest set to be cleared using bitwise complement
values, e.g., {@code interestOpsAnd(~SelectionKey.OP_READ)} will remove
the {@code OP_READ} from the interest set without affecting other bits.
@implSpec The default implementation synchronizes on this key and invokes
{@code interestOps()} and {@code interestOps(int)} to retrieve and set
this key's interest set.
@param ops The interest set to apply
@return The previous interest set
@throws CancelledKeyException
If this key has been cancelled
@since 11
| SelectionKey::interestOpsAnd | java | Reginer/aosp-android-jar | android-33/src/java/nio/channels/SelectionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/channels/SelectionKey.java | MIT |
public final boolean isReadable() {
return (readyOps() & OP_READ) != 0;
} |
Tests whether this key's channel is ready for reading.
<p> An invocation of this method of the form {@code k.isReadable()}
behaves in exactly the same way as the expression
<blockquote><pre>{@code
k.readyOps() & OP_READ != 0
}</pre></blockquote>
<p> If this key's channel does not support read operations then this
method always returns {@code false}. </p>
@return {@code true} if, and only if,
{@code readyOps() & OP_READ} is nonzero
@throws CancelledKeyException
If this key has been cancelled
| SelectionKey::isReadable | java | Reginer/aosp-android-jar | android-33/src/java/nio/channels/SelectionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/channels/SelectionKey.java | MIT |
public final boolean isWritable() {
return (readyOps() & OP_WRITE) != 0;
} |
Tests whether this key's channel is ready for writing.
<p> An invocation of this method of the form {@code k.isWritable()}
behaves in exactly the same way as the expression
<blockquote><pre>{@code
k.readyOps() & OP_WRITE != 0
}</pre></blockquote>
<p> If this key's channel does not support write operations then this
method always returns {@code false}. </p>
@return {@code true} if, and only if,
{@code readyOps() & OP_WRITE} is nonzero
@throws CancelledKeyException
If this key has been cancelled
| SelectionKey::isWritable | java | Reginer/aosp-android-jar | android-33/src/java/nio/channels/SelectionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/channels/SelectionKey.java | MIT |
public final boolean isConnectable() {
return (readyOps() & OP_CONNECT) != 0;
} |
Tests whether this key's channel has either finished, or failed to
finish, its socket-connection operation.
<p> An invocation of this method of the form {@code k.isConnectable()}
behaves in exactly the same way as the expression
<blockquote><pre>{@code
k.readyOps() & OP_CONNECT != 0
}</pre></blockquote>
<p> If this key's channel does not support socket-connect operations
then this method always returns {@code false}. </p>
@return {@code true} if, and only if,
{@code readyOps() & OP_CONNECT} is nonzero
@throws CancelledKeyException
If this key has been cancelled
| SelectionKey::isConnectable | java | Reginer/aosp-android-jar | android-33/src/java/nio/channels/SelectionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/channels/SelectionKey.java | MIT |
public final boolean isAcceptable() {
return (readyOps() & OP_ACCEPT) != 0;
} |
Tests whether this key's channel is ready to accept a new socket
connection.
<p> An invocation of this method of the form {@code k.isAcceptable()}
behaves in exactly the same way as the expression
<blockquote><pre>{@code
k.readyOps() & OP_ACCEPT != 0
}</pre></blockquote>
<p> If this key's channel does not support socket-accept operations then
this method always returns {@code false}. </p>
@return {@code true} if, and only if,
{@code readyOps() & OP_ACCEPT} is nonzero
@throws CancelledKeyException
If this key has been cancelled
| SelectionKey::isAcceptable | java | Reginer/aosp-android-jar | android-33/src/java/nio/channels/SelectionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/channels/SelectionKey.java | MIT |
public final Object attach(Object ob) {
return attachmentUpdater.getAndSet(this, ob);
} |
Attaches the given object to this key.
<p> An attached object may later be retrieved via the {@link #attachment()
attachment} method. Only one object may be attached at a time; invoking
this method causes any previous attachment to be discarded. The current
attachment may be discarded by attaching {@code null}. </p>
@param ob
The object to be attached; may be {@code null}
@return The previously-attached object, if any,
otherwise {@code null}
| SelectionKey::attach | java | Reginer/aosp-android-jar | android-33/src/java/nio/channels/SelectionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/channels/SelectionKey.java | MIT |
public final Object attachment() {
return attachment;
} |
Retrieves the current attachment.
@return The object currently attached to this key,
or {@code null} if there is no attachment
| SelectionKey::attachment | java | Reginer/aosp-android-jar | android-33/src/java/nio/channels/SelectionKey.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/nio/channels/SelectionKey.java | MIT |
public SearchManagerService(Context context) {
mContext = context;
new MyPackageMonitor().register(context, null, UserHandle.ALL, true);
new GlobalSearchProviderObserver(context.getContentResolver());
mHandler = BackgroundThread.getHandler();
} |
Initializes the Search Manager service in the provided system context.
Only one instance of this object should be created!
@param context to use for accessing DB, window manager, etc.
| Lifecycle::SearchManagerService | java | Reginer/aosp-android-jar | android-31/src/com/android/server/search/SearchManagerService.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/search/SearchManagerService.java | MIT |
private ProvisioningIntentHelper() { } |
This class is never instantiated
| ProvisioningIntentHelper::ProvisioningIntentHelper | java | Reginer/aosp-android-jar | android-35/src/android/app/admin/ProvisioningIntentHelper.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/app/admin/ProvisioningIntentHelper.java | MIT |
static ServiceConfigAccessor getInstance(Context context) {
synchronized (SLOCK) {
if (sInstance == null) {
sInstance = new ServiceConfigAccessorImpl(context);
}
return sInstance;
}
} |
If a newly calculated system clock time and the current system clock time differs by this or
more the system clock will actually be updated. Used to prevent the system clock being set
for only minor differences.
private final int mSystemClockUpdateThresholdMillis;
private ServiceConfigAccessorImpl(@NonNull Context context) {
mContext = Objects.requireNonNull(context);
mCr = context.getContentResolver();
mUserManager = context.getSystemService(UserManager.class);
mServerFlags = ServerFlags.getInstance(mContext);
mConfigOriginPrioritiesSupplier = new ConfigOriginPrioritiesSupplier(context);
mServerFlagsOriginPrioritiesSupplier =
new ServerFlagsOriginPrioritiesSupplier(mServerFlags);
mSystemClockUpdateThresholdMillis =
SystemProperties.getInt("ro.sys.time_detector_update_diff",
SYSTEM_CLOCK_UPDATE_THRESHOLD_MILLIS_DEFAULT);
// Wire up the config change listeners for anything that could affect ConfigurationInternal.
// Use the main thread for event delivery, listeners can post to their chosen thread.
// Listen for the user changing / the user's location mode changing. Report on the main
// thread.
IntentFilter filter = new IntentFilter();
filter.addAction(ACTION_USER_SWITCHED);
mContext.registerReceiverForAllUsers(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
handleConfigurationInternalChangeOnMainThread();
}
}, filter, null, null /* main thread */);
// Add async callbacks for global settings being changed.
ContentResolver contentResolver = mContext.getContentResolver();
ContentObserver contentObserver = new ContentObserver(mContext.getMainThreadHandler()) {
@Override
public void onChange(boolean selfChange) {
handleConfigurationInternalChangeOnMainThread();
}
};
contentResolver.registerContentObserver(
Settings.Global.getUriFor(Settings.Global.AUTO_TIME), true, contentObserver);
// Watch server flags.
mServerFlags.addListener(this::handleConfigurationInternalChangeOnMainThread,
SERVER_FLAGS_KEYS_TO_WATCH);
}
/** Returns the singleton instance. | ServiceConfigAccessorImpl::getInstance | java | Reginer/aosp-android-jar | android-34/src/com/android/server/timedetector/ServiceConfigAccessorImpl.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/timedetector/ServiceConfigAccessorImpl.java | MIT |
public BulletSpan() {
this(STANDARD_GAP_WIDTH, STANDARD_COLOR, false, STANDARD_BULLET_RADIUS);
} |
Creates a {@link BulletSpan} with the default values.
| BulletSpan::BulletSpan | java | Reginer/aosp-android-jar | android-34/src/android/text/style/BulletSpan.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/text/style/BulletSpan.java | MIT |
public BulletSpan(int gapWidth) {
this(gapWidth, STANDARD_COLOR, false, STANDARD_BULLET_RADIUS);
} |
Creates a {@link BulletSpan} based on a gap width
@param gapWidth the distance, in pixels, between the bullet point and the paragraph.
| BulletSpan::BulletSpan | java | Reginer/aosp-android-jar | android-34/src/android/text/style/BulletSpan.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/text/style/BulletSpan.java | MIT |
public BulletSpan(int gapWidth, @ColorInt int color) {
this(gapWidth, color, true, STANDARD_BULLET_RADIUS);
} |
Creates a {@link BulletSpan} based on a gap width and a color integer.
@param gapWidth the distance, in pixels, between the bullet point and the paragraph.
@param color the bullet point color, as a color integer
@see android.content.res.Resources#getColor(int, Resources.Theme)
| BulletSpan::BulletSpan | java | Reginer/aosp-android-jar | android-34/src/android/text/style/BulletSpan.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/text/style/BulletSpan.java | MIT |
public BulletSpan(int gapWidth, @ColorInt int color, @IntRange(from = 0) int bulletRadius) {
this(gapWidth, color, true, bulletRadius);
} |
Creates a {@link BulletSpan} based on a gap width and a color integer.
@param gapWidth the distance, in pixels, between the bullet point and the paragraph.
@param color the bullet point color, as a color integer.
@param bulletRadius the radius of the bullet point, in pixels.
@see android.content.res.Resources#getColor(int, Resources.Theme)
| BulletSpan::BulletSpan | java | Reginer/aosp-android-jar | android-34/src/android/text/style/BulletSpan.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/text/style/BulletSpan.java | MIT |
public BulletSpan(@NonNull Parcel src) {
mGapWidth = src.readInt();
mWantColor = src.readInt() != 0;
mColor = src.readInt();
mBulletRadius = src.readInt();
} |
Creates a {@link BulletSpan} from a parcel.
| BulletSpan::BulletSpan | java | Reginer/aosp-android-jar | android-34/src/android/text/style/BulletSpan.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/text/style/BulletSpan.java | MIT |
public int getGapWidth() {
return mGapWidth;
} |
Get the distance, in pixels, between the bullet point and the paragraph.
@return the distance, in pixels, between the bullet point and the paragraph.
| BulletSpan::getGapWidth | java | Reginer/aosp-android-jar | android-34/src/android/text/style/BulletSpan.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/text/style/BulletSpan.java | MIT |
public int getBulletRadius() {
return mBulletRadius;
} |
Get the radius, in pixels, of the bullet point.
@return the radius, in pixels, of the bullet point.
| BulletSpan::getBulletRadius | java | Reginer/aosp-android-jar | android-34/src/android/text/style/BulletSpan.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/text/style/BulletSpan.java | MIT |
public int getColor() {
return mColor;
} |
Get the bullet point color.
@return the bullet point color
| BulletSpan::getColor | java | Reginer/aosp-android-jar | android-34/src/android/text/style/BulletSpan.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/text/style/BulletSpan.java | MIT |
public HebrewCalendar() {
this(TimeZone.getDefault(), ULocale.getDefault(Category.FORMAT));
} |
Constructs a default <code>HebrewCalendar</code> using the current time
in the default time zone with the default <code>FORMAT</code> locale.
@see Category#FORMAT
| HebrewCalendar::HebrewCalendar | java | Reginer/aosp-android-jar | android-35/src/android/icu/util/HebrewCalendar.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/util/HebrewCalendar.java | MIT |
public HebrewCalendar(TimeZone zone) {
this(zone, ULocale.getDefault(Category.FORMAT));
} |
Constructs a <code>HebrewCalendar</code> based on the current time
in the given time zone with the default <code>FORMAT</code> locale.
@param zone The time zone for the new calendar.
@see Category#FORMAT
| HebrewCalendar::HebrewCalendar | java | Reginer/aosp-android-jar | android-35/src/android/icu/util/HebrewCalendar.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/util/HebrewCalendar.java | MIT |
public HebrewCalendar(Locale aLocale) {
this(TimeZone.forLocaleOrDefault(aLocale), aLocale);
} |
Constructs a <code>HebrewCalendar</code> based on the current time
in the default time zone with the given locale.
@param aLocale The locale for the new calendar.
| HebrewCalendar::HebrewCalendar | java | Reginer/aosp-android-jar | android-35/src/android/icu/util/HebrewCalendar.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/util/HebrewCalendar.java | MIT |
public HebrewCalendar(ULocale locale) {
this(TimeZone.forULocaleOrDefault(locale), locale);
} |
Constructs a <code>HebrewCalendar</code> based on the current time
in the default time zone with the given locale.
@param locale The locale for the new calendar.
| HebrewCalendar::HebrewCalendar | java | Reginer/aosp-android-jar | android-35/src/android/icu/util/HebrewCalendar.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/util/HebrewCalendar.java | MIT |
public HebrewCalendar(TimeZone zone, Locale aLocale) {
super(zone, aLocale);
setTimeInMillis(System.currentTimeMillis());
} |
Constructs a <code>HebrewCalendar</code> based on the current time
in the given time zone with the given locale.
@param zone The time zone for the new calendar.
@param aLocale The locale for the new calendar.
| HebrewCalendar::HebrewCalendar | java | Reginer/aosp-android-jar | android-35/src/android/icu/util/HebrewCalendar.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/util/HebrewCalendar.java | MIT |
public HebrewCalendar(TimeZone zone, ULocale locale) {
super(zone, locale);
setTimeInMillis(System.currentTimeMillis());
} |
Constructs a <code>HebrewCalendar</code> based on the current time
in the given time zone with the given locale.
@param zone The time zone for the new calendar.
@param locale The locale for the new calendar.
| HebrewCalendar::HebrewCalendar | java | Reginer/aosp-android-jar | android-35/src/android/icu/util/HebrewCalendar.java | https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/icu/util/HebrewCalendar.java | MIT |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.