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

Commit 033c18ab authored by Sahil Sonar's avatar Sahil Sonar 💬
Browse files

FP5: Wire up a service to toggle fairphone camera

   - Ships as disabled on first boot
parent 55c9ae63
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -128,6 +128,9 @@ PRODUCT_PACKAGES += \
    vendor.qti.hardware.camera.device@1.0.vendor \
    vendor.qti.hardware.camera.postproc@1.0.vendor

PRODUCT_PACKAGES += \
    FairphoneCameraService

PRODUCT_COPY_FILES += \
    frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
    frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \

parts/Android.bp

0 → 100644
+24 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2023-2024 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//

android_app {
    name: "FairphoneCameraService",

    srcs: ["src/**/*.java"],
    resource_dirs: ["res"],
    certificate: "platform",
    platform_apis: true,
    system_ext_specific: true,
    privileged: true,

    static_libs: [
        "org.lineageos.settings.resources",
    ],

    optimize: {
        proguard_flags_files: ["proguard.flags"],
    },
}
+64 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2015-2016 The CyanogenMod Project
                   2017-2024 The LineageOS Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.lineageos.settings"
    android:versionCode="1"
    android:versionName="1.0"
    android:sharedUserId="android.uid.system">

    <uses-permission android:name="android.permission.GET_TASKS" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <application
        android:icon="@mipmap/ic_launcher"
        android:label="@string/device_settings_app_name"
        android:persistent="true"
        android:theme="@style/Theme.SubSettingsBase">

        <receiver
            android:name=".BootCompletedReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".fpcamera.FPCameraActivity"
            android:exported="true"
            android:label="@string/fp_camera_title">
            <intent-filter>
                <action android:name="com.android.settings.action.IA_SETTINGS" />
            </intent-filter>

            <meta-data
                android:name="com.android.settings.category"
                android:value="com.android.settings.category.ia.apps" />
            <meta-data
                android:name="com.android.settings.summary"
                android:resource="@string/fp_camera_desc" />
            <meta-data
                android:name="com.android.settings.order"
                android:value="-255" />
        </activity>

    </application>

</manifest>

parts/proguard.flags

0 → 100644
+3 −0
Original line number Diff line number Diff line
-keep class org.lineageos.settings.fpcamera.* {
  *;
}
+9 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2023-2024 The LineageOS Project
    SPDX-License-Identifier: Apache-2.0
-->
<resources>
    <string name="fp_camera_title">Fairphone camera</string>
    <string name="fp_camera_desc">Enable fairphone camera</string>
</resources>
Loading