Make AS happy (#672)

* Suppress error

* Register data binding generated files
This commit is contained in:
vvb2060 2021-05-25 11:03:01 +08:00 committed by GitHub
parent 6034d97e17
commit 7403a17b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 7 deletions

View File

@ -22,10 +22,24 @@ import com.android.build.gradle.internal.dsl.BuildType
import java.nio.file.Paths
plugins {
id("org.gradle.idea")
id("com.android.application")
kotlin("android")
}
// workaround for AS.
val dataBinding = file("${project.buildDir}/generated/data_binding_base_class_source_out/debug/out")
sourceSets {
create("dataBinding") {
java.srcDir(dataBinding)
}
}
idea {
module {
generatedSourceDirs.add(dataBinding)
}
}
val androidTargetSdkVersion: Int by rootProject.extra
val androidMinSdkVersion: Int by rootProject.extra
val androidBuildToolsVersion: String by rootProject.extra
@ -229,4 +243,3 @@ configurations.all {
exclude(group = "androidx.appcompat", module = "appcompat")
}
}

View File

@ -124,8 +124,8 @@ public class ConfigManager {
private boolean sepolicyLoaded = true;
static class ProcessScope {
String processName;
int uid;
final String processName;
final int uid;
ProcessScope(@NonNull String processName, int uid) {
this.processName = processName;
@ -367,6 +367,7 @@ public class ConfigManager {
obsoleteScopes.add(module);
} else {
var info = pkgInfo.get(userId);
assert info != null;
cachedModule.computeIfAbsent(info.applicationInfo.uid % PER_USER_RANGE, k -> info.packageName);
}
}
@ -436,9 +437,7 @@ public class ConfigManager {
Log.d(TAG, "cached Scope");
cachedScope.forEach((ps, module) -> {
Log.d(TAG, ps.processName + "/" + ps.uid);
module.forEach((pkg_name, apk_path) -> {
Log.d(TAG, "\t" + pkg_name);
});
module.forEach((pkg_name, apk_path) -> Log.d(TAG, "\t" + pkg_name));
});
}
@ -508,7 +507,7 @@ public class ConfigManager {
if (cursor == null) return -1;
if (cursor.getCount() != 1) return -1;
cursor.moveToFirst();
return cursor.getInt(cursor.getColumnIndex("mid"));
return cursor.getInt(cursor.getColumnIndexOrThrow("mid"));
}
}