Merge "Fix issue #7213113: Remove old intent resolver" into jb-mr1-dev

This commit is contained in:
Dianne Hackborn
2012-09-21 17:05:47 -07:00
committed by Android (Google) Code Review
3 changed files with 19 additions and 11 deletions

View File

@@ -257,7 +257,7 @@ public class AppSecurityPermissions {
try {
pkgInfo = mPm.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS);
} catch (NameNotFoundException e) {
Log.w(TAG, "Could'nt retrieve permissions for package:"+packageName);
Log.w(TAG, "Couldn't retrieve permissions for package:"+packageName);
return;
}
// Extract all user permissions

View File

@@ -45,6 +45,7 @@
<protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_VERIFICATION" />
<protected-broadcast android:name="android.intent.action.PACKAGE_VERIFIED" />
<protected-broadcast android:name="android.intent.action.UID_REMOVED" />
<protected-broadcast android:name="android.intent.action.QUERY_PACKAGE_RESTART" />
<protected-broadcast android:name="android.intent.action.CONFIGURATION_CHANGED" />
<protected-broadcast android:name="android.intent.action.LOCALE_CHANGED" />
<protected-broadcast android:name="android.intent.action.BATTERY_CHANGED" />

View File

@@ -46,6 +46,7 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
final private static String TAG = "IntentResolver";
final private static boolean DEBUG = false;
final private static boolean localLOGV = DEBUG || false;
final private static boolean VALIDATE = false;
public void addFilter(F f) {
if (localLOGV) {
@@ -67,16 +68,20 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
mTypedActionToFilter, " TypedAction: ");
}
mOldResolver.addFilter(f);
verifyDataStructures(f);
if (VALIDATE) {
mOldResolver.addFilter(f);
verifyDataStructures(f);
}
}
public void removeFilter(F f) {
removeFilterInternal(f);
mFilters.remove(f);
mOldResolver.removeFilter(f);
verifyDataStructures(f);
if (VALIDATE) {
mOldResolver.removeFilter(f);
verifyDataStructures(f);
}
}
void removeFilterInternal(F f) {
@@ -314,12 +319,14 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
}
sortResults(finalList);
List<R> oldList = mOldResolver.queryIntent(intent, resolvedType, defaultOnly, userId);
if (oldList.size() != finalList.size()) {
ValidationFailure here = new ValidationFailure();
here.fillInStackTrace();
Log.wtf(TAG, "Query result " + intent + " size is " + finalList.size()
+ "; old implementation is " + oldList.size(), here);
if (VALIDATE) {
List<R> oldList = mOldResolver.queryIntent(intent, resolvedType, defaultOnly, userId);
if (oldList.size() != finalList.size()) {
ValidationFailure here = new ValidationFailure();
here.fillInStackTrace();
Log.wtf(TAG, "Query result " + intent + " size is " + finalList.size()
+ "; old implementation is " + oldList.size(), here);
}
}
if (debug) {