Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c43a832 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reference the runtime sensor range defined in the HAL from SensorService"

parents ba51b483 29d2afd8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ cc_library {
        "libaidlcommonsupport",
        "android.hardware.sensors@1.0-convert",
        "android.hardware.sensors-V1-convert",
        "android.hardware.sensors-V1-ndk",
        "android.hardware.sensors-V2-ndk",
    ],

    generated_headers: ["framework-cppstream-protos"],
+4 −5
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <aidl/android/hardware/sensors/ISensors.h>
#include <android-base/strings.h>
#include <android/content/pm/IPackageManagerNative.h>
#include <android/util/ProtoOutputStream.h>
@@ -104,12 +105,10 @@ static const String16 sManageSensorsPermission("android.permission.MANAGE_SENSOR

namespace {

// TODO(b/259227294): Move the sensor ranges to the HAL.
int32_t nextRuntimeSensorHandle() {
    static constexpr int32_t kRuntimeHandleBase = 0x5F000000;
    static constexpr int32_t kRuntimeHandleEnd = 0x5FFFFFFF;
    static int32_t nextHandle = kRuntimeHandleBase;
    if (nextHandle == kRuntimeHandleEnd) {
    using ::aidl::android::hardware::sensors::ISensors;
    static int32_t nextHandle = ISensors::RUNTIME_SENSORS_HANDLE_BASE;
    if (nextHandle == ISensors::RUNTIME_SENSORS_HANDLE_END) {
        return -1;
    }
    return nextHandle++;
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ cc_library {
        "libbinder_ndk",
        "libsensor",
        "android.frameworks.sensorservice-V1-ndk",
        "android.hardware.sensors-V1-ndk",
        "android.hardware.sensors-V2-ndk",
    ],
    export_include_dirs: [
        "include/",
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ cc_fuzz {
        "libpermission",
        "android.frameworks.sensorservice-V1-ndk",
        "android.hardware.sensors-V1-convert",
        "android.hardware.sensors-V1-ndk",
        "android.hardware.sensors-V2-ndk",
        "android.hardware.common-V2-ndk",
        "libsensor",
        "libfakeservicemanager",