Skip to content

Commit

Permalink
fix: conflict between Android 10 and 11
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanjieli committed Nov 23, 2020
1 parent 2c116ef commit 614d968
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions diag_revealer/qcom/jni/diag_revealer.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,20 @@ enable_logging (int fd, int mode)
// LOGD("arglen=%ld, target=%lu\n", arglen, sizeof(struct diag_logging_mode_param_t_r));
switch (arglen) {

case sizeof(struct diag_logging_mode_param_t_pie): {
/* Android 9.0 mode
* Reference: https://android.googlesource.com/kernel/msm.git/+/android-9.0.0_r0.31/drivers/char/diag/diagchar_core.c
*/
struct diag_logging_mode_param_t_pie new_mode;
new_mode.req_mode = mode;
new_mode.mode_param = 0;
new_mode.pd_mask = 0;
new_mode.peripheral_mask = DIAG_CON_ALL;
ret = ioctl(fd, DIAG_IOCTL_SWITCH_LOGGING, &new_mode);

if(ret >= 0)
break;
}
case (sizeof(struct diag_logging_mode_param_t_q)): {
/* Android 10.0 mode
* Reference:
Expand Down Expand Up @@ -879,20 +893,6 @@ enable_logging (int fd, int mode)
if(ret >= 0)
break;
}
case sizeof(struct diag_logging_mode_param_t_pie): {
/* Android 9.0 mode
* Reference: https://android.googlesource.com/kernel/msm.git/+/android-9.0.0_r0.31/drivers/char/diag/diagchar_core.c
*/
struct diag_logging_mode_param_t_pie new_mode;
new_mode.req_mode = mode;
new_mode.mode_param = 0;
new_mode.pd_mask = 0;
new_mode.peripheral_mask = DIAG_CON_ALL;
ret = ioctl(fd, DIAG_IOCTL_SWITCH_LOGGING, &new_mode);

if(ret >= 0)
break;
}
case sizeof(struct diag_logging_mode_param_t): {
/* Android 7.0 mode
* Reference: https://android.googlesource.com/kernel/msm.git/+/android-7.1.0_r0.3/drivers/char/diag/diagchar_core.c
Expand Down

0 comments on commit 614d968

Please sign in to comment.