Bug 1366644 - Part 2: Work around new deprecation warnings from Android SDK 25/26. r=maliu

MozReview-Commit-ID: CDDGqQBQHDS

--HG--
extra : rebase_source : f0d9d7eb2b6f701f19cae69bf9428020e3f823d4
This commit is contained in:
Nick Alexander 2017-06-21 10:11:03 -07:00
parent 7bf2570b31
commit ec1556ae55
5 changed files with 11 additions and 9 deletions

View File

@ -147,8 +147,8 @@ public class UpdateService extends IntentService {
mPrefs = getSharedPreferences(PREFS_NAME, 0);
mNotificationManager = NotificationManagerCompat.from(this);
mConnectivityManager = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
mWifiLock = ((WifiManager)getSystemService(Context.WIFI_SERVICE))
mConnectivityManager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
mWifiLock = ((WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE))
.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, PREFS_NAME);
mCancelDownload = false;
}

View File

@ -95,12 +95,8 @@ public class BouncerService extends IntentService {
}
}
private String getDataDir() {
return getApplicationInfo().dataDir;
}
private File getDataFile(final String path) {
File outFile = new File(getDataDir(), path);
File outFile = new File(getApplicationInfo().dataDir, path);
File dir = outFile.getParentFile();
if (dir != null && !dir.exists()) {

View File

@ -110,6 +110,7 @@ public class PostSearchFragment extends Fragment {
networkError = false;
}
@SuppressWarnings("deprecation")
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// Ignore about:blank URL loads and the first results page we try to load.

View File

@ -12,4 +12,6 @@ include('stumbler_sources.mozbuild')
stumbler_jar = add_java_jar('stumbler')
stumbler_jar.sources += stumbler_sources
stumbler_jar.extra_jars += [CONFIG['ANDROID_SUPPORT_V4_AAR_LIB']]
stumbler_jar.javac_flags += ['-Xlint:all']
# Android has deprecated most of the GPS interfaces stumbler uses, so
# we need -deprecation.
stumbler_jar.javac_flags += ['-Xlint:all,-deprecation']

View File

@ -31,7 +31,10 @@ jar.sources += [
'src/org/mozilla/tests/browser/junit3/TestSuggestedSites.java',
]
jar.generated_sources = [] # None yet -- try to keep it this way.
jar.javac_flags += ['-Xlint:all']
# MockResources has been deprecated, so we need -deprecation. See
# https://github.com/Countly/countly-sdk-android/blob/ae89490a5646e7db09c855f62b35c861819300cd/sdk/src/androidTest/java/ly/count/android/sdk/DeviceInfoTests.java#L80
# for a Mockito-based approach.
jar.javac_flags += ['-Xlint:all,-deprecation']
jar.extra_jars += [
CONFIG['ANDROID_SUPPORT_V4_AAR_LIB'],