Maurice Lam | ecd2b7b | 2014-12-01 10:41:49 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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.android.settings; |
| 18 | |
Maurice Lam | ecd2b7b | 2014-12-01 10:41:49 -0800 | [diff] [blame] | 19 | import android.content.Context; |
| 20 | import android.content.Intent; |
Maurice Lam | ecd2b7b | 2014-12-01 10:41:49 -0800 | [diff] [blame] | 21 | import android.os.Bundle; |
Udam Saini | 71fde52 | 2016-03-30 13:38:05 -0700 | [diff] [blame] | 22 | import android.widget.LinearLayout; |
Maurice Lam | ecd2b7b | 2014-12-01 10:41:49 -0800 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * Setup Wizard's version of EncryptionInterstitial screen. It inherits the logic and basic |
| 26 | * structure from EncryptionInterstitial class, and should remain similar to that behaviorally. This |
| 27 | * class should only overload base methods for minor theme and behavior differences specific to |
| 28 | * Setup Wizard. Other changes should be done to EncryptionInterstitial class instead and let this |
| 29 | * class inherit those changes. |
| 30 | */ |
Maurice Lam | 83301b5 | 2015-04-18 20:11:59 -0700 | [diff] [blame] | 31 | public class SetupEncryptionInterstitial extends EncryptionInterstitial { |
Maurice Lam | ecd2b7b | 2014-12-01 10:41:49 -0800 | [diff] [blame] | 32 | |
| 33 | public static Intent createStartIntent(Context ctx, int quality, |
Udam Saini | edac136 | 2015-12-08 17:28:19 -0800 | [diff] [blame] | 34 | boolean requirePasswordDefault, Intent unlockMethodIntent) { |
Maurice Lam | ecd2b7b | 2014-12-01 10:41:49 -0800 | [diff] [blame] | 35 | Intent startIntent = EncryptionInterstitial.createStartIntent(ctx, quality, |
Udam Saini | edac136 | 2015-12-08 17:28:19 -0800 | [diff] [blame] | 36 | requirePasswordDefault, unlockMethodIntent); |
Maurice Lam | ecd2b7b | 2014-12-01 10:41:49 -0800 | [diff] [blame] | 37 | startIntent.setClass(ctx, SetupEncryptionInterstitial.class); |
| 38 | startIntent.putExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, false) |
| 39 | .putExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID, -1); |
| 40 | return startIntent; |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public Intent getIntent() { |
| 45 | Intent modIntent = new Intent(super.getIntent()); |
| 46 | modIntent.putExtra(EXTRA_SHOW_FRAGMENT, |
| 47 | SetupEncryptionInterstitialFragment.class.getName()); |
| 48 | return modIntent; |
| 49 | } |
| 50 | |
| 51 | @Override |
| 52 | protected boolean isValidFragment(String fragmentName) { |
| 53 | return SetupEncryptionInterstitialFragment.class.getName().equals(fragmentName); |
| 54 | } |
| 55 | |
| 56 | @Override |
Udam Saini | 71fde52 | 2016-03-30 13:38:05 -0700 | [diff] [blame] | 57 | protected void onCreate(Bundle savedInstance) { |
| 58 | super.onCreate(savedInstance); |
| 59 | LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent); |
| 60 | layout.setFitsSystemWindows(false); |
| 61 | } |
| 62 | |
Maurice Lam | 190ec1c | 2016-04-22 16:41:18 -0700 | [diff] [blame] | 63 | public static class SetupEncryptionInterstitialFragment extends EncryptionInterstitialFragment { |
Maurice Lam | ecd2b7b | 2014-12-01 10:41:49 -0800 | [diff] [blame] | 64 | } |
| 65 | } |