├── settings.gradle ├── screenshots ├── 1.png ├── 2.png ├── 3.png ├── 4.png └── icon-web.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── Application ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── tile.9.png │ │ │ ├── ic_alarm_black_24dp.png │ │ │ ├── ic_fbe_notification.png │ │ │ ├── ic_delete_black_24dp.png │ │ │ └── ic_add_alarm_white_24dp.png │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ ├── ic_alarm_black_24dp.png │ │ │ ├── ic_fbe_notification.png │ │ │ ├── ic_delete_black_24dp.png │ │ │ └── ic_add_alarm_white_24dp.png │ │ ├── drawable-xhdpi │ │ │ ├── ic_alarm_black_24dp.png │ │ │ ├── ic_delete_black_24dp.png │ │ │ ├── ic_fbe_notification.png │ │ │ └── ic_add_alarm_white_24dp.png │ │ ├── drawable-xxhdpi │ │ │ ├── ic_alarm_black_24dp.png │ │ │ ├── ic_delete_black_24dp.png │ │ │ ├── ic_fbe_notification.png │ │ │ └── ic_add_alarm_white_24dp.png │ │ ├── drawable-xxxhdpi │ │ │ ├── ic_alarm_black_24dp.png │ │ │ ├── ic_fbe_notification.png │ │ │ ├── ic_delete_black_24dp.png │ │ │ └── ic_add_alarm_white_24dp.png │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ ├── base-strings.xml │ │ │ ├── template-dimens.xml │ │ │ └── template-styles.xml │ │ ├── values-v21 │ │ │ ├── base-colors.xml │ │ │ └── base-template-styles.xml │ │ ├── values-v11 │ │ │ └── template-styles.xml │ │ ├── values-sw600dp │ │ │ ├── template-dimens.xml │ │ │ └── template-styles.xml │ │ ├── drawable │ │ │ └── divider.xml │ │ └── layout │ │ │ ├── activity_main.xml │ │ │ ├── alarm_row.xml │ │ │ ├── fragment_alarm_scheduler.xml │ │ │ └── fragment_time_picker.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── android │ │ │ └── directboot │ │ │ ├── MainActivity.java │ │ │ ├── BootBroadcastReceiver.java │ │ │ ├── alarms │ │ │ ├── AlarmIntentService.java │ │ │ ├── Alarm.java │ │ │ ├── AlarmStorage.java │ │ │ ├── AlarmUtil.java │ │ │ └── AlarmAdapter.java │ │ │ ├── TimePickerFragment.java │ │ │ └── SchedulerFragment.java │ │ └── AndroidManifest.xml └── build.gradle ├── README.md ├── .google └── packaging.yaml ├── CONTRIBUTING.md ├── gradlew.bat ├── gradlew └── LICENSE /settings.gradle: -------------------------------------------------------------------------------- 1 | 2 | include 'Application' 3 | -------------------------------------------------------------------------------- /screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/screenshots/1.png -------------------------------------------------------------------------------- /screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/screenshots/2.png -------------------------------------------------------------------------------- /screenshots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/screenshots/3.png -------------------------------------------------------------------------------- /screenshots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/screenshots/4.png -------------------------------------------------------------------------------- /screenshots/icon-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/screenshots/icon-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Application/src/main/res/drawable-hdpi/tile.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-hdpi/tile.9.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-hdpi/ic_alarm_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-hdpi/ic_alarm_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-hdpi/ic_fbe_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-hdpi/ic_fbe_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-mdpi/ic_alarm_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-mdpi/ic_alarm_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-mdpi/ic_fbe_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-mdpi/ic_fbe_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-hdpi/ic_delete_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-hdpi/ic_delete_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-mdpi/ic_delete_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-mdpi/ic_delete_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xhdpi/ic_alarm_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xhdpi/ic_alarm_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xhdpi/ic_delete_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xhdpi/ic_delete_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xhdpi/ic_fbe_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xhdpi/ic_fbe_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxhdpi/ic_alarm_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xxhdpi/ic_alarm_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxhdpi/ic_delete_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xxhdpi/ic_delete_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxhdpi/ic_fbe_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xxhdpi/ic_fbe_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxxhdpi/ic_alarm_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xxxhdpi/ic_alarm_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxxhdpi/ic_fbe_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xxxhdpi/ic_fbe_notification.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-hdpi/ic_add_alarm_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-hdpi/ic_add_alarm_white_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-mdpi/ic_add_alarm_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-mdpi/ic_add_alarm_white_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xhdpi/ic_add_alarm_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xhdpi/ic_add_alarm_white_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxxhdpi/ic_delete_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xxxhdpi/ic_delete_black_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxhdpi/ic_add_alarm_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xxhdpi/ic_add_alarm_white_24dp.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxxhdpi/ic_add_alarm_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-DirectBoot/HEAD/Application/src/main/res/drawable-xxxhdpi/ic_add_alarm_white_24dp.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | Android DirectBoot Sample 3 | ========================= 4 | 5 | This repo has been migrated to [github.com/android/security][1]. Please check that repo for future updates. Thank you! 6 | 7 | [1]: https://github.com/android/security 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Feb 08 18:26:13 JST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip -------------------------------------------------------------------------------- /.google/packaging.yaml: -------------------------------------------------------------------------------- 1 | 2 | # GOOGLE SAMPLE PACKAGING DATA 3 | # 4 | # This file is used by Google as part of our samples packaging process. 5 | # End users may safely ignore this file. It has no relevance to other systems. 6 | --- 7 | status: PUBLISHED 8 | technologies: [Android] 9 | categories: [Security] 10 | languages: [Java] 11 | solutions: [Mobile] 12 | github: android-DirectBoot 13 | level: INTERMEDIATE 14 | icon: screenshots/icon-web.png 15 | apiRefs: 16 | - android:android.content.Context.createDeviceProtectedStorageContext 17 | license: apache2 18 | -------------------------------------------------------------------------------- /Application/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 80dp 19 | -------------------------------------------------------------------------------- /Application/src/main/res/values-v21/base-colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Application/src/main/res/values-v11/template-styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Application/src/main/res/values-sw600dp/template-dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | @dimen/margin_huge 22 | @dimen/margin_medium 23 | 24 | 25 | -------------------------------------------------------------------------------- /Application/src/main/res/drawable/divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /Application/src/main/res/values-sw600dp/template-styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Application/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 25 | -------------------------------------------------------------------------------- /Application/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Alarm scheduled at %1$2d:%2$02d 20 | Deleted the alarm at %1$2d:%2$02d 21 | Alarm went off at %1$2d:%2$02d 22 | %1$2d:%2$02d 23 | OK 24 | Cancel 25 | Registered alarms 26 | -------------------------------------------------------------------------------- /Application/src/main/res/values/base-strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | DirectBoot 20 | 21 | Android N devices, the scheduled alarms 27 | go off after reboot even before the user enters their credentials. 28 | 29 | 30 | ]]> 31 | 32 | 33 | -------------------------------------------------------------------------------- /Application/src/main/res/values/template-dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 4dp 22 | 8dp 23 | 16dp 24 | 32dp 25 | 64dp 26 | 27 | 28 | 29 | @dimen/margin_medium 30 | @dimen/margin_medium 31 | 32 | 33 | -------------------------------------------------------------------------------- /Application/src/main/java/com/example/android/directboot/MainActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.android.directboot; 18 | 19 | import android.os.Bundle; 20 | import android.support.v7.app.AppCompatActivity; 21 | 22 | /** 23 | * Launcher Activity for the Direct Boot sample app. 24 | */ 25 | public class MainActivity extends AppCompatActivity { 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.activity_main); 31 | if (savedInstanceState == null) { 32 | getSupportFragmentManager().beginTransaction() 33 | .add(R.id.container, SchedulerFragment.newInstance()) 34 | .commit(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Application/src/main/res/values/template-styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 34 | 35 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to become a contributor and submit your own code 2 | 3 | ## Contributor License Agreements 4 | 5 | We'd love to accept your sample apps and patches! Before we can take them, we 6 | have to jump a couple of legal hurdles. 7 | 8 | Please fill out either the individual or corporate Contributor License Agreement (CLA). 9 | 10 | * If you are an individual writing original source code and you're sure you 11 | own the intellectual property, then you'll need to sign an [individual CLA] 12 | (https://cla.developers.google.com). 13 | * If you work for a company that wants to allow you to contribute your work, 14 | then you'll need to sign a [corporate CLA] 15 | (https://cla.developers.google.com). 16 | 17 | Follow either of the two links above to access the appropriate CLA and 18 | instructions for how to sign and return it. Once we receive it, we'll be able to 19 | accept your pull requests. 20 | 21 | ## Contributing A Patch 22 | 23 | 1. Submit an issue describing your proposed change to the repo in question. 24 | 1. The repo owner will respond to your issue promptly. 25 | 1. If your proposed change is accepted, and you haven't already done so, sign a 26 | Contributor License Agreement (see details above). 27 | 1. Fork the desired repo, develop and test your code changes. 28 | 1. Ensure that your code adheres to the existing style in the sample to which 29 | you are contributing. Refer to the 30 | [Android Code Style Guide] 31 | (https://source.android.com/source/code-style.html) for the 32 | recommended coding standards for this organization. 33 | 1. Ensure that your code has an appropriate set of unit tests which all pass. 34 | 1. Submit a pull request. 35 | 36 | -------------------------------------------------------------------------------- /Application/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | buildscript { 3 | repositories { 4 | jcenter() 5 | google() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.0.1' 10 | } 11 | } 12 | 13 | apply plugin: 'com.android.application' 14 | 15 | repositories { 16 | jcenter() 17 | google() 18 | } 19 | 20 | dependencies { 21 | compile "com.android.support:support-v4:27.0.2" 22 | compile "com.android.support:support-v13:27.0.2" 23 | compile "com.android.support:cardview-v7:27.0.2" 24 | compile "com.android.support:appcompat-v7:27.0.2" 25 | compile 'com.android.support:recyclerview-v7:25.0.1' 26 | compile 'com.android.support:design:25.0.1' 27 | } 28 | 29 | // The sample build uses multiple directories to 30 | // keep boilerplate and common code separate from 31 | // the main sample code. 32 | List dirs = [ 33 | 'main', // main sample code; look here for the interesting stuff. 34 | 'common', // components that are reused by multiple samples 35 | 'template'] // boilerplate code that is generated by the sample template process 36 | 37 | android { 38 | compileSdkVersion 25 39 | 40 | buildToolsVersion "27.0.2" 41 | 42 | defaultConfig { 43 | minSdkVersion 24 44 | targetSdkVersion 25 45 | } 46 | 47 | compileOptions { 48 | sourceCompatibility JavaVersion.VERSION_1_7 49 | targetCompatibility JavaVersion.VERSION_1_7 50 | } 51 | 52 | sourceSets { 53 | main { 54 | dirs.each { dir -> 55 | java.srcDirs "src/${dir}/java" 56 | res.srcDirs "src/${dir}/res" 57 | } 58 | } 59 | androidTest.setRoot('tests') 60 | androidTest.java.srcDirs = ['tests/src'] 61 | 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /Application/src/main/res/layout/alarm_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 20 | 21 | 28 | 29 | 38 | 39 | 48 | -------------------------------------------------------------------------------- /Application/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 21 | 22 | 23 | 24 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Application/src/main/res/layout/fragment_alarm_scheduler.xml: -------------------------------------------------------------------------------- 1 | 16 | 19 | 20 | 30 | 31 | 41 | 42 | 48 | 49 | 58 | 59 | -------------------------------------------------------------------------------- /Application/src/main/res/layout/fragment_time_picker.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 23 | 27 | 28 | 39 | 40 | 46 | 47 |