[Settings] Fix RTL issue of Calls and SMS

Screenshot: https://screenshot.googleplex.com/9BqEh99vz7xp2g4.png

Bug: 189300799
Test: make
Change-Id: I022253efbe0ea25f11d5ac6c2b3b0fcd1d9f54aa
(cherry picked from commit 54bd206fbc)
Merged-In: I022253efbe0ea25f11d5ac6c2b3b0fcd1d9f54aa
This commit is contained in:
Zoey Chen
2021-07-12 23:43:41 +08:00
parent c97269a900
commit 95bcd7cb23
5 changed files with 27 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.view.View;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
@@ -62,11 +63,14 @@ public abstract class DefaultSubscriptionController extends TelephonyBasePrefere
private static final ComponentName PSTN_CONNECTION_SERVICE_COMPONENT =
new ComponentName("com.android.phone",
"com.android.services.telephony.TelephonyConnectionService");
private boolean mIsRtlMode;
public DefaultSubscriptionController(Context context, String preferenceKey) {
super(context, preferenceKey);
mManager = context.getSystemService(SubscriptionManager.class);
mChangeListener = new SubscriptionsChangeListener(context, this);
mIsRtlMode = context.getResources().getConfiguration().getLayoutDirection()
== View.LAYOUT_DIRECTION_RTL;
}
public void init(Lifecycle lifecycle) {
@@ -285,4 +289,8 @@ public abstract class DefaultSubscriptionController extends TelephonyBasePrefere
refreshSummary(mPreference);
}
}
boolean isRtlMode() {
return mIsRtlMode;
}
}