Home
last modified time | relevance | path

Searched refs:uid (Results 1 – 25 of 63) sorted by relevance

123

/cts/tests/tests/net/native/qtaguid/src/
DNativeQtaguidTest.cpp51 int getCtrlSkInfo(int tag, uid_t uid, uint64_t* sk_addr, int* ref_cnt) { in getCtrlSkInfo() argument
56 uint64_t full_tag = (uint64_t)tag << 32 | uid; in getCtrlSkInfo()
58 snprintf(pattern, sizeof(pattern), " tag=0x%" PRIx64 " (uid=%" PRIu32 ")", full_tag, uid); in getCtrlSkInfo()
73 if (!(res == TOTAL_PARAM && k_tag == full_tag && k_uid == uid)) in getCtrlSkInfo()
84 uid_t uid = getuid(); in checkNoSocketPointerLeaks() local
90 EXPECT_EQ(0, legacy_tagSocket(sockfd, tag, uid)); in checkNoSocketPointerLeaks()
91 EXPECT_EQ(0, getCtrlSkInfo(tag, uid, &sk_addr, &ref_cnt)); in checkNoSocketPointerLeaks()
94 EXPECT_EQ(-ENOENT, getCtrlSkInfo(tag, uid, &sk_addr, &ref_cnt)); in checkNoSocketPointerLeaks()
105 uid_t uid = getuid(); in TEST() local
109 EXPECT_EQ(0, legacy_tagSocket(sockfd, tag, uid)); in TEST()
[all …]
/cts/tests/app/src/android/app/cts/
DActivityManagerProcessErrorStateInfoTest.java43 int uid = 3; in testWriteToParcel() local
51 mErrorStateInfo.uid = uid; in testWriteToParcel()
65 assertEquals(uid, values.uid); in testWriteToParcel()
77 int uid = 3; in testReadFromParcel() local
85 mErrorStateInfo.uid = uid; in testReadFromParcel()
99 assertEquals(uid, values.uid); in testReadFromParcel()
/cts/tests/app/src/android/app/cts/android/app/cts/tools/
DUidImportanceListener.java35 public UidImportanceListener(Context context, int uid, int cutPoint) { in UidImportanceListener() argument
36 this(context, uid, cutPoint, 5*1000); in UidImportanceListener()
39 public UidImportanceListener(Context context, int uid, int cutPoint, long defaultWaitTime) { in UidImportanceListener() argument
41 mUid = uid; in UidImportanceListener()
47 public void onUidImportance(int uid, int importance) { in onUidImportance() argument
49 Log.d("XXXXX", "Got importance for uid " + uid + " (cut " + mCutPoint in onUidImportance()
51 if (uid == mUid) { in onUidImportance()
DWatchUidRunner.java94 public WatchUidRunner(Instrumentation instrumentation, int uid) { in WatchUidRunner() argument
95 this(instrumentation, uid, 5*1000); in WatchUidRunner()
98 public WatchUidRunner(Instrumentation instrumentation, int uid, long defaultWaitTime) { in WatchUidRunner() argument
100 mUid = uid; in WatchUidRunner()
101 mUidStr = Integer.toString(uid); in WatchUidRunner()
105 "am watch-uids --oom " + uid); in WatchUidRunner()
/cts/hostsidetests/appsecurity/test-apps/AppAccessData/src/com/android/cts/appaccessdata/
DAccessPrivateDataTest.java124 .getApplicationInfo().uid; in testAccessPrivateTrafficStats()
137 final int uid = android.os.Process.myUid(); in testTrafficStatsStatsUidSelf() local
138 final long rxb = TrafficStats.getUidRxBytes(uid); in testTrafficStatsStatsUidSelf()
139 final long rxp = TrafficStats.getUidRxPackets(uid); in testTrafficStatsStatsUidSelf()
140 final long txb = TrafficStats.getUidTxBytes(uid); in testTrafficStatsStatsUidSelf()
141 final long txp = TrafficStats.getUidTxPackets(uid); in testTrafficStatsStatsUidSelf()
172 assertEquals(rxb, TrafficStats.getUidRxBytes(uid)); in testTrafficStatsStatsUidSelf()
173 assertEquals(rxp, TrafficStats.getUidRxPackets(uid)); in testTrafficStatsStatsUidSelf()
174 assertEquals(txb, TrafficStats.getUidTxBytes(uid)); in testTrafficStatsStatsUidSelf()
175 assertEquals(txp, TrafficStats.getUidTxPackets(uid)); in testTrafficStatsStatsUidSelf()
/cts/tests/tests/externalservice/src/android/externalservice/cts/
DExternalServiceTest.java145 assertFalse(id.uid == 0 || id.pid == 0); in testBindExternalService()
146 assertNotEquals(Process.myUid(), id.uid); in testBindExternalService()
167 assertFalse(creatorId.uid == 0 || creatorId.pid == 0); in testBindExternalServiceWithRunningOwn()
201 assertFalse(creatorServiceId.uid == 0 || creatorId.pid == 0); in testBindExternalServiceWithRunningOwn()
213 assertFalse(serviceId.uid == 0 || serviceId.pid == 0); in testBindExternalServiceWithRunningOwn()
220 assertNotEquals(myUid, creatorId.uid); in testBindExternalServiceWithRunningOwn()
221 assertNotEquals(myUid, creatorServiceId.uid); in testBindExternalServiceWithRunningOwn()
222 assertNotEquals(myUid, serviceId.uid); in testBindExternalServiceWithRunningOwn()
227 assertNotEquals(creatorId.uid, creatorServiceId.uid); in testBindExternalServiceWithRunningOwn()
228 assertNotEquals(creatorId.uid, serviceId.uid); in testBindExternalServiceWithRunningOwn()
[all …]
/cts/hostsidetests/statsd/src/android/cts/statsd/uidmap/
DUidMapTests.java56 private boolean hasMatchingChange(UidMapping uidmap, int uid, boolean expectDeletion) { in hasMatchingChange() argument
57 LogUtil.CLog.d("The uid we are looking for is " + uid); in hasMatchingChange()
59 if (change.getAppHash() == DEVICE_SIDE_TEST_PKG_HASH && change.getUid() == uid) { in hasMatchingChange()
87 int uid = getUid(); in testChangeFromInstallation() local
90 if (hasMatchingChange(report.getUidMap(), uid, false)) { in testChangeFromInstallation()
114 int uid = getUid(); in testChangeFromReinstall() local
117 if (hasMatchingChange(report.getUidMap(), uid, false)) { in testChangeFromReinstall()
131 int uid = getUid(); in testChangeFromUninstall() local
142 if (hasMatchingChange(report.getUidMap(), uid, true)) { in testChangeFromUninstall()
/cts/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/src/com/android/cts/multiuserstorageapp/
DMultiUserStorageTest.java69 final int uid = android.os.Process.myUid(); in testWriteIsolatedStorage() local
71 writeInt(buildApiPath(FILE_SINGLETON), uid); in testWriteIsolatedStorage() local
72 writeInt(buildApiPath(FILE_MY_UID), uid); in testWriteIsolatedStorage() local
80 writeInt(new File(path, FILE_SINGLETON), uid); in testWriteIsolatedStorage()
85 final int uid = android.os.Process.myUid(); in testReadIsolatedStorage() local
89 assertEquals("Failed to read singleton file from API path", uid, in testReadIsolatedStorage()
91 assertEquals("Failed to read singleton file from env path", uid, in testReadIsolatedStorage()
93 assertEquals("Failed to read singleton file from raw path", uid, in testReadIsolatedStorage()
96 assertEquals("Failed to read UID file from API path", uid, in testReadIsolatedStorage()
104 assertEquals("Unexpected value in singleton file at " + path, uid, in testReadIsolatedStorage()
/cts/tests/tests/security/src/android/security/cts/
DListeningPortsTest.java213 String addrUid = entry.localAddress.getHostAddress() + ' ' + entry.uid; in assertNoAccessibleListeningPorts()
214 String addrPortUid = addrPort + ' ' + entry.uid; in assertNoAccessibleListeningPorts()
225 + entry.port + ", UID=" + entry.uid in assertNoAccessibleListeningPorts()
226 + " " + uidToPackage(entry.uid) + " in " in assertNoAccessibleListeningPorts()
235 private String uidToPackage(int uid) { in uidToPackage() argument
237 String[] packages = pm.getPackagesForUid(uid); in uidToPackage()
301 private final int uid; field in ListeningPortsTest.ParsedProcEntry
303 private ParsedProcEntry(InetAddress addr, int port, String state, int uid) { in ParsedProcEntry() argument
307 this.uid = uid; in ParsedProcEntry()
343 int uid = Integer.parseInt(fields[7]); in parse() local
[all …]
/cts/tests/tests/media/src/android/media/cts/
DAudioRecordAppOpTest.java56 final int uid = Process.myUid(); in testRecordAppOps() local
76 uid, packageName)).isFalse(); in testRecordAppOps()
88 eq(uid), eq(packageName), eq(true)); in testRecordAppOps()
92 uid, packageName)).isTrue(); in testRecordAppOps()
106 eq(uid), eq(packageName), eq(false)); in testRecordAppOps()
110 uid, packageName)).isFalse(); in testRecordAppOps()
/cts/tests/framework/base/windowmanager/src/android/server/wm/
DAlertWindowsAppOpsTests.java83 final int uid = Process.myUid(); in testSystemAlertWindowAppOpsInitiallyAllowed() local
96 assertFalse(appOpsManager.isOperationActive(OP_SYSTEM_ALERT_WINDOW, uid, packageName)); in testSystemAlertWindowAppOpsInitiallyAllowed()
106 eq(uid), eq(packageName), eq(true)); in testSystemAlertWindowAppOpsInitiallyAllowed()
110 uid, packageName)); in testSystemAlertWindowAppOpsInitiallyAllowed()
123 eq(uid), eq(packageName), eq(false)); in testSystemAlertWindowAppOpsInitiallyAllowed()
126 assertFalse(appOpsManager.isOperationActive(OP_SYSTEM_ALERT_WINDOW, uid, packageName)); in testSystemAlertWindowAppOpsInitiallyAllowed()
145 assertTrue(appOpsManager.isOperationActive(OP_SYSTEM_ALERT_WINDOW, uid, packageName)); in testSystemAlertWindowAppOpsInitiallyAllowed()
/cts/tests/inputmethod/src/android/view/inputmethod/cts/
DInputBindingTest.java43 int uid = 1; in testInputBinding() local
45 InputBinding inputBinding = new InputBinding(bic, binder, uid, pid); in testInputBinding()
49 assertEquals(uid, inputBinding.getUid()); in testInputBinding()
59 assertEquals(uid, target.getUid()); in testInputBinding()
/cts/hostsidetests/net/app/src/com/android/cts/net/hostside/
DDataSaverModeTest.java204 int uid = -1; in testGetRestrictBackgroundStatus_requiredWhitelistedPackages() local
206 uid = getUid(packageName); in testGetRestrictBackgroundStatus_requiredWhitelistedPackages()
207 assertRestrictBackgroundWhitelist(uid, true); in testGetRestrictBackgroundStatus_requiredWhitelistedPackages()
210 if (uid > 0) { in testGetRestrictBackgroundStatus_requiredWhitelistedPackages()
211 error.append(" (uid ").append(uid).append(")"); in testGetRestrictBackgroundStatus_requiredWhitelistedPackages()
DAbstractRestrictBackgroundNetworkTestCase.java713 protected void addRestrictBackgroundWhitelist(int uid) throws Exception { in addRestrictBackgroundWhitelist() argument
714 executeShellCommand("cmd netpolicy add restrict-background-whitelist " + uid); in addRestrictBackgroundWhitelist()
715 assertRestrictBackgroundWhitelist(uid, true); in addRestrictBackgroundWhitelist()
718 assertRestrictBackgroundBlacklist(uid, false); in addRestrictBackgroundWhitelist()
721 protected void removeRestrictBackgroundWhitelist(int uid) throws Exception { in removeRestrictBackgroundWhitelist() argument
722 executeShellCommand("cmd netpolicy remove restrict-background-whitelist " + uid); in removeRestrictBackgroundWhitelist()
723 assertRestrictBackgroundWhitelist(uid, false); in removeRestrictBackgroundWhitelist()
726 protected void assertRestrictBackgroundWhitelist(int uid, boolean expected) throws Exception { in assertRestrictBackgroundWhitelist() argument
727 assertRestrictBackground("restrict-background-whitelist", uid, expected); in assertRestrictBackgroundWhitelist()
730 protected void addRestrictBackgroundBlacklist(int uid) throws Exception { in addRestrictBackgroundBlacklist() argument
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/
DBleClientService.java542 private void writeCharacteristic(UUID uid, String writeValue) { in writeCharacteristic() argument
543 BluetoothGattCharacteristic characteristic = getCharacteristic(uid); in writeCharacteristic()
556 private void writeDescriptor(UUID uid, String writeValue) { in writeDescriptor() argument
557 BluetoothGattDescriptor descriptor = getDescriptor(uid); in writeDescriptor()
626 private void setNotification(UUID uid, boolean enable) { in setNotification() argument
627 BluetoothGattCharacteristic characteristic = getCharacteristic(uid); in setNotification()
843 private BluetoothGattDescriptor getDescriptor(UUID uid) { in getDescriptor() argument
848 descriptor = characteristic.getDescriptor(uid); in getDescriptor()
991 final UUID uid = characteristic.getUuid();
1001 notifyError("Failed to write characteristic: " + status + " : " + uid);
[all …]
DBleEncryptedClientService.java240 private BluetoothGattDescriptor getDescriptor(UUID uid) { in getDescriptor() argument
245 descriptor = characteristic.getDescriptor(uid); in getDescriptor()
380 UUID uid = characteristic.getUuid();
382 …d(TAG, "onCharacteristicWrite: characteristic.val=" + value + " status=" + status + " uid=" + uid);
385 if (uid.equals(CHARACTERISTIC_ENCRYPTED_WRITE_UUID)) {
417 UUID uid = characteristic.getUuid();
421 if (uid.equals(CHARACTERISTIC_ENCRYPTED_READ_UUID)) {
464 UUID uid = descriptor.getUuid();
466 if (uid.equals(DESCRIPTOR_ENCRYPTED_READ_UUID)) {
487 if (uid.equals(DESCRIPTOR_ENCRYPTED_READ_UUID)) {
[all …]
/cts/tests/tests/permission/src/android/permission/cts/
DAppIdleStatePermissionTest.java54 int uid = pm.getApplicationInfo(pkg.packageName, 0).uid; in testChangeAppIdleStatePermission() local
55 if (UserHandle.isApp(uid)) { in testChangeAppIdleStatePermission()
/cts/hostsidetests/net/src/com/android/cts/net/
DHostsideRestrictBackgroundNetworkTests.java288 private void assertRestrictBackgroundWhitelist(int uid, boolean expected) throws Exception { in assertRestrictBackgroundWhitelist() argument
293 actual = output.contains(Integer.toString(uid)); in assertRestrictBackgroundWhitelist()
297 Log.v(TAG, "whitelist check for uid " + uid + " doesn't match yet (expected " in assertRestrictBackgroundWhitelist()
301 fail("whitelist check for uid " + uid + " failed: expected " in assertRestrictBackgroundWhitelist()
330 protected void addRestrictBackgroundWhitelist(int uid) throws Exception { in addRestrictBackgroundWhitelist() argument
331 runCommand("cmd netpolicy add restrict-background-whitelist " + uid); in addRestrictBackgroundWhitelist()
332 assertRestrictBackgroundWhitelist(uid, true); in addRestrictBackgroundWhitelist()
/cts/hostsidetests/appsecurity/test-apps/V3SigningSchemeRotation/src/android/appsecurity/cts/v3rotationtests/
DV3RotationTest.java173 int uid = pm.getPackageUid(PKG, 0); in testHasSigningCertificateByUid() local
176 pm.hasSigningCertificate(uid, firstCertBytes, PackageManager.CERT_INPUT_RAW_X509)); in testHasSigningCertificateByUid()
179 pm.hasSigningCertificate(uid, secondCertBytes, PackageManager.CERT_INPUT_RAW_X509)); in testHasSigningCertificateByUid()
186 int uid = pm.getPackageUid(PKG, 0); in testHasSigningCertificateByUidSha256() local
190 pm.hasSigningCertificate(uid, firstCertBytes, PackageManager.CERT_INPUT_SHA256)); in testHasSigningCertificateByUidSha256()
193 pm.hasSigningCertificate(uid, secondCertBytes, PackageManager.CERT_INPUT_SHA256)); in testHasSigningCertificateByUidSha256()
/cts/hostsidetests/appsecurity/test-apps/AppWithData/src/com/android/cts/appwithdata/
DMyProvider.java83 final int uid = Os.getuid(); in call() local
84 Log.v(TAG, "My UID is " + uid); in call()
85 TrafficStats.setThreadStatsUid(uid); in call()
86 if (TrafficStats.getThreadStatsUid() != uid) { in call()
/cts/hostsidetests/incident/src/com/android/server/cts/
DPowerIncidentTest.java78 final PowerManagerServiceDumpProto.UidStateProto uid = dump.getUidStates(0); in verifyPowerManagerServiceDumpProto() local
79 assertEquals(uid.getUid(), SYSTEM_UID); in verifyPowerManagerServiceDumpProto()
80 assertEquals(uid.getUidString(), Integer.toString(SYSTEM_UID)); in verifyPowerManagerServiceDumpProto()
81 assertTrue(uid.getIsActive()); in verifyPowerManagerServiceDumpProto()
DBatteryStatsValidationTest.java485 int uid = Integer.parseInt(uidLineParts[2].trim()); local
486 assertTrue(uid > 10000);
487 return uid;
500 int uid = getUid(); in assertValueRange() local
501 long value = getLongValue(uid, tag, optionalAfterTag, index); in assertValueRange()
509 private long getLongValue(int uid, String tag, String optionalAfterTag, int index) in getLongValue() argument
519 if (line.contains(uid + ",l," + tag + "," + optionalAfterTag) in getLongValue()
521 line.contains(uid + ",l," + tag + ",\"" + optionalAfterTag))) { in getLongValue()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DBaseDeviceAdminTest.java45 public String onChoosePrivateKeyAlias(Context context, Intent intent, int uid, Uri uri, in onChoosePrivateKeyAlias() argument
47 super.onChoosePrivateKeyAlias(context, intent, uid, uri, suggestedAlias); in onChoosePrivateKeyAlias()
48 if (uid != Process.myUid() || uri == null) { in onChoosePrivateKeyAlias()
/cts/tests/ProcessTest/src/com/android/cts/process/
DProcessTest.java40 PackageManager.GET_META_DATA).uid; in testUid()
42 PackageManager.GET_META_DATA).uid; in testUid()
44 PackageManager.GET_META_DATA).uid; in testUid()
/cts/hostsidetests/statsd/src/android/cts/statsd/validation/
DValidationTests.java125 int uid = getUid(); in testPartialWakelock() local
127 getBatteryStatsPartialWakelock(batterystatsProto, uid, EXPECTED_TAG); in testPartialWakelock()
295 int uid = -1; in getStatsdWakelockData() local
299 uid = dim.getValueInt(); in getStatsdWakelockData()
306 assertTrue("Did not receive a uid for the wakelock", uid != -1); in getStatsdWakelockData()
314 if (statsdWakelockData.containsKey(uid)) { in getStatsdWakelockData()
315 HashMap<Long, Long> tagToDuration = statsdWakelockData.get(uid); in getStatsdWakelockData()
320 statsdWakelockData.put(uid, tagToDuration); in getStatsdWakelockData()
328 long uid, String tag) { in getBatteryStatsPartialWakelock() argument
335 if (uidProto.getUid() == uid) { in getBatteryStatsPartialWakelock()
[all …]

123