Messaging: Let there be lambdas
Change-Id: Iee1fc46c92ea9159abb10d92d34baee937bdee0c
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 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.
|
||||
@@ -336,12 +337,8 @@ public class ApnDatabase extends SQLiteOpenHelper {
|
||||
final Resources r = sContext.getResources();
|
||||
final XmlResourceParser parser = r.getXml(R.xml.apns);
|
||||
final ApnsXmlProcessor processor = ApnsXmlProcessor.get(parser);
|
||||
processor.setApnHandler(new ApnsXmlProcessor.ApnHandler() {
|
||||
@Override
|
||||
public void process(final ContentValues apnValues) {
|
||||
db.insert(APN_TABLE, null/*nullColumnHack*/, apnValues);
|
||||
}
|
||||
});
|
||||
processor.setApnHandler(apnValues -> db.insert(APN_TABLE, null/*nullColumnHack*/,
|
||||
apnValues));
|
||||
try {
|
||||
processor.process();
|
||||
} catch (final Exception e) {
|
||||
|
||||
@@ -129,13 +129,8 @@ public class BugleCarrierConfigValuesLoader implements CarrierConfigValuesLoader
|
||||
try {
|
||||
parser = subContext.getResources().getXml(R.xml.mms_config);
|
||||
final ApnsXmlProcessor processor = ApnsXmlProcessor.get(parser);
|
||||
processor.setMmsConfigHandler(new ApnsXmlProcessor.MmsConfigHandler() {
|
||||
@Override
|
||||
public void process(final String mccMnc, final String key, final String value,
|
||||
final String type) {
|
||||
update(values, type, key, value);
|
||||
}
|
||||
});
|
||||
processor.setMmsConfigHandler((mccMnc, key, value, type) ->
|
||||
update(values, type, key, value));
|
||||
processor.process();
|
||||
} catch (final Resources.NotFoundException e) {
|
||||
LogUtil.w(LogUtil.BUGLE_TAG, "Can not find mms_config.xml");
|
||||
|
||||
@@ -134,12 +134,7 @@ public class MmsConfig {
|
||||
* Same as load() but doing it using an async thread from SafeAsyncTask thread pool.
|
||||
*/
|
||||
public static void loadAsync() {
|
||||
SafeAsyncTask.executeOnThreadPool(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
load();
|
||||
}
|
||||
});
|
||||
SafeAsyncTask.executeOnThreadPool(MmsConfig::load);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user