mirror of
				https://github.com/mozilla/gecko-dev.git
				synced 2025-10-31 08:18:54 +02:00 
			
		
		
		
	Bug 1971744 - Report policy telemetry when distribution customizaton is complete. a=dmeehan
Original Revision: https://phabricator.services.mozilla.com/D253512 Differential Revision: https://phabricator.services.mozilla.com/D253805
This commit is contained in:
		
							parent
							
								
									7c9783dc9e
								
							
						
					
					
						commit
						0248f76d94
					
				
					 1 changed files with 14 additions and 9 deletions
				
			
		|  | @ -78,6 +78,7 @@ export function EnterprisePoliciesManager() { | ||||||
|   Services.obs.addObserver(this, "final-ui-startup", true); |   Services.obs.addObserver(this, "final-ui-startup", true); | ||||||
|   Services.obs.addObserver(this, "sessionstore-windows-restored", true); |   Services.obs.addObserver(this, "sessionstore-windows-restored", true); | ||||||
|   Services.obs.addObserver(this, "EnterprisePolicies:Restart", true); |   Services.obs.addObserver(this, "EnterprisePolicies:Restart", true); | ||||||
|  |   Services.obs.addObserver(this, "distribution-customization-complete", true); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| EnterprisePoliciesManager.prototype = { | EnterprisePoliciesManager.prototype = { | ||||||
|  | @ -112,20 +113,17 @@ EnterprisePoliciesManager.prototype = { | ||||||
| 
 | 
 | ||||||
|     if (provider.failed) { |     if (provider.failed) { | ||||||
|       this.status = Ci.nsIEnterprisePolicies.FAILED; |       this.status = Ci.nsIEnterprisePolicies.FAILED; | ||||||
|       this._reportEnterpriseTelemetry(); |  | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (!provider.hasPolicies) { |     if (!provider.hasPolicies) { | ||||||
|       this.status = Ci.nsIEnterprisePolicies.INACTIVE; |       this.status = Ci.nsIEnterprisePolicies.INACTIVE; | ||||||
|       this._reportEnterpriseTelemetry(); |  | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     this.status = Ci.nsIEnterprisePolicies.ACTIVE; |     this.status = Ci.nsIEnterprisePolicies.ACTIVE; | ||||||
|     this._parsedPolicies = {}; |     this._parsedPolicies = {}; | ||||||
|     this._activatePolicies(provider.policies); |     this._activatePolicies(provider.policies); | ||||||
|     this._reportEnterpriseTelemetry(); |  | ||||||
| 
 | 
 | ||||||
|     Services.prefs.setBoolPref(PREF_POLICIES_APPLIED, true); |     Services.prefs.setBoolPref(PREF_POLICIES_APPLIED, true); | ||||||
|   }, |   }, | ||||||
|  | @ -276,6 +274,7 @@ EnterprisePoliciesManager.prototype = { | ||||||
|     await notifyTopicOnIdle("profile-after-change"); |     await notifyTopicOnIdle("profile-after-change"); | ||||||
|     await notifyTopicOnIdle("final-ui-startup"); |     await notifyTopicOnIdle("final-ui-startup"); | ||||||
|     await notifyTopicOnIdle("sessionstore-windows-restored"); |     await notifyTopicOnIdle("sessionstore-windows-restored"); | ||||||
|  |     await notifyTopicOnIdle("distribution-customization-complete"); | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   // nsIObserver implementation
 |   // nsIObserver implementation
 | ||||||
|  | @ -299,17 +298,23 @@ EnterprisePoliciesManager.prototype = { | ||||||
| 
 | 
 | ||||||
|       case "sessionstore-windows-restored": |       case "sessionstore-windows-restored": | ||||||
|         this._runPoliciesCallbacks("onAllWindowsRestored"); |         this._runPoliciesCallbacks("onAllWindowsRestored"); | ||||||
| 
 |  | ||||||
|         // After the last set of policy callbacks ran, notify the test observer.
 |  | ||||||
|         Services.obs.notifyObservers( |  | ||||||
|           null, |  | ||||||
|           "EnterprisePolicies:AllPoliciesApplied" |  | ||||||
|         ); |  | ||||||
|         break; |         break; | ||||||
| 
 | 
 | ||||||
|       case "EnterprisePolicies:Restart": |       case "EnterprisePolicies:Restart": | ||||||
|         this._restart().then(null, console.error); |         this._restart().then(null, console.error); | ||||||
|         break; |         break; | ||||||
|  | 
 | ||||||
|  |       case "distribution-customization-complete": | ||||||
|  |         this._reportEnterpriseTelemetry(); | ||||||
|  | 
 | ||||||
|  |         // Notify the test observer when the last message
 | ||||||
|  |         // is received.
 | ||||||
|  |         Services.obs.notifyObservers( | ||||||
|  |           null, | ||||||
|  |           "EnterprisePolicies:AllPoliciesApplied" | ||||||
|  |         ); | ||||||
|  | 
 | ||||||
|  |         break; | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Michael Kaply
						Michael Kaply