OSDN Git Service

LangId Config installer.
authorAbodunrinwa Toki <toki@google.com>
Sun, 2 Apr 2017 18:16:01 +0000 (19:16 +0100)
committerAbodunrinwa Toki <toki@google.com>
Wed, 19 Apr 2017 20:35:07 +0000 (21:35 +0100)
Test: none
Bug: 34780396
Change-Id: I6cdd608ea9a41041d03640997c076c6e6fea0129

api/system-current.txt
core/java/android/os/ConfigUpdate.java
core/java/android/provider/Settings.java
core/res/AndroidManifest.xml
services/core/java/com/android/server/updates/LangIdInstallReceiver.java [new file with mode: 0644]

index 5dd3b88..f5cb5b1 100644 (file)
@@ -33574,6 +33574,7 @@ package android.os {
     field public static final java.lang.String ACTION_UPDATE_CARRIER_PROVISIONING_URLS = "android.intent.action.UPDATE_CARRIER_PROVISIONING_URLS";
     field public static final java.lang.String ACTION_UPDATE_CT_LOGS = "android.intent.action.UPDATE_CT_LOGS";
     field public static final java.lang.String ACTION_UPDATE_INTENT_FIREWALL = "android.intent.action.UPDATE_INTENT_FIREWALL";
+    field public static final java.lang.String ACTION_UPDATE_LANG_ID = "android.intent.action.UPDATE_LANG_ID";
     field public static final java.lang.String ACTION_UPDATE_PINS = "android.intent.action.UPDATE_PINS";
     field public static final java.lang.String ACTION_UPDATE_SMS_SHORT_CODES = "android.intent.action.UPDATE_SMS_SHORT_CODES";
     field public static final java.lang.String ACTION_UPDATE_TZDATA = "android.intent.action.UPDATE_TZDATA";
index 793a90e..f8bab61 100644 (file)
@@ -74,6 +74,13 @@ public final class ConfigUpdate {
     @SystemApi
     public static final String ACTION_UPDATE_TZDATA = "android.intent.action.UPDATE_TZDATA";
 
+    /**
+     * Update language detection model file.
+     * @hide
+     */
+    @SystemApi
+    public static final String ACTION_UPDATE_LANG_ID = "android.intent.action.UPDATE_LANG_ID";
+
     private ConfigUpdate() {
     }
 }
index f32f163..d359b8c 100755 (executable)
@@ -9517,6 +9517,18 @@ public final class Settings {
                 "intent_firewall_metadata_url";
 
         /**
+         * URL for lang id model updates
+         * @hide
+         */
+        public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
+
+        /**
+         * URL for lang id model update metadata
+         * @hide
+         */
+        public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
+
+        /**
          * SELinux enforcement status. If 0, permissive; if 1, enforcing.
          * @hide
          */
index 8869593..7ea9c53 100644 (file)
             </intent-filter>
         </receiver>
 
+        <receiver android:name="com.android.server.updates.LangIdInstallReceiver"
+                android:permission="android.permission.UPDATE_CONFIG">
+            <intent-filter>
+                <action android:name="android.intent.action.UPDATE_LANG_ID" />
+                <data android:scheme="content" android:host="*" android:mimeType="*/*" />
+            </intent-filter>
+        </receiver>
+
         <receiver android:name="com.android.server.MasterClearReceiver"
             android:permission="android.permission.MASTER_CLEAR">
             <intent-filter
diff --git a/services/core/java/com/android/server/updates/LangIdInstallReceiver.java b/services/core/java/com/android/server/updates/LangIdInstallReceiver.java
new file mode 100644 (file)
index 0000000..f7301b0
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.updates;
+
+public class LangIdInstallReceiver extends ConfigUpdateInstallReceiver {
+
+    public LangIdInstallReceiver() {
+        super(
+            "/data/misc/textclassifier/",
+            "textclassifier.langid.model",
+            "metadata/langid",
+            "version");
+    }
+}
+