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

Commit 0cad779d authored by Alexandra Gherghina's avatar Alexandra Gherghina Committed by Android (Google) Code Review
Browse files

Merge "Switch to listening for USER_INITIALIZE broadcast in the Settings app." into lmp-dev

parents cd88c2f7 f2e39f2e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -97,8 +97,7 @@

        <receiver android:name="ManagedProfileSetup">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
                <action android:name="android.intent.action.PRE_BOOT_COMPLETED"/>
                <action android:name="android.intent.action.USER_INITIALIZE"/>
            </intent-filter>
        </receiver>

+4 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.util.Log;
import android.os.UserHandle;
import android.os.UserManager;

@@ -37,6 +38,7 @@ import static android.content.pm.PackageManager.GET_RESOLVED_FILTER;
 * adds cross-profile intent filters for the appropriate Settings activities).
 */
public class ManagedProfileSetup extends BroadcastReceiver {
    private static final String TAG = "Settings";
    private static final String PRIMARY_PROFILE_SETTING =
            "com.android.settings.PRIMARY_PROFILE_CONTROLLED";

@@ -46,7 +48,8 @@ public class ManagedProfileSetup extends BroadcastReceiver {
        if (!Utils.isManagedProfile(um)) {
            return;
        }

        Log.i(TAG, "Received broadcast: " + broadcast.getAction()
                + ". Setting up intent forwarding for managed profile.");
        final PackageManager pm  = context.getPackageManager();
        // Clear any previous intent forwarding we set up
        pm.clearCrossProfileIntentFilters(UserHandle.myUserId());