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.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class MobileNetworkSettings extends AbstractMobileNetworkSettings implements
|
||||
@@ -359,24 +358,18 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
||||
}
|
||||
|
||||
private void onSubscriptionDetailChanged() {
|
||||
if (mSubscriptionInfoEntity != null) {
|
||||
/**
|
||||
* Update the title when SIM stats got changed
|
||||
*/
|
||||
final Consumer<Activity> renameTitle = activity -> {
|
||||
if (activity != null && !activity.isFinishing()) {
|
||||
if (activity instanceof SettingsActivity) {
|
||||
((SettingsActivity) activity).setTitle(mSubscriptionInfoEntity.uniqueName);
|
||||
final SubscriptionInfoEntity subscriptionInfoEntity = mSubscriptionInfoEntity;
|
||||
if (subscriptionInfoEntity == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ThreadUtils.postOnMainThread(() -> {
|
||||
renameTitle.accept(getActivity());
|
||||
if (getActivity() instanceof SettingsActivity activity && !activity.isFinishing()) {
|
||||
// Update the title when SIM stats got changed
|
||||
activity.setTitle(subscriptionInfoEntity.uniqueName);
|
||||
}
|
||||
redrawPreferenceControllers();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
|
Reference in New Issue
Block a user