Loading cmds/dumpstate/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,7 @@ cc_binary { "main.cpp", "main.cpp", ], ], required: [ required: [ "alloctop", "atrace", "atrace", "bugreport_procdump", "bugreport_procdump", "default_screenshot", "default_screenshot", Loading cmds/dumpstate/dumpstate.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -1264,6 +1264,15 @@ static void DumpIpAddrAndRules() { RunCommand("IP RULES v6", {"ip", "-6", "rule", "show"}); RunCommand("IP RULES v6", {"ip", "-6", "rule", "show"}); } } static void DumpKernelMemoryAllocations() { if (!access("/proc/allocinfo", F_OK)) { // Print the top 100 biggest memory allocations of at least one byte. // The output is sorted by size, descending. RunCommand("KERNEL MEMORY ALLOCATIONS", {"alloctop", "--once", "--sort", "s", "--min", "1", "--lines", "100"}); } } static Dumpstate::RunStatus RunDumpsysTextByPriority(const std::string& title, int priority, static Dumpstate::RunStatus RunDumpsysTextByPriority(const std::string& title, int priority, std::chrono::milliseconds timeout, std::chrono::milliseconds timeout, std::chrono::milliseconds service_timeout) { std::chrono::milliseconds service_timeout) { Loading Loading @@ -1773,6 +1782,8 @@ Dumpstate::RunStatus Dumpstate::dumpstate() { DoKmsg(); DoKmsg(); DumpKernelMemoryAllocations(); DumpShutdownCheckpoints(); DumpShutdownCheckpoints(); DumpIpAddrAndRules(); DumpIpAddrAndRules(); Loading include/input/AccelerationCurve.h +11 −0 Original line number Original line Diff line number Diff line Loading @@ -46,4 +46,15 @@ struct AccelerationCurveSegment { std::vector<AccelerationCurveSegment> createAccelerationCurveForPointerSensitivity( std::vector<AccelerationCurveSegment> createAccelerationCurveForPointerSensitivity( int32_t sensitivity); int32_t sensitivity); /* * Creates a flat acceleration curve for disabling pointer acceleration. * * This method generates a single AccelerationCurveSegment with specific values * to effectively disable acceleration for both mice and touchpads. * A flat acceleration curve ensures a constant gain, meaning that the output * velocity is directly proportional to the input velocity, resulting in * a 1:1 movement ratio between the input device and the on-screen pointer. */ std::vector<AccelerationCurveSegment> createFlatAccelerationCurve(int32_t sensitivity); } // namespace android } // namespace android libs/binder/include/binder/IPCThreadState.h +4 −1 Original line number Original line Diff line number Diff line Loading @@ -64,7 +64,10 @@ public: * Returns the PID of the process which has made the current binder * Returns the PID of the process which has made the current binder * call. If not in a binder call, this will return getpid. * call. If not in a binder call, this will return getpid. * * * Warning: oneway transactions do not receive PID. Even if you expect * Warning do not use this as a security identifier! PID is unreliable * as it may be re-used. This should mostly be used for debugging. * * oneway transactions do not receive PID. Even if you expect * a transaction to be synchronous, a misbehaving client could send it * a transaction to be synchronous, a misbehaving client could send it * as an asynchronous call and result in a 0 PID here. Additionally, if * as an asynchronous call and result in a 0 PID here. Additionally, if * there is a race and the calling process dies, the PID may still be * there is a race and the calling process dies, the PID may still be Loading libs/binder/ndk/include_ndk/android/binder_ibinder.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -419,6 +419,9 @@ binder_status_t AIBinder_unlinkToDeath(AIBinder* binder, AIBinder_DeathRecipient * This can be used with higher-level system services to determine the caller's identity and check * This can be used with higher-level system services to determine the caller's identity and check * permissions. * permissions. * * * Warning do not use this as a security identifier! PID is unreliable as it may be re-used. This * should mostly be used for debugging. * * Available since API level 29. * Available since API level 29. * * * \return calling uid or the current process's UID if this thread isn't processing a transaction. * \return calling uid or the current process's UID if this thread isn't processing a transaction. Loading Loading
cmds/dumpstate/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,7 @@ cc_binary { "main.cpp", "main.cpp", ], ], required: [ required: [ "alloctop", "atrace", "atrace", "bugreport_procdump", "bugreport_procdump", "default_screenshot", "default_screenshot", Loading
cmds/dumpstate/dumpstate.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -1264,6 +1264,15 @@ static void DumpIpAddrAndRules() { RunCommand("IP RULES v6", {"ip", "-6", "rule", "show"}); RunCommand("IP RULES v6", {"ip", "-6", "rule", "show"}); } } static void DumpKernelMemoryAllocations() { if (!access("/proc/allocinfo", F_OK)) { // Print the top 100 biggest memory allocations of at least one byte. // The output is sorted by size, descending. RunCommand("KERNEL MEMORY ALLOCATIONS", {"alloctop", "--once", "--sort", "s", "--min", "1", "--lines", "100"}); } } static Dumpstate::RunStatus RunDumpsysTextByPriority(const std::string& title, int priority, static Dumpstate::RunStatus RunDumpsysTextByPriority(const std::string& title, int priority, std::chrono::milliseconds timeout, std::chrono::milliseconds timeout, std::chrono::milliseconds service_timeout) { std::chrono::milliseconds service_timeout) { Loading Loading @@ -1773,6 +1782,8 @@ Dumpstate::RunStatus Dumpstate::dumpstate() { DoKmsg(); DoKmsg(); DumpKernelMemoryAllocations(); DumpShutdownCheckpoints(); DumpShutdownCheckpoints(); DumpIpAddrAndRules(); DumpIpAddrAndRules(); Loading
include/input/AccelerationCurve.h +11 −0 Original line number Original line Diff line number Diff line Loading @@ -46,4 +46,15 @@ struct AccelerationCurveSegment { std::vector<AccelerationCurveSegment> createAccelerationCurveForPointerSensitivity( std::vector<AccelerationCurveSegment> createAccelerationCurveForPointerSensitivity( int32_t sensitivity); int32_t sensitivity); /* * Creates a flat acceleration curve for disabling pointer acceleration. * * This method generates a single AccelerationCurveSegment with specific values * to effectively disable acceleration for both mice and touchpads. * A flat acceleration curve ensures a constant gain, meaning that the output * velocity is directly proportional to the input velocity, resulting in * a 1:1 movement ratio between the input device and the on-screen pointer. */ std::vector<AccelerationCurveSegment> createFlatAccelerationCurve(int32_t sensitivity); } // namespace android } // namespace android
libs/binder/include/binder/IPCThreadState.h +4 −1 Original line number Original line Diff line number Diff line Loading @@ -64,7 +64,10 @@ public: * Returns the PID of the process which has made the current binder * Returns the PID of the process which has made the current binder * call. If not in a binder call, this will return getpid. * call. If not in a binder call, this will return getpid. * * * Warning: oneway transactions do not receive PID. Even if you expect * Warning do not use this as a security identifier! PID is unreliable * as it may be re-used. This should mostly be used for debugging. * * oneway transactions do not receive PID. Even if you expect * a transaction to be synchronous, a misbehaving client could send it * a transaction to be synchronous, a misbehaving client could send it * as an asynchronous call and result in a 0 PID here. Additionally, if * as an asynchronous call and result in a 0 PID here. Additionally, if * there is a race and the calling process dies, the PID may still be * there is a race and the calling process dies, the PID may still be Loading
libs/binder/ndk/include_ndk/android/binder_ibinder.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -419,6 +419,9 @@ binder_status_t AIBinder_unlinkToDeath(AIBinder* binder, AIBinder_DeathRecipient * This can be used with higher-level system services to determine the caller's identity and check * This can be used with higher-level system services to determine the caller's identity and check * permissions. * permissions. * * * Warning do not use this as a security identifier! PID is unreliable as it may be re-used. This * should mostly be used for debugging. * * Available since API level 29. * Available since API level 29. * * * \return calling uid or the current process's UID if this thread isn't processing a transaction. * \return calling uid or the current process's UID if this thread isn't processing a transaction. Loading