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

Commit 0827e1d0 authored by Tim Van Patten's avatar Tim Van Patten
Browse files

FeatureOverrides: Remove copy constructor

Remove the FeatureOverrides copy constructor to reduces the amount of
bytes copied on each app launch to just the Binder call.

While debugging b/425292768, it stood out that the FeatureOverrides copy
constructor is unnecessary and inefficient.

When an app launches, there are two instances of FeatureOverrides:

1. gpuservice (the cached instance, parsed from the protobuf file)
2. GraphicsEnv (the per-app instance used by the loader to toggle
   features for each app).

GraphicsEnv is instantiated per-app, so it's instance of
FeatureOverrides needs to be populated by the cached values from
gpuservice. This is achieved with a Binder call from GraphicsEnv to
gpuservice. Before this CL, there were several FeatureOverrides copy
constructor calls, which is inefficient and unnecessary.

Instead, GraphicsEnv is updated to pass a reference to
BpGpuService::getFeatureOverrides(), so it's instance can be filled in
directly with the deserialized Binder data. Additionally,
FeatureOverrideParser returns a const reference to its cached
FeatureOverrides values to BnGpuService
eliminating the copy constructor. This leaves the Binder
serialize-deserialize as the only copying of the FeatureOverrides data.

Bug: b/425292768
Test: atest gpuservice_unittest
Flag: EXEMPT bugfix
Change-Id: I9cbacad24ac5601e8fa550517ee1913bf3000c73
parent 7598f6bf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment