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 void clearConnections() { synchronized (mLock) { mConnections.clear(); } }
clearConnection
SrvccState::clearConnections
java
Reginer/aosp-android-jar
android-35/src/com/android/internal/telephony/Call.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/internal/telephony/Call.java
MIT
public List<ConferenceParticipant> getConferenceParticipants() { return null; }
getConferenceParticipants @return List of conference participants.
SrvccState::getConferenceParticipants
java
Reginer/aosp-android-jar
android-35/src/com/android/internal/telephony/Call.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/internal/telephony/Call.java
MIT
public void hangupIfAlive() { if (getState().isAlive()) { try { hangup(); } catch (CallStateException ex) { Rlog.w(LOG_TAG, " hangupIfActive: caught " + ex); } } }
Hangup call if it is alive
SrvccState::hangupIfAlive
java
Reginer/aosp-android-jar
android-35/src/com/android/internal/telephony/Call.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/internal/telephony/Call.java
MIT
public void clearDisconnected() { for (Connection conn : getConnections()) { if (conn.getState() == State.DISCONNECTED) { removeConnection(conn); } } if (getConnectionsCount() == 0) { setState(State.IDLE); } }
Called when it's time to clean up disconnected Connection objects
SrvccState::clearDisconnected
java
Reginer/aosp-android-jar
android-35/src/com/android/internal/telephony/Call.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/internal/telephony/Call.java
MIT
public static boolean isFillDialogEnabled() { return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_AUTOFILL_DIALOG_ENABLED, DEFAULT_HAS_FILL_DIALOG_UI_FEATURE); }
Whether the fill dialog feature is enabled or not @hide
AutofillFeatureFlags::isFillDialogEnabled
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static String[] getFillDialogEnabledHints() { final String dialogHints = DeviceConfig.getString( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_AUTOFILL_DIALOG_HINTS, DEFAULT_FILL_DIALOG_ENABLED_HINTS); if (TextUtils.isEmpty(dialogHints)) { return new String[0]; } return ArrayUtils.filter(dialogHints.split(DIALOG_HINTS_DELIMITER), String[]::new, (str) -> !TextUtils.isEmpty(str)); }
Gets fill dialog enabled hints. @hide
AutofillFeatureFlags::getFillDialogEnabledHints
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static boolean isFillAndSaveDialogDisabledForCredentialManager() { return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_AUTOFILL_CREDENTIAL_MANAGER_SUPPRESS_FILL_AND_SAVE_DIALOG, DEFAULT_CREDENTIAL_MANAGER_SUPPRESS_FILL_AND_SAVE_DIALOG); }
Whether credential manager tagged views should not trigger fill dialog requests. @hide
AutofillFeatureFlags::isFillAndSaveDialogDisabledForCredentialManager
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static boolean isTriggerFillRequestOnUnimportantViewEnabled() { return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_TRIGGER_FILL_REQUEST_ON_UNIMPORTANT_VIEW, DEFAULT_AFAA_ON_UNIMPORTANT_VIEW_ENABLED); }
Whether triggering fill request on unimportant view is enabled. @hide
AutofillFeatureFlags::isTriggerFillRequestOnUnimportantViewEnabled
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static boolean isTriggerFillRequestOnFilteredImportantViewsEnabled() { return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_TRIGGER_FILL_REQUEST_ON_FILTERED_IMPORTANT_VIEWS, DEFAULT_AFAA_ON_IMPORTANT_VIEW_ENABLED); }
Whether to apply heuristic check on important views before triggering fill request @hide
AutofillFeatureFlags::isTriggerFillRequestOnFilteredImportantViewsEnabled
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static boolean shouldEnableAutofillOnAllViewTypes(){ return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_SHOULD_ENABLE_AUTOFILL_ON_ALL_VIEW_TYPES, DEFAULT_AFAA_SHOULD_ENABLE_AUTOFILL_ON_ALL_VIEW_TYPES); }
Whether to enable autofill on all view types. @hide
AutofillFeatureFlags::shouldEnableAutofillOnAllViewTypes
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static Set<String> getNonAutofillableImeActionIdSetFromFlag() { final String mNonAutofillableImeActions = DeviceConfig.getString( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_NON_AUTOFILLABLE_IME_ACTION_IDS, DEFAULT_AFAA_NON_AUTOFILLABLE_IME_ACTIONS); return new ArraySet<>(Arrays.asList(mNonAutofillableImeActions.split(","))); }
Get the non-autofillable ime actions from flag. This will be used in filtering condition to trigger fill request. @hide
AutofillFeatureFlags::getNonAutofillableImeActionIdSetFromFlag
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static String getDenylistStringFromFlag() { return DeviceConfig.getString( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_PACKAGE_DENYLIST_FOR_UNIMPORTANT_VIEW, DEFAULT_AFAA_DENYLIST); }
Get denylist string from flag. Note: This denylist works both on important view and not important views. The flag used here is legacy flag which will be replaced with soon. @hide
AutofillFeatureFlags::getDenylistStringFromFlag
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static String getAllowlistStringFromFlag() { return DeviceConfig.getString( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_PACKAGE_AND_ACTIVITY_ALLOWLIST_FOR_TRIGGERING_FILL_REQUEST, DEFAULT_AFAA_ALLOWLIST); }
Get autofill allowlist from flag @hide
AutofillFeatureFlags::getAllowlistStringFromFlag
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static boolean shouldIncludeAllViewsAutofillTypeNotNoneInAssistStructrue() { return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_INCLUDE_ALL_AUTOFILL_TYPE_NOT_NONE_VIEWS_IN_ASSIST_STRUCTURE, false); }
Whether include all views that have autofill type not none in assist structure. @hide
AutofillFeatureFlags::shouldIncludeAllViewsAutofillTypeNotNoneInAssistStructrue
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static boolean shouldIncludeAllChildrenViewInAssistStructure() { return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_INCLUDE_ALL_VIEWS_IN_ASSIST_STRUCTURE, false); }
Whether include all views in assist structure. @hide
AutofillFeatureFlags::shouldIncludeAllChildrenViewInAssistStructure
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static boolean shouldEnableMultilineFilter() { return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_MULTILINE_FILTER_ENABLED, DEFAULT_AFAA_SHOULD_ENABLE_MULTILINE_FILTER); }
Whether should enable multi-line filter @hide
AutofillFeatureFlags::shouldEnableMultilineFilter
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
public static boolean isAutofillPccClassificationEnabled() { // TODO(b/266379948): Add condition for checking whether device has PCC first return DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_AUTOFILL, DEVICE_CONFIG_AUTOFILL_PCC_CLASSIFICATION_ENABLED, DEFAULT_AUTOFILL_PCC_CLASSIFICATION_ENABLED); }
Whether Autofill PCC Detection is enabled. @hide
AutofillFeatureFlags::isAutofillPccClassificationEnabled
java
Reginer/aosp-android-jar
android-34/src/android/view/autofill/AutofillFeatureFlags.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/autofill/AutofillFeatureFlags.java
MIT
boolean printDuration(IndentingPrintWriter pw, long period, long duration, int count, String suffix) { float fraction = duration / (float) period; int percent = (int) ((fraction * 100) + .5f); if (percent > 0) { pw.print(percent); pw.print("% "); pw.print(count); pw.print("x "); pw.print(suffix); return true; } else if (count > 0) { pw.print(count); pw.print("x "); pw.print(suffix); return true; } return false; }
/* Copyright (C) 2016 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.job; import static com.android.server.job.JobSchedulerService.sElapsedRealtimeClock; import static com.android.server.job.JobSchedulerService.sSystemClock; import static com.android.server.job.JobSchedulerService.sUptimeMillisClock; import android.app.job.JobInfo; import android.app.job.JobParameters; import android.os.UserHandle; import android.text.format.DateFormat; import android.util.ArrayMap; import android.util.IndentingPrintWriter; import android.util.SparseArray; import android.util.SparseIntArray; import android.util.TimeUtils; import android.util.proto.ProtoOutputStream; import com.android.internal.util.RingBufferIndices; import com.android.server.job.controllers.JobStatus; public final class JobPackageTracker { // We batch every 30 minutes. static final long BATCHING_TIME = 30*60*1000; // Number of historical data sets we keep. static final int NUM_HISTORY = 5; private static final int EVENT_BUFFER_SIZE = 100; public static final int EVENT_CMD_MASK = 0xff; public static final int EVENT_STOP_REASON_SHIFT = 8; public static final int EVENT_STOP_REASON_MASK = 0xff << EVENT_STOP_REASON_SHIFT; public static final int EVENT_NULL = 0; public static final int EVENT_START_JOB = 1; public static final int EVENT_STOP_JOB = 2; public static final int EVENT_START_PERIODIC_JOB = 3; public static final int EVENT_STOP_PERIODIC_JOB = 4; private final RingBufferIndices mEventIndices = new RingBufferIndices(EVENT_BUFFER_SIZE); private final int[] mEventCmds = new int[EVENT_BUFFER_SIZE]; private final long[] mEventTimes = new long[EVENT_BUFFER_SIZE]; private final int[] mEventUids = new int[EVENT_BUFFER_SIZE]; private final String[] mEventTags = new String[EVENT_BUFFER_SIZE]; private final int[] mEventJobIds = new int[EVENT_BUFFER_SIZE]; private final String[] mEventReasons = new String[EVENT_BUFFER_SIZE]; public void addEvent(int cmd, int uid, String tag, int jobId, int stopReason, String debugReason) { int index = mEventIndices.add(); mEventCmds[index] = cmd | ((stopReason<<EVENT_STOP_REASON_SHIFT) & EVENT_STOP_REASON_MASK); mEventTimes[index] = sElapsedRealtimeClock.millis(); mEventUids[index] = uid; mEventTags[index] = tag; mEventJobIds[index] = jobId; mEventReasons[index] = debugReason; } DataSet mCurDataSet = new DataSet(); DataSet[] mLastDataSets = new DataSet[NUM_HISTORY]; final static class PackageEntry { long pastActiveTime; long activeStartTime; int activeNesting; int activeCount; boolean hadActive; long pastActiveTopTime; long activeTopStartTime; int activeTopNesting; int activeTopCount; boolean hadActiveTop; long pastPendingTime; long pendingStartTime; int pendingNesting; int pendingCount; boolean hadPending; final SparseIntArray stopReasons = new SparseIntArray(); public long getActiveTime(long now) { long time = pastActiveTime; if (activeNesting > 0) { time += now - activeStartTime; } return time; } public long getActiveTopTime(long now) { long time = pastActiveTopTime; if (activeTopNesting > 0) { time += now - activeTopStartTime; } return time; } public long getPendingTime(long now) { long time = pastPendingTime; if (pendingNesting > 0) { time += now - pendingStartTime; } return time; } } final static class DataSet { final SparseArray<ArrayMap<String, PackageEntry>> mEntries = new SparseArray<>(); final long mStartUptimeTime; final long mStartElapsedTime; final long mStartClockTime; long mSummedTime; int mMaxTotalActive; int mMaxFgActive; public DataSet(DataSet otherTimes) { mStartUptimeTime = otherTimes.mStartUptimeTime; mStartElapsedTime = otherTimes.mStartElapsedTime; mStartClockTime = otherTimes.mStartClockTime; } public DataSet() { mStartUptimeTime = sUptimeMillisClock.millis(); mStartElapsedTime = sElapsedRealtimeClock.millis(); mStartClockTime = sSystemClock.millis(); } private PackageEntry getOrCreateEntry(int uid, String pkg) { ArrayMap<String, PackageEntry> uidMap = mEntries.get(uid); if (uidMap == null) { uidMap = new ArrayMap<>(); mEntries.put(uid, uidMap); } PackageEntry entry = uidMap.get(pkg); if (entry == null) { entry = new PackageEntry(); uidMap.put(pkg, entry); } return entry; } public PackageEntry getEntry(int uid, String pkg) { ArrayMap<String, PackageEntry> uidMap = mEntries.get(uid); if (uidMap == null) { return null; } return uidMap.get(pkg); } long getTotalTime(long now) { if (mSummedTime > 0) { return mSummedTime; } return now - mStartUptimeTime; } void incPending(int uid, String pkg, long now) { PackageEntry pe = getOrCreateEntry(uid, pkg); if (pe.pendingNesting == 0) { pe.pendingStartTime = now; pe.pendingCount++; } pe.pendingNesting++; } void decPending(int uid, String pkg, long now) { PackageEntry pe = getOrCreateEntry(uid, pkg); if (pe.pendingNesting == 1) { pe.pastPendingTime += now - pe.pendingStartTime; } pe.pendingNesting--; } void incActive(int uid, String pkg, long now) { PackageEntry pe = getOrCreateEntry(uid, pkg); if (pe.activeNesting == 0) { pe.activeStartTime = now; pe.activeCount++; } pe.activeNesting++; } void decActive(int uid, String pkg, long now, int stopReason) { PackageEntry pe = getOrCreateEntry(uid, pkg); if (pe.activeNesting == 1) { pe.pastActiveTime += now - pe.activeStartTime; } pe.activeNesting--; int count = pe.stopReasons.get(stopReason, 0); pe.stopReasons.put(stopReason, count+1); } void incActiveTop(int uid, String pkg, long now) { PackageEntry pe = getOrCreateEntry(uid, pkg); if (pe.activeTopNesting == 0) { pe.activeTopStartTime = now; pe.activeTopCount++; } pe.activeTopNesting++; } void decActiveTop(int uid, String pkg, long now, int stopReason) { PackageEntry pe = getOrCreateEntry(uid, pkg); if (pe.activeTopNesting == 1) { pe.pastActiveTopTime += now - pe.activeTopStartTime; } pe.activeTopNesting--; int count = pe.stopReasons.get(stopReason, 0); pe.stopReasons.put(stopReason, count+1); } void finish(DataSet next, long now) { for (int i = mEntries.size() - 1; i >= 0; i--) { ArrayMap<String, PackageEntry> uidMap = mEntries.valueAt(i); for (int j = uidMap.size() - 1; j >= 0; j--) { PackageEntry pe = uidMap.valueAt(j); if (pe.activeNesting > 0 || pe.activeTopNesting > 0 || pe.pendingNesting > 0) { // Propagate existing activity in to next data set. PackageEntry nextPe = next.getOrCreateEntry(mEntries.keyAt(i), uidMap.keyAt(j)); nextPe.activeStartTime = now; nextPe.activeNesting = pe.activeNesting; nextPe.activeTopStartTime = now; nextPe.activeTopNesting = pe.activeTopNesting; nextPe.pendingStartTime = now; nextPe.pendingNesting = pe.pendingNesting; // Finish it off. if (pe.activeNesting > 0) { pe.pastActiveTime += now - pe.activeStartTime; pe.activeNesting = 0; } if (pe.activeTopNesting > 0) { pe.pastActiveTopTime += now - pe.activeTopStartTime; pe.activeTopNesting = 0; } if (pe.pendingNesting > 0) { pe.pastPendingTime += now - pe.pendingStartTime; pe.pendingNesting = 0; } } } } } void addTo(DataSet out, long now) { out.mSummedTime += getTotalTime(now); for (int i = mEntries.size() - 1; i >= 0; i--) { ArrayMap<String, PackageEntry> uidMap = mEntries.valueAt(i); for (int j = uidMap.size() - 1; j >= 0; j--) { PackageEntry pe = uidMap.valueAt(j); PackageEntry outPe = out.getOrCreateEntry(mEntries.keyAt(i), uidMap.keyAt(j)); outPe.pastActiveTime += pe.pastActiveTime; outPe.activeCount += pe.activeCount; outPe.pastActiveTopTime += pe.pastActiveTopTime; outPe.activeTopCount += pe.activeTopCount; outPe.pastPendingTime += pe.pastPendingTime; outPe.pendingCount += pe.pendingCount; if (pe.activeNesting > 0) { outPe.pastActiveTime += now - pe.activeStartTime; outPe.hadActive = true; } if (pe.activeTopNesting > 0) { outPe.pastActiveTopTime += now - pe.activeTopStartTime; outPe.hadActiveTop = true; } if (pe.pendingNesting > 0) { outPe.pastPendingTime += now - pe.pendingStartTime; outPe.hadPending = true; } for (int k = pe.stopReasons.size()-1; k >= 0; k--) { int type = pe.stopReasons.keyAt(k); outPe.stopReasons.put(type, outPe.stopReasons.get(type, 0) + pe.stopReasons.valueAt(k)); } } } if (mMaxTotalActive > out.mMaxTotalActive) { out.mMaxTotalActive = mMaxTotalActive; } if (mMaxFgActive > out.mMaxFgActive) { out.mMaxFgActive = mMaxFgActive; } } /** Return {@code true} if text was printed.
DataSet::printDuration
java
Reginer/aosp-android-jar
android-32/src/com/android/server/job/JobPackageTracker.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/server/job/JobPackageTracker.java
MIT
public static void setWindowImmersiveMode(Window window, String immersiveModeValue) { Preconditions.checkNotNull(window); ImmersiveModeTypes immersiveModeType; try { immersiveModeType = ImmersiveModeTypes.valueOf(immersiveModeValue); } catch (IllegalArgumentException | NullPointerException e) { Log.w(TAG, "Immersive Mode value: " + immersiveModeValue + " not valid, using IMMERSIVE"); immersiveModeType = ImmersiveModeTypes.IMMERSIVE; } Log.v(TAG, "Enable " + immersiveModeType + " mode"); switch (immersiveModeType) { case IMMERSIVE: enableImmersiveMode(window); window.getDecorView().setOnSystemUiVisibilityChangeListener( visibility -> enableImmersiveMode(window)); break; case IMMERSIVE_WITH_STATUS: enableImmersiveModeWithStatus(window); window.getDecorView().setOnSystemUiVisibilityChangeListener( visibility -> enableImmersiveModeWithStatus(window)); break; case NON_IMMERSIVE: disableImmersiveMode(window); window.getDecorView().setOnSystemUiVisibilityChangeListener( visibility -> disableImmersiveMode(window)); break; case SYSTEM_DEFAULT: //SUW won't change the current immersive mode. break; } }
Set the appropriate immersive mode according to immersiveModeValue
getSimpleName::setWindowImmersiveMode
java
Reginer/aosp-android-jar
android-31/src/com/android/car/setupwizardlib/util/CarSetupWizardUiUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/car/setupwizardlib/util/CarSetupWizardUiUtils.java
MIT
private static void enableImmersiveModeWithStatus(Window window) { if (Log.isLoggable(TAG, Log.INFO)) { Log.i(TAG, "enableImmersiveModeWithStatus"); } Preconditions.checkNotNull(window); // See https://developer.android.com/training/system-ui/immersive#EnableFullscreen // Enables regular immersive mode. window.getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_IMMERSIVE // Set the content to appear under the system bars so that the // content doesn't resize when the system bars hide and show. | View.SYSTEM_UI_FLAG_LAYOUT_STABLE // Hide the nav bar | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); }
Enables immersive mode hiding only navigation bar. @param window to apply immersive mode.
getSimpleName::enableImmersiveModeWithStatus
java
Reginer/aosp-android-jar
android-31/src/com/android/car/setupwizardlib/util/CarSetupWizardUiUtils.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/car/setupwizardlib/util/CarSetupWizardUiUtils.java
MIT
private Region () {}
Type representing a region whose code has been deprecated, usually due to a country splitting into multiple territories or changing its name. DEPRECATED, } private String id; private int code; private RegionType type; private Region containingRegion = null; private Set<Region> containedRegions = new TreeSet<Region>(); private List<Region> preferredValues = null; private static boolean regionDataIsLoaded = false; private static Map<String,Region> regionIDMap = null; // Map from ID the regions private static Map<Integer,Region> numericCodeMap = null; // Map from numeric code to the regions private static Map<String,Region> regionAliases = null; // Aliases private static ArrayList<Region> regions = null; // This is the main data structure where the Regions are stored. private static ArrayList<Set<Region>> availableRegions = null; private static final String UNKNOWN_REGION_ID = "ZZ"; private static final String OUTLYING_OCEANIA_REGION_ID = "QO"; private static final String WORLD_ID = "001"; /* Private default constructor. Use factory methods only.
RegionType::Region
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/Region.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/Region.java
MIT
private static synchronized void loadRegionData() { if ( regionDataIsLoaded ) { return; } regionAliases = new HashMap<String,Region>(); regionIDMap = new HashMap<String,Region>(); numericCodeMap = new HashMap<Integer,Region>(); availableRegions = new ArrayList<Set<Region>>(RegionType.values().length); UResourceBundle metadataAlias = null; UResourceBundle territoryAlias = null; UResourceBundle codeMappings = null; UResourceBundle idValidity = null; UResourceBundle regionList = null; UResourceBundle regionRegular = null; UResourceBundle regionMacro = null; UResourceBundle regionUnknown = null; UResourceBundle worldContainment = null; UResourceBundle territoryContainment = null; UResourceBundle groupingContainment = null; UResourceBundle metadata = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,"metadata",ICUResourceBundle.ICU_DATA_CLASS_LOADER); metadataAlias = metadata.get("alias"); territoryAlias = metadataAlias.get("territory"); UResourceBundle supplementalData = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,"supplementalData", ICUResourceBundle.ICU_DATA_CLASS_LOADER); codeMappings = supplementalData.get("codeMappings"); idValidity = supplementalData.get("idValidity"); regionList = idValidity.get("region"); regionRegular = regionList.get("regular"); regionMacro = regionList.get("macroregion"); regionUnknown = regionList.get("unknown"); territoryContainment = supplementalData.get("territoryContainment"); worldContainment = territoryContainment.get("001"); groupingContainment = territoryContainment.get("grouping"); String[] continentsArr = worldContainment.getStringArray(); List<String> continents = Arrays.asList(continentsArr); Enumeration<String> groupings = groupingContainment.getKeys(); List<String> regionCodes = new ArrayList<String>(); List<String> allRegions = new ArrayList<String>(); allRegions.addAll(Arrays.asList(regionRegular.getStringArray())); allRegions.addAll(Arrays.asList(regionMacro.getStringArray())); allRegions.add(regionUnknown.getString()); for ( String r : allRegions ) { int rangeMarkerLocation = r.indexOf("~"); if ( rangeMarkerLocation > 0 ) { StringBuilder regionName = new StringBuilder(r); char endRange = regionName.charAt(rangeMarkerLocation+1); regionName.setLength(rangeMarkerLocation); char lastChar = regionName.charAt(rangeMarkerLocation-1); while ( lastChar <= endRange ) { String newRegion = regionName.toString(); regionCodes.add(newRegion); lastChar++; regionName.setCharAt(rangeMarkerLocation-1,lastChar); } } else { regionCodes.add(r); } } regions = new ArrayList<Region>(regionCodes.size()); // First process the region codes and create the primary array of regions. for ( String id : regionCodes) { Region r = new Region(); r.id = id; r.type = RegionType.TERRITORY; // Only temporary - figure out the real type later once the aliases are known. regionIDMap.put(id, r); if ( id.matches("[0-9]{3}")) { r.code = Integer.valueOf(id).intValue(); numericCodeMap.put(r.code, r); r.type = RegionType.SUBCONTINENT; } else { r.code = -1; } regions.add(r); } // Process the territory aliases for ( int i = 0 ; i < territoryAlias.getSize(); i++ ) { UResourceBundle res = territoryAlias.get(i); String aliasFrom = res.getKey(); String aliasTo = res.get("replacement").getString(); if ( regionIDMap.containsKey(aliasTo) && !regionIDMap.containsKey(aliasFrom) ) { // This is just an alias from some string to a region regionAliases.put(aliasFrom, regionIDMap.get(aliasTo)); } else { Region r; if ( regionIDMap.containsKey(aliasFrom) ) { // This is a deprecated region r = regionIDMap.get(aliasFrom); } else { // Deprecated region code not in the primary codes list - so need to create a deprecated region for it. r = new Region(); r.id = aliasFrom; regionIDMap.put(aliasFrom, r); if ( aliasFrom.matches("[0-9]{3}")) { r.code = Integer.valueOf(aliasFrom).intValue(); numericCodeMap.put(r.code, r); } else { r.code = -1; } regions.add(r); } r.type = RegionType.DEPRECATED; List<String> aliasToRegionStrings = Arrays.asList(aliasTo.split(" ")); r.preferredValues = new ArrayList<Region>(); for ( String s : aliasToRegionStrings ) { if (regionIDMap.containsKey(s)) { r.preferredValues.add(regionIDMap.get(s)); } } } } // Process the code mappings - This will allow us to assign numeric codes to most of the territories. for ( int i = 0 ; i < codeMappings.getSize(); i++ ) { UResourceBundle mapping = codeMappings.get(i); if ( mapping.getType() == UResourceBundle.ARRAY ) { String [] codeMappingStrings = mapping.getStringArray(); String codeMappingID = codeMappingStrings[0]; Integer codeMappingNumber = Integer.valueOf(codeMappingStrings[1]); String codeMapping3Letter = codeMappingStrings[2]; if ( regionIDMap.containsKey(codeMappingID)) { Region r = regionIDMap.get(codeMappingID); r.code = codeMappingNumber.intValue(); numericCodeMap.put(r.code, r); regionAliases.put(codeMapping3Letter, r); } } } // Now fill in the special cases for WORLD, UNKNOWN, CONTINENTS, and GROUPINGS Region r; if ( regionIDMap.containsKey(WORLD_ID)) { r = regionIDMap.get(WORLD_ID); r.type = RegionType.WORLD; } if ( regionIDMap.containsKey(UNKNOWN_REGION_ID)) { r = regionIDMap.get(UNKNOWN_REGION_ID); r.type = RegionType.UNKNOWN; } for ( String continent : continents ) { if (regionIDMap.containsKey(continent)) { r = regionIDMap.get(continent); r.type = RegionType.CONTINENT; } } while ( groupings.hasMoreElements() ) { String grouping = groupings.nextElement(); if (regionIDMap.containsKey(grouping)) { r = regionIDMap.get(grouping); r.type = RegionType.GROUPING; } } // Special case: The region code "QO" (Outlying Oceania) is a subcontinent code added by CLDR // even though it looks like a territory code. Need to handle it here. if ( regionIDMap.containsKey(OUTLYING_OCEANIA_REGION_ID)) { r = regionIDMap.get(OUTLYING_OCEANIA_REGION_ID); r.type = RegionType.SUBCONTINENT; } // Load territory containment info from the supplemental data. for ( int i = 0 ; i < territoryContainment.getSize(); i++ ) { UResourceBundle mapping = territoryContainment.get(i); String parent = mapping.getKey(); if (parent.equals("containedGroupings") || parent.equals("deprecated") || parent.equals("grouping")) { continue; // handle new pseudo-parent types added in ICU data per cldrbug 7808; for now just skip. // #11232 is to do something useful with these. // Also skip "grouping" which has multi-level structure below from CLDR 34. } Region parentRegion = regionIDMap.get(parent); for ( int j = 0 ; j < mapping.getSize(); j++ ) { String child = mapping.getString(j); Region childRegion = regionIDMap.get(child); if ( parentRegion != null && childRegion != null ) { // Add the child region to the set of regions contained by the parent parentRegion.containedRegions.add(childRegion); // Set the parent region to be the containing region of the child. // Regions of type GROUPING can't be set as the parent, since another region // such as a SUBCONTINENT, CONTINENT, or WORLD must always be the parent. if ( parentRegion.getType() != RegionType.GROUPING) { childRegion.containingRegion = parentRegion; } } } } // Fill in the grouping containment resource as well for ( int i = 0 ; i < groupingContainment.getSize(); i++ ) { UResourceBundle mapping = groupingContainment.get(i); String parent = mapping.getKey(); Region parentRegion = regionIDMap.get(parent); for ( int j = 0 ; j < mapping.getSize(); j++ ) { String child = mapping.getString(j); Region childRegion = regionIDMap.get(child); if ( parentRegion != null && childRegion != null ) { // Add the child region to the set of regions contained by the parent parentRegion.containedRegions.add(childRegion); // Do NOT change the parent of the child region, since groupings are // never the primary parent of a region. } } } // Create the availableRegions lists for (int i = 0 ; i < RegionType.values().length ; i++) { availableRegions.add(new TreeSet<Region>()); } for ( Region ar : regions ) { Set<Region> currentSet = availableRegions.get(ar.type.ordinal()); currentSet.add(ar); availableRegions.set(ar.type.ordinal(),currentSet); } regionDataIsLoaded = true; }
Type representing a region whose code has been deprecated, usually due to a country splitting into multiple territories or changing its name. DEPRECATED, } private String id; private int code; private RegionType type; private Region containingRegion = null; private Set<Region> containedRegions = new TreeSet<Region>(); private List<Region> preferredValues = null; private static boolean regionDataIsLoaded = false; private static Map<String,Region> regionIDMap = null; // Map from ID the regions private static Map<Integer,Region> numericCodeMap = null; // Map from numeric code to the regions private static Map<String,Region> regionAliases = null; // Aliases private static ArrayList<Region> regions = null; // This is the main data structure where the Regions are stored. private static ArrayList<Set<Region>> availableRegions = null; private static final String UNKNOWN_REGION_ID = "ZZ"; private static final String OUTLYING_OCEANIA_REGION_ID = "QO"; private static final String WORLD_ID = "001"; /* Private default constructor. Use factory methods only. private Region () {} /* Initializes the region data from the ICU resource bundles. The region data contains the basic relationships such as which regions are known, what the numeric codes are, any known aliases, and the territory containment data. If the region data has already loaded, then this method simply returns without doing anything meaningful.
RegionType::loadRegionData
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/Region.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/Region.java
MIT
public List<Region> getPreferredValues() { loadRegionData(); if ( type == RegionType.DEPRECATED) { return Collections.unmodifiableList(preferredValues); } else { return null; } }
@return For deprecated regions, return an unmodifiable list of the regions that are the preferred replacement regions for this region. Returns null for a non-deprecated region. For example, calling this method with region "SU" (Soviet Union) would return a list of the regions containing "RU" (Russia), "AM" (Armenia), "AZ" (Azerbaijan), etc...
RegionType::getPreferredValues
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/Region.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/Region.java
MIT
public boolean contains(Region other) { loadRegionData(); if (containedRegions.contains(other)) { return true; } else { for (Region cr : containedRegions) { if (cr.contains(other)) { return true; } } } return false; }
@return Returns true if this region contains the supplied other region anywhere in the region hierarchy.
RegionType::contains
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/Region.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/Region.java
MIT
public int compareTo(Region other) { return id.compareTo(other.id); }
{@inheritDoc}
RegionType::compareTo
java
Reginer/aosp-android-jar
android-34/src/android/icu/util/Region.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/icu/util/Region.java
MIT
public static boolean readInstallPolicy() { synchronized (sPolicies) { if (sPolicyRead) { return true; } } // Temp structure to hold the rules while we parse the xml file List<Policy> policies = new ArrayList<>(); FileReader policyFile = null; XmlPullParser parser = Xml.newPullParser(); final int count = sMacPermissions.size(); for (int i = 0; i < count; ++i) { final File macPermission = sMacPermissions.get(i); try { policyFile = new FileReader(macPermission); Slog.d(TAG, "Using policy file " + macPermission); parser.setInput(policyFile); parser.nextTag(); parser.require(XmlPullParser.START_TAG, null, "policy"); while (parser.next() != XmlPullParser.END_TAG) { if (parser.getEventType() != XmlPullParser.START_TAG) { continue; } switch (parser.getName()) { case "signer": policies.add(readSignerOrThrow(parser)); break; default: skip(parser); } } } catch (IllegalStateException | IllegalArgumentException | XmlPullParserException ex) { StringBuilder sb = new StringBuilder("Exception @"); sb.append(parser.getPositionDescription()); sb.append(" while parsing "); sb.append(macPermission); sb.append(":"); sb.append(ex); Slog.w(TAG, sb.toString()); return false; } catch (IOException ioe) { Slog.w(TAG, "Exception parsing " + macPermission, ioe); return false; } finally { IoUtils.closeQuietly(policyFile); } } // Now sort the policy stanzas PolicyComparator policySort = new PolicyComparator(); Collections.sort(policies, policySort); if (policySort.foundDuplicate()) { Slog.w(TAG, "ERROR! Duplicate entries found parsing mac_permissions.xml files"); return false; } synchronized (sPolicies) { sPolicies.clear(); sPolicies.addAll(policies); sPolicyRead = true; if (DEBUG_POLICY_ORDER) { for (Policy policy : sPolicies) { Slog.d(TAG, "Policy: " + policy.toString()); } } } return true; }
Load the mac_permissions.xml file containing all seinfo assignments used to label apps. The loaded mac_permissions.xml files are plat_mac_permissions.xml and vendor_mac_permissions.xml, on /system and /vendor partitions, respectively. odm_mac_permissions.xml on /odm partition is optional. For further guidance on the proper structure of a mac_permissions.xml file consult the source code located at system/sepolicy/private/mac_permissions.xml. @return boolean indicating if policy was correctly loaded. A value of false typically indicates a structural problem with the xml or incorrectly constructed policy stanzas. A value of true means that all stanzas were loaded successfully; no partial loading is possible.
SELinuxMMAC::readInstallPolicy
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
private static Policy readSignerOrThrow(XmlPullParser parser) throws IOException, XmlPullParserException { parser.require(XmlPullParser.START_TAG, null, "signer"); Policy.PolicyBuilder pb = new Policy.PolicyBuilder(); // Check for a cert attached to the signer tag. We allow a signature // to appear as an attribute as well as those attached to cert tags. String cert = parser.getAttributeValue(null, "signature"); if (cert != null) { pb.addSignature(cert); } while (parser.next() != XmlPullParser.END_TAG) { if (parser.getEventType() != XmlPullParser.START_TAG) { continue; } String tagName = parser.getName(); if ("seinfo".equals(tagName)) { String seinfo = parser.getAttributeValue(null, "value"); pb.setGlobalSeinfoOrThrow(seinfo); readSeinfo(parser); } else if ("package".equals(tagName)) { readPackageOrThrow(parser, pb); } else if ("cert".equals(tagName)) { String sig = parser.getAttributeValue(null, "signature"); pb.addSignature(sig); readCert(parser); } else { skip(parser); } } return pb.build(); }
Loop over a signer tag looking for seinfo, package and cert tags. A {@link Policy} instance will be created and returned in the process. During the pass all other tag elements will be skipped. @param parser an XmlPullParser object representing a signer element. @return the constructed {@link Policy} instance @throws IOException @throws XmlPullParserException @throws IllegalArgumentException if any of the validation checks fail while parsing tag values. @throws IllegalStateException if any of the invariants fail when constructing the {@link Policy} instance.
SELinuxMMAC::readSignerOrThrow
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
private static void readPackageOrThrow(XmlPullParser parser, Policy.PolicyBuilder pb) throws IOException, XmlPullParserException { parser.require(XmlPullParser.START_TAG, null, "package"); String pkgName = parser.getAttributeValue(null, "name"); while (parser.next() != XmlPullParser.END_TAG) { if (parser.getEventType() != XmlPullParser.START_TAG) { continue; } String tagName = parser.getName(); if ("seinfo".equals(tagName)) { String seinfo = parser.getAttributeValue(null, "value"); pb.addInnerPackageMapOrThrow(pkgName, seinfo); readSeinfo(parser); } else { skip(parser); } } }
Loop over a package element looking for seinfo child tags. If found return the value attribute of the seinfo tag, otherwise return null. All other tags encountered will be skipped. @param parser an XmlPullParser object representing a package element. @param pb a Policy.PolicyBuilder instance to build @throws IOException @throws XmlPullParserException @throws IllegalArgumentException if any of the validation checks fail while parsing tag values. @throws IllegalStateException if there is a duplicate seinfo tag for the current package tag.
SELinuxMMAC::readPackageOrThrow
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public static String getSeInfo(@NonNull PackageState packageState, @NonNull AndroidPackage pkg, @Nullable SharedUserApi sharedUser, @NonNull PlatformCompat compatibility) { final int targetSdkVersion = getTargetSdkVersionForSeInfo(pkg, sharedUser, compatibility); // TODO(b/71593002): isPrivileged for sharedUser and appInfo should never be out of sync. // They currently can be if the sharedUser apps are signed with the platform key. final boolean isPrivileged = (sharedUser != null) ? sharedUser.isPrivileged() | packageState.isPrivileged() : packageState.isPrivileged(); return getSeInfo(packageState, pkg, isPrivileged, targetSdkVersion); }
Selects a security label to a package based on input parameters and the seinfo tag taken from a matched policy. All signature based policy stanzas are consulted and, if no match is found, the default seinfo label of 'default' is used. The security label is attached to the ApplicationInfo instance of the package. @param packageState {@link PackageState} object representing the package to be labeled. @param pkg {@link AndroidPackage} object representing the package to be labeled. @param sharedUser if the app shares a sharedUserId, then this has the shared setting. @param compatibility the PlatformCompat service to ask about state of compat changes. @return String representing the resulting seinfo.
SELinuxMMAC::getSeInfo
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public static String getSeInfo(PackageState packageState, AndroidPackage pkg, boolean isPrivileged, int targetSdkVersion) { String seInfo = null; synchronized (sPolicies) { if (!sPolicyRead) { if (DEBUG_POLICY) { Slog.d(TAG, "Policy not read"); } } else { for (Policy policy : sPolicies) { seInfo = policy.getMatchedSeInfo(pkg); if (seInfo != null) { break; } } } } if (seInfo == null) { seInfo = DEFAULT_SEINFO; } if (isPrivileged) { seInfo += PRIVILEGED_APP_STR; } seInfo += TARGETSDKVERSION_STR + targetSdkVersion; String partition = getPartition(packageState); if (!partition.isEmpty()) { seInfo += PARTITION_STR + partition; } if (DEBUG_POLICY_INSTALL) { Slog.i(TAG, "package (" + packageState.getPackageName() + ") labeled with " + "seinfo=" + seInfo); } return seInfo; }
Selects a security label to a package based on input parameters and the seinfo tag taken from a matched policy. All signature based policy stanzas are consulted and, if no match is found, the default seinfo label of 'default' is used. The security label is attached to the ApplicationInfo instance of the package. @param packageState {@link PackageState} object representing the package to be labeled. @param pkg {@link AndroidPackage} object representing the package to be labeled. @param isPrivileged boolean. @param targetSdkVersion int. If this pkg runs as a sharedUser, targetSdkVersion is the greater of: lowest targetSdk for all pkgs in the sharedUser, or MINIMUM_TARGETSDKVERSION. @return String representing the resulting seinfo.
SELinuxMMAC::getSeInfo
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public Set<Signature> getSignatures() { return mCerts; }
Return all the certs stored with this policy stanza. @return A set of Signature objects representing all the certs stored with the policy.
Policy::getSignatures
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public boolean hasInnerPackages() { return !mPkgMap.isEmpty(); }
Return whether this policy object contains package name mapping refinements. @return A boolean indicating if this object has inner package name mappings.
Policy::hasInnerPackages
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public Map<String, String> getInnerPackages() { return mPkgMap; }
Return the mapping of all package name refinements. @return A Map object whose keys are the package names and whose values are the seinfo assignments.
Policy::getInnerPackages
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public boolean hasGlobalSeinfo() { return mSeinfo != null; }
Return whether the policy object has a global seinfo tag attached. @return A boolean indicating if this stanza has a global seinfo tag.
Policy::hasGlobalSeinfo
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public String getMatchedSeInfo(AndroidPackage pkg) { // Check for exact signature matches across all certs. Signature[] certs = mCerts.toArray(new Signature[0]); if (pkg.getSigningDetails() != SigningDetails.UNKNOWN && !Signature.areExactMatch(pkg.getSigningDetails(), certs)) { // certs aren't exact match, but the package may have rotated from the known system cert if (certs.length > 1 || !pkg.getSigningDetails().hasCertificate(certs[0])) { return null; } } // Check for inner package name matches given that the // signature checks already passed. String seinfoValue = mPkgMap.get(pkg.getPackageName()); if (seinfoValue != null) { return seinfoValue; } // Return the global seinfo value. return mSeinfo; }
<p> Determine the seinfo value to assign to an apk. The appropriate seinfo value is determined using the following steps: </p> <ul> <li> All certs used to sign the apk and all certs stored with this policy instance are tested for set equality. If this fails then null is returned. </li> <li> If all certs match then an appropriate inner package stanza is searched based on package name alone. If matched, the stored seinfo value for that mapping is returned. </li> <li> If all certs matched and no inner package stanza matches then return the global seinfo value. The returned value can be null in this case. </li> </ul> <p> In all cases, a return value of null should be interpreted as the apk failing to match this Policy instance; i.e. failing this policy stanza. </p> @param pkg the apk to check given as a AndroidPackage object @return A string representing the seinfo matched during policy lookup. A value of null can also be returned if no match occured.
Policy::getMatchedSeInfo
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public PolicyBuilder addSignature(String cert) { if (cert == null) { String err = "Invalid signature value " + cert; throw new IllegalArgumentException(err); } mCerts.add(new Signature(cert)); return this; }
Adds a signature to the set of certs used for validation checks. The purpose being that all contained certs will need to be matched against all certs contained with an apk. @param cert the signature to add given as a String. @return The reference to this PolicyBuilder. @throws IllegalArgumentException if the cert value fails validation; null or is an invalid hex-encoded ASCII string.
PolicyBuilder::addSignature
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public PolicyBuilder setGlobalSeinfoOrThrow(String seinfo) { if (!validateValue(seinfo)) { String err = "Invalid seinfo value " + seinfo; throw new IllegalArgumentException(err); } if (mSeinfo != null && !mSeinfo.equals(seinfo)) { String err = "Duplicate seinfo tag found"; throw new IllegalStateException(err); } mSeinfo = seinfo; return this; }
Set the global seinfo tag for this policy stanza. The global seinfo tag when attached to a signer tag represents the assignment when there isn't a further inner package refinement in policy. @param seinfo the seinfo value given as a String. @return The reference to this PolicyBuilder. @throws IllegalArgumentException if the seinfo value fails validation; null, zero length or contains non-valid characters [^a-zA-Z_\._0-9]. @throws IllegalStateException if an seinfo value has already been found
PolicyBuilder::setGlobalSeinfoOrThrow
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public PolicyBuilder addInnerPackageMapOrThrow(String pkgName, String seinfo) { if (!validateValue(pkgName)) { String err = "Invalid package name " + pkgName; throw new IllegalArgumentException(err); } if (!validateValue(seinfo)) { String err = "Invalid seinfo value " + seinfo; throw new IllegalArgumentException(err); } String pkgValue = mPkgMap.get(pkgName); if (pkgValue != null && !pkgValue.equals(seinfo)) { String err = "Conflicting seinfo value found"; throw new IllegalStateException(err); } mPkgMap.put(pkgName, seinfo); return this; }
Create a package name to seinfo value mapping. Each mapping represents the seinfo value that will be assigned to the described package name. These localized mappings allow the global seinfo to be overriden. @param pkgName the android package name given to the app @param seinfo the seinfo value that will be assigned to the passed pkgName @return The reference to this PolicyBuilder. @throws IllegalArgumentException if the seinfo value fails validation; null, zero length or contains non-valid characters [^a-zA-Z_\.0-9]. Or, if the package name isn't a valid android package name. @throws IllegalStateException if trying to reset a package mapping with a different seinfo value.
PolicyBuilder::addInnerPackageMapOrThrow
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
private boolean validateValue(String name) { if (name == null) return false; // Want to match on [0-9a-zA-Z_.] if (!name.matches("\\A[\\.\\w]+\\z")) { return false; } return true; }
General validation routine for the attribute strings of an element. Checks if the string is non-null, positive length and only contains [a-zA-Z_\.0-9]. @param name the string to validate. @return boolean indicating if the string was valid.
PolicyBuilder::validateValue
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public Policy build() { Policy p = new Policy(this); if (p.mCerts.isEmpty()) { String err = "Missing certs with signer tag. Expecting at least one."; throw new IllegalStateException(err); } if (!(p.mSeinfo == null ^ p.mPkgMap.isEmpty())) { String err = "Only seinfo tag XOR package tags are allowed within " + "a signer stanza."; throw new IllegalStateException(err); } return p; }
<p> Create a {@link Policy} instance based on the current configuration. This method checks for certain policy invariants used to enforce certain guarantees about the expected structure of a policy stanza. Those invariants are: </p> <ul> <li> at least one cert must be found </li> <li> either a global seinfo value is present OR at least one inner package mapping must be present BUT not both. </li> </ul> @return an instance of {@link Policy} with the options set from this builder @throws IllegalStateException if an invariant is violated.
PolicyBuilder::build
java
Reginer/aosp-android-jar
android-35/src/com/android/server/pm/SELinuxMMAC.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/pm/SELinuxMMAC.java
MIT
public NotificationBlockingHelperManager( Context context, NotificationGutsManager notificationGutsManager, NotificationEntryManager notificationEntryManager, MetricsLogger metricsLogger, GroupMembershipManager groupMembershipManager) { mContext = context; mNotificationGutsManager = notificationGutsManager; mNotificationEntryManager = notificationEntryManager; mMetricsLogger = metricsLogger; mNonBlockablePkgs = new HashSet<>(); Collections.addAll(mNonBlockablePkgs, mContext.getResources().getStringArray( com.android.internal.R.array.config_nonBlockableNotificationPackages)); mGroupMembershipManager = groupMembershipManager; }
Injected constructor. See {@link NotificationsModule}.
NotificationBlockingHelperManager::NotificationBlockingHelperManager
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
MIT
boolean perhapsShowBlockingHelper( ExpandableNotificationRow row, NotificationMenuRowPlugin menuRow) { // We only show the blocking helper if: // - User sentiment is negative (DEBUG flag can bypass) // - The notification shade is fully expanded (guarantees we're not touching a HUN). // - The row is blockable (i.e. not non-blockable) // - The dismissed row is a valid group (>1 or 0 children from the same channel) // or the only child in the group final NotificationEntry entry = row.getEntry(); if ((entry.getUserSentiment() == USER_SENTIMENT_NEGATIVE || DEBUG_ALWAYS_SHOW) && mIsShadeExpanded && !row.getIsNonblockable() && ((!row.isChildInGroup() || mGroupMembershipManager.isOnlyChildInGroup(entry)) && row.getNumUniqueChannels() <= 1)) { // Dismiss any current blocking helper before continuing forward (only one can be shown // at a given time). dismissCurrentBlockingHelper(); if (DEBUG) { Log.d(TAG, "Manager.perhapsShowBlockingHelper: Showing new blocking helper"); } // Enable blocking helper on the row before moving forward so everything in the guts is // correctly prepped. mBlockingHelperRow = row; mBlockingHelperRow.setBlockingHelperShowing(true); // Log triggering of blocking helper by the system. This log line // should be emitted before the "display" log line. mMetricsLogger.write( getLogMaker().setSubtype(MetricsEvent.BLOCKING_HELPER_TRIGGERED_BY_SYSTEM)); // We don't care about the touch origin (x, y) since we're opening guts without any // explicit user interaction. mNotificationGutsManager.openGuts( mBlockingHelperRow, 0, 0, menuRow.getLongpressMenuItem(mContext)); mMetricsLogger.count(NotificationCounters.BLOCKING_HELPER_SHOWN, 1); return true; } return false; }
Potentially shows the blocking helper, represented via the {@link NotificationInfo} menu item, in the current row if user sentiment is negative. @param row row to render the blocking helper in @param menuRow menu used to generate the {@link NotificationInfo} view that houses the blocking helper UI @return whether we're showing a blocking helper in the given notification row
NotificationBlockingHelperManager::perhapsShowBlockingHelper
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
MIT
boolean dismissCurrentBlockingHelper() { if (!isBlockingHelperRowNull()) { if (DEBUG) { Log.d(TAG, "Manager.dismissCurrentBlockingHelper: Dismissing current helper"); } if (!mBlockingHelperRow.isBlockingHelperShowing()) { Log.e(TAG, "Manager.dismissCurrentBlockingHelper: " + "Non-null row is not showing a blocking helper"); } mBlockingHelperRow.setBlockingHelperShowing(false); if (mBlockingHelperRow.isAttachedToWindow()) { mNotificationEntryManager.updateNotifications("dismissCurrentBlockingHelper"); } mBlockingHelperRow = null; return true; } return false; }
Dismiss the currently showing blocking helper, if any, through a notification update. @return whether the blocking helper was dismissed
NotificationBlockingHelperManager::dismissCurrentBlockingHelper
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
MIT
public void setNotificationShadeExpanded(float expandedHeight) { mIsShadeExpanded = expandedHeight > 0.0f; }
Update the expansion status of the notification shade/stack. @param expandedHeight how much the shade is expanded ({code 0} indicating it's collapsed)
NotificationBlockingHelperManager::setNotificationShadeExpanded
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
MIT
public boolean isNonblockable(String packageName, String channelName) { return mNonBlockablePkgs.contains(packageName) || mNonBlockablePkgs.contains(makeChannelKey(packageName, channelName)); }
Returns whether the given package name is in the list of non-blockable packages.
NotificationBlockingHelperManager::isNonblockable
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/notification/row/NotificationBlockingHelperManager.java
MIT
private @BiometricAuthenticator.Modality int getEligibleModalities() { return mPreAuthInfo.getEligibleModalities(); }
@return bitmask representing the modalities that are running or could be running for the current session.
AuthSession::getEligibleModalities
java
Reginer/aosp-android-jar
android-33/src/com/android/server/biometrics/AuthSession.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/biometrics/AuthSession.java
MIT
boolean onErrorReceived(int sensorId, int cookie, @BiometricConstants.Errors int error, int vendorCode) throws RemoteException { Slog.d(TAG, "onErrorReceived sensor: " + sensorId + " error: " + error); if (!containsCookie(cookie)) { Slog.e(TAG, "Unknown/expired cookie: " + cookie); return false; } // TODO: The sensor-specific state is not currently used, this would need to be updated if // multiple authenticators are running. for (BiometricSensor sensor : mPreAuthInfo.eligibleSensors) { if (sensor.getSensorState() == BiometricSensor.STATE_AUTHENTICATING) { sensor.goToStoppedStateIfCookieMatches(cookie, error); } } // do not propagate the error and let onAuthenticationSucceeded handle the new state if (hasAuthenticated()) { Slog.d(TAG, "onErrorReceived after successful auth (ignoring)"); return false; } mErrorEscrow = error; mVendorCodeEscrow = vendorCode; @Modality final int modality = sensorIdToModality(sensorId); switch (mState) { case STATE_AUTH_CALLED: { // If any error is received while preparing the auth session (lockout, etc), // and if device credential is allowed, just show the credential UI. if (isAllowDeviceCredential()) { @BiometricManager.Authenticators.Types int authenticators = mPromptInfo.getAuthenticators(); // Disallow biometric and notify SystemUI to show the authentication prompt. authenticators = Utils.removeBiometricBits(authenticators); mPromptInfo.setAuthenticators(authenticators); mState = STATE_SHOWING_DEVICE_CREDENTIAL; mMultiSensorMode = BIOMETRIC_MULTI_SENSOR_DEFAULT; mSensors = new int[0]; mStatusBarService.showAuthenticationDialog( mPromptInfo, mSysuiReceiver, mSensors /* sensorIds */, true /* credentialAllowed */, false /* requireConfirmation */, mUserId, mOperationId, mOpPackageName, mRequestId, mMultiSensorMode); } else { mClientReceiver.onError(modality, error, vendorCode); return true; } break; } case STATE_AUTH_STARTED: case STATE_AUTH_STARTED_UI_SHOWING: { final boolean errorLockout = error == BiometricConstants.BIOMETRIC_ERROR_LOCKOUT || error == BiometricConstants.BIOMETRIC_ERROR_LOCKOUT_PERMANENT; if (isAllowDeviceCredential() && errorLockout) { // SystemUI handles transition from biometric to device credential. mState = STATE_SHOWING_DEVICE_CREDENTIAL; mStatusBarService.onBiometricError(modality, error, vendorCode); } else if (error == BiometricConstants.BIOMETRIC_ERROR_CANCELED) { mStatusBarService.hideAuthenticationDialog(mRequestId); // TODO: If multiple authenticators are simultaneously running, this will // need to be modified. Send the error to the client here, instead of doing // a round trip to SystemUI. mClientReceiver.onError(modality, error, vendorCode); return true; } else { mState = STATE_ERROR_PENDING_SYSUI; mStatusBarService.onBiometricError(modality, error, vendorCode); } break; } case STATE_AUTH_PAUSED: { // In the "try again" state, we should forward canceled errors to // the client and clean up. The only error we should get here is // ERROR_CANCELED due to another client kicking us out. mClientReceiver.onError(modality, error, vendorCode); mStatusBarService.hideAuthenticationDialog(mRequestId); return true; } case STATE_SHOWING_DEVICE_CREDENTIAL: Slog.d(TAG, "Biometric canceled, ignoring from state: " + mState); break; case STATE_CLIENT_DIED_CANCELLING: mStatusBarService.hideAuthenticationDialog(mRequestId); return true; default: Slog.e(TAG, "Unhandled error state, mState: " + mState); break; } return false; }
@return true if this AuthSession is finished, e.g. should be set to null.
AuthSession::onErrorReceived
java
Reginer/aosp-android-jar
android-33/src/com/android/server/biometrics/AuthSession.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/biometrics/AuthSession.java
MIT
boolean onClientDied() { try { switch (mState) { case STATE_AUTH_STARTED: case STATE_AUTH_STARTED_UI_SHOWING: mState = STATE_CLIENT_DIED_CANCELLING; cancelAllSensors(); return false; default: mStatusBarService.hideAuthenticationDialog(mRequestId); return true; } } catch (RemoteException e) { Slog.e(TAG, "Remote Exception: " + e); return true; } }
@return true if this session is finished and should be set to null.
AuthSession::onClientDied
java
Reginer/aosp-android-jar
android-33/src/com/android/server/biometrics/AuthSession.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/biometrics/AuthSession.java
MIT
boolean onCancelAuthSession(boolean force) { if (hasAuthenticated()) { Slog.d(TAG, "onCancelAuthSession after successful auth"); return true; } mCancelled = true; final boolean authStarted = mState == STATE_AUTH_CALLED || mState == STATE_AUTH_STARTED || mState == STATE_AUTH_STARTED_UI_SHOWING; cancelAllSensors(); if (authStarted && !force) { // Wait for ERROR_CANCELED to be returned from the sensors return false; } else { // If we're in a state where biometric sensors are not running (e.g. pending confirm, // showing device credential, etc), we need to dismiss the dialog and send our own // ERROR_CANCELED to the client, since we won't be getting an onError from the driver. try { // Send error to client mClientReceiver.onError( getEligibleModalities(), BiometricConstants.BIOMETRIC_ERROR_CANCELED, 0 /* vendorCode */ ); mStatusBarService.hideAuthenticationDialog(mRequestId); return true; } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } } return false; }
Cancels authentication for the entire authentication session. The caller will receive {@link BiometricPrompt#BIOMETRIC_ERROR_CANCELED} at some point. @param force if true, will immediately dismiss the dialog and send onError to the client @return true if this AuthSession is finished, e.g. should be set to null
AuthSession::onCancelAuthSession
java
Reginer/aosp-android-jar
android-33/src/com/android/server/biometrics/AuthSession.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/biometrics/AuthSession.java
MIT
public ChunkHasher(SecretKey secretKey) { this.mSecretKey = secretKey; }
/* 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.server.backup.encryption.chunk.ChunkHash; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.Mac; import javax.crypto.SecretKey; /** Computes the SHA-256 HMAC of a chunk of bytes. public class ChunkHasher { private static final String MAC_ALGORITHM = "HmacSHA256"; private final SecretKey mSecretKey; /** Constructs a new hasher which computes the HMAC using the given secret key.
ChunkHasher::ChunkHasher
java
Reginer/aosp-android-jar
android-33/src/com/android/server/backup/encryption/chunking/ChunkHasher.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/backup/encryption/chunking/ChunkHasher.java
MIT
public ChunkHash computeHash(byte[] plaintext) throws InvalidKeyException { try { Mac mac = Mac.getInstance(MAC_ALGORITHM); mac.init(mSecretKey); return new ChunkHash(mac.doFinal(plaintext)); } catch (NoSuchAlgorithmException e) { // This can not happen - AES/GCM/NoPadding is available as part of the framework. throw new AssertionError(e); } }
/* 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.server.backup.encryption.chunk.ChunkHash; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.Mac; import javax.crypto.SecretKey; /** Computes the SHA-256 HMAC of a chunk of bytes. public class ChunkHasher { private static final String MAC_ALGORITHM = "HmacSHA256"; private final SecretKey mSecretKey; /** Constructs a new hasher which computes the HMAC using the given secret key. public ChunkHasher(SecretKey secretKey) { this.mSecretKey = secretKey; } /** Returns the SHA-256 over the given bytes.
ChunkHasher::computeHash
java
Reginer/aosp-android-jar
android-33/src/com/android/server/backup/encryption/chunking/ChunkHasher.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/backup/encryption/chunking/ChunkHasher.java
MIT
public void dispose() { synchronized (mLock) { if (DBG) log("Disposing card"); for (UiccPort uiccPort : mUiccPorts.values()) { if (uiccPort != null) { uiccPort.dispose(); } } mUiccPorts.clear(); mUiccPorts = null; mPhoneIdToPortIdx.clear(); mPhoneIdToPortIdx = null; } }
Dispose the card and its related UiccPort objects.
UiccCard::dispose
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/uicc/UiccCard.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/uicc/UiccCard.java
MIT
public void disposePort(int portIndex) { synchronized (mLock) { if (DBG) log("Disposing port for index " + portIndex); UiccPort port = getUiccPort(portIndex); if (port != null) { mPhoneIdToPortIdx.remove(port.getPhoneId()); port.dispose(); } mUiccPorts.remove(portIndex); } }
Dispose the port corresponding to the port index.
UiccCard::disposePort
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/uicc/UiccCard.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/uicc/UiccCard.java
MIT
public void update(Context c, CommandsInterface ci, IccCardStatus ics, int phoneId) { synchronized (mLock) { mCardState = ics.mCardState; updateCardId(ics.iccid); if (mCardState != CardState.CARDSTATE_ABSENT) { int portIdx = ics.mSlotPortMapping.mPortIndex; UiccPort port = mUiccPorts.get(portIdx); if (port == null) { if (this instanceof EuiccCard) { port = new EuiccPort(c, ci, ics, phoneId, mLock, this, mIsSupportsMultipleEnabledProfiles); // eSim } else { port = new UiccPort(c, ci, ics, phoneId, mLock, this); // pSim } mUiccPorts.put(portIdx, port); } else { port.update(c, ci, ics, this); } mPhoneIdToPortIdx.put(phoneId, portIdx); } else { throw new RuntimeException("Card state is absent when updating!"); } } }
Update card. The main trigger for this is a change in the ICC Card status.
UiccCard::update
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/uicc/UiccCard.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/uicc/UiccCard.java
MIT
protected void updateCardId(String iccId) { mCardId = iccId; }
Updates the ID of the SIM card. <p>Whenever the {@link UiccCard#update(Context, CommandsInterface, IccCardStatus, int)} is called, this function needs to be called to update the card ID. Subclasses of {@link UiccCard} could override this function to set the {@link UiccCard#mCardId} to be something else instead of setting iccId.</p>
UiccCard::updateCardId
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/uicc/UiccCard.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/uicc/UiccCard.java
MIT
public void updateSupportMultipleEnabledProfile(boolean supported) { mIsSupportsMultipleEnabledProfiles = supported; }
Updates MEP(Multiple Enabled Profile) support flag. <p>If IccSlotStatus comes later, the number of ports reported is only known after the UiccCard creation which will impact UICC MEP capability.
UiccCard::updateSupportMultipleEnabledProfile
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/uicc/UiccCard.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/uicc/UiccCard.java
MIT
public String getCardId() { if (!TextUtils.isEmpty(mCardId)) { return mCardId; } else { UiccProfile uiccProfile = mUiccPorts.get(TelephonyManager.DEFAULT_PORT_INDEX) .getUiccProfile(); return uiccProfile == null ? null : uiccProfile.getIccId(); } }
Returns the ID of this SIM card, it is the ICCID of the active profile on the card for a UICC card or the EID of the card for an eUICC card.
UiccCard::getCardId
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/uicc/UiccCard.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/uicc/UiccCard.java
MIT
public UiccPort[] getUiccPortList() { synchronized (mLock) { return mUiccPorts.values().stream().toArray(UiccPort[]::new); } }
Returns all the UiccPorts associated with the card.
UiccCard::getUiccPortList
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/telephony/uicc/UiccCard.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/telephony/uicc/UiccCard.java
MIT
public Object[][] getContents() { Object[][] contents = new Object[][] { { MsgKey.BAD_MSGKEY, "Der Nachrichtenschl\u00fcssel ''{0}'' ist nicht in der Nachrichtenklasse ''{1}'' enthalten." }, { MsgKey.BAD_MSGFORMAT, "Das Format der Nachricht ''{0}'' in der Nachrichtenklasse ''{1}'' ist fehlgeschlagen." }, { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, "Die Parallel-Seriell-Umsetzerklasse ''{0}'' implementiert org.xml.sax.ContentHandler nicht." }, { MsgKey.ER_RESOURCE_COULD_NOT_FIND, "Die Ressource [ {0} ] konnte nicht gefunden werden.\n {1}" }, { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, "Die Ressource [ {0} ] konnte nicht geladen werden: {1} \n {2} \t {3}" }, { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, "Puffergr\u00f6\u00dfe <=0" }, { MsgKey.ER_INVALID_UTF16_SURROGATE, "Ung\u00fcltige UTF-16-Ersetzung festgestellt: {0} ?" }, { MsgKey.ER_OIERROR, "E/A-Fehler" }, { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, "Attribut {0} kann nicht nach Kindknoten oder vor dem Erstellen eines Elements hinzugef\u00fcgt werden. Das Attribut wird ignoriert." }, /* * Note to translators: The stylesheet contained a reference to a * namespace prefix that was undefined. The value of the substitution * text is the name of the prefix. */ { MsgKey.ER_NAMESPACE_PREFIX, "Der Namensbereich f\u00fcr Pr\u00e4fix ''{0}'' wurde nicht deklariert." }, /* * Note to translators: This message is reported if the stylesheet * being processed attempted to construct an XML document with an * attribute in a place other than on an element. The substitution text * specifies the name of the attribute. */ { MsgKey.ER_STRAY_ATTRIBUTE, "Attribut ''{0}'' befindet sich nicht in einem Element." }, /* * Note to translators: As with the preceding message, a namespace * declaration has the form of an attribute and is only permitted to * appear on an element. The substitution text {0} is the namespace * prefix and {1} is the URI that was being used in the erroneous * namespace declaration. */ { MsgKey.ER_STRAY_NAMESPACE, "Namensbereichdeklaration ''{0}''=''{1}'' befindet sich nicht in einem Element." }, { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, "''{0}'' konnte nicht geladen werden (CLASSPATH pr\u00fcfen). Es werden die Standardwerte verwendet." }, { MsgKey.ER_ILLEGAL_CHARACTER, "Es wurde versucht, ein Zeichen des Integralwerts {0} auszugeben, der nicht in der angegebenen Ausgabeverschl\u00fcsselung von {1} dargestellt ist." }, { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, "Die Merkmaldatei ''{0}'' konnte f\u00fcr die Ausgabemethode ''{1}'' nicht geladen werden (CLASSPATH pr\u00fcfen)" }, { MsgKey.ER_INVALID_PORT, "Ung\u00fcltige Portnummer" }, { MsgKey.ER_PORT_WHEN_HOST_NULL, "Der Port kann nicht festgelegt werden, wenn der Host gleich Null ist." }, { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, "Der Host ist keine syntaktisch korrekte Adresse." }, { MsgKey.ER_SCHEME_NOT_CONFORMANT, "Das Schema ist nicht angepasst." }, { MsgKey.ER_SCHEME_FROM_NULL_STRING, "Schema kann nicht von Nullzeichenfolge festgelegt werden." }, { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, "Der Pfad enth\u00e4lt eine ung\u00fcltige Escapezeichenfolge." }, { MsgKey.ER_PATH_INVALID_CHAR, "Pfad enth\u00e4lt ung\u00fcltiges Zeichen: {0}." }, { MsgKey.ER_FRAG_INVALID_CHAR, "Fragment enth\u00e4lt ein ung\u00fcltiges Zeichen." }, { MsgKey.ER_FRAG_WHEN_PATH_NULL, "Fragment kann nicht festgelegt werden, wenn der Pfad gleich Null ist." }, { MsgKey.ER_FRAG_FOR_GENERIC_URI, "Fragment kann nur f\u00fcr eine generische URI (Uniform Resource Identifier) festgelegt werden." }, { MsgKey.ER_NO_SCHEME_IN_URI, "Kein Schema gefunden in URI" }, { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, "URI (Uniform Resource Identifier) kann nicht mit leeren Parametern initialisiert werden." }, { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, "Fragment kann nicht im Pfad und im Fragment angegeben werden." }, { MsgKey.ER_NO_QUERY_STRING_IN_PATH, "Abfragezeichenfolge kann nicht im Pfad und in der Abfragezeichenfolge angegeben werden." }, { MsgKey.ER_NO_PORT_IF_NO_HOST, "Der Port kann nicht angegeben werden, wenn der Host nicht angegeben wurde." }, { MsgKey.ER_NO_USERINFO_IF_NO_HOST, "Benutzerinformationen k\u00f6nnen nicht angegeben werden, wenn der Host nicht angegeben wurde." }, { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, "Warnung: Die Version des Ausgabedokuments muss ''{0}'' lauten. Diese XML-Version wird nicht unterst\u00fctzt. Die Version des Ausgabedokuments ist ''1.0''." }, { MsgKey.ER_SCHEME_REQUIRED, "Schema ist erforderlich!" }, /* * Note to translators: The words 'Properties' and * 'SerializerFactory' in this message are Java class names * and should not be translated. */ { MsgKey.ER_FACTORY_PROPERTY_MISSING, "Das an SerializerFactory \u00fcbermittelte Merkmalobjekt weist kein Merkmal ''{0}'' auf." }, { MsgKey.ER_ENCODING_NOT_SUPPORTED, "Warnung: Die Codierung ''{0}'' wird von Java Runtime nicht unterst\u00fctzt." }, {MsgKey.ER_FEATURE_NOT_FOUND, "Der Parameter ''{0}'' wird nicht erkannt."}, {MsgKey.ER_FEATURE_NOT_SUPPORTED, "Der Parameter ''{0}'' wird erkannt, der angeforderte Wert kann jedoch nicht festgelegt werden."}, {MsgKey.ER_STRING_TOO_LONG, "Die Ergebniszeichenfolge ist zu lang f\u00fcr eine DOM-Zeichenfolge: ''{0}''."}, {MsgKey.ER_TYPE_MISMATCH_ERR, "Der Werttyp f\u00fcr diesen Parameternamen ist nicht kompatibel mit dem erwarteten Werttyp."}, {MsgKey.ER_NO_OUTPUT_SPECIFIED, "Das Ausgabeziel f\u00fcr die zu schreibenden Daten war leer."}, {MsgKey.ER_UNSUPPORTED_ENCODING, "Eine nicht unterst\u00fctzte Codierung wurde festgestellt."}, {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, "Der Knoten konnte nicht serialisiert werden."}, {MsgKey.ER_CDATA_SECTIONS_SPLIT, "Der Abschnitt CDATA enth\u00e4lt mindestens eine Beendigungsmarkierung ']]>'."}, {MsgKey.ER_WARNING_WF_NOT_CHECKED, "Eine Instanz des Pr\u00fcfprogramms f\u00fcr korrekte Formatierung konnte nicht erstellt werden. F\u00fcr den korrekt formatierten Parameter wurde der Wert 'True' festgelegt, die Pr\u00fcfung auf korrekte Formatierung kann jedoch nicht durchgef\u00fchrt werden." }, {MsgKey.ER_WF_INVALID_CHARACTER, "Der Knoten ''{0}'' enth\u00e4lt ung\u00fcltige XML-Zeichen." }, { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, "Im Kommentar wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden." }, { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, "In der Verarbeitungsanweisung wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden." }, { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, "Im Inhalt von CDATASection wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden." }, { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, "Ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) wurde im Inhalt der Zeichendaten des Knotens gefunden." }, { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, "Ung\u00fcltige XML-Zeichen wurden gefunden in {0} im Knoten ''{1}''." }, { MsgKey.ER_WF_DASH_IN_COMMENT, "Die Zeichenfolge \"--\" ist innerhalb von Kommentaren nicht zul\u00e4ssig." }, {MsgKey.ER_WF_LT_IN_ATTVAL, "Der Wert des Attributs \"{1}\" mit einem Elementtyp \"{0}\" darf nicht das Zeichen ''<'' enthalten." }, {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, "Der syntaktisch nicht analysierte Entit\u00e4tenverweis \"&{0};\" ist nicht zul\u00e4ssig." }, {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, "Der externe Entit\u00e4tenverweis \"&{0};\" ist in einem Attributwert nicht zul\u00e4ssig." }, {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, "Das Pr\u00e4fix \"{0}\" kann nicht an den Namensbereich \"{1}\" gebunden werden." }, {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, "Der lokale Name von Element \"{0}\" ist nicht angegeben." }, {MsgKey.ER_NULL_LOCAL_ATTR_NAME, "Der lokale Name des Attributs \"{0}\" ist nicht angegeben." }, { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Elementknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"." }, { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Attributknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"." }, }; return contents; }
An instance of this class is a ListResourceBundle that has the required getContents() method that returns an array of message-key/message associations. <p> The message keys are defined in {@link MsgKey}. The messages that those keys map to are defined here. <p> The messages in the English version are intended to be translated. This class is not a public API, it is only public because it is used in org.apache.xml.serializer. @xsl.usage internal public class SerializerMessages_de extends ListResourceBundle { /* This file contains error and warning messages related to Serializer Error Handling. General notes to translators: 1) A stylesheet is a description of how to transform an input XML document into a resultant XML document (or HTML document or text). The stylesheet itself is described in the form of an XML document. 2) An element is a mark-up tag in an XML document; an attribute is a modifier on the tag. For example, in <elem attr='val' attr2='val2'> "elem" is an element name, "attr" and "attr2" are attribute names with the values "val" and "val2", respectively. 3) A namespace declaration is a special attribute that is used to associate a prefix with a URI (the namespace). The meanings of element names and attribute names that use that prefix are defined with respect to that namespace. /** The lookup table for error messages.
SerializerMessages_de::getContents
java
Reginer/aosp-android-jar
android-34/src/org/apache/xml/serializer/utils/SerializerMessages_de.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/apache/xml/serializer/utils/SerializerMessages_de.java
MIT
public InputMismatchException() { super(); }
Constructs an <code>InputMismatchException</code> with <tt>null</tt> as its error message string.
InputMismatchException::InputMismatchException
java
Reginer/aosp-android-jar
android-31/src/java/util/InputMismatchException.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/util/InputMismatchException.java
MIT
public InputMismatchException(String s) { super(s); }
Constructs an <code>InputMismatchException</code>, saving a reference to the error message string <tt>s</tt> for later retrieval by the <tt>getMessage</tt> method. @param s the detail message.
InputMismatchException::InputMismatchException
java
Reginer/aosp-android-jar
android-31/src/java/util/InputMismatchException.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/util/InputMismatchException.java
MIT
void setSwipingEnabled(boolean swipingEnabled) { mSwipingEnabled = swipingEnabled; }
Sets whether swiping sideways should happen. <p>Note that swiping is always disabled for RTL layouts (b/159110029 for context).
ResolverViewPager::setSwipingEnabled
java
Reginer/aosp-android-jar
android-33/src/com/android/internal/app/ResolverViewPager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/internal/app/ResolverViewPager.java
MIT
public TimeZone() { }
Sole constructor. (For invocation by subclass constructors, typically implicit.)
TimeZone::TimeZone
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public int getOffset(long date) { if (inDaylightTime(new Date(date))) { return getRawOffset() + getDSTSavings(); } return getRawOffset(); }
Returns the offset of this time zone from UTC at the specified date. If Daylight Saving Time is in effect at the specified date, the offset value is adjusted with the amount of daylight saving. <p> This method returns a historically correct offset value if an underlying TimeZone implementation subclass supports historical Daylight Saving Time schedule and GMT offset changes. @param date the date represented in milliseconds since January 1, 1970 00:00:00 GMT @return the amount of time in milliseconds to add to UTC to get local time. @see Calendar#ZONE_OFFSET @see Calendar#DST_OFFSET @since 1.4
NoImagePreloadHolder::getOffset
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
int getOffsets(long date, int[] offsets) { int rawoffset = getRawOffset(); int dstoffset = 0; if (inDaylightTime(new Date(date))) { dstoffset = getDSTSavings(); } if (offsets != null) { offsets[0] = rawoffset; offsets[1] = dstoffset; } return rawoffset + dstoffset; }
Gets the raw GMT offset and the amount of daylight saving of this time zone at the given time. @param date the milliseconds (since January 1, 1970, 00:00:00.000 GMT) at which the time zone offset and daylight saving amount are found @param offsets an array of int where the raw GMT offset (offset[0]) and daylight saving amount (offset[1]) are stored, or null if those values are not needed. The method assumes that the length of the given array is two or larger. @return the total amount of the raw GMT offset and daylight saving at the specified date. @see Calendar#ZONE_OFFSET @see Calendar#DST_OFFSET
NoImagePreloadHolder::getOffsets
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public String getID() { return ID; }
Gets the ID of this time zone. @return the ID of this time zone.
NoImagePreloadHolder::getID
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public void setID(String ID) { if (ID == null) { throw new NullPointerException(); } this.ID = ID; }
Sets the time zone ID. This does not change any other data in the time zone object. @param ID the new time zone ID.
NoImagePreloadHolder::setID
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public final String getDisplayName() { return getDisplayName(false, LONG, Locale.getDefault(Locale.Category.DISPLAY)); }
Returns a long standard time name of this {@code TimeZone} suitable for presentation to the user in the default locale. <p>This method is equivalent to: <blockquote><pre> getDisplayName(false, {@link #LONG}, Locale.getDefault({@link Locale.Category#DISPLAY})) </pre></blockquote> @return the human-readable name of this time zone in the default locale. @since 1.2 @see #getDisplayName(boolean, int, Locale) @see Locale#getDefault(Locale.Category) @see Locale.Category
NoImagePreloadHolder::getDisplayName
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public final String getDisplayName(Locale locale) { return getDisplayName(false, LONG, locale); }
Returns a long standard time name of this {@code TimeZone} suitable for presentation to the user in the specified {@code locale}. <p>This method is equivalent to: <blockquote><pre> getDisplayName(false, {@link #LONG}, locale) </pre></blockquote> @param locale the locale in which to supply the display name. @return the human-readable name of this time zone in the given locale. @exception NullPointerException if {@code locale} is {@code null}. @since 1.2 @see #getDisplayName(boolean, int, Locale)
NoImagePreloadHolder::getDisplayName
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public final String getDisplayName(boolean daylight, int style) { return getDisplayName(daylight, style, Locale.getDefault(Locale.Category.DISPLAY)); }
Returns a name in the specified {@code style} of this {@code TimeZone} suitable for presentation to the user in the default locale. If the specified {@code daylight} is {@code true}, a Daylight Saving Time name is returned (even if this {@code TimeZone} doesn't observe Daylight Saving Time). Otherwise, a Standard Time name is returned. <p>This method is equivalent to: <blockquote><pre> getDisplayName(daylight, style, Locale.getDefault({@link Locale.Category#DISPLAY})) </pre></blockquote> @param daylight {@code true} specifying a Daylight Saving Time name, or {@code false} specifying a Standard Time name @param style either {@link #LONG} or {@link #SHORT} @return the human-readable name of this time zone in the default locale. @exception IllegalArgumentException if {@code style} is invalid. @since 1.2 @see #getDisplayName(boolean, int, Locale) @see Locale#getDefault(Locale.Category) @see Locale.Category @see java.text.DateFormatSymbols#getZoneStrings()
NoImagePreloadHolder::getDisplayName
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public String getDisplayName(boolean daylightTime, int style, Locale locale) { // BEGIN Android-changed: implement using android.icu.text.TimeZoneNames TimeZoneNames.NameType nameType; switch (style) { case SHORT: nameType = daylightTime ? TimeZoneNames.NameType.SHORT_DAYLIGHT : TimeZoneNames.NameType.SHORT_STANDARD; break; case LONG: nameType = daylightTime ? TimeZoneNames.NameType.LONG_DAYLIGHT : TimeZoneNames.NameType.LONG_STANDARD; break; default: throw new IllegalArgumentException("Illegal style: " + style); } String canonicalID = android.icu.util.TimeZone.getCanonicalID(getID()); if (canonicalID != null) { TimeZoneNames names = TimeZoneNames.getInstance(locale); long now = System.currentTimeMillis(); String displayName = names.getDisplayName(canonicalID, nameType, now); if (displayName != null) { return displayName; } } // We get here if this is a custom timezone or ICU doesn't have name data for the specific // style and locale. int offsetMillis = getRawOffset(); if (daylightTime) { offsetMillis += getDSTSavings(); } return createGmtOffsetString(true /* includeGmt */, true /* includeMinuteSeparator */, offsetMillis); // END Android-changed: implement using android.icu.text.TimeZoneNames }
Returns the {@link #SHORT short} or {@link #LONG long} name of this time zone with either standard or daylight time, as written in {@code locale}. If the name is not available, the result is in the format {@code GMT[+-]hh:mm}. @param daylightTime true for daylight time, false for standard time. @param style either {@link TimeZone#LONG} or {@link TimeZone#SHORT}. @param locale the display locale.
NoImagePreloadHolder::getDisplayName
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public static String createGmtOffsetString(boolean includeGmt, boolean includeMinuteSeparator, int offsetMillis) { int offsetMinutes = offsetMillis / 60000; char sign = '+'; if (offsetMinutes < 0) { sign = '-'; offsetMinutes = -offsetMinutes; } StringBuilder builder = new StringBuilder(9); if (includeGmt) { builder.append("GMT"); } builder.append(sign); appendNumber(builder, 2, offsetMinutes / 60); if (includeMinuteSeparator) { builder.append(':'); } appendNumber(builder, 2, offsetMinutes % 60); return builder.toString(); }
Returns a string representation of an offset from UTC. <p>The format is "[GMT](+|-)HH[:]MM". The output is not localized. @param includeGmt true to include "GMT", false to exclude @param includeMinuteSeparator true to include the separator between hours and minutes, false to exclude. @param offsetMillis the offset from UTC @hide used internally by SimpleDateFormat
NoImagePreloadHolder::createGmtOffsetString
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public int getDSTSavings() { if (useDaylightTime()) { return 3600000; } return 0; }
Returns the amount of time to be added to local standard time to get local wall clock time. <p>The default implementation returns 3600000 milliseconds (i.e., one hour) if a call to {@link #useDaylightTime()} returns {@code true}. Otherwise, 0 (zero) is returned. <p>If an underlying {@code TimeZone} implementation subclass supports historical and future Daylight Saving Time schedule changes, this method returns the amount of saving time of the last known Daylight Saving Time rule that can be a future prediction. <p>If the amount of saving time at any given time stamp is required, construct a {@link Calendar} with this {@code TimeZone} and the time stamp, and call {@link Calendar#get(int) Calendar.get}{@code (}{@link Calendar#DST_OFFSET}{@code )}. @return the amount of saving time in milliseconds @since 1.4 @see #inDaylightTime(Date) @see #getOffset(long) @see #getOffset(int,int,int,int,int,int) @see Calendar#ZONE_OFFSET
NoImagePreloadHolder::getDSTSavings
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public boolean observesDaylightTime() { return useDaylightTime() || inDaylightTime(new Date()); }
Returns {@code true} if this {@code TimeZone} is currently in Daylight Saving Time, or if a transition from Standard Time to Daylight Saving Time occurs at any future time. <p>The default implementation returns {@code true} if {@code useDaylightTime()} or {@code inDaylightTime(new Date())} returns {@code true}. @return {@code true} if this {@code TimeZone} is currently in Daylight Saving Time, or if a transition from Standard Time to Daylight Saving Time occurs at any future time; {@code false} otherwise. @since 1.7 @see #useDaylightTime() @see #inDaylightTime(Date) @see Calendar#DST_OFFSET
NoImagePreloadHolder::observesDaylightTime
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public static TimeZone getTimeZone(ZoneId zoneId) { String tzid = zoneId.getId(); // throws an NPE if null char c = tzid.charAt(0); if (c == '+' || c == '-') { tzid = "GMT" + tzid; } else if (c == 'Z' && tzid.length() == 1) { tzid = "UTC"; } return getTimeZone(tzid); }
Gets the {@code TimeZone} for the given {@code zoneId}. @param zoneId a {@link ZoneId} from which the time zone ID is obtained @return the specified {@code TimeZone}, or the GMT zone if the given ID cannot be understood. @throws NullPointerException if {@code zoneId} is {@code null} @since 1.8
NoImagePreloadHolder::getTimeZone
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public ZoneId toZoneId() { // Android-changed: don't support "old mapping" return ZoneId.of(getID(), ZoneId.SHORT_IDS); }
Converts this {@code TimeZone} object to a {@code ZoneId}. @return a {@code ZoneId} representing the same time zone as this {@code TimeZone} @since 1.8
NoImagePreloadHolder::toZoneId
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
private static TimeZone getCustomTimeZone(String id) { Matcher m = NoImagePreloadHolder.CUSTOM_ZONE_ID_PATTERN.matcher(id); if (!m.matches()) { return null; } int hour; int minute = 0; try { hour = Integer.parseInt(m.group(1)); if (m.group(3) != null) { minute = Integer.parseInt(m.group(3)); } } catch (NumberFormatException impossible) { throw new AssertionError(impossible); } if (hour < 0 || hour > 23 || minute < 0 || minute > 59) { return null; } char sign = id.charAt(3); int raw = (hour * 3600000) + (minute * 60000); if (sign == '-') { raw = -raw; } String cleanId = String.format(Locale.ROOT, "GMT%c%02d:%02d", sign, hour, minute); return new SimpleTimeZone(raw, cleanId); }
Returns a new SimpleTimeZone for an ID of the form "GMT[+|-]hh[[:]mm]", or null.
NoImagePreloadHolder::getCustomTimeZone
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public static synchronized String[] getAvailableIDs(int rawOffset) { return ZoneInfoDb.getInstance().getAvailableIDs(rawOffset); }
Gets the available IDs according to the given time zone offset in milliseconds. @param rawOffset the given time zone GMT offset in milliseconds. @return an array of IDs, where the time zone for that ID has the specified GMT offset. For example, "America/Phoenix" and "America/Denver" both have GMT-07:00, but differ in daylight saving behavior. @see #getRawOffset()
NoImagePreloadHolder::getAvailableIDs
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public static synchronized String[] getAvailableIDs() { return ZoneInfoDb.getInstance().getAvailableIDs(); }
Gets all the available IDs supported. @return an array of IDs.
NoImagePreloadHolder::getAvailableIDs
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public static TimeZone getDefault() { return (TimeZone) getDefaultRef().clone(); }
Gets the default <code>TimeZone</code> for this host. The source of the default <code>TimeZone</code> may vary with implementation. @return a default <code>TimeZone</code>. @see #setDefault
NoImagePreloadHolder::getDefault
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
static synchronized TimeZone getDefaultRef() { if (defaultTimeZone == null) { Supplier<String> tzGetter = RuntimeHooks.getTimeZoneIdSupplier(); String zoneName = (tzGetter != null) ? tzGetter.get() : null; if (zoneName != null) { zoneName = zoneName.trim(); } if (zoneName == null || zoneName.isEmpty()) { try { // On the host, we can find the configured timezone here. zoneName = IoUtils.readFileAsString("/etc/timezone"); } catch (IOException ex) { // "vogar --mode device" can end up here. // TODO: give libcore access to Android system properties and read "persist.sys.timezone". zoneName = "GMT"; } } defaultTimeZone = TimeZone.getTimeZone(zoneName); } return defaultTimeZone; }
Returns the reference to the default TimeZone object. This method doesn't create a clone.
NoImagePreloadHolder::getDefaultRef
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public boolean hasSameRules(TimeZone other) { return other != null && getRawOffset() == other.getRawOffset() && useDaylightTime() == other.useDaylightTime(); }
Returns true if this zone has the same rule and offset as another zone. That is, if this zone differs only in ID, if at all. Returns false if the other zone is null. @param other the <code>TimeZone</code> object to be compared with @return true if the other zone is not null and is the same as this one, with the possible exception of the ID @since 1.2
NoImagePreloadHolder::hasSameRules
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public Object clone() { try { TimeZone other = (TimeZone) super.clone(); other.ID = ID; return other; } catch (CloneNotSupportedException e) { throw new InternalError(e); } }
Creates a copy of this <code>TimeZone</code>. @return a clone of this <code>TimeZone</code>
NoImagePreloadHolder::clone
java
Reginer/aosp-android-jar
android-32/src/java/util/TimeZone.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/util/TimeZone.java
MIT
public textsplittexttwo(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException { super(factory); // // check if loaded documents are supported for content type // String contentType = getContentType(); preload(contentType, "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
textsplittexttwo::textsplittexttwo
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/textsplittexttwo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/textsplittexttwo.java
MIT
public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; Text textNode; Text splitNode; String value; doc = (Document) load("staff", true); elementList = doc.getElementsByTagName("name"); nameNode = elementList.item(2); textNode = (Text) nameNode.getFirstChild(); splitNode = textNode.splitText(5); value = textNode.getNodeValue(); assertEquals("textSplitTextTwoAssert", "Roger", value); }
Runs the test case. @throws Throwable Any uncaught exception causes test to fail
textsplittexttwo::runTest
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/textsplittexttwo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/textsplittexttwo.java
MIT
public String getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/textsplittexttwo"; }
Gets URI that identifies the test. @return uri identifier of test
textsplittexttwo::getTargetURI
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/textsplittexttwo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/textsplittexttwo.java
MIT
public static void main(final String[] args) { DOMTestCase.doMain(textsplittexttwo.class, args); }
Runs this test from the command line. @param args command line arguments
textsplittexttwo::main
java
Reginer/aosp-android-jar
android-34/src/org/w3c/domts/level1/core/textsplittexttwo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/org/w3c/domts/level1/core/textsplittexttwo.java
MIT
public static boolean isWindowProviderService(@Nullable Bundle windowContextOptions) { if (windowContextOptions == null) { return false; } return (windowContextOptions.getBoolean(KEY_IS_WINDOW_PROVIDER_SERVICE, false)); }
Returns {@code true} if the {@code windowContextOptions} declares that it is a {@link WindowProviderService}. @hide
WindowProviderService::isWindowProviderService
java
Reginer/aosp-android-jar
android-34/src/android/window/WindowProviderService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/window/WindowProviderService.java
MIT
public IntentReceiverLeakedViolation(Throwable originStack) { super(null); setStackTrace(originStack.getStackTrace()); }
/* Copyright (C) 2017 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 android.os.strictmode; public final class IntentReceiverLeakedViolation extends Violation { /** @hide
IntentReceiverLeakedViolation::IntentReceiverLeakedViolation
java
Reginer/aosp-android-jar
android-34/src/android/os/strictmode/IntentReceiverLeakedViolation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/os/strictmode/IntentReceiverLeakedViolation.java
MIT
public NetworkSlicingConfig(List<UrspRule> urspRules, List<NetworkSliceInfo> sliceInfo) { this(); mUrspRules.addAll(urspRules); mSliceInfo.addAll(sliceInfo); }
Represents a slicing configuration public final class NetworkSlicingConfig implements Parcelable { private final List<UrspRule> mUrspRules; private final List<NetworkSliceInfo> mSliceInfo; public NetworkSlicingConfig() { mUrspRules = new ArrayList<>(); mSliceInfo = new ArrayList<>(); } /** @hide
NetworkSlicingConfig::NetworkSlicingConfig
java
Reginer/aosp-android-jar
android-33/src/android/telephony/data/NetworkSlicingConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/data/NetworkSlicingConfig.java
MIT
public NetworkSlicingConfig(Parcel p) { mUrspRules = p.createTypedArrayList(UrspRule.CREATOR); mSliceInfo = p.createTypedArrayList(NetworkSliceInfo.CREATOR); }
Represents a slicing configuration public final class NetworkSlicingConfig implements Parcelable { private final List<UrspRule> mUrspRules; private final List<NetworkSliceInfo> mSliceInfo; public NetworkSlicingConfig() { mUrspRules = new ArrayList<>(); mSliceInfo = new ArrayList<>(); } /** @hide public NetworkSlicingConfig(List<UrspRule> urspRules, List<NetworkSliceInfo> sliceInfo) { this(); mUrspRules.addAll(urspRules); mSliceInfo.addAll(sliceInfo); } /** @hide
NetworkSlicingConfig::NetworkSlicingConfig
java
Reginer/aosp-android-jar
android-33/src/android/telephony/data/NetworkSlicingConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/data/NetworkSlicingConfig.java
MIT
public @NonNull List<UrspRule> getUrspRules() { return mUrspRules; }
This list contains the current URSP rules. Empty list represents that no rules are configured. @return the current URSP rules for this slicing configuration.
NetworkSlicingConfig::getUrspRules
java
Reginer/aosp-android-jar
android-33/src/android/telephony/data/NetworkSlicingConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/data/NetworkSlicingConfig.java
MIT
public @NonNull List<NetworkSliceInfo> getSliceInfo() { return mSliceInfo; }
@return the list of all slices for this slicing configuration.
NetworkSlicingConfig::getSliceInfo
java
Reginer/aosp-android-jar
android-33/src/android/telephony/data/NetworkSlicingConfig.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/telephony/data/NetworkSlicingConfig.java
MIT
public static int mergeShortCodeCategories(int type1, int type2) { if (type1 > type2) return type1; return type2; }
Implement the per-application based SMS control, which limits the number of SMS/MMS messages an app can send in the checking period. This code was formerly part of {@link SMSDispatcher}, and has been moved into a separate class to support instantiation of multiple SMSDispatchers on dual-mode devices that require support for both 3GPP and 3GPP2 format messages. public class SmsUsageMonitor { private static final String TAG = "SmsUsageMonitor"; private static final boolean DBG = false; private static final boolean VDBG = false; private static final String SHORT_CODE_PATH = "/data/misc/sms/codes"; /** Default checking period for SMS sent without user permission. private static final int DEFAULT_SMS_CHECK_PERIOD = 60000; // 1 minute /** Default number of SMS sent in checking period without user permission. private static final int DEFAULT_SMS_MAX_COUNT = 30; /** @hide
SmsUsageMonitor::mergeShortCodeCategories
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
MIT
private ShortCodePatternMatcher getPatternMatcherFromFile(String country) { FileReader patternReader = null; XmlPullParser parser = null; try { patternReader = new FileReader(mPatternFile); parser = Xml.newPullParser(); parser.setInput(patternReader); return getPatternMatcherFromXmlParser(parser, country); } catch (FileNotFoundException e) { Rlog.e(TAG, "Short Code Pattern File not found"); } catch (XmlPullParserException e) { Rlog.e(TAG, "XML parser exception reading short code pattern file", e); } finally { mPatternFileLastModified = mPatternFile.lastModified(); if (patternReader != null) { try { patternReader.close(); } catch (IOException e) {} } } return null; }
Return a pattern matcher object for the specified country. @param country the country to search for @return a {@link ShortCodePatternMatcher} for the specified country, or null if not found
SettingsObserverHandler::getPatternMatcherFromFile
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
MIT
void dispose() { mSmsStamp.clear(); }
Return a pattern matcher object for the specified country. @param country the country to search for @return a {@link ShortCodePatternMatcher} for the specified country, or null if not found private ShortCodePatternMatcher getPatternMatcherFromFile(String country) { FileReader patternReader = null; XmlPullParser parser = null; try { patternReader = new FileReader(mPatternFile); parser = Xml.newPullParser(); parser.setInput(patternReader); return getPatternMatcherFromXmlParser(parser, country); } catch (FileNotFoundException e) { Rlog.e(TAG, "Short Code Pattern File not found"); } catch (XmlPullParserException e) { Rlog.e(TAG, "XML parser exception reading short code pattern file", e); } finally { mPatternFileLastModified = mPatternFile.lastModified(); if (patternReader != null) { try { patternReader.close(); } catch (IOException e) {} } } return null; } private ShortCodePatternMatcher getPatternMatcherFromResource(String country) { int id = com.android.internal.R.xml.sms_short_codes; XmlResourceParser parser = null; try { parser = mContext.getResources().getXml(id); return getPatternMatcherFromXmlParser(parser, country); } finally { if (parser != null) parser.close(); } } private ShortCodePatternMatcher getPatternMatcherFromXmlParser(XmlPullParser parser, String country) { try { XmlUtils.beginDocument(parser, TAG_SHORTCODES); while (true) { XmlUtils.nextElement(parser); String element = parser.getName(); if (element == null) { Rlog.e(TAG, "Parsing pattern data found null"); break; } if (element.equals(TAG_SHORTCODE)) { String currentCountry = parser.getAttributeValue(null, ATTR_COUNTRY); if (VDBG) Rlog.d(TAG, "Found country " + currentCountry); if (country.equals(currentCountry)) { String pattern = parser.getAttributeValue(null, ATTR_PATTERN); String premium = parser.getAttributeValue(null, ATTR_PREMIUM); String free = parser.getAttributeValue(null, ATTR_FREE); String standard = parser.getAttributeValue(null, ATTR_STANDARD); return new ShortCodePatternMatcher(pattern, premium, free, standard); } } else { Rlog.e(TAG, "Error: skipping unknown XML tag " + element); } } } catch (XmlPullParserException e) { Rlog.e(TAG, "XML parser exception reading short code patterns", e); } catch (IOException e) { Rlog.e(TAG, "I/O exception reading short code patterns", e); } if (DBG) Rlog.d(TAG, "Country (" + country + ") not found"); return null; // country not found } /** Clear the SMS application list for disposal.
SettingsObserverHandler::dispose
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
MIT
private void loadPremiumSmsPolicyDb() { synchronized (mPremiumSmsPolicy) { if (mPolicyFile == null) { File dir = new File(SMS_POLICY_FILE_DIRECTORY); mPolicyFile = new AtomicFile(new File(dir, SMS_POLICY_FILE_NAME)); mPremiumSmsPolicy.clear(); FileInputStream infile = null; try { infile = mPolicyFile.openRead(); final XmlPullParser parser = Xml.newPullParser(); parser.setInput(infile, StandardCharsets.UTF_8.name()); XmlUtils.beginDocument(parser, TAG_SMS_POLICY_BODY); while (true) { XmlUtils.nextElement(parser); String element = parser.getName(); if (element == null) break; if (element.equals(TAG_PACKAGE)) { String packageName = parser.getAttributeValue(null, ATTR_PACKAGE_NAME); String policy = parser.getAttributeValue(null, ATTR_PACKAGE_SMS_POLICY); if (packageName == null) { Rlog.e(TAG, "Error: missing package name attribute"); } else if (policy == null) { Rlog.e(TAG, "Error: missing package policy attribute"); } else try { mPremiumSmsPolicy.put(packageName, Integer.parseInt(policy)); } catch (NumberFormatException e) { Rlog.e(TAG, "Error: non-numeric policy type " + policy); } } else { Rlog.e(TAG, "Error: skipping unknown XML tag " + element); } } } catch (FileNotFoundException e) { // No data yet } catch (IOException e) { Rlog.e(TAG, "Unable to read premium SMS policy database", e); } catch (NumberFormatException e) { Rlog.e(TAG, "Unable to parse premium SMS policy database", e); } catch (XmlPullParserException e) { Rlog.e(TAG, "Unable to parse premium SMS policy database", e); } finally { if (infile != null) { try { infile.close(); } catch (IOException ignored) { } } } } } }
Load the premium SMS policy from an XML file. Based on code from NotificationManagerService.
SettingsObserverHandler::loadPremiumSmsPolicyDb
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
MIT
private void writePremiumSmsPolicyDb() { synchronized (mPremiumSmsPolicy) { FileOutputStream outfile = null; try { outfile = mPolicyFile.startWrite(); XmlSerializer out = new FastXmlSerializer(); out.setOutput(outfile, StandardCharsets.UTF_8.name()); out.startDocument(null, true); out.startTag(null, TAG_SMS_POLICY_BODY); for (Map.Entry<String, Integer> policy : mPremiumSmsPolicy.entrySet()) { out.startTag(null, TAG_PACKAGE); out.attribute(null, ATTR_PACKAGE_NAME, policy.getKey()); out.attribute(null, ATTR_PACKAGE_SMS_POLICY, policy.getValue().toString()); out.endTag(null, TAG_PACKAGE); } out.endTag(null, TAG_SMS_POLICY_BODY); out.endDocument(); mPolicyFile.finishWrite(outfile); } catch (IOException e) { Rlog.e(TAG, "Unable to write premium SMS policy database", e); if (outfile != null) { mPolicyFile.failWrite(outfile); } } } }
Persist the premium SMS policy to an XML file. Based on code from NotificationManagerService.
SettingsObserverHandler::writePremiumSmsPolicyDb
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
MIT
public int getPremiumSmsPermission(String packageName) { checkCallerIsSystemOrPhoneOrSameApp(packageName); synchronized (mPremiumSmsPolicy) { Integer policy = mPremiumSmsPolicy.get(packageName); if (policy == null) { return PREMIUM_SMS_PERMISSION_UNKNOWN; } else { return policy; } } }
Returns the premium SMS permission for the specified package. If the package has never been seen before, the default {@link #PREMIUM_SMS_PERMISSION_UNKNOWN} will be returned. @param packageName the name of the package to query permission @return one of {@link #PREMIUM_SMS_PERMISSION_UNKNOWN}, {@link #PREMIUM_SMS_PERMISSION_ASK_USER}, {@link #PREMIUM_SMS_PERMISSION_NEVER_ALLOW}, or {@link #PREMIUM_SMS_PERMISSION_ALWAYS_ALLOW} @throws SecurityException if the caller is not a system process
SettingsObserverHandler::getPremiumSmsPermission
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
MIT
public void setPremiumSmsPermission(String packageName, int permission) { checkCallerIsSystemOrPhoneApp(); if (permission < PREMIUM_SMS_PERMISSION_ASK_USER || permission > PREMIUM_SMS_PERMISSION_ALWAYS_ALLOW) { throw new IllegalArgumentException("invalid SMS permission type " + permission); } synchronized (mPremiumSmsPolicy) { mPremiumSmsPolicy.put(packageName, permission); } // write policy file in the background new Thread(new Runnable() { @Override public void run() { writePremiumSmsPolicyDb(); } }).start(); }
Sets the premium SMS permission for the specified package and save the value asynchronously to persistent storage. @param packageName the name of the package to set permission @param permission one of {@link #PREMIUM_SMS_PERMISSION_ASK_USER}, {@link #PREMIUM_SMS_PERMISSION_NEVER_ALLOW}, or {@link #PREMIUM_SMS_PERMISSION_ALWAYS_ALLOW} @throws SecurityException if the caller is not a system process
SettingsObserverHandler::setPremiumSmsPermission
java
Reginer/aosp-android-jar
android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/internal/telephony/SmsUsageMonitor.java
MIT