summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/voicemailstatus
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-03-26 12:46:18 -0700
committerCopybara-Service <copybara-piper@google.com>2018-03-26 22:23:52 -0700
commit437ae9552cce7768068fa92663740711ee541417 (patch)
tree1ae9af42ed23c09404b87ca613247e18c3fa10d2 /java/com/android/dialer/voicemailstatus
parentcf14ecbc3cb604804ae1f9d01e47444fcf0eedc6 (diff)
Remove obsolete version checks and compat utilities after min SDK was bumped up to N.
Test: Existing tests PiperOrigin-RevId: 190508397 Change-Id: Ia5f33e45af1d1cc666fec5f43efa564b2b68c193
Diffstat (limited to 'java/com/android/dialer/voicemailstatus')
-rw-r--r--java/com/android/dialer/voicemailstatus/VoicemailStatusQuery.java24
1 files changed, 7 insertions, 17 deletions
diff --git a/java/com/android/dialer/voicemailstatus/VoicemailStatusQuery.java b/java/com/android/dialer/voicemailstatus/VoicemailStatusQuery.java
index 4a6e9f703..8923f7411 100644
--- a/java/com/android/dialer/voicemailstatus/VoicemailStatusQuery.java
+++ b/java/com/android/dialer/voicemailstatus/VoicemailStatusQuery.java
@@ -51,28 +51,24 @@ public class VoicemailStatusQuery {
@RequiresApi(VERSION_CODES.N_MR1)
public static final int SOURCE_TYPE_INDEX = 10;
- private static final String[] PROJECTION_M =
+ @RequiresApi(VERSION_CODES.N)
+ private static final String[] PROJECTION_N =
new String[] {
Status.SOURCE_PACKAGE, // 0
Status.SETTINGS_URI, // 1
Status.VOICEMAIL_ACCESS_URI, // 2
Status.CONFIGURATION_STATE, // 3
Status.DATA_CHANNEL_STATE, // 4
- Status.NOTIFICATION_CHANNEL_STATE // 5
+ Status.NOTIFICATION_CHANNEL_STATE, // 5
+ Status.QUOTA_OCCUPIED, // 6
+ Status.QUOTA_TOTAL // 7
};
- @RequiresApi(VERSION_CODES.N)
- private static final String[] PROJECTION_N;
-
@RequiresApi(VERSION_CODES.N_MR1)
private static final String[] PROJECTION_NMR1;
static {
- List<String> projectionList = new ArrayList<>(Arrays.asList(PROJECTION_M));
- projectionList.add(Status.QUOTA_OCCUPIED); // 6
- projectionList.add(Status.QUOTA_TOTAL); // 7
- PROJECTION_N = projectionList.toArray(new String[projectionList.size()]);
-
+ List<String> projectionList = new ArrayList<>(Arrays.asList(PROJECTION_N));
projectionList.add(Status.PHONE_ACCOUNT_COMPONENT_NAME); // 8
projectionList.add(Status.PHONE_ACCOUNT_ID); // 9
projectionList.add(Status.SOURCE_TYPE); // 10
@@ -80,12 +76,6 @@ public class VoicemailStatusQuery {
}
public static String[] getProjection() {
- if (VERSION.SDK_INT >= VERSION_CODES.N_MR1) {
- return PROJECTION_NMR1;
- }
- if (VERSION.SDK_INT >= VERSION_CODES.N) {
- return PROJECTION_N;
- }
- return PROJECTION_M;
+ return VERSION.SDK_INT >= VERSION_CODES.N_MR1 ? PROJECTION_NMR1 : PROJECTION_N;
}
}