Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbdd0c0d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add protected broadcasts for model loaded/unloaded events." into main

parents 61cc9d30 b771efba
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -129,6 +129,16 @@ public abstract class OnDeviceSandboxedInferenceService extends Service {
     * @hide
     */
    public static final String MODEL_UNLOADED_BUNDLE_KEY = "model_unloaded";
    /**
     * @hide
     */
    public static final String MODEL_LOADED_BROADCAST_INTENT =
        "android.service.ondeviceintelligence.MODEL_LOADED";
    /**
     * @hide
     */
    public static final String MODEL_UNLOADED_BROADCAST_INTENT =
        "android.service.ondeviceintelligence.MODEL_UNLOADED";

    /**
     * @hide
+2 −0
Original line number Diff line number Diff line
@@ -845,6 +845,8 @@
    <protected-broadcast android:name="android.intent.action.MAIN_USER_LOCKSCREEN_KNOWLEDGE_FACTOR_CHANGED" />
    <protected-broadcast android:name="com.android.uwb.uwbcountrycode.GEOCODE_RETRY" />
    <protected-broadcast android:name="android.telephony.action.ACTION_SATELLITE_SUBSCRIBER_ID_LIST_CHANGED" />
    <protected-broadcast android:name="android.service.ondeviceintelligence.MODEL_LOADED" />
    <protected-broadcast android:name="android.service.ondeviceintelligence.MODEL_UNLOADED" />

    <!-- ====================================================================== -->
    <!--                          RUNTIME PERMISSIONS                           -->
+4 −5
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.server.ondeviceintelligence;
import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.DEVICE_CONFIG_UPDATE_BUNDLE_KEY;
import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_LOADED_BUNDLE_KEY;
import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_UNLOADED_BUNDLE_KEY;
import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_LOADED_BROADCAST_INTENT;
import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_UNLOADED_BROADCAST_INTENT;
import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.REGISTER_MODEL_UPDATE_CALLBACK_BUNDLE_KEY;

import static com.android.server.ondeviceintelligence.BundleUtil.sanitizeInferenceParams;
@@ -154,7 +156,7 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
    @GuardedBy("mLock")
    private String[] mTemporaryBroadcastKeys;
    @GuardedBy("mLock")
    private String mBroadcastPackageName;
    private String mBroadcastPackageName = SYSTEM_PACKAGE;
    @GuardedBy("mLock")
    private String mTemporaryConfigNamespace;

@@ -921,10 +923,7 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
            }
        }

        return new String[]{mContext.getResources().getString(
                R.string.config_onDeviceIntelligenceModelLoadedBroadcastKey),
                mContext.getResources().getString(
                        R.string.config_onDeviceIntelligenceModelUnloadedBroadcastKey)};
        return new String[]{ MODEL_LOADED_BROADCAST_INTENT, MODEL_UNLOADED_BROADCAST_INTENT };
    }

    @RequiresPermission(Manifest.permission.USE_ON_DEVICE_INTELLIGENCE)