Clean up before making all setting page render edge-to-edge

These classes are casting view to LinearLayout unnecessarily. Later we
might change the root view away from LinearLayout. The cast will cause
crash.

Bug: 132182711
Test: go through SUW.
Change-Id: Iea31882f8edea0c87ef8e95b4da9b6bffa8ea7d0
This commit is contained in:
Fan Zhang
2019-05-10 14:18:33 -07:00
parent dcf21d4bd6
commit 9db66a562c
7 changed files with 10 additions and 25 deletions

View File

@@ -84,8 +84,7 @@ public class EncryptionInterstitial extends SettingsActivity {
@Override @Override
protected void onCreate(Bundle savedInstance) { protected void onCreate(Bundle savedInstance) {
super.onCreate(savedInstance); super.onCreate(savedInstance);
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent); findViewById(R.id.content_parent).setFitsSystemWindows(false);
layout.setFitsSystemWindows(false);
} }
public static class EncryptionInterstitialFragment extends InstrumentedFragment { public static class EncryptionInterstitialFragment extends InstrumentedFragment {

View File

@@ -18,8 +18,6 @@ package com.android.settings;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle;
import android.widget.LinearLayout;
/** /**
* Setup Wizard's version of EncryptionInterstitial screen. It inherits the logic and basic * Setup Wizard's version of EncryptionInterstitial screen. It inherits the logic and basic
@@ -53,13 +51,6 @@ public class SetupEncryptionInterstitial extends EncryptionInterstitial {
return SetupEncryptionInterstitialFragment.class.getName().equals(fragmentName); return SetupEncryptionInterstitialFragment.class.getName().equals(fragmentName);
} }
@Override
protected void onCreate(Bundle savedInstance) {
super.onCreate(savedInstance);
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent);
layout.setFitsSystemWindows(false);
}
public static class SetupEncryptionInterstitialFragment extends EncryptionInterstitialFragment { public static class SetupEncryptionInterstitialFragment extends EncryptionInterstitialFragment {
} }
} }

View File

@@ -33,7 +33,6 @@ import android.provider.Settings;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
@@ -74,12 +73,12 @@ public class RedactionInterstitial extends SettingsActivity {
@Override @Override
protected void onCreate(Bundle savedInstance) { protected void onCreate(Bundle savedInstance) {
super.onCreate(savedInstance); super.onCreate(savedInstance);
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent); findViewById(R.id.content_parent).setFitsSystemWindows(false);
layout.setFitsSystemWindows(false);
} }
/** /**
* Create an intent for launching RedactionInterstitial. * Create an intent for launching RedactionInterstitial.
*
* @return An intent to launch the activity is if is available, @null if the activity is not * @return An intent to launch the activity is if is available, @null if the activity is not
* available to be launched. * available to be launched.
*/ */
@@ -87,8 +86,8 @@ public class RedactionInterstitial extends SettingsActivity {
return new Intent(ctx, RedactionInterstitial.class) return new Intent(ctx, RedactionInterstitial.class)
.putExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID, .putExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID,
UserManager.get(ctx).isManagedProfile(userId) UserManager.get(ctx).isManagedProfile(userId)
? R.string.lock_screen_notifications_interstitial_title_profile ? R.string.lock_screen_notifications_interstitial_title_profile
: R.string.lock_screen_notifications_interstitial_title) : R.string.lock_screen_notifications_interstitial_title)
.putExtra(Intent.EXTRA_USER_ID, userId); .putExtra(Intent.EXTRA_USER_ID, userId);
} }
@@ -160,7 +159,7 @@ public class RedactionInterstitial extends SettingsActivity {
checkNotificationFeaturesAndSetDisabled(mShowAllButton, checkNotificationFeaturesAndSetDisabled(mShowAllButton,
KEYGUARD_DISABLE_SECURE_NOTIFICATIONS | KEYGUARD_DISABLE_SECURE_NOTIFICATIONS |
KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS); KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS);
checkNotificationFeaturesAndSetDisabled(mRedactSensitiveButton, checkNotificationFeaturesAndSetDisabled(mRedactSensitiveButton,
KEYGUARD_DISABLE_SECURE_NOTIFICATIONS); KEYGUARD_DISABLE_SECURE_NOTIFICATIONS);
loadFromSettings(); loadFromSettings();

View File

@@ -175,8 +175,7 @@ public class ChooseLockPassword extends SettingsActivity {
} }
setTitle(msg); setTitle(msg);
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent); findViewById(R.id.content_parent).setFitsSystemWindows(false);
layout.setFitsSystemWindows(false);
} }
public static class ChooseLockPasswordFragment extends InstrumentedFragment public static class ChooseLockPasswordFragment extends InstrumentedFragment

View File

@@ -163,8 +163,7 @@ public class ChooseLockPattern extends SettingsActivity {
} }
setTitle(msg); setTitle(msg);
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent); findViewById(R.id.content_parent).setFitsSystemWindows(false);
layout.setFitsSystemWindows(false);
} }
@Override @Override

View File

@@ -96,8 +96,7 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
if (mConfirmCredentialTheme == ConfirmCredentialTheme.NORMAL) { if (mConfirmCredentialTheme == ConfirmCredentialTheme.NORMAL) {
// Prevent the content parent from consuming the window insets because GlifLayout uses // Prevent the content parent from consuming the window insets because GlifLayout uses
// it to show the status bar background. // it to show the status bar background.
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent); findViewById(R.id.content_parent).setFitsSystemWindows(false);
layout.setFitsSystemWindows(false);
} }
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
mIsKeyguardLocked = savedState == null mIsKeyguardLocked = savedState == null

View File

@@ -93,8 +93,7 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric {
} }
} }
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent); findViewById(R.id.content_parent).setFitsSystemWindows(false);
layout.setFitsSystemWindows(false);
} }
public static class SetupChooseLockGenericFragment extends ChooseLockGenericFragment { public static class SetupChooseLockGenericFragment extends ChooseLockGenericFragment {