Merge "TEMP add missing remap log, reduce log spam" into sc-dev
This commit is contained in:
@@ -4502,8 +4502,12 @@ public class AppOpsService extends IAppOpsService.Stub {
|
|||||||
Slog.i("AppOpsDebug", "tag " + attributionTag + " found in "
|
Slog.i("AppOpsDebug", "tag " + attributionTag + " found in "
|
||||||
+ packageName);
|
+ packageName);
|
||||||
} else {
|
} else {
|
||||||
|
ArrayList<String> tagList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < pkg.getAttributions().size(); i++) {
|
||||||
|
tagList.add(pkg.getAttributions().get(i).tag);
|
||||||
|
}
|
||||||
Slog.i("AppOpsDebug", "tag " + attributionTag + " missing from "
|
Slog.i("AppOpsDebug", "tag " + attributionTag + " missing from "
|
||||||
+ packageName);
|
+ packageName + ", tags: " + tagList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat
|
|||||||
"android:activity_recognition_allow_listed_tags";
|
"android:activity_recognition_allow_listed_tags";
|
||||||
private static final String ACTIVITY_RECOGNITION_TAGS_SEPARATOR = ";";
|
private static final String ACTIVITY_RECOGNITION_TAGS_SEPARATOR = ";";
|
||||||
|
|
||||||
|
private static ArraySet<String> sExpectedTags = new ArraySet<>(new String[] {
|
||||||
|
"awareness_provider", "activity_recognition_provider", "network_location_provider",
|
||||||
|
"network_location_calibration", "fused_location_provider", "geofencer_provider"});
|
||||||
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private final Object mLock = new Object();
|
private final Object mLock = new Object();
|
||||||
|
|
||||||
@@ -222,8 +227,14 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat
|
|||||||
if (resolvedCode != code) {
|
if (resolvedCode != code) {
|
||||||
if (isDatasourceAttributionTag(uid, packageName, attributionTag,
|
if (isDatasourceAttributionTag(uid, packageName, attributionTag,
|
||||||
mLocationTags)) {
|
mLocationTags)) {
|
||||||
|
if (packageName.equals("com.google.android.gms")
|
||||||
|
&& !sExpectedTags.contains(attributionTag)) {
|
||||||
|
Log.i("AppOpsDebugRemapping", "remapping " + packageName + " location "
|
||||||
|
+ "for tag " + attributionTag);
|
||||||
|
}
|
||||||
return resolvedCode;
|
return resolvedCode;
|
||||||
} else if (packageName.equals("com.google.android.gms")) {
|
} else if (packageName.equals("com.google.android.gms")
|
||||||
|
&& sExpectedTags.contains(attributionTag)) {
|
||||||
Log.i("AppOpsDebugRemapping", "NOT remapping " + packageName + " code "
|
Log.i("AppOpsDebugRemapping", "NOT remapping " + packageName + " code "
|
||||||
+ code + " for tag " + attributionTag);
|
+ code + " for tag " + attributionTag);
|
||||||
}
|
}
|
||||||
@@ -232,10 +243,14 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat
|
|||||||
if (resolvedCode != code) {
|
if (resolvedCode != code) {
|
||||||
if (isDatasourceAttributionTag(uid, packageName, attributionTag,
|
if (isDatasourceAttributionTag(uid, packageName, attributionTag,
|
||||||
mActivityRecognitionTags)) {
|
mActivityRecognitionTags)) {
|
||||||
Log.i("AppOpsDebugRemapping", "remapping " + packageName + " code "
|
if (packageName.equals("com.google.android.gms")
|
||||||
+ code + " to " + resolvedCode + " for tag " + attributionTag);
|
&& !sExpectedTags.contains(attributionTag)) {
|
||||||
|
Log.i("AppOpsDebugRemapping", "remapping " + packageName + " "
|
||||||
|
+ "activity recognition for tag " + attributionTag);
|
||||||
|
}
|
||||||
return resolvedCode;
|
return resolvedCode;
|
||||||
} else if (packageName.equals("com.google.android.gms")) {
|
} else if (packageName.equals("com.google.android.gms")
|
||||||
|
&& sExpectedTags.contains(attributionTag)) {
|
||||||
Log.i("AppOpsDebugRemapping", "NOT remapping " + packageName
|
Log.i("AppOpsDebugRemapping", "NOT remapping " + packageName
|
||||||
+ " code " + code + " for tag " + attributionTag);
|
+ " code " + code + " for tag " + attributionTag);
|
||||||
}
|
}
|
||||||
@@ -351,13 +366,15 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat
|
|||||||
if (appIdTags != null) {
|
if (appIdTags != null) {
|
||||||
final ArraySet<String> packageTags = appIdTags.get(packageName);
|
final ArraySet<String> packageTags = appIdTags.get(packageName);
|
||||||
if (packageTags != null && packageTags.contains(attributionTag)) {
|
if (packageTags != null && packageTags.contains(attributionTag)) {
|
||||||
if (packageName.equals("com.google.android.gms")) {
|
if (packageName.equals("com.google.android.gms")
|
||||||
|
&& !sExpectedTags.contains(attributionTag)) {
|
||||||
Log.i("AppOpsDebugRemapping", packageName + " tag "
|
Log.i("AppOpsDebugRemapping", packageName + " tag "
|
||||||
+ attributionTag + " in " + packageTags);
|
+ attributionTag + " in " + packageTags);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (packageName.equals("com.google.android.gms")) {
|
if (packageName.equals("com.google.android.gms")
|
||||||
|
&& sExpectedTags.contains(attributionTag)) {
|
||||||
Log.i("AppOpsDebugRemapping", packageName + " tag " + attributionTag
|
Log.i("AppOpsDebugRemapping", packageName + " tag " + attributionTag
|
||||||
+ " NOT in " + packageTags);
|
+ " NOT in " + packageTags);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user