From 2ba238bf7a14df087529f532d491be479281ea14 Mon Sep 17 00:00:00 2001 From: Roman Birg Date: Tue, 22 Dec 2015 08:49:46 -0800 Subject: [PATCH] ProfileManagerService: fix broadcasting crash Ref: CYNGNOS-1478 Change-Id: If4952c4513063ea4b2cf2105514183731175ad72 Signed-off-by: Roman Birg --- .../platform/internal/ProfileManagerService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java b/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java index 1a93c86..538fded 100644 --- a/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java +++ b/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java @@ -187,10 +187,6 @@ public class ProfileManagerService extends SystemService { filter.addAction(Intent.ACTION_LOCALE_CHANGED); filter.addAction(Intent.ACTION_SHUTDOWN); mContext.registerReceiver(mIntentReceiver, filter); - - mContext.getContentResolver().registerContentObserver( - CMSettings.System.getUriFor(CMSettings.System.SYSTEM_PROFILES_ENABLED), - false, new ProfilesObserver(mHandler), UserHandle.USER_ALL); } private void bindKeyguard() { @@ -208,6 +204,10 @@ public class ProfileManagerService extends SystemService { public void onBootPhase(int phase) { if (phase == PHASE_ACTIVITY_MANAGER_READY) { bindKeyguard(); + } else if (phase == PHASE_BOOT_COMPLETED) { + mContext.getContentResolver().registerContentObserver( + CMSettings.System.getUriFor(CMSettings.System.SYSTEM_PROFILES_ENABLED), + false, new ProfilesObserver(mHandler), UserHandle.USER_ALL); } }