Skip to content

Commit

Permalink
Removing deprecation warning for ACTION_STORAGE_CHANGED
Browse files Browse the repository at this point in the history
Change-Id: I5ab4fd94c4d4c171ab17b9900bab5ca27f0b7c4b
Reviewed-on: https://chromium-review.googlesource.com/895540
Reviewed-by: David Benjamin <davidben@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533480}
  • Loading branch information
marcinwiacek authored and Commit Bot committed Feb 1, 2018
1 parent 845319f commit 486920a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions net/android/java/src/org/chromium/net/X509Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ public void onReceive(Context context, Intent intent) {
shouldReloadTrustManager = true;
}
} else {
@SuppressWarnings("deprecation")
String action = KeyChain.ACTION_STORAGE_CHANGED;
// Before Android O, KeyChain only emitted a coarse-grained intent. This fires much
// more often than it should (https://crbug.com/381912), but there are no APIs to
// distinguish the various cases.
shouldReloadTrustManager =
KeyChain.ACTION_STORAGE_CHANGED.equals(intent.getAction());
shouldReloadTrustManager = action.equals(intent.getAction());
}

if (shouldReloadTrustManager) {
Expand Down Expand Up @@ -275,7 +276,9 @@ private static void ensureInitializedLocked()
filter.addAction(KeyChain.ACTION_KEY_ACCESS_CHANGED);
filter.addAction(KeyChain.ACTION_TRUST_STORE_CHANGED);
} else {
filter.addAction(KeyChain.ACTION_STORAGE_CHANGED);
@SuppressWarnings("deprecation")
String action = KeyChain.ACTION_STORAGE_CHANGED;
filter.addAction(action);
}
ContextUtils.getApplicationContext().registerReceiver(sTrustStorageListener, filter);
}
Expand Down

0 comments on commit 486920a

Please sign in to comment.