Decouple PolicyManager native initialization and registration with activities.
commite7468cc5f4c0ed12f1cdc1f70b50cdbd00d681fc
authorknn <knn@chromium.org>
Fri, 22 May 2015 17:38:21 +0000 (22 10:38 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 22 May 2015 17:39:01 +0000 (22 17:39 +0000)
tree4fa2e11afb53b882f52e8a16706221999e7fd37f
parentdaadc2e177c935d1a09204933abe05a86fe866fd
Decouple PolicyManager native initialization and registration with activities.

When Switching between Document mode and single activity mode. A new
ChromiumApplication is created that does not have the PolicyManager yet.

This caused a NPE which was fixed by adding a statically initialized list that
was never used as List#remove does not complain for non-existent values.

By decoupling native and java initializations of PolicyManager. We can do the same thing with stronger asserts in place.

BUG=490894

Review URL: https://codereview.chromium.org/1149353004

Cr-Commit-Position: refs/heads/master@{#331137}
chrome/android/java_staging/src/org/chromium/chrome/browser/ChromeActivity.java
chrome/android/java_staging/src/org/chromium/chrome/browser/ChromeMobileApplication.java
chrome/android/java_staging/src/org/chromium/chrome/browser/policy/PolicyManager.java