summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-01-27 03:02:15 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-01-27 03:02:15 +0000
commit3ac75b08b95a29881b234cb9fa1b1e5fdbf8da99 (patch)
treea234aa17edb4108ebaba93d61a2b832331e5c74e
parent47aa54e53d289433b1220a621bd76128923021c9 (diff)
parentd0916f9b9d902b1ee5e4842cc5f4b1ff59ac22cc (diff)
downloadbase-3ac75b08b95a29881b234cb9fa1b1e5fdbf8da99.tar.gz
Merge cherrypicks of ['googleplex-android-review.googlesource.com/25718466', 'googleplex-android-review.googlesource.com/26028024'] into 24Q1-release.
Change-Id: I849d6e876e7de8f98109fe3506a92df8050a5ea2
-rw-r--r--core/jni/android_util_Process.cpp33
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt2
2 files changed, 3 insertions, 32 deletions
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index 04b26b36fe63..91dfc6023e42 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -28,7 +28,6 @@
#include <meminfo/sysmeminfo.h>
#include <processgroup/processgroup.h>
#include <processgroup/sched_policy.h>
-#include <android-base/logging.h>
#include <android-base/unique_fd.h>
#include <algorithm>
@@ -233,31 +232,6 @@ void android_os_Process_setThreadGroupAndCpuset(JNIEnv* env, jobject clazz, int
}
}
-// Look up the user ID of a process in /proc/${pid}/status. The Uid: line is present in
-// /proc/${pid}/status since at least kernel v2.5.
-static int uid_from_pid(int pid)
-{
- int uid = -1;
- std::array<char, 64> path;
- int res = snprintf(path.data(), path.size(), "/proc/%d/status", pid);
- if (res < 0 || res >= static_cast<int>(path.size())) {
- DCHECK(false);
- return uid;
- }
- FILE* f = fopen(path.data(), "r");
- if (!f) {
- return uid;
- }
- char line[256];
- while (fgets(line, sizeof(line), f)) {
- if (sscanf(line, "Uid: %d", &uid) == 1) {
- break;
- }
- }
- fclose(f);
- return uid;
-}
-
void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jint grp)
{
ALOGV("%s pid=%d grp=%" PRId32, __func__, pid, grp);
@@ -301,12 +275,7 @@ void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jin
}
}
- const int uid = uid_from_pid(pid);
- if (uid < 0) {
- signalExceptionForGroupError(env, ESRCH, pid);
- return;
- }
- if (!SetProcessProfilesCached(uid, pid, {get_cpuset_policy_profile_name((SchedPolicy)grp)}))
+ if (!SetProcessProfilesCached(0, pid, {get_cpuset_policy_profile_name((SchedPolicy)grp)}))
signalExceptionForGroupError(env, errno ? errno : EPERM, pid);
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt
index 01a1ca3eeb93..edc9c4cd2f0a 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt
@@ -256,6 +256,7 @@ object KeyguardRootViewBinder {
vibratorHelper.performHapticFeedback(
view,
HapticFeedbackConstants.CONFIRM,
+ HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING,
)
}
}
@@ -265,6 +266,7 @@ object KeyguardRootViewBinder {
vibratorHelper.performHapticFeedback(
view,
HapticFeedbackConstants.REJECT,
+ HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING,
)
}
}