# Contributing

## Background

Switchroot Android is based on the [LineageOS Project](https://lineageos.org/), an open-source Android distribution focused on simplicity, stability, device support, common sense features, and upstream adherence. We use Lineage because it has platform-level support for the NVIDIA Shield, which shares the Tegra X1/X1+ processor with the Switch.

Lineage is in turn based on the [Android Open-Source Project (AOSP)](https://source.android.com/), which is effectively just mainline Android from Google. AOSP is meant as a platform baseline, and is not a great experience by itself (even Google uses their own private internal fork for Pixel etc.), and it's up to distributions like Lineage to provide a more OEM-like experience.

## Basics

To contribute to upstream Lineage, you'll need \~350GB free space, a decently powerful PC, a Linux distribution (instructions assume Ubuntu but you can figure out most others), and a lot of time--some of us got our starts with mediocre old PCs chucked in a closet, so if you've got a 2018 Optiplex in your basement, might want to dig it out.

### Gerrit

Lineage (like upstream AOSP) uses Gerrit as a code review platform. The flow is basically:

Push to Gerrit -> Get comments and criticisms -> Respond -> Obtain +2 Code Review from repo owner -> Repo owner will merge. makinbacon and npjohnson can merge most Switch-related stuff, but you might need to reach out further for common Tegra (Steel01) or Lineage (Lineage project directors).

More Lineage contributing instructions can be found here: <https://wiki.lineageos.org/contributing>.

### Switch-Specific Code

Follow <https://wiki.lineageos.org/devices/nx_tab/build/variant1/> to get a LineageOS tree for nx\_tab (tablet Android).

Main repos:

* Android device repo (and Switch Configuration app): <https://github.com/LineageOS/android_device_nintendo_nx>
* Shim device repo for tablet (very little content): <https://github.com/LineageOS/android_device_nintendo_nx_tab>
* AIDL Joycond HAL (Joycond rework for modern Android: <https://github.com/LineageOS/android_hardware_nintendo_joycond>
* Sensor HAL (generic IIO): <https://github.com/LineageOS/android_hardware_intel_sensors-iio>
* Kernel & kernel drivers: <https://github.com/LineageOS/android_kernel_nvidia_kernel-nx>, <https://github.com/LineageOS/android_kernel_nvidia_nvidia-nx>, <https://github.com/LineageOS/android_kernel_nvidia_cypress-fmac-upstream>
* Kernel device tree: <https://github.com/LineageOS/android_hardware_nvidia_platform_t210_nx>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.switchroot.org/wiki/android/contributing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
