Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 1294) sorted by relevance

12345678910>>...52

/frameworks/base/libs/androidfw/
DObbFile.cpp88 int fd; in readFrom() local
91 fd = ::open(filename, O_RDONLY); in readFrom()
92 if (fd < 0) { in readFrom()
96 success = readFrom(fd); in readFrom()
97 close(fd); in readFrom()
100 ALOGW("failed to read from %s (fd=%d)\n", filename, fd); in readFrom()
107 bool ObbFile::readFrom(int fd) in readFrom() argument
109 if (fd < 0) { in readFrom()
114 return parseObbFile(fd); in readFrom()
117 bool ObbFile::parseObbFile(int fd) in parseObbFile() argument
[all …]
/frameworks/base/services/core/jni/
Dcom_android_server_UsbDeviceManager.cpp45 static void set_accessory_string(JNIEnv *env, int fd, int cmd, jobjectArray strArray, int index) in set_accessory_string() argument
50 ioctl(fd, cmd, buffer); in set_accessory_string()
62 int fd = open(DRIVER_NAME, O_RDWR); in android_server_UsbDeviceManager_getAccessoryStrings() local
63 if (fd < 0) { in android_server_UsbDeviceManager_getAccessoryStrings()
70 set_accessory_string(env, fd, ACCESSORY_GET_STRING_MANUFACTURER, strArray, 0); in android_server_UsbDeviceManager_getAccessoryStrings()
71 set_accessory_string(env, fd, ACCESSORY_GET_STRING_MODEL, strArray, 1); in android_server_UsbDeviceManager_getAccessoryStrings()
72 set_accessory_string(env, fd, ACCESSORY_GET_STRING_DESCRIPTION, strArray, 2); in android_server_UsbDeviceManager_getAccessoryStrings()
73 set_accessory_string(env, fd, ACCESSORY_GET_STRING_VERSION, strArray, 3); in android_server_UsbDeviceManager_getAccessoryStrings()
74 set_accessory_string(env, fd, ACCESSORY_GET_STRING_URI, strArray, 4); in android_server_UsbDeviceManager_getAccessoryStrings()
75 set_accessory_string(env, fd, ACCESSORY_GET_STRING_SERIAL, strArray, 5); in android_server_UsbDeviceManager_getAccessoryStrings()
[all …]
Dcom_android_server_PersistentDataBlockService.cpp35 uint64_t get_block_device_size(int fd) in get_block_device_size() argument
40 ret = ioctl(fd, BLKGETSIZE64, &size); in get_block_device_size()
48 int wipe_block_device(int fd) in wipe_block_device() argument
52 uint64_t len = get_block_device_size(fd); in wipe_block_device()
60 ret = ioctl(fd, BLKSECDISCARD, &range); in wipe_block_device()
65 ret = ioctl(fd, BLKDISCARD, &range); in wipe_block_device()
82 int fd = open(path.c_str(), O_RDONLY); in com_android_server_PersistentDataBlockService_getBlockDeviceSize() local
84 if (fd < 0) in com_android_server_PersistentDataBlockService_getBlockDeviceSize()
87 const uint64_t size = get_block_device_size(fd); in com_android_server_PersistentDataBlockService_getBlockDeviceSize()
89 close(fd); in com_android_server_PersistentDataBlockService_getBlockDeviceSize()
[all …]
/frameworks/base/core/java/android/net/
DLocalSocketImpl.java45 private FileDescriptor fd; field in LocalSocketImpl
65 FileDescriptor myFd = fd; in available()
88 FileDescriptor myFd = fd; in read()
106 FileDescriptor myFd = fd; in read()
141 FileDescriptor myFd = fd; in write()
155 FileDescriptor myFd = fd; in write()
162 private native int read_native(FileDescriptor fd) throws IOException; in read_native() argument
164 FileDescriptor fd) throws IOException; in readba_native() argument
166 FileDescriptor fd) throws IOException; in writeba_native() argument
167 private native void write_native(int b, FileDescriptor fd) in write_native() argument
[all …]
/frameworks/base/core/jni/
Dandroid_util_MemoryIntArray.cpp39 int fd = ashmem_create_region(nameStr, ashmemSize); in android_util_MemoryIntArray_create() local
42 if (fd < 0) { in android_util_MemoryIntArray_create()
47 int setProtResult = ashmem_set_prot_region(fd, PROT_READ | PROT_WRITE); in android_util_MemoryIntArray_create()
53 return fd; in android_util_MemoryIntArray_create()
56 static jlong android_util_MemoryIntArray_open(JNIEnv* env, jobject clazz, jint fd, in android_util_MemoryIntArray_open() argument
59 if (fd < 0) { in android_util_MemoryIntArray_open()
64 if (!ashmem_valid(fd)) { in android_util_MemoryIntArray_open()
69 int ashmemSize = ashmem_get_size_region(fd); in android_util_MemoryIntArray_open()
84 void* ashmemAddr = mmap(NULL, ashmemSize, protMode, MAP_SHARED, fd, 0); in android_util_MemoryIntArray_open()
91 int mmapedSize = ashmem_get_size_region(fd); in android_util_MemoryIntArray_open()
[all …]
Dfd_utils.cpp173 static FileDescriptorInfo* CreateFromFd(int fd, fail_fn_t fail_fn);
181 const int fd; member in FileDescriptorInfo
191 explicit FileDescriptorInfo(int fd);
193 FileDescriptorInfo(struct stat stat, const std::string& file_path, int fd, int open_flags,
203 static bool GetSocketName(const int fd, std::string* result);
211 FileDescriptorInfo* FileDescriptorInfo::CreateFromFd(int fd, fail_fn_t fail_fn) { in CreateFromFd() argument
215 if (TEMP_FAILURE_RETRY(fstat(fd, &f_stat)) == -1) { in CreateFromFd()
216 fail_fn(android::base::StringPrintf("Unable to stat %d", fd)); in CreateFromFd()
223 if (!GetSocketName(fd, &socket_name)) { in CreateFromFd()
230 fd)); in CreateFromFd()
[all …]
Dandroid_hardware_SerialPort.cpp135 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_hardware_SerialPort_open() local
137 fd = fcntl(fd, F_DUPFD_CLOEXEC, 0); in android_hardware_SerialPort_open()
138 if (fd < 0) { in android_hardware_SerialPort_open()
142 env->SetIntField(thiz, field_context, fd); in android_hardware_SerialPort_open()
145 if (tcgetattr(fd, &tio)) in android_hardware_SerialPort_open()
156 tcsetattr(fd, TCSANOW, &tio); in android_hardware_SerialPort_open()
157 tcflush(fd, TCIFLUSH); in android_hardware_SerialPort_open()
163 int fd = env->GetIntField(thiz, field_context); in android_hardware_SerialPort_close() local
164 close(fd); in android_hardware_SerialPort_close()
171 int fd = env->GetIntField(thiz, field_context); in android_hardware_SerialPort_read_array() local
[all …]
Dandroid_net_LocalSocketImpl.cpp61 int fd; in socket_connect_local() local
68 fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in socket_connect_local()
77 fd, in socket_connect_local()
99 int fd; in socket_bind_local() local
106 fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in socket_bind_local()
114 ret = socket_local_server_bind(fd, nameUtf8.c_str(), namespaceId); in socket_bind_local()
129 static ssize_t socket_read_all(JNIEnv *env, jobject thisJ, int fd, in socket_read_all() argument
135 ret = ReceiveFileDescriptorVector(fd, buffer, len, 64, &received_fds); in socket_read_all()
169 for (auto &fd : received_fds) { in socket_read_all() local
171 static_cast<void>(fd.release()); in socket_read_all()
[all …]
Dandroid_backup_BackupHelperDispatcher.cpp52 int fd = jniGetFDFromFileDescriptor(env, fdObj); in readHeader_native() local
54 amt = read(fd, &flattenedHeader.headerSize, sizeof(flattenedHeader.headerSize)); in readHeader_native()
64 lseek(fd, remainingHeader, SEEK_CUR); in readHeader_native()
70 amt = read(fd, &flattenedHeader.version, in readHeader_native()
82 lseek(fd, remainingHeader, SEEK_CUR); in readHeader_native()
109 amt = read(fd, buf, flattenedHeader.nameLength); in readHeader_native()
117 lseek(fd, remainingHeader, SEEK_CUR); in readHeader_native()
129 int fd = jniGetFDFromFileDescriptor(env, fdObj); in skipChunk_native() local
131 lseek(fd, bytesToSkip, SEEK_CUR); in skipChunk_native()
152 int fd = jniGetFDFromFileDescriptor(env, fdObj); in allocateHeader_native() local
[all …]
/frameworks/native/services/utils/tests/
DPriorityDumper_test.cpp50 PriorityDumperTest() : dumper_(), dumpAlldumper_(), fd(1) {} in PriorityDumperTest()
53 int fd; member in PriorityDumperTest
64 EXPECT_CALL(dumper_, dumpAll(fd, ElementsAreArray(args), /*asProto=*/false)); in TEST_F()
65 dumper_.priorityDump(fd, args); in TEST_F()
71 EXPECT_CALL(dumper_, dumpAll(fd, ElementsAreArray(args), /*asProto=*/false)); in TEST_F()
72 dumper_.priorityDump(fd, args); in TEST_F()
79 EXPECT_CALL(dumper_, dumpCritical(fd, ElementsAreArray(strippedArgs), /*asProto=*/false)); in TEST_F()
80 dumper_.priorityDump(fd, args); in TEST_F()
89 EXPECT_CALL(dumper_, dumpCritical(fd, ElementsAreArray(strippedArgs), /*asProto=*/false)); in TEST_F()
90 dumper_.priorityDump(fd, args); in TEST_F()
[all …]
/frameworks/base/services/core/java/com/android/server/connectivity/
DTcpKeepaliveController.java111 public static TcpKeepalivePacketData getTcpKeepalivePacket(@NonNull FileDescriptor fd) in getTcpKeepalivePacket() argument
114 final TcpKeepalivePacketDataParcelable tcpDetails = switchToRepairMode(fd); in getTcpKeepalivePacket()
117 switchOutOfRepairMode(fd); in getTcpKeepalivePacket()
128 private static TcpKeepalivePacketDataParcelable switchToRepairMode(FileDescriptor fd) in switchToRepairMode() argument
130 if (DBG) Log.i(TAG, "switchToRepairMode to start tcp keepalive : " + fd); in switchToRepairMode()
138 srcSockAddr = Os.getsockname(fd); in switchToRepairMode()
152 dstSockAddr = Os.getpeername(fd); in switchToRepairMode()
166 dropAllIncomingPackets(fd, true); in switchToRepairMode()
169 Os.setsockoptInt(fd, IPPROTO_TCP, TCP_REPAIR, TCP_REPAIR_ON); in switchToRepairMode()
172 if (!isSocketIdle(fd)) { in switchToRepairMode()
[all …]
/frameworks/native/libs/binder/
DMemoryHeapBase.cpp49 int fd = ashmem_create_region(name == nullptr ? "MemoryHeapBase" : name, size); in MemoryHeapBase() local
50 ALOGE_IF(fd<0, "error creating ashmem region: %s", strerror(errno)); in MemoryHeapBase()
51 if (fd >= 0) { in MemoryHeapBase()
52 if (mapfd(fd, size) == NO_ERROR) { in MemoryHeapBase()
54 ashmem_set_prot_region(fd, PROT_READ); in MemoryHeapBase()
68 int fd = open(device, open_flags); in MemoryHeapBase() local
69 ALOGE_IF(fd<0, "error opening %s: %s", device, strerror(errno)); in MemoryHeapBase()
70 if (fd >= 0) { in MemoryHeapBase()
73 if (mapfd(fd, size) == NO_ERROR) { in MemoryHeapBase()
79 MemoryHeapBase::MemoryHeapBase(int fd, size_t size, uint32_t flags, off_t offset) in MemoryHeapBase() argument
[all …]
/frameworks/native/opengl/libs/EGL/
DFileBlobCache.cpp55 int fd = open(mFilename.c_str(), O_RDONLY, 0); in FileBlobCache() local
56 if (fd == -1) { in FileBlobCache()
65 if (fstat(fd, &statBuf) == -1) { in FileBlobCache()
67 close(fd); in FileBlobCache()
76 close(fd); in FileBlobCache()
81 PROT_READ, MAP_PRIVATE, fd, 0)); in FileBlobCache()
85 close(fd); in FileBlobCache()
93 close(fd); in FileBlobCache()
99 close(fd); in FileBlobCache()
108 close(fd); in FileBlobCache()
[all …]
/frameworks/av/media/codec2/vndk/internal/
DC2ParamInternal.h23 inline static uint32_t GetOffset(const C2FieldDescriptor &fd) { in GetOffset()
24 return fd._mFieldId._mOffset; in GetOffset()
27 inline static void SetOffset(C2FieldDescriptor &fd, uint32_t offset) { in SetOffset()
28 fd._mFieldId._mOffset = offset; in SetOffset()
31 inline static uint32_t GetEndOffset(const C2FieldDescriptor &fd, uint32_t paramSize = 0) {
32 uint32_t endOffset = fd._mFieldId._mOffset + fd._mExtent * fd._mFieldId._mSize;
34 return fd._mExtent ? endOffset : std::max(endOffset, paramSize);
37 inline static uint32_t GetSize(const C2FieldDescriptor &fd) { in GetSize()
38 return fd._mFieldId._mSize; in GetSize()
61 inline static _C2FieldId GetField(const C2FieldDescriptor &fd) { in GetField()
[all …]
/frameworks/base/cmds/incidentd/src/
DFdBuffer.cpp55 status_t FdBuffer::read(int fd, int64_t timeout) { in read() argument
56 struct pollfd pfds = {.fd = fd, .events = POLLIN}; in read()
59 fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); in read()
93 ::read(fd, mBuffer->writeBuffer(), mBuffer->currentToWrite())); in read()
98 VLOG("Fail to read %d: %s", fd, strerror(errno)); in read()
102 VLOG("Reached EOF of fd=%d", fd); in read()
113 status_t FdBuffer::readFully(int fd) { in readFully() argument
129 TEMP_FAILURE_RETRY(::read(fd, mBuffer->writeBuffer(), mBuffer->currentToWrite())); in readFully()
131 VLOG("Fail to read %d: %s", fd, strerror(errno)); in readFully()
145 status_t FdBuffer::readProcessedDataInStream(int fd, unique_fd toFd, unique_fd fromFd, in readProcessedDataInStream() argument
[all …]
/frameworks/base/cmds/statsd/src/storage/
DStorageManager.cpp127 int fd = open(file, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR); in writeFile() local
128 if (fd == -1) { in writeFile()
135 if (android::base::WriteFully(fd, buffer, numBytes)) { in writeFile()
141 int result = fchown(fd, AID_STATSD, AID_STATSD); in writeFile()
146 close(fd); in writeFile()
161 int fd = open(fileName.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR); in writeTrainInfo() local
162 if (fd == -1) { in writeTrainInfo()
169 result = write(fd, &TRAIN_INFO_FILE_MAGIC, sizeof(TRAIN_INFO_FILE_MAGIC)); in writeTrainInfo()
172 close(fd); in writeTrainInfo()
178 result = write(fd, &trainInfo.trainVersionCode, trainVersionCodeByteCount); in writeTrainInfo()
[all …]
/frameworks/base/core/tests/coretests/src/android/os/
DRedactingFileDescriptorTest.java66 final FileDescriptor fd = RedactingFileDescriptor.open(mContext, mFile, MODE_READ_ONLY, in testSingleByte() local
70 assertEquals(buf.length, Os.read(fd, buf, 0, buf.length)); in testSingleByte()
82 final FileDescriptor fd = RedactingFileDescriptor.open(mContext, mFile, MODE_READ_ONLY, in testRanges() local
86 assertEquals(buf.length, Os.pread(fd, buf, 0, 10, 90)); in testRanges()
89 assertEquals(buf.length, Os.pread(fd, buf, 0, 10, 95)); in testRanges()
92 assertEquals(buf.length, Os.pread(fd, buf, 0, 10, 100)); in testRanges()
95 assertEquals(buf.length, Os.pread(fd, buf, 0, 10, 195)); in testRanges()
98 assertEquals(buf.length, Os.pread(fd, buf, 0, 10, 395)); in testRanges()
104 final FileDescriptor fd = RedactingFileDescriptor.open(mContext, mFile, MODE_READ_ONLY, in testEntireFile() local
107 try (FileInputStream in = new FileInputStream(fd)) { in testEntireFile()
[all …]
/frameworks/native/libs/nativewindow/tests/
DANativeWindowTest.cpp82 int fd; in TEST_F() local
83 int result = ANativeWindow_dequeueBuffer(mWindow.get(), &buffer, &fd); in TEST_F()
84 close(fd); in TEST_F()
100 int fd; in TEST_F() local
101 int result = ANativeWindow_dequeueBuffer(mWindow.get(), &buffer, &fd); in TEST_F()
102 close(fd); in TEST_F()
112 int fd; in TEST_F() local
113 int result = ANativeWindow_dequeueBuffer(mWindow.get(), &buffer, &fd); in TEST_F()
114 close(fd); in TEST_F()
132 int fd; in TEST_F() local
[all …]
/frameworks/base/libs/androidfw/tests/
DBackupData_test.cpp60 int fd = ::open(mFilename.string(), O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); in SetUp() local
61 if (fd < 0) { in SetUp()
75 int fd = ::open(mFilename.string(), O_WRONLY); in TEST_F() local
76 BackupDataWriter* writer = new BackupDataWriter(fd); in TEST_F()
83 ::close(fd); in TEST_F()
84 fd = ::open(mFilename.string(), O_RDONLY); in TEST_F()
85 BackupDataReader* reader = new BackupDataReader(fd); in TEST_F()
117 int fd = ::open(mFilename.string(), O_WRONLY); in TEST_F() local
118 BackupDataWriter* writer = new BackupDataWriter(fd); in TEST_F()
124 ::close(fd); in TEST_F()
[all …]
/frameworks/native/cmds/dumpstate/
DDumpstateService.cpp158 status_t DumpstateService::dump(int fd, const Vector<String16>&) { in dump() argument
161 dprintf(fd, "Bugreport not in progress yet"); in dump()
167 dprintf(fd, "id: %d\n", ds_->id_); in dump()
168 dprintf(fd, "pid: %d\n", ds_->pid_); in dump()
169 dprintf(fd, "update_progress: %s\n", ds_->options_->do_progress_updates ? "true" : "false"); in dump()
170 dprintf(fd, "last_percent_progress: %d\n", ds_->last_reported_percent_progress_); in dump()
171 dprintf(fd, "progress:\n"); in dump()
172 ds_->progress_->Dump(fd, " "); in dump()
173 dprintf(fd, "args: %s\n", ds_->options_->args.c_str()); in dump()
174 dprintf(fd, "bugreport_mode: %s\n", ds_->options_->bugreport_mode.c_str()); in dump()
[all …]
/frameworks/opt/net/wifi/libwifi_hal/
Dwifi_hal_common.cpp57 int fd; in insmod() local
59 fd = TEMP_FAILURE_RETRY(open(filename, O_RDONLY | O_CLOEXEC | O_NOFOLLOW)); in insmod()
60 if (fd < 0) { in insmod()
65 ret = syscall(__NR_finit_module, fd, args, 0); in insmod()
67 close(fd); in insmod()
95 int fd; in wifi_change_driver_state() local
99 fd = TEMP_FAILURE_RETRY(open(WIFI_DRIVER_STATE_CTRL_PARAM, O_WRONLY)); in wifi_change_driver_state()
100 if (fd < 0) { in wifi_change_driver_state()
105 if (TEMP_FAILURE_RETRY(write(fd, state, len)) != len) { in wifi_change_driver_state()
109 close(fd); in wifi_change_driver_state()
[all …]
/frameworks/av/services/minijail/
Dav_services_minijail_unittest.cpp51 android::base::unique_fd fd(android::WritePolicyToPipe(base_policy_, {std::string()})); in TEST_F() local
52 EXPECT_LE(0, fd.get()); in TEST_F()
53 bool success = android::base::ReadFdToString(fd.get(), &final_string); in TEST_F()
62 android::base::unique_fd fd(android::WritePolicyToPipe(base_policy_, {})); in TEST_F() local
63 EXPECT_LE(0, fd.get()); in TEST_F()
64 bool success = android::base::ReadFdToString(fd.get(), &final_string); in TEST_F()
72 android::base::unique_fd fd(android::WritePolicyToPipe(base_policy_, {additional_policy_})); in TEST_F() local
73 EXPECT_LE(0, fd.get()); in TEST_F()
74 bool success = android::base::ReadFdToString(fd.get(), &final_string); in TEST_F()
82 …android::base::unique_fd fd(android::WritePolicyToPipe(base_policy_, {additional_policy_, third_po… in TEST_F() local
[all …]
/frameworks/av/media/mtp/tests/
DMtpFfsHandle_test.cpp66 int fd[2]; in MtpFfsHandleTest() local
69 EXPECT_EQ(pipe(fd), 0); in MtpFfsHandleTest()
70 control.reset(fd[0]); in MtpFfsHandleTest()
71 handle->mControl.reset(fd[1]); in MtpFfsHandleTest()
73 EXPECT_EQ(pipe(fd), 0); in MtpFfsHandleTest()
74 EXPECT_EQ(fcntl(fd[0], F_SETPIPE_SZ, 1048576), 1048576); in MtpFfsHandleTest()
75 bulk_in.reset(fd[0]); in MtpFfsHandleTest()
76 handle->mBulkIn.reset(fd[1]); in MtpFfsHandleTest()
78 EXPECT_EQ(pipe(fd), 0); in MtpFfsHandleTest()
79 EXPECT_EQ(fcntl(fd[0], F_SETPIPE_SZ, 1048576), 1048576); in MtpFfsHandleTest()
[all …]
/frameworks/rs/driver/
DrsdShader.cpp315 void RsdShader::logUniform(const Element *field, const float *fd, uint32_t arraySize ) { in logUniform() argument
324 ALOGV("{%f, %f, %f, %f", fd[0], fd[4], fd[8], fd[12]); in logUniform()
325 ALOGV(" %f, %f, %f, %f", fd[1], fd[5], fd[9], fd[13]); in logUniform()
326 ALOGV(" %f, %f, %f, %f", fd[2], fd[6], fd[10], fd[14]); in logUniform()
327 ALOGV(" %f, %f, %f, %f}", fd[3], fd[7], fd[11], fd[15]); in logUniform()
330 ALOGV("{%f, %f, %f", fd[0], fd[3], fd[6]); in logUniform()
331 ALOGV(" %f, %f, %f", fd[1], fd[4], fd[7]); in logUniform()
332 ALOGV(" %f, %f, %f}", fd[2], fd[5], fd[8]); in logUniform()
335 ALOGV("{%f, %f", fd[0], fd[2]); in logUniform()
336 ALOGV(" %f, %f}", fd[1], fd[3]); in logUniform()
[all …]
/frameworks/base/native/android/
Dsharedmem.cpp54 size_t ASharedMemory_getSize(int fd) { in ASharedMemory_getSize() argument
55 return ashmem_valid(fd) ? ashmem_get_size_region(fd) : 0; in ASharedMemory_getSize()
58 int ASharedMemory_setProt(int fd, int prot) { in ASharedMemory_setProt() argument
59 return ashmem_set_prot_region(fd, prot); in ASharedMemory_setProt()
72 int fd = env->CallIntMethod(javaSharedMemory, sSharedMemory.getFd); in ASharedMemory_dupFromJava() local
73 if (fd != -1) { in ASharedMemory_dupFromJava()
74 fd = fcntl(fd, F_DUPFD_CLOEXEC, 0); in ASharedMemory_dupFromJava()
76 return fd; in ASharedMemory_dupFromJava()

12345678910>>...52