mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1014161 - Allow GeckoApp to handle activity results. r=rnewman
This commit is contained in:
parent
d94352ccd6
commit
9e8d2216d9
@ -1805,31 +1805,30 @@ abstract public class BrowserApp extends GeckoApp
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
Log.d(LOGTAG, "onActivityResult: " + requestCode + ", " + resultCode + ", " + data);
|
||||
switch (requestCode) {
|
||||
case ACTIVITY_REQUEST_PREFERENCES:
|
||||
// We just returned from preferences. If our locale changed,
|
||||
// we need to redisplay at this point, and do any other browser-level
|
||||
// bookkeeping that we associate with a locale change.
|
||||
if (resultCode != GeckoPreferences.RESULT_CODE_LOCALE_DID_CHANGE) {
|
||||
Log.d(LOGTAG, "No locale change returning from preferences; nothing to do.");
|
||||
return;
|
||||
}
|
||||
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final LocaleManager localeManager = BrowserLocaleManager.getInstance();
|
||||
final Locale locale = localeManager.getCurrentLocale(getApplicationContext());
|
||||
Log.d(LOGTAG, "Read persisted locale " + locale);
|
||||
if (locale == null) {
|
||||
return;
|
||||
}
|
||||
onLocaleChanged(BrowserLocaleManager.getLanguageTag(locale));
|
||||
case ACTIVITY_REQUEST_PREFERENCES:
|
||||
// We just returned from preferences. If our locale changed,
|
||||
// we need to redisplay at this point, and do any other browser-level
|
||||
// bookkeeping that we associate with a locale change.
|
||||
if (resultCode != GeckoPreferences.RESULT_CODE_LOCALE_DID_CHANGE) {
|
||||
Log.d(LOGTAG, "No locale change returning from preferences; nothing to do.");
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final LocaleManager localeManager = BrowserLocaleManager.getInstance();
|
||||
final Locale locale = localeManager.getCurrentLocale(getApplicationContext());
|
||||
Log.d(LOGTAG, "Read persisted locale " + locale);
|
||||
if (locale == null) {
|
||||
return;
|
||||
}
|
||||
onLocaleChanged(BrowserLocaleManager.getLanguageTag(locale));
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user