Notification importance/selected sound conflict fixes.

- When you've selected "Silent" as your sound, update notification
importance messaging to match.
- When you explicitly move from a silent type of notifications to a
loud type, but have "Silent" selected as the sound, change the
sound to the default notification sound also.

Change-Id: I462785d593e1d6c7d1e87388aeee1bdcbcf6aa3d
Fixes: 63109928
Test: RunSettingsRoboTests, manual
This commit is contained in:
Alison Cichowlas
2017-09-14 15:01:29 -04:00
parent 097f4184fa
commit ad1158169c
4 changed files with 38 additions and 10 deletions

View File

@@ -46,6 +46,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
@@ -506,4 +507,8 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen
}
}
};
boolean hasValidSound(NotificationChannel channel) {
return channel.getSound() != null && !Uri.EMPTY.equals(channel.getSound());
}
}