Home
last modified time | relevance | path

Searched refs:key (Results 1 – 25 of 174) sorted by relevance

1234567

/cts/tests/autofillservice/src/android/autofillservice/cts/common/
DSettingsHelper.java40 public static void set(@NonNull String namespace, @NonNull String key, @Nullable String value) { in set() argument
42 delete(namespace, key); in set()
45 runShellCommand("settings put %s %s %s default", namespace, key, value); in set()
48 public static void set(@NonNull String key, @Nullable String value) { in set() argument
49 set(NAMESPACE_SECURE, key, value); in set()
56 @NonNull String key, @Nullable String value) { in syncSet() argument
58 syncDelete(context, namespace, key); in syncSet()
62 final String currentValue = get(namespace, key); in syncSet()
69 new OneTimeSettingsListener(context, namespace, key); in syncSet()
70 set(namespace, key, value); in syncSet()
[all …]
DOneTimeSettingsListener.java41 public OneTimeSettingsListener(Context context, String key) { in OneTimeSettingsListener() argument
42 this(context, NAMESPACE_SECURE, key); in OneTimeSettingsListener()
45 public OneTimeSettingsListener(Context context, String namespace, String key) { in OneTimeSettingsListener() argument
47 mKey = key; in OneTimeSettingsListener()
52 uri = Settings.Secure.getUriFor(key); in OneTimeSettingsListener()
55 uri = Settings.Global.getUriFor(key); in OneTimeSettingsListener()
DSettingsStateChangerRule.java38 public SettingsStateChangerRule(@NonNull Context context, @NonNull String key, in SettingsStateChangerRule() argument
40 this(context, SettingsHelper.NAMESPACE_SECURE, key, value); in SettingsStateChangerRule()
52 @NonNull String key, @Nullable String value) { in SettingsStateChangerRule() argument
53 super(new SettingsStateManager(context, namespace, key), value); in SettingsStateChangerRule()
/cts/tests/tests/location/src/android/location/cts/psedorange/
DTroposphericModelEgnos.java215 int key = (int) (absLatitudeDeg / LATITUDE_15_DEGREES); in calculateZenithDryAndWetDelaysSec() local
217 double averagePressureMbar = interpolate(key * LATITUDE_15_DEGREES, in calculateZenithDryAndWetDelaysSec()
218 latDegreeToPressureMbarAvgMap[key - 1], (key + 1) * LATITUDE_15_DEGREES, in calculateZenithDryAndWetDelaysSec()
219 latDegreeToPressureMbarAvgMap[key], absLatitudeDeg); in calculateZenithDryAndWetDelaysSec()
220 double amplitudePressureMbar = interpolate(key * LATITUDE_15_DEGREES, in calculateZenithDryAndWetDelaysSec()
221 latDegreeToPressureMbarAmpMap[key - 1], (key + 1) * LATITUDE_15_DEGREES, in calculateZenithDryAndWetDelaysSec()
222 latDegreeToPressureMbarAmpMap[key], absLatitudeDeg); in calculateZenithDryAndWetDelaysSec()
225 double averageTempKelvin = interpolate(key * LATITUDE_15_DEGREES, in calculateZenithDryAndWetDelaysSec()
226 latDegreeToTempKelvinAvgMap[key - 1], (key + 1) * LATITUDE_15_DEGREES, in calculateZenithDryAndWetDelaysSec()
227 latDegreeToTempKelvinAvgMap[key], absLatitudeDeg); in calculateZenithDryAndWetDelaysSec()
[all …]
/cts/tests/camera/utils/src/android/hardware/camera2/cts/helpers/
DStaticMetadata.java420 Key<Float> key = CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE; in getMinimumFocusDistanceChecked() local
429 minFocusDistance = getValueFromKeyNonNull(key); in getMinimumFocusDistanceChecked()
431 minFocusDistance = mCharacteristics.get(key); in getMinimumFocusDistanceChecked()
438 checkTrueForKey(key, " minFocusDistance value shouldn't be negative", in getMinimumFocusDistanceChecked()
453 Key<Integer> key = CameraCharacteristics.LENS_INFO_FOCUS_DISTANCE_CALIBRATION; in getFocusDistanceCalibrationChecked() local
454 Integer calibration = getValueFromKeyNonNull(key); in getFocusDistanceCalibrationChecked()
460 checkTrueForKey(key, " value is out of range" , in getFocusDistanceCalibrationChecked()
521 Key<int[]> key = CameraCharacteristics.CONTROL_AE_AVAILABLE_ANTIBANDING_MODES; in getAeAvailableAntiBandingModesChecked() local
522 int[] modes = getValueFromKeyNonNull(key); in getAeAvailableAntiBandingModesChecked()
528 checkTrueForKey(key, "mode value " + mode + " is out if range", in getAeAvailableAntiBandingModesChecked()
[all …]
DCameraErrorCollector.java627 CameraCharacteristics.Key<T> key) { in expectKeyValueNotNull() argument
629 T value = characteristics.get(key); in expectKeyValueNotNull()
631 addMessage("Key " + key.getName() + " shouldn't be null"); in expectKeyValueNotNull()
646 CaptureRequest.Key<T> key) { in expectKeyValueNotNull() argument
648 T value = request.get(key); in expectKeyValueNotNull()
650 addMessage("Key " + key.getName() + " shouldn't be null"); in expectKeyValueNotNull()
663 public <T> T expectKeyValueNotNull(Builder request, CaptureRequest.Key<T> key) { in expectKeyValueNotNull() argument
665 T value = request.get(key); in expectKeyValueNotNull()
667 addMessage("Key " + key.getName() + " shouldn't be null"); in expectKeyValueNotNull()
680 public <T> T expectKeyValueNotNull(CaptureResult result, CaptureResult.Key<T> key) { in expectKeyValueNotNull() argument
[all …]
/cts/tools/utils/
Dcertificates.py23 key = None variable in Certificate
24 def __init__(self, cert, key): argument
26 self.key = key
32 return crypto.dump_privatekey(crypto.FILETYPE_PEM, self.key)
48 key = crypto.load_privatekey(crypto.FILETYPE_PEM, data)
49 return Certificate(cert, key)
52 def create(cn, issuer=None, key=None, keysize=2048, digest="sha256", argument
55 if key is None:
56 key = crypto.PKey()
57 key.generate_key(crypto.TYPE_RSA, keysize)
[all …]
/cts/tests/tests/keystore/src/android/keystore/cts/
DRSACipherTest.java43 for (ImportedKey key : RSASignatureTest.importKatKeyPairs(getContext(), in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
49 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
50 PrivateKey privateKey = key.getKeystoreBackedKeyPair().getPrivate(); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
66 throw new RuntimeException("Failed for key " + key.getAlias(), e); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
76 for (ImportedKey key : RSASignatureTest.importKatKeyPairs(getContext(), in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
82 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
83 PrivateKey privateKey = key.getKeystoreBackedKeyPair().getPrivate(); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
95 throw new RuntimeException("Failed for key " + key.getAlias(), e); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
104 for (ImportedKey key : RSASignatureTest.importKatKeyPairs(getContext(), in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus()
110 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus()
[all …]
DMacTest.java214 SecretKey key = importDefaultKatKey(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider() local
218 mac.init(key); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider()
231 SecretKey key = importDefaultKatKey(algorithm); in testMacGeneratedForEmptyMessage() local
235 mac.init(key); in testMacGeneratedForEmptyMessage()
252 SecretKey key = importDefaultKatKey(algorithm); in testMacGeneratedByAndroidKeyStoreVerifiesByAndroidKeyStore() local
256 mac.init(key); in testMacGeneratedByAndroidKeyStoreVerifiesByAndroidKeyStore()
260 assertMacVerifiesOneShot(algorithm, provider, key, message, macBytes); in testMacGeneratedByAndroidKeyStoreVerifiesByAndroidKeyStore()
273 SecretKey key = getDefaultKatKey(algorithm); in testMacGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider() local
282 assertMacVerifiesOneShot(algorithm, key, message, macBytes); in testMacGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider()
296 SecretKey key = getDefaultKatKey(algorithm); in testMacGeneratedByHighestPriorityProviderVerifiesByAndroidKeyStore() local
[all …]
DTestUtils.java136 static int getKeySizeBits(Key key) { in getKeySizeBits() argument
137 if (key instanceof ECKey) { in getKeySizeBits()
138 return ((ECKey) key).getParams().getCurve().getField().getFieldSize(); in getKeySizeBits()
139 } else if (key instanceof RSAKey) { in getKeySizeBits()
140 return ((RSAKey) key).getModulus().bitLength(); in getKeySizeBits()
142 throw new IllegalArgumentException("Unsupported key type: " + key.getClass()); in getKeySizeBits()
196 private static void assertKeyMaterialExportable(Key key) { in assertKeyMaterialExportable() argument
197 if (key instanceof PublicKey) { in assertKeyMaterialExportable()
198 assertEquals("X.509", key.getFormat()); in assertKeyMaterialExportable()
199 } else if (key instanceof PrivateKey) { in assertKeyMaterialExportable()
[all …]
/cts/common/device-side/util/src/com/android/compatibility/common/util/
DBundleUtils.java35 final String key = keysAndValues[i].toString(); in makeBundle() local
39 ret.putString(key, null); in makeBundle()
42 ret.putBoolean(key, (Boolean) value); in makeBundle()
45 ret.putInt(key, (Integer) value); in makeBundle()
48 ret.putString(key, (String) value); in makeBundle()
51 ret.putBundle(key, (Bundle) value); in makeBundle()
DSettingsUtils.java25 public static void putGlobalSetting(String key, String value) { in putGlobalSetting() argument
27 SystemUtil.runShellCommandForNoOutput("settings put global " + key + " " + value); in putGlobalSetting()
33 public static void putSecureSetting(String key, String value) { in putSecureSetting() argument
35 "settings --user current put secure " + key + " " + value); in putSecureSetting()
DCtsKeyEventUtil.java109 String key = keys[i]; in sendKeys() local
110 int repeater = key.indexOf('*'); in sendKeys()
114 keyCount = repeater == -1 ? 1 : Integer.parseInt(key.substring(0, repeater)); in sendKeys()
116 Log.w("ActivityTestCase", "Invalid repeat count: " + key); in sendKeys()
121 key = key.substring(repeater + 1); in sendKeys()
126 final Field keyCodeField = KeyEvent.class.getField("KEYCODE_" + key); in sendKeys()
136 Log.w("ActivityTestCase", "Unknown keycode: KEYCODE_" + key); in sendKeys()
139 Log.w("ActivityTestCase", "Unknown keycode: KEYCODE_" + key); in sendKeys()
154 final int key) { in sendKeyDownUp() argument
155 sendKey(instrumentation, targetView, new KeyEvent(KeyEvent.ACTION_DOWN, key)); in sendKeyDownUp()
[all …]
/cts/tests/sensor/src/android/hardware/cts/helpers/
DSensorStats.java80 public synchronized void addValue(String key, Object value) { in addValue() argument
84 mValues.put(key, value); in addValue()
94 public synchronized void addSensorStats(String key, SensorStats stats) { in addSensorStats() argument
98 mSensorStats.put(key, stats); in addSensorStats()
113 public synchronized Object getValue(String key) { in getValue() argument
114 return mValues.get(key); in getValue()
129 String key = statsEntry.getKey() + DELIMITER + valueEntry.getKey(); in flatten() local
130 flattenedMap.put(key, valueEntry.getValue()); in flatten()
141 for (String key : getSortedKeys(flattened)) { in log()
142 Object value = flattened.get(key); in log()
[all …]
/cts/tests/tests/drm/src/android/drm/cts/
DDrmInfoRequestTest.java75 final String key = (String) keys.next(); in testPutAndGetKeys() local
76 request.put(key, attributes.get(key)); in testPutAndGetKeys()
82 final String key = (String) keys.next(); in testPutAndGetKeys() local
83 assertEquals(request.get(key), attributes.get(key)); in testPutAndGetKeys()
88 final String key = (String) infoKeys.next(); in testPutAndGetKeys() local
89 assertEquals(request.get(key), attributes.get(key)); in testPutAndGetKeys()
DDrmInfoTest.java86 final String key = (String) keys.next(); in testPutAndGetKeys() local
87 info.put(key, attributes.get(key)); in testPutAndGetKeys()
93 final String key = (String) keys.next(); in testPutAndGetKeys() local
94 assertEquals(info.get(key), attributes.get(key)); in testPutAndGetKeys()
99 final String key = (String) infoKeys.next(); in testPutAndGetKeys() local
100 assertEquals(info.get(key), attributes.get(key)); in testPutAndGetKeys()
/cts/tests/tests/preference2/src/android/preference2/cts/
DPreferenceTest.java116 String key = mPreference.getKey(); in testGetKey() local
118 assertEquals(keyExp, key); in testGetKey()
122 final String key = "key1"; in testSetKey() local
125 mPreference.setKey(key); in testSetKey()
128 assertEquals(key, mPreference.getKey()); in testSetKey()
189 String key = "" + Math.random(); in testPersistInt() local
190 mCustomPreference.setKey(key); in testPersistInt()
206 String key = "" + Math.random(); in testPersistBoolean() local
207 mCustomPreference.setKey(key); in testPersistBoolean()
224 String key = "" + Math.random(); in testPersistString() local
[all …]
/cts/tests/leanbackjank/src/android/leanbackjank/cts/
DCtsJankTestBase.java36 private void printIntValueWithKey(String source, Bundle metrics, String key, in printIntValueWithKey() argument
38 if (!metrics.containsKey(key)) { in printIntValueWithKey()
41 … mLog.addValue(source, formatKeyForTestMetrics(key), metrics.getInt(key), resultType, resultUnit); in printIntValueWithKey()
44 private void printDoubleValueWithKey(String source, Bundle metrics, String key, in printDoubleValueWithKey() argument
46 if (!metrics.containsKey(key)) { in printDoubleValueWithKey()
49 mLog.addValue(source, formatKeyForTestMetrics(key), metrics.getDouble(key), resultType, in printDoubleValueWithKey()
53 private String formatKeyForTestMetrics(String key) { in formatKeyForTestMetrics() argument
54 return key.toLowerCase().replace('-', '_'); in formatKeyForTestMetrics()
/cts/tests/sample/src/android/sample/
DSampleDeviceActivity.java47 public void savePreference(String key, String value) { in savePreference() argument
51 editor.putString(key, value); in savePreference()
62 public String getPreference(String key) { in getPreference() argument
63 return mPreferences.getString(key, null); in getPreference()
/cts/tests/tests/content/src/android/content/cts/
DSharedPreferencesTest.java85 String key = "not-set"; in testDefaults() local
86 assertFalse(prefs.contains(key)); in testDefaults()
89 assertEquals(false, prefs.getBoolean(key, false)); in testDefaults()
90 assertEquals(true, prefs.getBoolean(key, true)); in testDefaults()
91 assertEquals(0.5f, prefs.getFloat(key, 0.5f)); in testDefaults()
92 assertEquals(123, prefs.getInt(key, 123)); in testDefaults()
93 assertEquals(999L, prefs.getLong(key, 999L)); in testDefaults()
94 assertEquals("default", prefs.getString(key, "default")); in testDefaults()
253 String key = new Integer(rand.nextInt(25)).toString(); in testTorture() local
258 Log.d(TAG, "Setting " + key + "=" + value); in testTorture()
[all …]
/cts/tests/signature/src/android/signature/cts/
DCurrentApi.java142 private static int modifierDescriptionToReflectedType(String name, String key, String value) { in modifierDescriptionToReflectedType() argument
143 if (key.equals(MODIFIER_ABSTRACT)) { in modifierDescriptionToReflectedType()
145 } else if (key.equals(MODIFIER_FINAL)) { in modifierDescriptionToReflectedType()
147 } else if (key.equals(MODIFIER_NATIVE)) { in modifierDescriptionToReflectedType()
149 } else if (key.equals(MODIFIER_STATIC)) { in modifierDescriptionToReflectedType()
151 } else if (key.equals(MODIFIER_SYNCHRONIZED)) { in modifierDescriptionToReflectedType()
153 } else if (key.equals(MODIFIER_TRANSIENT)) { in modifierDescriptionToReflectedType()
155 } else if (key.equals(MODIFIER_VOLATILE)) { in modifierDescriptionToReflectedType()
157 } else if (key.equals(MODIFIER_VISIBILITY)) { in modifierDescriptionToReflectedType()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DFbeHelper.java91 for (char key : numericKeys.toCharArray()) { in pressNumericKeys()
92 if (key >= '0' && key <= '9') { in pressNumericKeys()
93 mUiDevice.pressKeyCode(KeyEvent.KEYCODE_0 + key - '0'); in pressNumericKeys()
95 throw new IllegalArgumentException(key + " is not a numeric key."); in pressNumericKeys()
/cts/tests/inputmethod/src/android/view/inputmethod/cts/
DKeyboardTest.java42 for (final Key key : keyboard.getKeys()) { in testKeyOnPressedAndReleased()
43 if (!key.sticky) { in testKeyOnPressedAndReleased()
44 nonStickyKey = key; in testKeyOnPressedAndReleased()
48 for (final Key key : keyboard.getModifierKeys()) { in testKeyOnPressedAndReleased()
49 if (key.sticky) { in testKeyOnPressedAndReleased()
50 stickyKey = key; in testKeyOnPressedAndReleased()
/cts/tests/sensor/src/android/hardware/cts/helpers/sensoroperations/
DSensorOperation.java78 protected void addSensorStats(String key, SensorStats stats) { in addSensorStats() argument
79 getStats().addSensorStats(key, stats); in addSensorStats()
88 protected void addSensorStats(String key, int index, SensorStats stats) { in addSensorStats() argument
89 addSensorStats(String.format("%s_%03d", key, index), stats); in addSensorStats()
/cts/apps/CameraITS/tests/scene0/
Dtest_sensor_events.py37 for key, existing in sensors.iteritems():
39 e_msg = 'Sensor %s has no events!' % key
40 assert len(events[key]) > 0, e_msg

1234567