android.app.NotificationChannel#mSystemBlockable is false by default.
If the app was built with system signature the notification channel cannot be blocked.
Change-Id: I24133042654bf36a18d0da8b273220e9d7e9d5d3
Android S deems that our "stable API files" are out of date, but leaves
them empty on regeneration - most likely because we are not fixing an
API version in place. Remove it entirely instead to allow the build to
continue.
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Change-Id: Iea0ca5e498b649fd2b2bcaf1948872c4d7c2f333
Marijn Suijtenauthored and LuK1337commited 2022-03-08 20:21:55 +01:00
Assuming the value is used after onCreate has been called (ie. not in a
constructor) parseProviders can safely run and retrieve resources.
This solves poor (basically inexistent) use-before-initialization checks
of a lateinit value as well; the value could have been freely used
without any initialization at all or reassigned from anywhere because
it's mutable, without the compiler complaining.
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
Marijn Suijtenauthored and Alin Jerpeleacommited 2020-10-26 10:15:44 +01:00
Lazyinit allows a non-nullable to be null "temporarily" while it is
initialized outside of a constructor. This is useful in android
scenarios where initialization usually happens in onCreate().
Note that it is not really safe. The compiler doesn't do any checks or
use annotations to understand that this value should be initialized in
onCreate, nor does it fail compilation if it is never initialized at
all or used before initialization. After all `providers` remains a
`var`iable, not a `val`ue. In hindsight `lateinit` is simply a free pass
to circumvent compile-time null checks, and is best avoided.
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
Marijn Suijtenauthored and Alin Jerpeleacommited 2020-10-26 10:15:44 +01:00
These properties were previously persistent but have inadevertently lost
that during a refactor. It doesn't really matter what type it is since
init files forward this to (broken) non vendor-prefixed persist
properties anyway. Having only one pair persistent would be cleaner but
requires modifying more repos (device-sony-{common,sepolicy}) which we
rather do in one go when modem-switcher (blob) is updated to listen to a
vendor-prefixed property instead.
Fixes: e9db620081
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
Generic IMS allows carriers with an unknown configuration (in the
current mapping) to still use IMS if they end up supporting it.
If sony-modem-switcher ends up not finding the config or the modem file
it'll (as always) fall back to the default non_ims variant anyway.
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
Hide the icon from the statusbar as well. It's not relevant to see here,
just in the notification shade is enough.
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
Some of these strings are (temporarily) empty, eg. while the SIM is
locked. Make sure we do not crash in these instances, and rather wait
for the time these become available.
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
In order to help our efforts finalizing the initial release, provide a
little bit of info to the user about the detected config and the
firmware path belonging to the installation.
TODO: This can be improved in various ways:
- Clear sony.modemswitcher.modem_name_*, and wait for it to change.
This variable contains the path so that we do not need to read it from
a file, including the default path (when the config is not found).
- Extend the notification (or start a Dialog/Activity onclick) to
display more diagnostic info.
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
Unfortunately sysprop - which is the SDK-compliant repacement for
SystemProperties - does not work properly in Android Q. Specificially
a java library is not generated and passed to the java compiler when
building ModemConfig. This works flawlessly in Android R.
Use SystemProperties from the private API as a stop-gap solution, until
we either pick a build-system fix or move to R.
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
DEFAULT_SUBSCRIPTION_CHANGED is not delivered often enough. When
swapping the same SIM between slots the selected subscription doesn't
change yet the firmware for the slot might need to be updated.
Registering this handler provides the ability to do so, but has to be
registered from a background service that consequently is to be started
by a BootReceiver.
Signed-off-by: Marijn Suijten <marijns95@gmail.com>
This overlay contains the necessary mappings from mcc/mnc/gid1/imsi/sp
to a configuration name. The configuration file under this name contains
a path to the actuall modem firmware that is supposed to be flashed.
Signed-off-by: Marijn Suijten <marijns95@gmail.com>