Commit graph

32 commits

Message SHA1
Automatic translation import
Change-Id: I2415a374afe31989aabc6923f7ae7367046c1d0c

Michael Bestas   commited 2021-08-21 04:06:27 +03:00
dbaab0bfeb
Automatic translation import
Change-Id: Ic0f1221a3e6de0c054958df53794c1c568f09acd

LineageOS Builder   commited 2021-05-01 15:55:52 +00:00
7d9e132b3d
Automatic translation import
Change-Id: If5f6ce53cdcfda2f91a77718496c705e1a05f129

Michael Bestas   commited 2021-02-28 02:38:26 +02:00
fd696f512d
ModemConfig: Convert providers list into readonly, lazy-initialized val
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 Suijten   authored and   Alin Jerpelea   commited 2020-10-26 10:15:44 +01:00
c0b6d4306c
ModemConfig: Convert getProviders one-time-init to lazyinit
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 Suijten   authored and   Alin Jerpelea   commited 2020-10-26 10:15:44 +01:00
da023cc43f
Merge pull request #4 from MarijnS95/fix-android-r
[ModemConfig] [R] Fixup sysprop refactor

Alin Jerpelea   authored and   GitHub   commited 2020-09-28 09:30:40 +02:00
612dabaf80
FIXUP: ModemConfig: vendor.somc.cust.modem\d is supposed to be persist.
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>

Marijn Suijten   commited 2020-09-27 22:42:10 +02:00
1497865ca1
ModemConfig: Statically link SomcModemProperties
Fixes: "Failed resolution of: Lcom/sony/opentelephony/modemconfig/SomcModemProperties;"

LuK1337   authored and   Marijn Suijten   commited 2020-09-27 22:40:34 +02:00
6dd5d78835
Merge pull request #3 from MarijnS95/android-r
[opentelephony] [R] Convert ModemConfig to sysprop and drop private platform apis

Alin Jerpelea   authored and   GitHub   commited 2020-09-10 09:40:15 +02:00
1a803f475d
Merge pull request #2 from MarijnS95/generic-ims
[OpenTelephony] ModemConfig: Fall back to generic-IMS if no match is found

Alin Jerpelea   authored and   GitHub   commited 2020-09-10 09:35:50 +02:00
67c3970475
[R] ModemConfig: sysprop: Update current API
m SomcModemProperties-dump-api && rm -rf vendor/oss/opentelephony/ModemConfig/sysprop/api/SomcModemProperties-current.txt && cp -f out/soong/.intermediates/vendor/oss/opentelephony/ModemConfig/sysprop/SomcModemProperties_sysprop_library/api-dump.txt vendor/oss/opentelephony/ModemConfig/sysprop/api/SomcModemProperties-current.txt

Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-09-09 22:39:47 +02:00
bbf108cb9c
[R] ModemConfig: sysprop: Generate api files
build/soong/scripts/gen-sysprop-api-files.sh "vendor/oss/opentelephony/ModemConfig/sysprop" "SomcModemProperties"

Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-09-09 22:39:47 +02:00
fe0c10b122
[R] ModemConfig: Replace try-with-resources with .use block
Q kotlinc chokes on it.

Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-09-09 22:39:47 +02:00
1b7bdd82ec
[R] ModemConfig: Implement properties using sysprop
Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-09-09 22:39:47 +02:00
e9db620081
Revert "REVERTME: ModemConfig: Use platform APIs for SystemProperties"
This reverts commit 14e521c0487af0b513cc9a5df93cc7a3b5add450.

Marijn Suijten   commited 2020-09-09 22:39:47 +02:00
8cc4875938
ModemConfig: Fall back to generic-IMS if no match is found
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>

Marijn Suijten   commited 2020-06-29 20:32:45 +02:00
403a7f1cab
Merge pull request #1 from MarijnS95/master
[ModemConfig] Fix null/empty string issues, show multiple grouped notifications for DSDS configuration

Alin Jerpelea   authored and   GitHub   commited 2020-06-11 14:05:32 +02:00
7716856612
ModemConfig: Drop notification importance from LOW to MIN
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>

Marijn Suijten   commited 2020-06-07 11:16:48 +02:00
c7583ac3c8
ModemConfig: Show a grouped notification per slot
Otherwise the notifcation for slot 1 would hide the one for slot 0, if
both are available.

Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-06-06 18:07:44 +02:00
16b7b8391e
ModemConfig: Deal with null|empty strings from TelephonyManager
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>

Marijn Suijten   commited 2020-06-06 13:22:16 +02:00
0d8dc0c542
ModemConfig: Fix warning in translated string
res/values-it/strings.xml:6: warn: multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?.

LuK1337   authored and   Marijn Suijten   commited 2020-06-06 13:22:16 +02:00
5ed9020953
gitignore: Ignore gen and lib folder created by aidegen + Android Studio
Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-06-05 22:44:34 +02:00
131e68dc24
ModemConfig: Add a simple notification showing to-be-flashed firmware
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>

Marijn Suijten   commited 2020-06-05 01:03:31 +02:00
6ff9b1f132
ModemConfig: Add privapp whitelist xml
LuK1337   authored and   Marijn Suijten   commited 2020-06-05 00:56:12 +02:00
6343ef61fb
ModemConfig: Sort by most specific config first; take first match
Marijn Suijten   commited 2020-06-05 00:56:12 +02:00
bd2a2b1109
REVERTME: ModemConfig: Use platform APIs for SystemProperties
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>

Marijn Suijten   commited 2020-06-05 00:56:11 +02:00
822920ff5b
ModemConfig: Register subchange with SubscriptionManager instead
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>

Marijn Suijten   commited 2020-06-05 00:55:53 +02:00
05d50c9738
ModemConfig: Receive subId, resolve config and trigger modem FW flash
Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-06-05 00:33:33 +02:00
9f0ec9dcb2
ModemConfig: Add service provider resource xml
This xml is extracted from an overlay using the python script in this
repository.

Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-05-21 00:58:00 +02:00
d4e49a851c
ModemConfig: Add service_providers.xml extractor from stock overlay
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>

Marijn Suijten   commited 2020-05-21 00:58:00 +02:00
1f742ecc01
Add simple Java gitignore
Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-05-11 21:42:50 +02:00
9891f78f6a
Initial commit
Signed-off-by: Marijn Suijten <marijns95@gmail.com>

Marijn Suijten   commited 2020-05-11 21:42:50 +02:00
00faa3ce1a