Merge "Fix mSubscriptionInfoEntity NullPointerException" into main
This commit is contained in:
@@ -68,7 +68,6 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||||
public class MobileNetworkSettings extends AbstractMobileNetworkSettings implements
|
public class MobileNetworkSettings extends AbstractMobileNetworkSettings implements
|
||||||
@@ -359,23 +358,17 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onSubscriptionDetailChanged() {
|
private void onSubscriptionDetailChanged() {
|
||||||
if (mSubscriptionInfoEntity != null) {
|
final SubscriptionInfoEntity subscriptionInfoEntity = mSubscriptionInfoEntity;
|
||||||
/**
|
if (subscriptionInfoEntity == null) {
|
||||||
* Update the title when SIM stats got changed
|
return;
|
||||||
*/
|
|
||||||
final Consumer<Activity> renameTitle = activity -> {
|
|
||||||
if (activity != null && !activity.isFinishing()) {
|
|
||||||
if (activity instanceof SettingsActivity) {
|
|
||||||
((SettingsActivity) activity).setTitle(mSubscriptionInfoEntity.uniqueName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
ThreadUtils.postOnMainThread(() -> {
|
|
||||||
renameTitle.accept(getActivity());
|
|
||||||
redrawPreferenceControllers();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
ThreadUtils.postOnMainThread(() -> {
|
||||||
|
if (getActivity() instanceof SettingsActivity activity && !activity.isFinishing()) {
|
||||||
|
// Update the title when SIM stats got changed
|
||||||
|
activity.setTitle(subscriptionInfoEntity.uniqueName);
|
||||||
|
}
|
||||||
|
redrawPreferenceControllers();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user