Merge "Import translations. DO NOT MERGE"
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 228fcea..6a4e22a 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -376,12 +376,11 @@
final Notification notification = builder.build();
List<UserInfo> users = mUserManager.getUsers(true);
- for (int i = 0; i < users.size(); i++) {
- final UserInfo user = users.get(i);
+ for (UserInfo user : users) {
final UserHandle userHandle = user.getUserHandle();
if (!mUserManager.hasUserRestriction(
UserManager.DISALLOW_OUTGOING_CALLS, userHandle)
- && !user.isManagedProfile()) {
+ && !mUserManager.isManagedProfile(userHandle.getIdentifier())) {
if (!maybeSendVoicemailNotificationUsingDefaultDialer(phone, vmCount, vmNumber,
pendingIntent, isSettingsIntent, userHandle, isRefresh)) {
notifyAsUser(
@@ -394,12 +393,11 @@
}
} else {
List<UserInfo> users = mUserManager.getUsers(true /* excludeDying */);
- for (int i = 0; i < users.size(); i++) {
- final UserInfo user = users.get(i);
+ for (UserInfo user : users) {
final UserHandle userHandle = user.getUserHandle();
if (!mUserManager.hasUserRestriction(
UserManager.DISALLOW_OUTGOING_CALLS, userHandle)
- && !user.isManagedProfile()) {
+ && !mUserManager.isManagedProfile(userHandle.getIdentifier())) {
if (!maybeSendVoicemailNotificationUsingDefaultDialer(phone, 0, null, null,
false, userHandle, isRefresh)) {
cancelAsUser(
@@ -554,7 +552,7 @@
} else {
List<UserInfo> users = mUserManager.getUsers(true);
for (UserInfo user : users) {
- if (user.isManagedProfile()) {
+ if (mUserManager.isManagedProfile(user.getUserHandle().getIdentifier())) {
continue;
}
UserHandle userHandle = user.getUserHandle();
@@ -679,7 +677,7 @@
.setContentText(contentText)
.setOnlyAlertOnce(true)
.setOngoing(true)
- .setChannel(NotificationChannelController.CHANNEL_ID_SIM_HIGH_PRIORITY)
+ .setChannelId(NotificationChannelController.CHANNEL_ID_SIM_HIGH_PRIORITY)
.setContentIntent(contentIntent);
final Notification notification = new Notification.BigTextStyle(builder).bigText(
contentText).build();
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 133b65f..2991da8 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -593,7 +593,9 @@
if (tm != null && tm.isInEmergencyCall()) {
// Switch airplane mode back to off.
- ConnectivityManager.from(this).setAirplaneMode(false);
+ ConnectivityManager cm =
+ (ConnectivityManager) context.getSystemService(CONNECTIVITY_SERVICE);
+ cm.setAirplaneMode(false);
Toast.makeText(this, R.string.radio_off_during_emergency_call, Toast.LENGTH_LONG)
.show();
Log.i(LOG_TAG, "Ignoring airplane mode: emergency call. Turning airplane off");
diff --git a/src/com/android/phone/RestrictedSwitchPreference.java b/src/com/android/phone/RestrictedSwitchPreference.java
index ba6b65e..5a86ed2 100644
--- a/src/com/android/phone/RestrictedSwitchPreference.java
+++ b/src/com/android/phone/RestrictedSwitchPreference.java
@@ -68,7 +68,7 @@
public void checkRestrictionAndSetDisabled(String userRestriction) {
UserManager um = UserManager.get(mContext);
- UserHandle user = UserHandle.of(um.getUserHandle());
+ UserHandle user = UserHandle.of(UserHandle.myUserId());
boolean disabledByAdmin = um.hasUserRestriction(userRestriction, user)
&& !um.hasBaseUserRestriction(userRestriction, user);
setDisabledByAdmin(disabledByAdmin);
diff --git a/src/com/android/phone/settings/AccessibilitySettingsFragment.java b/src/com/android/phone/settings/AccessibilitySettingsFragment.java
index 334ad6e..5a70fe2 100644
--- a/src/com/android/phone/settings/AccessibilitySettingsFragment.java
+++ b/src/com/android/phone/settings/AccessibilitySettingsFragment.java
@@ -172,7 +172,8 @@
for (int subId : SubscriptionController.getInstance().getActiveSubIdList(true)) {
if (!configManager.getConfigForSubId(subId).getBoolean(
CarrierConfigManager.KEY_IGNORE_RTT_MODE_SETTING_BOOL, false)) {
- ImsManager imsManager = ImsManager.getInstance(getContext(), subId);
+ int phoneId = SubscriptionController.getInstance().getPhoneId(subId);
+ ImsManager imsManager = ImsManager.getInstance(getContext(), phoneId);
imsManager.setRttEnabled(mButtonRtt.isChecked());
}
}