Camera & Camera2 API - missing features & bugs

It sounds to me like Google is intentionally making the use of alternative camera apps unattractive. This way, the Google smartphones (with stock ROM!) are even better off with their photo quality than they already are. So you have no chance to get the Google quality/functions with a custom ROM and e.g. gcam port on their smartphones. Using gcam port with other manufacturers (with or without custom ROM) of course leads to the same problem. Sometimes people want to use a gcam port although they have a stock ROM, because manufacturers other than Google often cannot match their quality. This might indirectly push one or the other customer to buy a Google smartphone.

Yes, that’s precisely how it’s currently implemented. The point is that it doesn’t have to be this way. And the key is indeed to drop the SYSTEM_CAMERA permission requirement, i.e., make the wide lens camera a regular camera instead of a system camera. Which Fairphone can do.

Also I have a new update from the support team. I hope it will be done soon.

Indeed, we have been working on this request for some time already. I have discussed this again with the relevant department and we have agreed to heighten the priority in order to resolve this faster. As soon as I know more in terms of timeline, I will be happy to let you know.


Yes, dropping the permission would be best.

If it’s not done, at least for custom Roms it would be best to patch Android to just ignore that permission and provide it to all apps - not sure how hard that is. Maybe such a change would make sense for Linage OS in general.

The stock FPCamera app unfortunately is still not working without crashes if integrated in custom ROMs. But it’s able to access all cameras, when installed as SYSTEM_CAMERA app. I decompiled the camera app and now I’m trying to get behind some of the causes with remote debugging in Android Studio. But that’s time intensive and the learning curve for that is quite steep …


So the stock FPCamera App can come around all these missing features / bugs?
Or only accessing all camera lenses?

In general - if I get that right:

  • all non-stock apps (Open Camera, GCam Ports, etc. …) have the described problems, as they use the Camera2 API and
  • there are bugs in it for the FP Camera(s) Fairphone needs to fix, right?
  • So is this a closed source component (of the phone’s firmware)?
  • What is the stock FPCamera doing differently? How does it access the Camera’s?
  • How is /e/-OS dealing with it - as there is an official partnership?

As far as I can see, this was reported a while ago and the problem is well described by @Razem in the first post.

  • Is there any way the community can push this / push Fairphone to fix this?

I imagine they have heard the chatter and are doing all they can.

/e/-OS includes a modified version of OpenCamera that is installed as part of the system and has the SYSTEM_CAMERA permission. Only with that permission it’s possible to use the Wide Angle camera. e / os / Camera · GitLab

User-installed camera apps are unable to use the wide angle camera. That’s not really a bug but was done that way by design. Not sure how common this is. On a Pixel Phone, can third party apps use auxiliary cameras?

The part that defines which camera is a system camera is closed source, unfortunately. Fairphone should change this to make everything accessible by all apps.

Another thing is that some open source Android components seem to be modified with Fairphone specific proprietary extensions (i.e. libcameraservice from camera · ks-aosp.lnx.3.0.r4-rel · CodeLinaro / la / platform / frameworks / av · GitLab). Fairphone could release that modifications as open source, but due to Apache 2.0 License there is no obligation, unfortunately. That mostly matters for custom roms.


I assume when many unhappy people contact them, they might work on this (faster)…so I would say #contactsupport


Thanks @xblax for the details.

Only point I don’t get which seems to be not answered to me is:
Does the e / os / camera have all the other issues/bugs described here apart from the possibility to use the wide angle camera?

In general to deal with that, as long as it not fixed by Fairphone:
Why not using the “e / os / camera” and transform it to a system app for now? (also for other custom roms)
I know there are people which prefer the Gcam (or the ports) in regards of the photo quality, but still, I think Open Camera is a good camera app, which fits, at least to my needs. So is there a place where one can get the “e / os / camera” as apk or do I need to create an APK on my own out of the code in GitLab (never did that up to now but I’m willing to find out)?


Will do. :wink:

Hi @Smojo

Does the e / os / camera have all the other issues/bugs described here apart from the possibility to use the wide angle camera?

I have not tried e-/os/ myself. But all third party camera apps do not get access to the full 16MP resolution - that is definitely a bug. I also tried GrapheneOs Camera which uses CameraX instead of using Camera2 APIs directly - only ~12MP.

At the moment I cannot say if that is due to missing SYSTEM_CAMERA permission or not. I will try to find out.

Might also be related to another “feature” in the Camera implementation. Basically there’s a check which camera app uses the camera APIs. If it’s the stock camera app it uses a different capture pipeline.

On custom roms we could theoretically force to use the Fairphone pipelines for all apps, but for example the stock AOSP camera app crashes immediately then.

Not sure what’s the reason behind this. I found some references to other Qualcomm based phones doing the same. Don’t think that comes from Qualcomm but rather from the ODM which does the camera integration.

Here is a discussion in German that indicates that with #leos the wide angel lense is accessible e.g. with BigKaka Gcam port and the statement is “it works because its a GSI ROM based on PHH Treble with treble settings phhusson. The advantage of GSIs is that they use the standard kernel what allows to use all OEM funtions…” (no idea if this is correct or what it really means but maybe it helps to troubleshoot this).


I’ve had a look at that before, but still couldn’t make wideangle work on non stock, not even for the FPCamera (then again, not a developer, just randomly trying things… ).

For people who want to take a look, the settings app is here, relevant code likely here:

MiscSettings.multiCameras -> {
    val value = sp.getBoolean(key, false)

    safeSetprop("persist.sys.phh.include_all_cameras", if(value) "true" else "false")
    if (value ||
            SystemProperties.get("", null) == null ||
            SystemProperties.get("camera.aux.packagelist", null) == null) {
        safeSetprop("", if (value) "nothing" else null)
        safeSetprop("camera.aux.packagelist", if (value) "nothing" else null)
        safeSetprop("ctl.restart", "")
        safeSetprop("ctl.restart", "camera-provider-2-4")
        safeSetprop("ctl.restart", "cameraserver")
MiscSettings.forceCamera2APIHAL3 -> {
    val value = sp.getBoolean(key, false)
    val defValue = "0"
    val newValue = if (value) "1" else defValue

    if (value ||
            SystemProperties.get("", defValue) != newValue ||
            SystemProperties.get("", defValue) != newValue) {
        safeSetprop("", newValue)
        safeSetprop("", newValue)
        Log.d("PHH", "forced Camera2API HAL3 to $value")
        // Restart services
        safeSetprop("ctl.restart", "")
        safeSetprop("ctl.restart", "camera-provider-2-4")

Thanks @yvmuell interesting infos.

Had to update myself about this topic (Treble) again.

  • DSI - Generic System Image
  • Phhusson is a developer

So the project exist since Android 8 - Oreo (
So do all the custom roms (except #leos) still skip / ignore it?

I think the relevant code in that GSI rom is that change here:

If the property is enabled it then treats the camera as public and ignores that the HAL flagged the camera as system only.

I tried various Camera Apps and patched them to have SYSTEM_CAMERA permission (GrapheneOs, Camera2 Api Prober, Open Camera). Only Open Camera then detects the Wide Angle Camera, for the other apps there appears to be no change.

Open Camera can use the full 4000x3000 resolution, even without SYSTEM_CAMERA permission.

In the Android documentation I found this:

Starting from API level 29:

Some or all physical cameras may not be independently exposed to the application, in which case the physical camera IDs will not be available in CameraManager.getCameraIdList(). But the application can still query the physical cameras’ characteristics by calling CameraManager.getCameraCharacteristics(String).

Maybe the wide angle lens is not exposed at all via Camera2? But OpenCamera somehow detects it, which the other apps can’t.

Also interesting: in OpenCamera 4000x3000 resolution is listed as not “Burst” capable. So maybe the other apps only request burst capable modes?

Unless Fairphone improves how Cameras and Modes are exposed it’s probably our best option to get the Stock camera fully functional on custom roms.


Edited the last post because it was not fully correct: With SYSTEM_CAMERA permission Open Camera v1.50.1 appears to be fully functional, even in Camera2 mode it can access the Wide Angle Lens and full resolution.

It’s accessed in the UI differently than in Legacy API Mode which got me confused.


You are completely right, that’s the more relevant part of code. I was referring to the code in the settings app that lets you toggle it (which didn’t get me very far with my own experiments).
Interestingly enough, the commit you linked is dated July 16th, but we have reports of a working wide-angle lens on LeOS from June, so as always with Camera2, it’s complicated :man_shrugging:

That’s probably the best interim solution, but you seem to make great progress here, keep up the good work :smiley:

I think that’s because for each release they rebase their changes onto the upstream repo. There are older versions of that commit around:


Makes sense, my bad :see_no_evil:



Dump question from someone less experienced than you guys:
How to you “patch” the camera apps?
Where exactly is the SYSTEM_CAMERA permission set? Or is this equal to install the Camera Apps as system app? EDIT: - docs - system-cameras

Open Camera can use the full 4000x3000 resolution, even without SYSTEM_CAMERA permission.

4000x3000 is 12MP (and yes Open Camera shows this as max resolution, also without modification/patching or after a normal installation), while the cameras have 48MP in the specs - afaiu.
Or is this the “Pixel Binning” I read about (best of 4 Pixels will be taken), which reduces the 48-Megapixel-photos to 12 Megapixel?

(default Camera of CalyxOS - package - also shows 12MP as max resolution :thinking: but I only see one back camera in settings.)

After these facts, why it the overall interim conclusion to use the Stock camera or make it working?

The 12MP resolution (4000x3000) is accessible when using the old camera API. When using Camera2, it tops at 3952x1824 for some unknown reason. The primary sensor (IMX582) is actually capable of taking 48MP (8000x6000) photos, as seen in the stock camera app. The same applies to the selfie camera (IMX576), which is capable of taking 24MP (5760×4312) photos. The ultra-wide sensor is advertised as 48MP (I can’t find the exact sensor number), but I guess it uses binning, so you can’t really get a 48MP photo out of it, only 12MP.

The permission must be declared in the AndroidManifest.xml of the APK. This is where existing APKs need to be patched or compiled with the change. See

Then the app must be installed in /system/priv-app (or on the vendor partition). It must also be granted the system camera in /system/etc/permissions. For the stock camera we add

<?xml version="1.0" encoding="utf-8"?>
    <privapp-permissions package="">
        <permission name="android.permission.SYSTEM_CAMERA"/> 

And last the camera package name must also be whitelisted in property. It’s easier to disable that property so that it’s empty. Then all apps are allowed if they fulfill the other requirements …

Camera2 from AOSP shows 12MP in the settings, but the captured image is not. I didn’t try modify if for SYSTEM_CAMERA permission. Also don’t know if it supports aux cameras at all.

I believe 12MP is the intended native resolution of the sensor. The “high res” 48mp images are probably only available in a special capture mode. Afaik that is a function of the Qualcomm camera HAL but the camera Apps need special support for it.

Because it implements all the features like High Res, Timelapse, Slomo etc and it can be extracted from the stock images like the other blobs. Usability is easier than for OpenCamera. Also I think it’s probably the best baseline for custom ROMs to see what features are working and which are not.