Skip to content

Conversation

@quic-vkatoch
Copy link
Contributor

@quic-vkatoch quic-vkatoch commented Mar 18, 2025

Refactored the codebase by moving vendor-specific and Android-specific elements into dedicated files, making the project more generic.

@ekanshibu
Copy link
Contributor

Please check if you can break the change into multiple commits instead of a single commit.

@github-actions
Copy link

This pull request has been marked as stale due to 60 days of inactivity. To prevent automatic closure in 10 days, remove the stale label or add a comment. You can reopen a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jul 15, 2025
@ekanshibu
Copy link
Contributor

@quic-vkatoch, can you please rebase this PR?

@quic-vkatoch quic-vkatoch force-pushed the code-cleanup branch 3 times, most recently from 0ffa6c4 to f7d23d7 Compare August 12, 2025 10:48
@ekanshibu ekanshibu removed the Stale label Aug 12, 2025
@quic-vkatoch
Copy link
Contributor Author

@quic-vkatoch, can you please rebase this PR?

Done

ekanshibu
ekanshibu previously approved these changes Sep 1, 2025
@ekanshibu ekanshibu enabled auto-merge September 1, 2025 04:27
auto-merge was automatically disabled October 13, 2025 16:56

Head branch was pushed to by a user without write access

@quic-vkatoch quic-vkatoch force-pushed the code-cleanup branch 2 times, most recently from ef69f29 to 040ef4c Compare October 13, 2025 17:14
#endif
#endif /* ENABLE_UPSTREAM_DRIVER_INTERFACE */

#ifndef VENDOR_DSP_LOCATION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these two changes related to each other?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are unrelated; I will update the PR.

#ifndef FASTRPC_TRACE_H
#define FASTRPC_TRACE_H

#if ((defined _ANDROID) || (defined ANDROID)) || (defined DISABLE_ATRACE) && !defined(LE_ENABLE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, totally unrelated changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are unrelated; I will update the PR.


PL_DEP(gpls)
PL_DEP(listener_android)
PL_DEP(listener)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sould this be a part of the previous commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I'll do that.

dspqueue/dspqueue_cpu.c \
dspqueue/dspqueue_rpc_stub.c \
listener_android.c \
listener.c \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sould this be a part of the previous commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I'll do that.

#include "fastrpc_pm.h"
#include "fastrpc_procbuf.h"
#include "listener_android.h"
#include "listener.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh. Make sure that each commit works on its own. The code was broken up to now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll do that.

pthread_mutex_destroy(&hlist[i].async_init_deinit_mut);
}
listener_android_deinit();
listener_deinit();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yuck

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will update the PR.

const char *format, ...) {
int len = 0;
va_list argp;
char *buf = NULL, *log = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, feels like several unrelated changed squashed toggether.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I removed debug_build_type (ro.debuggable) under fastrpc_log_init, it caused issues due to incorrectness in the HAP_debug_runtime function, so I had to update it. I'll remove this change from the current PR and submit a separate PR to address the fix.

@quic-vkatoch
Copy link
Contributor Author

This PR depends on PR #252 being merged first.

@quic-vkatoch quic-vkatoch requested a review from lumag October 23, 2025 05:32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are removing the support for /vendor/dsp, where is shell expected to be pushed for android targets ? if it is /usr/lib/dsp/ like other LE targets, is /usr partition available on android targets ?

how is this change tested on android targets ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to check where the shell should be placed if /vendor/dsp support is removed, or if we actually need to remove it in the first place.

Regarding testing: earlier, the daemons were already running (opened the shell) and the tests passed. After killing and updating with new daemons, the tests are now failing. I will check this further and update.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell is loaded from the same folder as all other DSP libraries. What's the question?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are removing the support for /vendor/dsp, where is shell expected to be pushed for android targets ? if it is /usr/lib/dsp/ like other LE targets, is /usr partition available on android targets ?

All DSP binaries are located in the subdirs of /usr/share/qcom, one subdir per device.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Android systems you can reuse the same approach, changing /usr/share/qcom/ to /vendor or its subdir. All config files should be relative to that path,

Create fastrpc_android.h/c for Android-specific DSP search paths
and update fastrpc_config_parser.h for Linux paths, removing
vendor directories from both. Remove VENDOR_DSP_LOCATION and
VENDOR_DOM_LOCATION macros from apps_std_internal.h.

Simplify open_shell() in fastrpc_apps_user.c by removing vendor
path fallback logic. Update Makefiles to conditionally compile
fastrpc_android.c for Android builds.

This separates platform-specific configurations and eliminates
redundant vendor path fallbacks.

Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
Change header guard macros from FASTRPC_ANDROID_USER_H to
FASTRPC_USER_H to remove Android-specific naming and make
the header more generic for cross-platform usage.

Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
Rename listener_android.h to listener.h and listener_android.c
to listener.c to remove Android-specific naming. Update all
function names from listener_android_* to listener_* pattern.
Update header guards, includes, Makefile entries, platform
library dependencies, and all function calls throughout the
codebase to maintain compilation compatibility.

Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
Remove unused convert_level_to_android_priority() function,
TODO comments referencing Android-specific code, and Android
include statements. Update AEE_EINVHANDLE comment to remove
vendor-specific reference and clean up conditional compilation
blocks for Android platforms.

Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
Move Android property arrays (ANDROIDP_DEBUG_VAR_NAME and
ANDROID_DEBUG_VAR_NAME) to fastrpc_android.c. Add functions
android_get_property_int(), android_get_property_string(), and
android_is_debug_build() to handle Android-specific property
operations and build type checking.

Update fastrpc_apps_user.c to call Android functions when on
Android platform while maintaining environment variable fallback.
Update fastrpc_log.c to use android_is_debug_build() for debug
buffer allocation.

Android functionality preserved and isolated in dedicated files.

Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
@quic-vkatoch quic-vkatoch changed the title Refactor: Generalize Code by Removing Vendor and Android-Specific Elements Refactor: Generalize Code by Moving Vendor and Android-Specific Elements Dec 29, 2025
@quic-vkatoch quic-vkatoch marked this pull request as ready for review December 31, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants