Skip to content

Commit c9e94ea

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Fix issue #7213113: Remove old intent resolver" into jb-mr1-dev
2 parents 8562cb5 + 52c6234 commit c9e94ea

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

core/java/android/widget/AppSecurityPermissions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public AppSecurityPermissions(Context context, String packageName) {
257257
try {
258258
pkgInfo = mPm.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS);
259259
} catch (NameNotFoundException e) {
260-
Log.w(TAG, "Could'nt retrieve permissions for package:"+packageName);
260+
Log.w(TAG, "Couldn't retrieve permissions for package:"+packageName);
261261
return;
262262
}
263263
// Extract all user permissions

core/res/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_VERIFICATION" />
4646
<protected-broadcast android:name="android.intent.action.PACKAGE_VERIFIED" />
4747
<protected-broadcast android:name="android.intent.action.UID_REMOVED" />
48+
<protected-broadcast android:name="android.intent.action.QUERY_PACKAGE_RESTART" />
4849
<protected-broadcast android:name="android.intent.action.CONFIGURATION_CHANGED" />
4950
<protected-broadcast android:name="android.intent.action.LOCALE_CHANGED" />
5051
<protected-broadcast android:name="android.intent.action.BATTERY_CHANGED" />

services/java/com/android/server/IntentResolver.java

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
4646
final private static String TAG = "IntentResolver";
4747
final private static boolean DEBUG = false;
4848
final private static boolean localLOGV = DEBUG || false;
49+
final private static boolean VALIDATE = false;
4950

5051
public void addFilter(F f) {
5152
if (localLOGV) {
@@ -67,16 +68,20 @@ public void addFilter(F f) {
6768
mTypedActionToFilter, " TypedAction: ");
6869
}
6970

70-
mOldResolver.addFilter(f);
71-
verifyDataStructures(f);
71+
if (VALIDATE) {
72+
mOldResolver.addFilter(f);
73+
verifyDataStructures(f);
74+
}
7275
}
7376

7477
public void removeFilter(F f) {
7578
removeFilterInternal(f);
7679
mFilters.remove(f);
7780

78-
mOldResolver.removeFilter(f);
79-
verifyDataStructures(f);
81+
if (VALIDATE) {
82+
mOldResolver.removeFilter(f);
83+
verifyDataStructures(f);
84+
}
8085
}
8186

8287
void removeFilterInternal(F f) {
@@ -314,12 +319,14 @@ public List<R> queryIntent(Intent intent, String resolvedType, boolean defaultOn
314319
}
315320
sortResults(finalList);
316321

317-
List<R> oldList = mOldResolver.queryIntent(intent, resolvedType, defaultOnly, userId);
318-
if (oldList.size() != finalList.size()) {
319-
ValidationFailure here = new ValidationFailure();
320-
here.fillInStackTrace();
321-
Log.wtf(TAG, "Query result " + intent + " size is " + finalList.size()
322-
+ "; old implementation is " + oldList.size(), here);
322+
if (VALIDATE) {
323+
List<R> oldList = mOldResolver.queryIntent(intent, resolvedType, defaultOnly, userId);
324+
if (oldList.size() != finalList.size()) {
325+
ValidationFailure here = new ValidationFailure();
326+
here.fillInStackTrace();
327+
Log.wtf(TAG, "Query result " + intent + " size is " + finalList.size()
328+
+ "; old implementation is " + oldList.size(), here);
329+
}
323330
}
324331

325332
if (debug) {

0 commit comments

Comments
 (0)