Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d660c73 authored by Jin Qian's avatar Jin Qian
Browse files

ANDROID: uid_sys_stats: allow writing same state



Signed-off-by: default avatarJin Qian <jinqian@google.com>
Bug: 34360629
Change-Id: Ia748351e07910b1febe54f0484ca1be58c4eb9c7
parent d2d3bd0d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -352,11 +352,16 @@ static ssize_t uid_procstat_write(struct file *file,
	mutex_lock(&uid_lock);

	uid_entry = find_or_register_uid(uid);
	if (!uid_entry || uid_entry->state == state) {
	if (!uid_entry) {
		mutex_unlock(&uid_lock);
		return -EINVAL;
	}

	if (uid_entry->state == state) {
		mutex_unlock(&uid_lock);
		return 0;
	}

	memset(&uid_entry->io[UID_STATE_TOTAL_CURR], 0,
		sizeof(struct io_stats));