13ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee/* 23ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * Copyright 2014, The Android Open Source Project 33ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * 43ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * Licensed under the Apache License, Version 2.0 (the "License"); 53ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * you may not use this file except in compliance with the License. 63ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * You may obtain a copy of the License at 73ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * 83ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * http://www.apache.org/licenses/LICENSE-2.0 93ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * 103ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * Unless required by applicable law or agreed to in writing, software 113ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * distributed under the License is distributed on an "AS IS" BASIS, 123ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 133ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * See the License for the specific language governing permissions and 143ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee * limitations under the License. 153ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee */ 16f7a9eea8fe577f2f5edbbe6e73891a54351286c6Benjamin Franzpackage com.android.managedprovisioning.preprovisioning; 173ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee 183ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Leeimport android.content.BroadcastReceiver; 193ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Leeimport android.content.Context; 203ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Leeimport android.content.Intent; 213ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee 223ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee/** 23292e9a3aa7cfea15ed01a2315f53dacc04e2a44eRubin Xu * Class that handles the resuming process that takes place after a reboot during the provisioning 24292e9a3aa7cfea15ed01a2315f53dacc04e2a44eRubin Xu * process. The reboot could be an unexpected reboot or a reboot during the encryption process. 250a964a32b7e8e7b2207416530f8f4575e1cde46eBenjamin Franz * 260a964a32b7e8e7b2207416530f8f4575e1cde46eBenjamin Franz * <p>For encryption flows during setup wizard, this class acts as a backup to 270a964a32b7e8e7b2207416530f8f4575e1cde46eBenjamin Franz * PostEncryptionActivity in case the PackageManager has not yet written the package state to disk 280a964a32b7e8e7b2207416530f8f4575e1cde46eBenjamin Franz * when the reboot is triggered. 293ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee */ 303ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Leepublic class BootReminder extends BroadcastReceiver { 313ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee @Override 323ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee public void onReceive(Context context, Intent intent) { 330a964a32b7e8e7b2207416530f8f4575e1cde46eBenjamin Franz EncryptionController.getInstance(context).resumeProvisioning(); 34e35cc9733194b380637728d39c14dcfc0adee84bNicolas Prevot } 353ab2b570bd2e18bbdd742ade979de5d368aa0a0eRobin Lee} 360a964a32b7e8e7b2207416530f8f4575e1cde46eBenjamin Franz 37