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 long getMaxFileSize() { return mMaxFileSize; }
Returns maximum file size for the storage, or zero if it is unbounded. @return maximum file size
MtpStorage::getMaxFileSize
java
Reginer/aosp-android-jar
android-35/src/android/mtp/MtpStorage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/mtp/MtpStorage.java
MIT
public boolean isHostWindows() { return mIsHostWindows.get(); }
Returns true if the mtp host of this storage is Windows. @return is host Windows
MtpStorage::isHostWindows
java
Reginer/aosp-android-jar
android-35/src/android/mtp/MtpStorage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/mtp/MtpStorage.java
MIT
public JobParameters(IBinder callback, String namespace, int jobId, PersistableBundle extras, Bundle transientExtras, ClipData clipData, int clipGrantFlags, boolean overrideDeadlineExpired, boolean isExpedited, boolean isUserInitiated, Uri[] triggeredContentUris, String[] triggeredContentAuthorities, Network network) { this.jobId = jobId; this.extras = extras; this.transientExtras = transientExtras; this.clipData = clipData; this.clipGrantFlags = clipGrantFlags; this.callback = callback; this.overrideDeadlineExpired = overrideDeadlineExpired; this.mIsExpedited = isExpedited; this.mIsUserInitiated = isUserInitiated; this.mTriggeredContentUris = triggeredContentUris; this.mTriggeredContentAuthorities = triggeredContentAuthorities; this.mNetwork = network; this.mJobNamespace = namespace; }
The system's estimate of when the app will be launched changed significantly enough to decide this job shouldn't be running right now. This will mostly apply to prefetch jobs. @see JobInfo#isPrefetch() @see JobInfo.Builder#setPrefetch(boolean) public static final int STOP_REASON_ESTIMATED_APP_LAUNCH_TIME_CHANGED = 15; /** @hide @IntDef(prefix = {"STOP_REASON_"}, value = { STOP_REASON_UNDEFINED, STOP_REASON_CANCELLED_BY_APP, STOP_REASON_PREEMPT, STOP_REASON_TIMEOUT, STOP_REASON_DEVICE_STATE, STOP_REASON_CONSTRAINT_BATTERY_NOT_LOW, STOP_REASON_CONSTRAINT_CHARGING, STOP_REASON_CONSTRAINT_CONNECTIVITY, STOP_REASON_CONSTRAINT_DEVICE_IDLE, STOP_REASON_CONSTRAINT_STORAGE_NOT_LOW, STOP_REASON_QUOTA, STOP_REASON_BACKGROUND_RESTRICTION, STOP_REASON_APP_STANDBY, STOP_REASON_USER, STOP_REASON_SYSTEM_PROCESSING, STOP_REASON_ESTIMATED_APP_LAUNCH_TIME_CHANGED, }) @Retention(RetentionPolicy.SOURCE) public @interface StopReason { } @UnsupportedAppUsage private final int jobId; @Nullable private final String mJobNamespace; private final PersistableBundle extras; private final Bundle transientExtras; private final ClipData clipData; private final int clipGrantFlags; @UnsupportedAppUsage private final IBinder callback; private final boolean overrideDeadlineExpired; private final boolean mIsExpedited; private final boolean mIsUserInitiated; private final Uri[] mTriggeredContentUris; private final String[] mTriggeredContentAuthorities; @Nullable private Network mNetwork; private int mStopReason = STOP_REASON_UNDEFINED; private int mInternalStopReason = INTERNAL_STOP_REASON_UNKNOWN; private String debugStopReason; // Human readable stop reason for debugging. /** @hide
JobParameters::JobParameters
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public int getJobId() { return jobId; }
@return The unique id of this job, specified at creation time.
JobParameters::getJobId
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public int getInternalStopReasonCode() { return mInternalStopReason; }
@return The reason {@link JobService#onStopJob(JobParameters)} was called on this job. Will be {@link #STOP_REASON_UNDEFINED} if {@link JobService#onStopJob(JobParameters)} has not yet been called. @StopReason public int getStopReason() { return mStopReason; } /** @hide
JobParameters::getInternalStopReasonCode
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public String getDebugStopReason() { return debugStopReason; }
Reason onStopJob() was called on this job. @hide
JobParameters::getDebugStopReason
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public @NonNull PersistableBundle getExtras() { return extras; }
@return The extras you passed in when constructing this job with {@link android.app.job.JobInfo.Builder#setExtras(android.os.PersistableBundle)}. This will never be null. If you did not set any extras this will be an empty bundle.
JobParameters::getExtras
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public @NonNull Bundle getTransientExtras() { return transientExtras; }
@return The transient extras you passed in when constructing this job with {@link android.app.job.JobInfo.Builder#setTransientExtras(android.os.Bundle)}. This will never be null. If you did not set any extras this will be an empty bundle.
JobParameters::getTransientExtras
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public @Nullable ClipData getClipData() { return clipData; }
@return The clip you passed in when constructing this job with {@link android.app.job.JobInfo.Builder#setClipData(ClipData, int)}. Will be null if it was not set.
JobParameters::getClipData
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public int getClipGrantFlags() { return clipGrantFlags; }
@return The clip grant flags you passed in when constructing this job with {@link android.app.job.JobInfo.Builder#setClipData(ClipData, int)}. Will be 0 if it was not set.
JobParameters::getClipGrantFlags
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public boolean isExpeditedJob() { return mIsExpedited; }
@return Whether this job is running as an expedited job or not. A job is guaranteed to have all expedited job guarantees for the duration of the job execution if this returns {@code true}. This will return {@code false} if the job that wasn't requested to run as a expedited job, or if it was requested to run as an expedited job but the app didn't have any remaining expedited job quota at the time of execution. @see JobInfo.Builder#setExpedited(boolean)
JobParameters::isExpeditedJob
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public boolean isUserInitiatedJob() { return mIsUserInitiated; }
@return Whether this job is running as a user-initiated job or not. A job is guaranteed to have all user-initiated job guarantees for the duration of the job execution if this returns {@code true}. This will return {@code false} if the job wasn't requested to run as a user-initiated job, or if it was requested to run as a user-initiated job but the app didn't meet any of the requirements at the time of execution, such as having the {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} permission. @see JobInfo.Builder#setUserInitiated(boolean)
JobParameters::isUserInitiatedJob
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public boolean isOverrideDeadlineExpired() { return overrideDeadlineExpired; }
For jobs with {@link android.app.job.JobInfo.Builder#setOverrideDeadline(long)} set, this provides an easy way to tell whether the job is being executed due to the deadline expiring. Note: If the job is running because its deadline expired, it implies that its constraints will not be met.
JobParameters::isOverrideDeadlineExpired
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public @Nullable Uri[] getTriggeredContentUris() { return mTriggeredContentUris; }
For jobs with {@link android.app.job.JobInfo.Builder#addTriggerContentUri} set, this reports which URIs have triggered the job. This will be null if either no URIs have triggered it (it went off due to a deadline or other reason), or the number of changed URIs is too large to report. Whether or not the number of URIs is too large, you can always use {@link #getTriggeredContentAuthorities()} to determine whether the job was triggered due to any content changes and the authorities they are associated with.
JobParameters::getTriggeredContentUris
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public @Nullable String[] getTriggeredContentAuthorities() { return mTriggeredContentAuthorities; }
For jobs with {@link android.app.job.JobInfo.Builder#addTriggerContentUri} set, this reports which content authorities have triggered the job. It will only be null if no authorities have triggered it -- that is, the job executed for some other reason, such as a deadline expiring. If this is non-null, you can use {@link #getTriggeredContentUris()} to retrieve the details of which URIs changed (as long as that has not exceeded the maximum number it can reported).
JobParameters::getTriggeredContentAuthorities
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public @Nullable Network getNetwork() { return mNetwork; }
Return the network that should be used to perform any network requests for this job. <p> Devices may have multiple active network connections simultaneously, or they may not have a default network route at all. To correctly handle all situations like this, your job should always use the network returned by this method instead of implicitly using the default network route. <p> Note that the system may relax the constraints you originally requested, such as allowing a {@link JobInfo#NETWORK_TYPE_UNMETERED} job to run over a metered network when there is a surplus of metered data available. Starting in Android version {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}, this will return {@code null} if the app does not hold the permissions specified in {@link JobInfo.Builder#setRequiredNetwork(NetworkRequest)}. @return the network that should be used to perform any network requests for this job, or {@code null} if this job didn't set any required network type or if the job executed when there was no available network to use. @see JobInfo.Builder#setRequiredNetworkType(int) @see JobInfo.Builder#setRequiredNetwork(NetworkRequest)
JobParameters::getNetwork
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public @Nullable JobWorkItem dequeueWork() { try { return getCallback().dequeueWork(getJobId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
Dequeue the next pending {@link JobWorkItem} from these JobParameters associated with their currently running job. Calling this method when there is no more work available and all previously dequeued work has been completed will result in the system taking care of stopping the job for you -- you should not call {@link JobService#jobFinished(JobParameters, boolean)} yourself (otherwise you risk losing an upcoming JobWorkItem that is being enqueued at the same time). <p>Once you are done with the {@link JobWorkItem} returned by this method, you must call {@link #completeWork(JobWorkItem)} with it to inform the system that you are done executing the work. The job will not be finished until all dequeued work has been completed. You do not, however, have to complete each returned work item before deqeueing the next one -- you can use {@link #dequeueWork()} multiple times before completing previous work if you want to process work in parallel, and you can complete the work in whatever order you want.</p> <p>If the job runs to the end of its available time period before all work has been completed, it will stop as normal. You should return true from {@link JobService#onStopJob(JobParameters)} in order to have the job rescheduled, and by doing so any pending as well as remaining uncompleted work will be re-queued for the next time the job runs.</p> <p>This example shows how to construct a JobService that will serially dequeue and process work that is available for it:</p> {@sample development/samples/ApiDemos/src/com/example/android/apis/app/JobWorkService.java service} @return Returns a new {@link JobWorkItem} if there is one pending, otherwise null. If null is returned, the system will also stop the job if all work has also been completed. (This means that for correct operation, you must always call dequeueWork() after you have completed other work, to check either for more work or allow the system to stop the job.)
JobParameters::dequeueWork
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public void completeWork(@NonNull JobWorkItem work) { try { if (!getCallback().completeWork(getJobId(), work.getWorkId())) { throw new IllegalArgumentException("Given work is not active: " + work); } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
Report the completion of executing a {@link JobWorkItem} previously returned by {@link #dequeueWork()}. This tells the system you are done with the work associated with that item, so it will not be returned again. Note that if this is the last work in the queue, completing it here will <em>not</em> finish the overall job -- for that to happen, you still need to call {@link #dequeueWork()} again. <p>If you are enqueueing work into a job, you must call this method for each piece of work you process. Do <em>not</em> call {@link JobService#jobFinished(JobParameters, boolean)} or else you can lose work in your queue.</p> @param work The work you have completed processing, as previously returned by {@link #dequeueWork()}
JobParameters::completeWork
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public void setNetwork(@Nullable Network network) { mNetwork = network; }
Report the completion of executing a {@link JobWorkItem} previously returned by {@link #dequeueWork()}. This tells the system you are done with the work associated with that item, so it will not be returned again. Note that if this is the last work in the queue, completing it here will <em>not</em> finish the overall job -- for that to happen, you still need to call {@link #dequeueWork()} again. <p>If you are enqueueing work into a job, you must call this method for each piece of work you process. Do <em>not</em> call {@link JobService#jobFinished(JobParameters, boolean)} or else you can lose work in your queue.</p> @param work The work you have completed processing, as previously returned by {@link #dequeueWork()} public void completeWork(@NonNull JobWorkItem work) { try { if (!getCallback().completeWork(getJobId(), work.getWorkId())) { throw new IllegalArgumentException("Given work is not active: " + work); } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** @hide @UnsupportedAppUsage public IJobCallback getCallback() { return IJobCallback.Stub.asInterface(callback); } private JobParameters(Parcel in) { jobId = in.readInt(); mJobNamespace = in.readString(); extras = in.readPersistableBundle(); transientExtras = in.readBundle(); if (in.readInt() != 0) { clipData = ClipData.CREATOR.createFromParcel(in); clipGrantFlags = in.readInt(); } else { clipData = null; clipGrantFlags = 0; } callback = in.readStrongBinder(); overrideDeadlineExpired = in.readInt() == 1; mIsExpedited = in.readBoolean(); mIsUserInitiated = in.readBoolean(); mTriggeredContentUris = in.createTypedArray(Uri.CREATOR); mTriggeredContentAuthorities = in.createStringArray(); if (in.readInt() != 0) { mNetwork = Network.CREATOR.createFromParcel(in); } else { mNetwork = null; } mStopReason = in.readInt(); mInternalStopReason = in.readInt(); debugStopReason = in.readString(); } /** @hide
JobParameters::setNetwork
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
public void setStopReason(@StopReason int reason, int internalStopReason, String debugStopReason) { mStopReason = reason; mInternalStopReason = internalStopReason; this.debugStopReason = debugStopReason; }
Report the completion of executing a {@link JobWorkItem} previously returned by {@link #dequeueWork()}. This tells the system you are done with the work associated with that item, so it will not be returned again. Note that if this is the last work in the queue, completing it here will <em>not</em> finish the overall job -- for that to happen, you still need to call {@link #dequeueWork()} again. <p>If you are enqueueing work into a job, you must call this method for each piece of work you process. Do <em>not</em> call {@link JobService#jobFinished(JobParameters, boolean)} or else you can lose work in your queue.</p> @param work The work you have completed processing, as previously returned by {@link #dequeueWork()} public void completeWork(@NonNull JobWorkItem work) { try { if (!getCallback().completeWork(getJobId(), work.getWorkId())) { throw new IllegalArgumentException("Given work is not active: " + work); } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** @hide @UnsupportedAppUsage public IJobCallback getCallback() { return IJobCallback.Stub.asInterface(callback); } private JobParameters(Parcel in) { jobId = in.readInt(); mJobNamespace = in.readString(); extras = in.readPersistableBundle(); transientExtras = in.readBundle(); if (in.readInt() != 0) { clipData = ClipData.CREATOR.createFromParcel(in); clipGrantFlags = in.readInt(); } else { clipData = null; clipGrantFlags = 0; } callback = in.readStrongBinder(); overrideDeadlineExpired = in.readInt() == 1; mIsExpedited = in.readBoolean(); mIsUserInitiated = in.readBoolean(); mTriggeredContentUris = in.createTypedArray(Uri.CREATOR); mTriggeredContentAuthorities = in.createStringArray(); if (in.readInt() != 0) { mNetwork = Network.CREATOR.createFromParcel(in); } else { mNetwork = null; } mStopReason = in.readInt(); mInternalStopReason = in.readInt(); debugStopReason = in.readString(); } /** @hide public void setNetwork(@Nullable Network network) { mNetwork = network; } /** @hide
JobParameters::setStopReason
java
Reginer/aosp-android-jar
android-34/src/android/app/job/JobParameters.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/job/JobParameters.java
MIT
ByteRange(long start, long end) { Preconditions.checkArgument(start >= 0); Preconditions.checkArgument(end >= start); mStart = start; mEnd = end; }
/* Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. package com.android.server.backup.encryption.chunking; import com.android.internal.util.Preconditions; /** Representation of a range of bytes to be downloaded. final class ByteRange { private final long mStart; private final long mEnd; /** Creates a range of bytes which includes {@code mStart} and {@code mEnd}.
ByteRange::ByteRange
java
Reginer/aosp-android-jar
android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
MIT
long getStart() { return mStart; }
/* Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. package com.android.server.backup.encryption.chunking; import com.android.internal.util.Preconditions; /** Representation of a range of bytes to be downloaded. final class ByteRange { private final long mStart; private final long mEnd; /** Creates a range of bytes which includes {@code mStart} and {@code mEnd}. ByteRange(long start, long end) { Preconditions.checkArgument(start >= 0); Preconditions.checkArgument(end >= start); mStart = start; mEnd = end; } /** Returns the start of the {@code ByteRange}. The start is included in the range.
ByteRange::getStart
java
Reginer/aosp-android-jar
android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
MIT
long getEnd() { return mEnd; }
/* Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. package com.android.server.backup.encryption.chunking; import com.android.internal.util.Preconditions; /** Representation of a range of bytes to be downloaded. final class ByteRange { private final long mStart; private final long mEnd; /** Creates a range of bytes which includes {@code mStart} and {@code mEnd}. ByteRange(long start, long end) { Preconditions.checkArgument(start >= 0); Preconditions.checkArgument(end >= start); mStart = start; mEnd = end; } /** Returns the start of the {@code ByteRange}. The start is included in the range. long getStart() { return mStart; } /** Returns the end of the {@code ByteRange}. The end is included in the range.
ByteRange::getEnd
java
Reginer/aosp-android-jar
android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
MIT
int getLength() { return (int) (mEnd - mStart + 1); }
/* Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. package com.android.server.backup.encryption.chunking; import com.android.internal.util.Preconditions; /** Representation of a range of bytes to be downloaded. final class ByteRange { private final long mStart; private final long mEnd; /** Creates a range of bytes which includes {@code mStart} and {@code mEnd}. ByteRange(long start, long end) { Preconditions.checkArgument(start >= 0); Preconditions.checkArgument(end >= start); mStart = start; mEnd = end; } /** Returns the start of the {@code ByteRange}. The start is included in the range. long getStart() { return mStart; } /** Returns the end of the {@code ByteRange}. The end is included in the range. long getEnd() { return mEnd; } /** Returns the number of bytes included in the {@code ByteRange}.
ByteRange::getLength
java
Reginer/aosp-android-jar
android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
MIT
ByteRange extend(long length) { Preconditions.checkArgument(length > 0); return new ByteRange(mStart, mEnd + length); }
/* Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. package com.android.server.backup.encryption.chunking; import com.android.internal.util.Preconditions; /** Representation of a range of bytes to be downloaded. final class ByteRange { private final long mStart; private final long mEnd; /** Creates a range of bytes which includes {@code mStart} and {@code mEnd}. ByteRange(long start, long end) { Preconditions.checkArgument(start >= 0); Preconditions.checkArgument(end >= start); mStart = start; mEnd = end; } /** Returns the start of the {@code ByteRange}. The start is included in the range. long getStart() { return mStart; } /** Returns the end of the {@code ByteRange}. The end is included in the range. long getEnd() { return mEnd; } /** Returns the number of bytes included in the {@code ByteRange}. int getLength() { return (int) (mEnd - mStart + 1); } /** Creates a new {@link ByteRange} from {@code mStart} to {@code mEnd + length}.
ByteRange::extend
java
Reginer/aosp-android-jar
android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/backup/encryption/chunking/ByteRange.java
MIT
MmsQueryHelper(Context context, BiConsumer<String, Event> eventConsumer) { mContext = context; mEventConsumer = eventConsumer; mCurrentCountryIso = Utils.getCurrentCountryIso(mContext); }
@param context Context for accessing the content resolver. @param eventConsumer Consumes the events created from the message records. The first input param is the normalized phone number.
MmsQueryHelper::MmsQueryHelper
java
Reginer/aosp-android-jar
android-34/src/com/android/server/people/data/MmsQueryHelper.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/people/data/MmsQueryHelper.java
MIT
public ContentValues() { mMap = new ArrayMap<>(); }
Creates an empty set of values using the default initial size
ContentValues::ContentValues
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public ContentValues(int size) { Preconditions.checkArgumentNonnegative(size); mMap = new ArrayMap<>(size); }
Creates an empty set of values using the given initial size @param size the initial size of the set of values
ContentValues::ContentValues
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public ContentValues(ContentValues from) { Objects.requireNonNull(from); mMap = new ArrayMap<>(from.mMap); }
Creates a set of values copied from the given set @param from the values to copy
ContentValues::ContentValues
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
private ContentValues(Parcel in) { mMap = new ArrayMap<>(in.readInt()); in.readArrayMap(mMap, null); }
@hide @deprecated kept around for lame people doing reflection @Deprecated @UnsupportedAppUsage private ContentValues(HashMap<String, Object> from) { mMap = new ArrayMap<>(); mMap.putAll(from); } /** {@hide}
ContentValues::ContentValues
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public ArrayMap<String, Object> getValues() { return mMap; }
@hide @deprecated kept around for lame people doing reflection @Deprecated @UnsupportedAppUsage private ContentValues(HashMap<String, Object> from) { mMap = new ArrayMap<>(); mMap.putAll(from); } /** {@hide} private ContentValues(Parcel in) { mMap = new ArrayMap<>(in.readInt()); in.readArrayMap(mMap, null); } @Override public boolean equals(@Nullable Object object) { if (!(object instanceof ContentValues)) { return false; } return mMap.equals(((ContentValues) object).mMap); } /** {@hide}
ContentValues::getValues
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void put(String key, String value) { mMap.put(key, value); }
Adds a value to the set. @param key the name of the value to put @param value the data for the value to put
ContentValues::put
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void putAll(ContentValues other) { mMap.putAll(other.mMap); }
Adds all values from the passed in ContentValues. @param other the ContentValues from which to copy
ContentValues::putAll
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void put(String key, Byte value) { mMap.put(key, value); }
Adds a value to the set. @param key the name of the value to put @param value the data for the value to put
ContentValues::put
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void put(String key, Short value) { mMap.put(key, value); }
Adds a value to the set. @param key the name of the value to put @param value the data for the value to put
ContentValues::put
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void put(String key, Integer value) { mMap.put(key, value); }
Adds a value to the set. @param key the name of the value to put @param value the data for the value to put
ContentValues::put
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void put(String key, Long value) { mMap.put(key, value); }
Adds a value to the set. @param key the name of the value to put @param value the data for the value to put
ContentValues::put
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void put(String key, Float value) { mMap.put(key, value); }
Adds a value to the set. @param key the name of the value to put @param value the data for the value to put
ContentValues::put
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void put(String key, Double value) { mMap.put(key, value); }
Adds a value to the set. @param key the name of the value to put @param value the data for the value to put
ContentValues::put
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void put(String key, Boolean value) { mMap.put(key, value); }
Adds a value to the set. @param key the name of the value to put @param value the data for the value to put
ContentValues::put
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void put(String key, byte[] value) { mMap.put(key, value); }
Adds a value to the set. @param key the name of the value to put @param value the data for the value to put
ContentValues::put
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void putNull(String key) { mMap.put(key, null); }
Adds a null value to the set. @param key the name of the value to make null
ContentValues::putNull
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void putObject(@Nullable String key, @Nullable Object value) { if (value == null) { putNull(key); } else if (value instanceof String) { put(key, (String) value); } else if (value instanceof Byte) { put(key, (Byte) value); } else if (value instanceof Short) { put(key, (Short) value); } else if (value instanceof Integer) { put(key, (Integer) value); } else if (value instanceof Long) { put(key, (Long) value); } else if (value instanceof Float) { put(key, (Float) value); } else if (value instanceof Double) { put(key, (Double) value); } else if (value instanceof Boolean) { put(key, (Boolean) value); } else if (value instanceof byte[]) { put(key, (byte[]) value); } else { throw new IllegalArgumentException("Unsupported type " + value.getClass()); } }
Adds a null value to the set. @param key the name of the value to make null public void putNull(String key) { mMap.put(key, null); } /** {@hide}
ContentValues::putObject
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public int size() { return mMap.size(); }
Returns the number of values. @return the number of values
ContentValues::size
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public boolean isEmpty() { return mMap.isEmpty(); }
Indicates whether this collection is empty. @return true iff size == 0
ContentValues::isEmpty
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void remove(String key) { mMap.remove(key); }
Remove a single value. @param key the name of the value to remove
ContentValues::remove
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public void clear() { mMap.clear(); }
Removes all values.
ContentValues::clear
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public boolean containsKey(String key) { return mMap.containsKey(key); }
Returns true if this object has the named value. @param key the value to check for @return {@code true} if the value is present, {@code false} otherwise
ContentValues::containsKey
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Object get(String key) { return mMap.get(key); }
Gets a value. Valid value types are {@link String}, {@link Boolean}, {@link Number}, and {@code byte[]} implementations. @param key the value to get @return the data for the value, or {@code null} if the value is missing or if {@code null} was previously added with the given {@code key}
ContentValues::get
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public String getAsString(String key) { Object value = mMap.get(key); return value != null ? value.toString() : null; }
Gets a value and converts it to a String. @param key the value to get @return the String for the value
ContentValues::getAsString
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Long getAsLong(String key) { Object value = mMap.get(key); try { return value != null ? ((Number) value).longValue() : null; } catch (ClassCastException e) { if (value instanceof CharSequence) { try { return Long.valueOf(value.toString()); } catch (NumberFormatException e2) { Log.e(TAG, "Cannot parse Long value for " + value + " at key " + key); return null; } } else { Log.e(TAG, "Cannot cast value for " + key + " to a Long: " + value, e); return null; } } }
Gets a value and converts it to a Long. @param key the value to get @return the Long value, or {@code null} if the value is missing or cannot be converted
ContentValues::getAsLong
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Integer getAsInteger(String key) { Object value = mMap.get(key); try { return value != null ? ((Number) value).intValue() : null; } catch (ClassCastException e) { if (value instanceof CharSequence) { try { return Integer.valueOf(value.toString()); } catch (NumberFormatException e2) { Log.e(TAG, "Cannot parse Integer value for " + value + " at key " + key); return null; } } else { Log.e(TAG, "Cannot cast value for " + key + " to a Integer: " + value, e); return null; } } }
Gets a value and converts it to an Integer. @param key the value to get @return the Integer value, or {@code null} if the value is missing or cannot be converted
ContentValues::getAsInteger
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Short getAsShort(String key) { Object value = mMap.get(key); try { return value != null ? ((Number) value).shortValue() : null; } catch (ClassCastException e) { if (value instanceof CharSequence) { try { return Short.valueOf(value.toString()); } catch (NumberFormatException e2) { Log.e(TAG, "Cannot parse Short value for " + value + " at key " + key); return null; } } else { Log.e(TAG, "Cannot cast value for " + key + " to a Short: " + value, e); return null; } } }
Gets a value and converts it to a Short. @param key the value to get @return the Short value, or {@code null} if the value is missing or cannot be converted
ContentValues::getAsShort
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Byte getAsByte(String key) { Object value = mMap.get(key); try { return value != null ? ((Number) value).byteValue() : null; } catch (ClassCastException e) { if (value instanceof CharSequence) { try { return Byte.valueOf(value.toString()); } catch (NumberFormatException e2) { Log.e(TAG, "Cannot parse Byte value for " + value + " at key " + key); return null; } } else { Log.e(TAG, "Cannot cast value for " + key + " to a Byte: " + value, e); return null; } } }
Gets a value and converts it to a Byte. @param key the value to get @return the Byte value, or {@code null} if the value is missing or cannot be converted
ContentValues::getAsByte
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Double getAsDouble(String key) { Object value = mMap.get(key); try { return value != null ? ((Number) value).doubleValue() : null; } catch (ClassCastException e) { if (value instanceof CharSequence) { try { return Double.valueOf(value.toString()); } catch (NumberFormatException e2) { Log.e(TAG, "Cannot parse Double value for " + value + " at key " + key); return null; } } else { Log.e(TAG, "Cannot cast value for " + key + " to a Double: " + value, e); return null; } } }
Gets a value and converts it to a Double. @param key the value to get @return the Double value, or {@code null} if the value is missing or cannot be converted
ContentValues::getAsDouble
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Float getAsFloat(String key) { Object value = mMap.get(key); try { return value != null ? ((Number) value).floatValue() : null; } catch (ClassCastException e) { if (value instanceof CharSequence) { try { return Float.valueOf(value.toString()); } catch (NumberFormatException e2) { Log.e(TAG, "Cannot parse Float value for " + value + " at key " + key); return null; } } else { Log.e(TAG, "Cannot cast value for " + key + " to a Float: " + value, e); return null; } } }
Gets a value and converts it to a Float. @param key the value to get @return the Float value, or {@code null} if the value is missing or cannot be converted
ContentValues::getAsFloat
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Boolean getAsBoolean(String key) { Object value = mMap.get(key); try { return (Boolean) value; } catch (ClassCastException e) { if (value instanceof CharSequence) { // Note that we also check against 1 here because SQLite's internal representation // for booleans is an integer with a value of 0 or 1. Without this check, boolean // values obtained via DatabaseUtils#cursorRowToContentValues will always return // false. return Boolean.valueOf(value.toString()) || "1".equals(value); } else if (value instanceof Number) { return ((Number) value).intValue() != 0; } else { Log.e(TAG, "Cannot cast value for " + key + " to a Boolean: " + value, e); return null; } } }
Gets a value and converts it to a Boolean. @param key the value to get @return the Boolean value, or {@code null} if the value is missing or cannot be converted
ContentValues::getAsBoolean
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public byte[] getAsByteArray(String key) { Object value = mMap.get(key); if (value instanceof byte[]) { return (byte[]) value; } else { return null; } }
Gets a value that is a byte array. Note that this method will not convert any other types to byte arrays. @param key the value to get @return the {@code byte[]} value, or {@code null} is the value is missing or not a {@code byte[]}
ContentValues::getAsByteArray
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Set<Map.Entry<String, Object>> valueSet() { return mMap.entrySet(); }
Returns a set of all of the keys and values @return a set of all of the keys and values
ContentValues::valueSet
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public Set<String> keySet() { return mMap.keySet(); }
Returns a set of all of the keys @return a set of all of the keys
ContentValues::keySet
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
public static boolean isSupportedValue(Object value) { if (value == null) { return true; } else if (value instanceof String) { return true; } else if (value instanceof Byte) { return true; } else if (value instanceof Short) { return true; } else if (value instanceof Integer) { return true; } else if (value instanceof Long) { return true; } else if (value instanceof Float) { return true; } else if (value instanceof Double) { return true; } else if (value instanceof Boolean) { return true; } else if (value instanceof byte[]) { return true; } else { return false; } }
Returns a string containing a concise, human-readable description of this object. @return a printable representation of this object. @Override public String toString() { StringBuilder sb = new StringBuilder(); for (String name : mMap.keySet()) { String value = getAsString(name); if (sb.length() > 0) sb.append(" "); sb.append(name + "=" + value); } return sb.toString(); } /** {@hide}
ContentValues::isSupportedValue
java
Reginer/aosp-android-jar
android-31/src/android/content/ContentValues.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/content/ContentValues.java
MIT
int getGameModeLocked(String packageName) { if (mGameModes.containsKey(packageName)) { return mGameModes.get(packageName); } return GameManager.GAME_MODE_UNSUPPORTED; }
Return the game mode of a given package. This operation must be synced with an external lock.
GameManagerSettings::getGameModeLocked
java
Reginer/aosp-android-jar
android-33/src/com/android/server/app/GameManagerSettings.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/app/GameManagerSettings.java
MIT
void setGameModeLocked(String packageName, int gameMode) { mGameModes.put(packageName, gameMode); }
Set the game mode of a given package. This operation must be synced with an external lock.
GameManagerSettings::setGameModeLocked
java
Reginer/aosp-android-jar
android-33/src/com/android/server/app/GameManagerSettings.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/app/GameManagerSettings.java
MIT
void removeGame(String packageName) { mGameModes.remove(packageName); }
Remove the game mode of a given package. This operation must be synced with an external lock.
GameManagerSettings::removeGame
java
Reginer/aosp-android-jar
android-33/src/com/android/server/app/GameManagerSettings.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/app/GameManagerSettings.java
MIT
void writePersistentDataLocked() { FileOutputStream fstr = null; try { fstr = mSettingsFile.startWrite(); final TypedXmlSerializer serializer = Xml.resolveSerializer(fstr); serializer.startDocument(null, true); serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true); serializer.startTag(null, TAG_PACKAGES); for (Map.Entry<String, Integer> entry : mGameModes.entrySet()) { serializer.startTag(null, TAG_PACKAGE); serializer.attribute(null, ATTR_NAME, entry.getKey()); serializer.attributeInt(null, ATTR_GAME_MODE, entry.getValue()); serializer.endTag(null, TAG_PACKAGE); } serializer.endTag(null, TAG_PACKAGES); serializer.endDocument(); mSettingsFile.finishWrite(fstr); FileUtils.setPermissions(mSettingsFile.toString(), FileUtils.S_IRUSR | FileUtils.S_IWUSR | FileUtils.S_IRGRP | FileUtils.S_IWGRP, -1, -1); return; } catch (java.io.IOException e) { mSettingsFile.failWrite(fstr); Slog.wtf(GameManagerService.TAG, "Unable to write game manager service settings, " + "current changes will be lost at reboot", e); } }
Write all current game service settings into disk. This operation must be synced with an external lock.
GameManagerSettings::writePersistentDataLocked
java
Reginer/aosp-android-jar
android-33/src/com/android/server/app/GameManagerSettings.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/app/GameManagerSettings.java
MIT
boolean readPersistentDataLocked() { mGameModes.clear(); if (!mSettingsFile.exists()) { Slog.v(GameManagerService.TAG, "Settings file doesn't exists, skip reading"); return false; } try { final FileInputStream str = mSettingsFile.openRead(); final TypedXmlPullParser parser = Xml.resolvePullParser(str); int type; while ((type = parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) { // Do nothing } if (type != XmlPullParser.START_TAG) { Slog.wtf(GameManagerService.TAG, "No start tag found in package manager settings"); return false; } int outerDepth = parser.getDepth(); while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) { continue; } String tagName = parser.getName(); if (tagName.equals(TAG_PACKAGE)) { readPackage(parser); } else { Slog.w(GameManagerService.TAG, "Unknown element: " + parser.getName()); XmlUtils.skipCurrentTag(parser); } } } catch (XmlPullParserException | java.io.IOException e) { Slog.wtf(GameManagerService.TAG, "Error reading package manager settings", e); return false; } return true; }
Read game service settings from the disk. This operation must be synced with an external lock.
GameManagerSettings::readPersistentDataLocked
java
Reginer/aosp-android-jar
android-33/src/com/android/server/app/GameManagerSettings.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/app/GameManagerSettings.java
MIT
public attrgetownerelement03(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException { super(factory); // // check if loaded documents are supported for content type // String contentType = getContentType(); preload(contentType, "staffNS", false); }
Constructor. @param factory document factory, may not be null @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
attrgetownerelement03::attrgetownerelement03
java
Reginer/aosp-android-jar
android-32/src/org/w3c/domts/level2/core/attrgetownerelement03.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level2/core/attrgetownerelement03.java
MIT
public void runTest() throws Throwable { Document doc; Node ownerElement; Attr attr; doc = (Document) load("staffNS", false); attr = doc.createAttributeNS("http://www.w3.org/DOM", "dom:attr"); ownerElement = attr.getOwnerElement(); assertNull("attrgetownerelement03", ownerElement); }
Runs the test case. @throws Throwable Any uncaught exception causes test to fail
attrgetownerelement03::runTest
java
Reginer/aosp-android-jar
android-32/src/org/w3c/domts/level2/core/attrgetownerelement03.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level2/core/attrgetownerelement03.java
MIT
public String getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/attrgetownerelement03"; }
Gets URI that identifies the test. @return uri identifier of test
attrgetownerelement03::getTargetURI
java
Reginer/aosp-android-jar
android-32/src/org/w3c/domts/level2/core/attrgetownerelement03.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level2/core/attrgetownerelement03.java
MIT
public static void main(final String[] args) { DOMTestCase.doMain(attrgetownerelement03.class, args); }
Runs this test from the command line. @param args command line arguments
attrgetownerelement03::main
java
Reginer/aosp-android-jar
android-32/src/org/w3c/domts/level2/core/attrgetownerelement03.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/org/w3c/domts/level2/core/attrgetownerelement03.java
MIT
public static ASN1Sequence getInstance( Object obj) { if (obj == null || obj instanceof ASN1Sequence) { return (ASN1Sequence)obj; } else if (obj instanceof ASN1SequenceParser) { return ASN1Sequence.getInstance(((ASN1SequenceParser)obj).toASN1Primitive()); } else if (obj instanceof byte[]) { try { return ASN1Sequence.getInstance(fromByteArray((byte[])obj)); } catch (IOException e) { throw new IllegalArgumentException("failed to construct sequence from byte[]: " + e.getMessage()); } } else if (obj instanceof ASN1Encodable) { ASN1Primitive primitive = ((ASN1Encodable)obj).toASN1Primitive(); if (primitive instanceof ASN1Sequence) { return (ASN1Sequence)primitive; } } throw new IllegalArgumentException("unknown object in getInstance: " + obj.getClass().getName()); }
Return an ASN1Sequence from the given object. @param obj the object we want converted. @exception IllegalArgumentException if the object cannot be converted. @return an ASN1Sequence instance, or null.
ASN1Sequence::getInstance
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
public static ASN1Sequence getInstance( ASN1TaggedObject taggedObject, boolean explicit) { if (explicit) { if (!taggedObject.isExplicit()) { throw new IllegalArgumentException("object implicit - explicit expected."); } return getInstance(taggedObject.getObject()); } ASN1Primitive o = taggedObject.getObject(); /* * constructed object which appears to be explicitly tagged when it should be implicit means * we have to add the surrounding sequence. */ if (taggedObject.isExplicit()) { if (taggedObject instanceof BERTaggedObject) { return new BERSequence(o); } return new DLSequence(o); } if (o instanceof ASN1Sequence) { ASN1Sequence s = (ASN1Sequence)o; if (taggedObject instanceof BERTaggedObject) { return s; } return (ASN1Sequence)s.toDLObject(); } throw new IllegalArgumentException("unknown object in getInstance: " + taggedObject.getClass().getName()); }
Return an ASN1 SEQUENCE from a tagged object. There is a special case here, if an object appears to have been explicitly tagged on reading but we were expecting it to be implicitly tagged in the normal course of events it indicates that we lost the surrounding sequence - so we need to add it back (this will happen if the tagged object is a sequence that contains other sequences). If you are dealing with implicitly tagged sequences you really <b>should</b> be using this method. @param taggedObject the tagged object. @param explicit true if the object is meant to be explicitly tagged, false otherwise. @exception IllegalArgumentException if the tagged object cannot be converted. @return an ASN1Sequence instance.
ASN1Sequence::getInstance
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
protected ASN1Sequence() { this.elements = ASN1EncodableVector.EMPTY_ELEMENTS; }
Create an empty SEQUENCE
ASN1Sequence::ASN1Sequence
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
protected ASN1Sequence(ASN1Encodable element) { if (null == element) { throw new NullPointerException("'element' cannot be null"); } this.elements = new ASN1Encodable[]{ element }; }
Create a SEQUENCE containing one object. @param element the object to be put in the SEQUENCE.
ASN1Sequence::ASN1Sequence
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
protected ASN1Sequence(ASN1EncodableVector elementVector) { if (null == elementVector) { throw new NullPointerException("'elementVector' cannot be null"); } this.elements = elementVector.takeElements(); }
Create a SEQUENCE containing a vector of objects. @param elementVector the vector of objects to be put in the SEQUENCE.
ASN1Sequence::ASN1Sequence
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
protected ASN1Sequence(ASN1Encodable[] elements) { if (Arrays.isNullOrContainsNull(elements)) { throw new NullPointerException("'elements' cannot be null, or contain null"); } this.elements = ASN1EncodableVector.cloneElements(elements); }
Create a SEQUENCE containing an array of objects. @param elements the array of objects to be put in the SEQUENCE.
ASN1Sequence::ASN1Sequence
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
public ASN1Encodable getObjectAt(int index) { return elements[index]; }
Return the object at the sequence position indicated by index. @param index the sequence number (starting at zero) of the object @return the object at the sequence position indicated by index.
ASN1Sequence::getObjectAt
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
public int size() { return elements.length; }
Return the number of objects in this sequence. @return the number of objects in this sequence.
ASN1Sequence::size
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
ASN1Primitive toDERObject() { return new DERSequence(elements, false); }
Change current SEQUENCE object to be encoded as {@link DERSequence}. This is part of Distinguished Encoding Rules form serialization.
ASN1Sequence::toDERObject
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
ASN1Primitive toDLObject() { return new DLSequence(elements, false); }
Change current SEQUENCE object to be encoded as {@link DLSequence}. This is part of Direct Length form serialization.
ASN1Sequence::toDLObject
java
Reginer/aosp-android-jar
android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/org/bouncycastle/asn1/ASN1Sequence.java
MIT
static String validatePrefix(String prefix, boolean namespaceAware, String namespaceURI) { if (!namespaceAware) { throw new DOMException(DOMException.NAMESPACE_ERR, prefix); } if (prefix != null) { if (namespaceURI == null || !DocumentImpl.isXMLIdentifier(prefix) || "xml".equals(prefix) && !"http://www.w3.org/XML/1998/namespace".equals(namespaceURI) || "xmlns".equals(prefix) && !"http://www.w3.org/2000/xmlns/".equals(namespaceURI)) { throw new DOMException(DOMException.NAMESPACE_ERR, prefix); } } return prefix; }
Validates the element or attribute namespace prefix on this node. @param namespaceAware whether this node is namespace aware @param namespaceURI this node's namespace URI
NodeImpl::validatePrefix
java
Reginer/aosp-android-jar
android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
MIT
static void setNameNS(NodeImpl node, String namespaceURI, String qualifiedName) { if (qualifiedName == null) { throw new DOMException(DOMException.NAMESPACE_ERR, qualifiedName); } String prefix = null; int p = qualifiedName.lastIndexOf(":"); if (p != -1) { prefix = validatePrefix(qualifiedName.substring(0, p), true, namespaceURI); qualifiedName = qualifiedName.substring(p + 1); } if (!DocumentImpl.isXMLIdentifier(qualifiedName)) { throw new DOMException(DOMException.INVALID_CHARACTER_ERR, qualifiedName); } switch (node.getNodeType()) { case ATTRIBUTE_NODE: if ("xmlns".equals(qualifiedName) && !"http://www.w3.org/2000/xmlns/".equals(namespaceURI)) { throw new DOMException(DOMException.NAMESPACE_ERR, qualifiedName); } AttrImpl attr = (AttrImpl) node; attr.namespaceAware = true; attr.namespaceURI = namespaceURI; attr.prefix = prefix; attr.localName = qualifiedName; break; case ELEMENT_NODE: ElementImpl element = (ElementImpl) node; element.namespaceAware = true; element.namespaceURI = namespaceURI; element.prefix = prefix; element.localName = qualifiedName; break; default: throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Cannot rename nodes of type " + node.getNodeType()); } }
Sets {@code node} to be namespace-aware and assigns its namespace URI and qualified name. @param node an element or attribute node. @param namespaceURI this node's namespace URI. May be null. @param qualifiedName a possibly-prefixed name like "img" or "html:img".
NodeImpl::setNameNS
java
Reginer/aosp-android-jar
android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
MIT
static void setName(NodeImpl node, String name) { int prefixSeparator = name.lastIndexOf(":"); if (prefixSeparator != -1) { String prefix = name.substring(0, prefixSeparator); String localName = name.substring(prefixSeparator + 1); if (!DocumentImpl.isXMLIdentifier(prefix) || !DocumentImpl.isXMLIdentifier(localName)) { throw new DOMException(DOMException.INVALID_CHARACTER_ERR, name); } } else if (!DocumentImpl.isXMLIdentifier(name)) { throw new DOMException(DOMException.INVALID_CHARACTER_ERR, name); } switch (node.getNodeType()) { case ATTRIBUTE_NODE: AttrImpl attr = (AttrImpl) node; attr.namespaceAware = false; attr.localName = name; break; case ELEMENT_NODE: ElementImpl element = (ElementImpl) node; element.namespaceAware = false; element.localName = name; break; default: throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Cannot rename nodes of type " + node.getNodeType()); } }
Sets {@code node} to be not namespace-aware and assigns its name. @param node an element or attribute node.
NodeImpl::setName
java
Reginer/aosp-android-jar
android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
MIT
private String sanitizeUri(String uri) { if (uri == null || uri.length() == 0) { return null; } try { return new URI(uri).toString(); } catch (URISyntaxException e) { return null; } }
Returns the sanitized input if it is a URI, or {@code null} otherwise.
NodeImpl::sanitizeUri
java
Reginer/aosp-android-jar
android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
MIT
private NodeImpl getNamespacingElement() { switch (this.getNodeType()) { case ELEMENT_NODE: return this; case DOCUMENT_NODE: return (NodeImpl) ((Document) this).getDocumentElement(); case ENTITY_NODE: case NOTATION_NODE: case DOCUMENT_FRAGMENT_NODE: case DOCUMENT_TYPE_NODE: return null; case ATTRIBUTE_NODE: return (NodeImpl) ((Attr) this).getOwnerElement(); case TEXT_NODE: case CDATA_SECTION_NODE: case ENTITY_REFERENCE_NODE: case PROCESSING_INSTRUCTION_NODE: case COMMENT_NODE: return getContainingElement(); default: throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Unsupported node type " + getNodeType()); } }
Returns the element whose namespace definitions apply to this node. Use this element when mapping prefixes to URIs and vice versa.
NodeImpl::getNamespacingElement
java
Reginer/aosp-android-jar
android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
MIT
private NodeImpl getContainingElement() { for (Node p = getParentNode(); p != null; p = p.getParentNode()) { if (p.getNodeType() == ELEMENT_NODE) { return (NodeImpl) p; } } return null; }
Returns the nearest ancestor element that contains this node.
NodeImpl::getContainingElement
java
Reginer/aosp-android-jar
android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
MIT
boolean isPrefixMappedToUri(String prefix, String uri) { if (prefix == null) { return false; } String actual = lookupNamespaceURI(prefix); return uri.equals(actual); }
Returns true if the given prefix is mapped to the given URI on this element. Since child elements can redefine prefixes, this check is necessary: {@code <foo xmlns:a="http://good"> <bar xmlns:a="http://evil"> <a:baz /> </bar> </foo>} @param prefix the prefix to find. Nullable. @param uri the URI to match. Non-null.
NodeImpl::isPrefixMappedToUri
java
Reginer/aosp-android-jar
android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
MIT
private static List<Object> createEqualityKey(Node node) { List<Object> values = new ArrayList<Object>(); values.add(node.getNodeType()); values.add(node.getNodeName()); values.add(node.getLocalName()); values.add(node.getNamespaceURI()); values.add(node.getPrefix()); values.add(node.getNodeValue()); for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) { values.add(child); } switch (node.getNodeType()) { case DOCUMENT_TYPE_NODE: DocumentTypeImpl doctype = (DocumentTypeImpl) node; values.add(doctype.getPublicId()); values.add(doctype.getSystemId()); values.add(doctype.getInternalSubset()); values.add(doctype.getEntities()); values.add(doctype.getNotations()); break; case ELEMENT_NODE: Element element = (Element) node; values.add(element.getAttributes()); break; } return values; }
Returns a list of objects such that two nodes are equal if their lists are equal. Be careful: the lists may contain NamedNodeMaps and Nodes, neither of which override Object.equals(). Such values must be compared manually.
NodeImpl::createEqualityKey
java
Reginer/aosp-android-jar
android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/harmony/xml/dom/NodeImpl.java
MIT
public Collection<MatchInfo> getMatches() { if (_matches == null) { return Collections.emptyList(); } return _matches; }
Returns the match results @return the match results
TZDBNameSearchHandler::getMatches
java
Reginer/aosp-android-jar
android-34/src/android/icu/impl/TZDBTimeZoneNames.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/impl/TZDBTimeZoneNames.java
MIT
public DEROctetString( ASN1Encodable obj) throws IOException { super(obj.toASN1Primitive().getEncoded(ASN1Encoding.DER)); }
Constructor from the encoding of an ASN.1 object. @param obj the object to be encoded.
DEROctetString::DEROctetString
java
Reginer/aosp-android-jar
android-35/src/com/android/org/bouncycastle/asn1/DEROctetString.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/org/bouncycastle/asn1/DEROctetString.java
MIT
ResolutionMechanism(){}
@hide
ResolutionMechanism::ResolutionMechanism
java
Reginer/aosp-android-jar
android-34/src/android/app/admin/ResolutionMechanism.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/app/admin/ResolutionMechanism.java
MIT
public JsonWriter(Writer out) { if (out == null) { throw new NullPointerException("out == null"); } this.out = out; }
Creates a new instance that writes a JSON-encoded stream to {@code out}. For best performance, ensure {@link Writer} is buffered; wrapping in {@link java.io.BufferedWriter BufferedWriter} if necessary.
JsonWriter::JsonWriter
java
Reginer/aosp-android-jar
android-33/src/android/util/JsonWriter.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/util/JsonWriter.java
MIT
public void setIndent(String indent) { if (indent.isEmpty()) { this.indent = null; this.separator = ":"; } else { this.indent = indent; this.separator = ": "; } }
Sets the indentation string to be repeated for each level of indentation in the encoded document. If {@code indent.isEmpty()} the encoded document will be compact. Otherwise the encoded document will be more human-readable. @param indent a string containing only whitespace.
JsonWriter::setIndent
java
Reginer/aosp-android-jar
android-33/src/android/util/JsonWriter.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/util/JsonWriter.java
MIT
public void setLenient(boolean lenient) { this.lenient = lenient; }
Configure this writer to relax its syntax rules. By default, this writer only emits well-formed JSON as specified by <a href="http://www.ietf.org/rfc/rfc4627.txt">RFC 4627</a>. Setting the writer to lenient permits the following: <ul> <li>Top-level values of any type. With strict writing, the top-level value must be an object or an array. <li>Numbers may be {@link Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}. </ul>
JsonWriter::setLenient
java
Reginer/aosp-android-jar
android-33/src/android/util/JsonWriter.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/util/JsonWriter.java
MIT
public boolean isLenient() { return lenient; }
Returns true if this writer has relaxed syntax rules.
JsonWriter::isLenient
java
Reginer/aosp-android-jar
android-33/src/android/util/JsonWriter.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/util/JsonWriter.java
MIT
public JsonWriter beginArray() throws IOException { return open(JsonScope.EMPTY_ARRAY, "["); }
Begins encoding a new array. Each call to this method must be paired with a call to {@link #endArray}. @return this writer.
JsonWriter::beginArray
java
Reginer/aosp-android-jar
android-33/src/android/util/JsonWriter.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/util/JsonWriter.java
MIT
public JsonWriter endArray() throws IOException { return close(JsonScope.EMPTY_ARRAY, JsonScope.NONEMPTY_ARRAY, "]"); }
Ends encoding the current array. @return this writer.
JsonWriter::endArray
java
Reginer/aosp-android-jar
android-33/src/android/util/JsonWriter.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/util/JsonWriter.java
MIT
public JsonWriter beginObject() throws IOException { return open(JsonScope.EMPTY_OBJECT, "{"); }
Begins encoding a new object. Each call to this method must be paired with a call to {@link #endObject}. @return this writer.
JsonWriter::beginObject
java
Reginer/aosp-android-jar
android-33/src/android/util/JsonWriter.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/util/JsonWriter.java
MIT
public JsonWriter endObject() throws IOException { return close(JsonScope.EMPTY_OBJECT, JsonScope.NONEMPTY_OBJECT, "}"); }
Ends encoding the current object. @return this writer.
JsonWriter::endObject
java
Reginer/aosp-android-jar
android-33/src/android/util/JsonWriter.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/util/JsonWriter.java
MIT
private JsonWriter open(JsonScope empty, String openBracket) throws IOException { beforeValue(true); stack.add(empty); out.write(openBracket); return this; }
Enters a new scope by appending any necessary whitespace and the given bracket.
JsonWriter::open
java
Reginer/aosp-android-jar
android-33/src/android/util/JsonWriter.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/util/JsonWriter.java
MIT