fixed app list .
authorTrillGates <williamtrillgates@gmail.com>
Fri, 23 Apr 2021 09:10:27 +0000 (17:10 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Fri, 23 Apr 2021 09:10:27 +0000 (17:10 +0800)
app/src/main/java/com/enqualcomm/support/provider/AiInfoDatabaseHelper.java
app/src/main/java/com/enqualcomm/support/provider/AiInfoProvider.java

index 2cee563..1c36bf6 100644 (file)
@@ -13,7 +13,7 @@ import android.util.Log;
  */
 public class AiInfoDatabaseHelper extends SQLiteOpenHelper {
 
-    public static final String name = "AiInfo";
+    public static final String name = "ai_info_db";
     public static final int version = 1;
     private static final String TAG = "AiInfoDatabaseHelper";
 
@@ -25,6 +25,7 @@ public class AiInfoDatabaseHelper extends SQLiteOpenHelper {
     public static final String aId = "_id";
     public static final String aPackageName = "package_name";
     public static final String aAppName = "app_name";
+    public static final String aComponentName = "component_name";
     public static final String aBrandName = "brand_name";
     public static final String aCreateTime = "create_time";
     public static final String aUpdateTime = "update_time";
@@ -33,15 +34,17 @@ public class AiInfoDatabaseHelper extends SQLiteOpenHelper {
     public void onCreate(SQLiteDatabase db) {
         String appSql = "create table " +
                 aTableName + "(" + aId
-                + " Integer primary key autoincrement "
+                + " Integer primary key autoincrement, "
                 + aPackageName
-                + " text "
+                + " text, "
                 + aAppName
-                + " text "
+                + " text, "
                 + aBrandName
-                + " text "
+                + " text, "
+                + aComponentName
+                + " text, "
                 + aCreateTime
-                + " date "
+                + " date, "
                 + aUpdateTime
                 + " date "
                 + ")";
index f5a26bb..c42130a 100644 (file)
@@ -18,7 +18,7 @@ public class AiInfoProvider extends ContentProvider {
     //添加规则
     public static final String AUTHORITY = "com.ic.ai.info";
     public static final String PATH = "apps";
-    public static final String APPS = AUTHORITY + "/" + PATH;
+    public static final String APPS = "content://" + AUTHORITY + "/" + PATH;
 
 
     private static UriMatcher uriMatcher;
@@ -48,7 +48,6 @@ public class AiInfoProvider extends ContentProvider {
             SQLiteDatabase readableDatabase = aiInfoDatabaseHelper.getReadableDatabase();
             return readableDatabase.query(AiInfoDatabaseHelper.aTableName,
                     projection, selection, selectionArgs, null, null, sortOrder);
-
         }
         //查询内容
         return null;