/frameworks/base/libs/androidfw/ |
D | ObbFile.cpp | 88 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 …]
|
D | BackupHelpers.cpp | 87 read_snapshot_file(int fd, KeyedVector<String8,FileState>* snapshot) in read_snapshot_file() argument 93 amt = read(fd, &header, sizeof(header)); in read_snapshot_file() 108 amt = read(fd, &file, sizeof(FileState)); in read_snapshot_file() 120 amt = read(fd, filename, nameBufSize); in read_snapshot_file() 144 write_snapshot_file(int fd, const KeyedVector<String8,FileRec>& snapshot) in write_snapshot_file() argument 159 LOGP("write_snapshot_file fd=%d\n", fd); in write_snapshot_file() 164 amt = write(fd, &header, sizeof(header)); in write_snapshot_file() 176 amt = write(fd, &r.s, sizeof(FileState)); in write_snapshot_file() 183 amt = write(fd, name.string(), nameLen); in write_snapshot_file() 191 amt = write(fd, &padding, paddingLen); in write_snapshot_file() [all …]
|
/frameworks/base/core/java/android/net/ |
D | LocalSocketImpl.java | 44 private FileDescriptor fd; field in LocalSocketImpl 62 FileDescriptor myFd = fd; in available() 85 FileDescriptor myFd = fd; in read() 103 FileDescriptor myFd = fd; in read() 138 FileDescriptor myFd = fd; in write() 152 FileDescriptor myFd = fd; in write() 166 FileDescriptor myFd = fd; in flush() 193 private native int read_native(FileDescriptor fd) throws IOException; in read_native() argument 195 FileDescriptor fd) throws IOException; in readba_native() argument 197 FileDescriptor fd) throws IOException; in writeba_native() argument [all …]
|
/frameworks/base/core/jni/ |
D | fd_utils-inl.h | 69 static FileDescriptorInfo* createFromFd(int fd) { in createFromFd() argument 73 if (TEMP_FAILURE_RETRY(fstat(fd, &f_stat)) == -1) { in createFromFd() 74 ALOGE("Unable to stat fd %d : %s", fd, strerror(errno)); in createFromFd() 80 if (!GetSocketName(fd, &socket_name)) { in createFromFd() 85 ALOGE("Socket name not whitelisted : %s (fd=%d)", socket_name.c_str(), fd); in createFromFd() 89 return new FileDescriptorInfo(fd); in createFromFd() 108 if (!Readlink(fd, &file_path)) { in createFromFd() 120 const int fd_flags = TEMP_FAILURE_RETRY(fcntl(fd, F_GETFD)); in createFromFd() 122 ALOGE("Failed fcntl(%d, F_GETFD) : %s", fd, strerror(errno)); in createFromFd() 138 int fs_flags = TEMP_FAILURE_RETRY(fcntl(fd, F_GETFL)); in createFromFd() [all …]
|
D | android_util_MemoryIntArray.cpp | 39 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 int ashmemSize = ashmem_get_size_region(fd); in android_util_MemoryIntArray_open() 71 void* ashmemAddr = mmap(NULL, ashmemSize, protMode, MAP_SHARED, fd, 0); in android_util_MemoryIntArray_open() 83 int setProtResult = ashmem_set_prot_region(fd, PROT_READ); in android_util_MemoryIntArray_open() 93 static void android_util_MemoryIntArray_close(JNIEnv* env, jobject clazz, jint fd, in android_util_MemoryIntArray_close() argument [all …]
|
D | android_os_MemoryFile.cpp | 49 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_os_MemoryFile_mmap() local 50 void* result = mmap(NULL, length, prot, MAP_SHARED, fd, 0); in android_os_MemoryFile_mmap() 66 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_os_MemoryFile_close() local 67 if (fd >= 0) { in android_os_MemoryFile_close() 69 close(fd); in android_os_MemoryFile_close() 77 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_os_MemoryFile_read() local 78 if (unpinned && ashmem_pin_region(fd, 0, 0) == ASHMEM_WAS_PURGED) { in android_os_MemoryFile_read() 79 ashmem_unpin_region(fd, 0, 0); in android_os_MemoryFile_read() 87 ashmem_unpin_region(fd, 0, 0); in android_os_MemoryFile_read() 96 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_os_MemoryFile_write() local [all …]
|
D | android_hardware_SerialPort.cpp | 135 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_hardware_SerialPort_open() local 137 fd = dup(fd); 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 …]
|
D | android_backup_BackupHelperDispatcher.cpp | 52 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 …]
|
D | android_net_LocalSocketImpl.cpp | 59 int fd; in socket_connect_local() local 61 fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in socket_connect_local() 70 fd, in socket_connect_local() 92 int fd; in socket_bind_local() local 99 fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in socket_bind_local() 107 ret = socket_local_server_bind(fd, nameUtf8.c_str(), namespaceId); in socket_bind_local() 183 static ssize_t socket_read_all(JNIEnv *env, jobject thisJ, int fd, in socket_read_all() argument 206 ret = recvmsg(fd, &msg, MSG_NOSIGNAL); in socket_read_all() 240 static int socket_write_all(JNIEnv *env, jobject object, int fd, in socket_write_all() argument 302 ret = sendmsg(fd, &msg, MSG_NOSIGNAL); in socket_write_all() [all …]
|
/frameworks/base/services/core/jni/ |
D | com_android_server_UsbDeviceManager.cpp | 44 static void set_accessory_string(JNIEnv *env, int fd, int cmd, jobjectArray strArray, int index) in set_accessory_string() argument 49 ioctl(fd, cmd, buffer); in set_accessory_string() 61 int fd = open(DRIVER_NAME, O_RDWR); in android_server_UsbDeviceManager_getAccessoryStrings() local 62 if (fd < 0) { in android_server_UsbDeviceManager_getAccessoryStrings() 69 set_accessory_string(env, fd, ACCESSORY_GET_STRING_MANUFACTURER, strArray, 0); in android_server_UsbDeviceManager_getAccessoryStrings() 70 set_accessory_string(env, fd, ACCESSORY_GET_STRING_MODEL, strArray, 1); in android_server_UsbDeviceManager_getAccessoryStrings() 71 set_accessory_string(env, fd, ACCESSORY_GET_STRING_DESCRIPTION, strArray, 2); in android_server_UsbDeviceManager_getAccessoryStrings() 72 set_accessory_string(env, fd, ACCESSORY_GET_STRING_VERSION, strArray, 3); in android_server_UsbDeviceManager_getAccessoryStrings() 73 set_accessory_string(env, fd, ACCESSORY_GET_STRING_URI, strArray, 4); in android_server_UsbDeviceManager_getAccessoryStrings() 74 set_accessory_string(env, fd, ACCESSORY_GET_STRING_SERIAL, strArray, 5); in android_server_UsbDeviceManager_getAccessoryStrings() [all …]
|
D | com_android_server_PersistentDataBlockService.cpp | 35 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/native/libs/binder/ |
D | MemoryHeapBase.cpp | 50 int fd = ashmem_create_region(name == NULL ? "MemoryHeapBase" : name, size); in MemoryHeapBase() local 51 ALOGE_IF(fd<0, "error creating ashmem region: %s", strerror(errno)); in MemoryHeapBase() 52 if (fd >= 0) { in MemoryHeapBase() 53 if (mapfd(fd, size) == NO_ERROR) { in MemoryHeapBase() 55 ashmem_set_prot_region(fd, PROT_READ); in MemoryHeapBase() 69 int fd = open(device, open_flags); in MemoryHeapBase() local 70 ALOGE_IF(fd<0, "error opening %s: %s", device, strerror(errno)); in MemoryHeapBase() 71 if (fd >= 0) { in MemoryHeapBase() 74 if (mapfd(fd, size) == NO_ERROR) { in MemoryHeapBase() 80 MemoryHeapBase::MemoryHeapBase(int fd, size_t size, uint32_t flags, uint32_t offset) in MemoryHeapBase() argument [all …]
|
/frameworks/base/libs/androidfw/tests/ |
D | BackupData_test.cpp | 60 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/base/cmds/idmap/ |
D | create.cpp | 35 int fd = TEMP_FAILURE_RETRY(open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)); in open_idmap() local 36 if (fd == -1) { in open_idmap() 40 if (fchmod(fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0) { in open_idmap() 44 if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX)) != 0) { in open_idmap() 49 return fd; in open_idmap() 51 if (fd != -1) { in open_idmap() 52 close(fd); in open_idmap() 58 int write_idmap(int fd, const uint32_t *data, size_t size) in write_idmap() argument 60 if (lseek(fd, 0, SEEK_SET) < 0) { in write_idmap() 65 ssize_t w = TEMP_FAILURE_RETRY(write(fd, data + size - bytesLeft, bytesLeft)); in write_idmap() [all …]
|
/frameworks/rs/driver/ |
D | rsdShader.cpp | 311 void RsdShader::logUniform(const Element *field, const float *fd, uint32_t arraySize ) { in logUniform() argument 320 ALOGV("{%f, %f, %f, %f", fd[0], fd[4], fd[8], fd[12]); in logUniform() 321 ALOGV(" %f, %f, %f, %f", fd[1], fd[5], fd[9], fd[13]); in logUniform() 322 ALOGV(" %f, %f, %f, %f", fd[2], fd[6], fd[10], fd[14]); in logUniform() 323 ALOGV(" %f, %f, %f, %f}", fd[3], fd[7], fd[11], fd[15]); in logUniform() 326 ALOGV("{%f, %f, %f", fd[0], fd[3], fd[6]); in logUniform() 327 ALOGV(" %f, %f, %f", fd[1], fd[4], fd[7]); in logUniform() 328 ALOGV(" %f, %f, %f}", fd[2], fd[5], fd[8]); in logUniform() 331 ALOGV("{%f, %f", fd[0], fd[2]); in logUniform() 332 ALOGV(" %f, %f}", fd[1], fd[3]); in logUniform() [all …]
|
/frameworks/base/core/java/com/android/server/ |
D | NetworkManagementSocketTagger.java | 66 public void tag(FileDescriptor fd) throws SocketException { in tag() argument 69 Log.d(TAG, "tagSocket(" + fd.getInt$() + ") with statsTag=0x" in tag() 73 tagSocketFd(fd, options.statsTag, options.statsUid); in tag() 76 private void tagSocketFd(FileDescriptor fd, int tag, int uid) { in tagSocketFd() argument 80 final int errno = native_tagSocketFd(fd, tag, uid); in tagSocketFd() 82 Log.i(TAG, "tagSocketFd(" + fd.getInt$() + ", " in tagSocketFd() 90 public void untag(FileDescriptor fd) throws SocketException { in untag() argument 92 Log.i(TAG, "untagSocket(" + fd.getInt$() + ")"); in untag() 94 unTagSocketFd(fd); in untag() 97 private void unTagSocketFd(FileDescriptor fd) { in unTagSocketFd() argument [all …]
|
/frameworks/av/services/camera/libcameraservice/utils/ |
D | TagMonitor.cpp | 148 void TagMonitor::dumpMonitoredMetadata(int fd) { in dumpMonitoredMetadata() argument 152 dprintf(fd, " Tag monitoring enabled for tags:\n"); in dumpMonitoredMetadata() 154 dprintf(fd, " %s.%s\n", in dumpMonitoredMetadata() 159 dprintf(fd, " Tag monitoring disabled (enable with -m <name1,..,nameN>)\n"); in dumpMonitoredMetadata() 162 dprintf(fd, " Monitored tag event log:\n"); in dumpMonitoredMetadata() 165 dprintf(fd, " f%d:%" PRId64 "ns: %*s%s.%s: ", in dumpMonitoredMetadata() 172 dprintf(fd, " (Removed)\n"); in dumpMonitoredMetadata() 174 printData(fd, event.newData.data(), event.tag, in dumpMonitoredMetadata() 187 void TagMonitor::printData(int fd, const uint8_t *data_ptr, uint32_t tag, in printData() argument 207 dprintf(fd, "%*s[", (j != 0) ? indentation + 4 : 0, ""); in printData() [all …]
|
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/ |
D | VolumeCurve.cpp | 64 void VolumeCurve::dump(int fd) const in dump() 77 write(fd, result.string(), result.size()); in dump() 80 void VolumeCurvesForStream::dump(int fd, int spaces = 0, bool curvePoints) const in dump() argument 95 write(fd, result.string(), result.size()); in dump() 104 write(fd, buffer, strlen(buffer)); in dump() 105 valueAt(i)->dump(fd); in dump() 108 write(fd, result.string(), result.size()); in dump() 111 status_t VolumeCurvesCollection::dump(int fd) const in dump() 117 write(fd, buffer, strlen(buffer)); in dump() 120 write(fd, buffer, strlen(buffer)); in dump() [all …]
|
/frameworks/av/drm/common/ |
D | ReadWriteUtils.cpp | 41 int fd = fileno(file); in readBytes() local 44 if (fstat(fd, &sb) == 0 && sb.st_size > 0) { in readBytes() 47 if (length == read(fd, (void*) bytes, length)) { in readBytes() 63 int fd = fileno(file); in readBytes() local 66 if (fstat(fd, &sb) == 0 && sb.st_size > 0) { in readBytes() 69 if (length != read(fd, (void*) *buffer, length)) { in readBytes() 83 int fd = fileno(file); in writeToFile() local 86 if (FAILURE != ftruncate(fd, size)) { in writeToFile() 87 if (size != write(fd, data.string(), size)) { in writeToFile() 100 int fd = fileno(file); in appendToFile() local [all …]
|
/frameworks/native/cmds/dumpstate/ |
D | utils.cpp | 136 int fd; in __for_each_pid() local 147 if ((fd = TEMP_FAILURE_RETRY(open(cmdpath, O_RDONLY | O_CLOEXEC))) >= 0) { in __for_each_pid() 148 TEMP_FAILURE_RETRY(read(fd, cmdline, sizeof(cmdline) - 2)); in __for_each_pid() 149 close(fd); in __for_each_pid() 158 if ((fd = TEMP_FAILURE_RETRY(open(cmdpath, O_RDONLY | O_CLOEXEC))) >= 0) { in __for_each_pid() 159 TEMP_FAILURE_RETRY(read(fd, cmdline + 1, sizeof(cmdline) - 4)); in __for_each_pid() 160 close(fd); in __for_each_pid() 204 int fd; in for_each_tid_helper() local 217 if ((fd = TEMP_FAILURE_RETRY(open(commpath, O_RDONLY | O_CLOEXEC))) < 0) { in for_each_tid_helper() 221 TEMP_FAILURE_RETRY(read(fd, comm, sizeof(comm) - 2)); in for_each_tid_helper() [all …]
|
/frameworks/native/opengl/libs/EGL/ |
D | egl_cache.cpp | 226 int fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0); in saveBlobCacheLocked() local 227 if (fd == -1) { in saveBlobCacheLocked() 237 fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0); in saveBlobCacheLocked() 239 if (fd == -1) { in saveBlobCacheLocked() 252 close(fd); in saveBlobCacheLocked() 262 close(fd); in saveBlobCacheLocked() 272 if (write(fd, buf, fileSize) == -1) { in saveBlobCacheLocked() 276 close(fd); in saveBlobCacheLocked() 282 fchmod(fd, S_IRUSR); in saveBlobCacheLocked() 283 close(fd); in saveBlobCacheLocked() [all …]
|
/frameworks/base/media/java/android/media/ |
D | MediaMetadataRetriever.java | 68 FileDescriptor fd = is.getFD(); in setDataSource() local 69 setDataSource(fd, 0, 0x7ffffffffffffffL); in setDataSource() 121 public native void setDataSource(FileDescriptor fd, long offset, long length) in setDataSource() argument 133 public void setDataSource(FileDescriptor fd) in setDataSource() argument 136 setDataSource(fd, 0, 0x7ffffffffffffffL); in setDataSource() 161 AssetFileDescriptor fd = null; in setDataSource() local 165 fd = resolver.openAssetFileDescriptor(uri, "r"); in setDataSource() 169 if (fd == null) { in setDataSource() 172 FileDescriptor descriptor = fd.getFileDescriptor(); in setDataSource() 179 if (fd.getDeclaredLength() < 0) { in setDataSource() [all …]
|
/frameworks/base/core/java/android/os/ |
D | ParcelFileDescriptor.java | 169 public ParcelFileDescriptor(FileDescriptor fd) { in ParcelFileDescriptor() argument 170 this(fd, null); in ParcelFileDescriptor() 174 public ParcelFileDescriptor(FileDescriptor fd, FileDescriptor commChannel) { in ParcelFileDescriptor() argument 175 if (fd == null) { in ParcelFileDescriptor() 179 mFd = fd; in ParcelFileDescriptor() 200 final FileDescriptor fd = openInternal(file, mode); in open() local 201 if (fd == null) return null; in open() 203 return new ParcelFileDescriptor(fd); in open() 233 final FileDescriptor fd = openInternal(file, mode); in open() local 234 if (fd == null) return null; in open() [all …]
|
/frameworks/av/services/audioflinger/ |
D | FastMixerDumpState.cpp | 59 void FastMixerDumpState::dump(int fd) const in dump() 62 dprintf(fd, " FastMixer not initialized\n"); in dump() 68 dprintf(fd, " FastMixer command=%s writeSequence=%u framesWritten=%u\n" in dump() 123 dprintf(fd, " Simple moving statistics over last %.1f seconds:\n", in dump() 125 dprintf(fd, " wall clock time in ms per mix cycle:\n" in dump() 129 dprintf(fd, " raw CPU load in us per mix cycle:\n" in dump() 134 dprintf(fd, " No FastMixer statistics available currently\n"); in dump() 137 dprintf(fd, " CPU clock frequency in MHz:\n" in dump() 140 dprintf(fd, " adjusted CPU load in MHz (i.e. normalized for CPU clock frequency):\n" in dump() 153 dprintf(fd, " Distribution of mix cycle times in ms for the tails " in dump() [all …]
|
/frameworks/base/libs/usb/tests/accessorytest/ |
D | hid.c | 50 int fd = (int)arg; in hid_thread() local 59 fprintf(stderr, "hid_thread start fd: %d\n", fd); in hid_thread() 61 if (ioctl(fd, HIDIOCGRDESCSIZE, &desc_length)) { in hid_thread() 63 close(fd); in hid_thread() 68 if (ioctl(fd, HIDIOCGRDESC, &desc)) { in hid_thread() 70 close(fd); in hid_thread() 75 fprintf(stderr, "waiting for device fd: %d\n", fd); in hid_thread() 109 ret = read(fd, buffer, sizeof(buffer)); in hid_thread() 111 fprintf(stderr, "read failed, errno: %d, fd: %d\n", errno, fd); in hid_thread() 137 int fd = open(path, O_RDWR); in open_hid() local [all …]
|