diff options
author | Christopher Tate <ctate@google.com> | 2013-11-05 18:42:57 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-11-05 18:42:58 +0000 |
commit | 8869d6f3537b323d1c9d1339d057a4866520e649 (patch) | |
tree | c529eec4b31ad676971a01df898322a36b7ed620 /services/java | |
parent | d64744cc764eb970df263aaebc44474d465686cb (diff) | |
parent | 2298ef2f7f89d7a5cab6ef4790d8cbdb189e73e9 (diff) | |
download | frameworks_base-8869d6f3537b323d1c9d1339d057a4866520e649.zip frameworks_base-8869d6f3537b323d1c9d1339d057a4866520e649.tar.gz frameworks_base-8869d6f3537b323d1c9d1339d057a4866520e649.tar.bz2 |
Merge "Extend preferred-app preload support for complex resolutions" into klp-dev
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/pm/Settings.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/services/java/com/android/server/pm/Settings.java b/services/java/com/android/server/pm/Settings.java index d3ccba6..0079b54 100644 --- a/services/java/com/android/server/pm/Settings.java +++ b/services/java/com/android/server/pm/Settings.java @@ -1959,10 +1959,14 @@ final class Settings { } boolean doNonData = true; + boolean hasSchemes = false; for (int ischeme=0; ischeme<tmpPa.countDataSchemes(); ischeme++) { boolean doScheme = true; String scheme = tmpPa.getDataScheme(ischeme); + if (scheme != null && !scheme.isEmpty()) { + hasSchemes = true; + } for (int issp=0; issp<tmpPa.countDataSchemeSpecificParts(); issp++) { Uri.Builder builder = new Uri.Builder(); builder.scheme(scheme); @@ -2016,11 +2020,25 @@ final class Settings { } for (int idata=0; idata<tmpPa.countDataTypes(); idata++) { - Intent finalIntent = new Intent(intent); String mimeType = tmpPa.getDataType(idata); - finalIntent.setType(mimeType); - applyDefaultPreferredActivityLPw(service, finalIntent, flags, cn, - null, null, null, null, mimeType, userId); + if (hasSchemes) { + Uri.Builder builder = new Uri.Builder(); + for (int ischeme=0; ischeme<tmpPa.countDataSchemes(); ischeme++) { + String scheme = tmpPa.getDataScheme(ischeme); + if (scheme != null && !scheme.isEmpty()) { + Intent finalIntent = new Intent(intent); + builder.scheme(scheme); + finalIntent.setDataAndType(builder.build(), mimeType); + applyDefaultPreferredActivityLPw(service, finalIntent, flags, cn, + scheme, null, null, null, mimeType, userId); + } + } + } else { + Intent finalIntent = new Intent(intent); + finalIntent.setType(mimeType); + applyDefaultPreferredActivityLPw(service, finalIntent, flags, cn, + null, null, null, null, mimeType, userId); + } doNonData = false; } |