Remove unnecessary casts on calls to findViewById

Just frameworks/ this time. More paths to come.

Bug: 24137209
Test: make -j32
Change-Id: Iff27abd26fa43296ac2fff8f534fc6742d2ae80c
diff --git a/core/java/android/accounts/ChooseAccountActivity.java b/core/java/android/accounts/ChooseAccountActivity.java
index 16a45ba..9f2c39b 100644
--- a/core/java/android/accounts/ChooseAccountActivity.java
+++ b/core/java/android/accounts/ChooseAccountActivity.java
@@ -77,7 +77,7 @@
         setContentView(R.layout.choose_account);
 
         // Setup the list
-        ListView list = (ListView) findViewById(android.R.id.list);
+        ListView list = findViewById(android.R.id.list);
         // Use an existing ListAdapter that will map an array of strings to TextViews
         list.setAdapter(new AccountArrayAdapter(this,
                 android.R.layout.simple_list_item_1, mAccountInfos));
diff --git a/core/java/android/accounts/ChooseAccountTypeActivity.java b/core/java/android/accounts/ChooseAccountTypeActivity.java
index a3222d8..e3352bc 100644
--- a/core/java/android/accounts/ChooseAccountTypeActivity.java
+++ b/core/java/android/accounts/ChooseAccountTypeActivity.java
@@ -99,7 +99,7 @@
 
         setContentView(R.layout.choose_account_type);
         // Setup the list
-        ListView list = (ListView) findViewById(android.R.id.list);
+        ListView list = findViewById(android.R.id.list);
         // Use an existing ListAdapter that will map an array of strings to TextViews
         list.setAdapter(new AccountArrayAdapter(this,
                 android.R.layout.simple_list_item_1, mAuthenticatorInfosToDisplay));
diff --git a/core/java/android/accounts/ChooseTypeAndAccountActivity.java b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
index 8442585..6680ce6 100644
--- a/core/java/android/accounts/ChooseTypeAndAccountActivity.java
+++ b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
@@ -248,7 +248,7 @@
         populateUIAccountList(listItems);
 
         // Only enable "OK" button if something has been selected.
-        mOkButton = (Button) findViewById(android.R.id.button2);
+        mOkButton = findViewById(android.R.id.button2);
         mOkButton.setEnabled(mSelectedItemIndex != SELECTED_ITEM_NONE);
     }
 
@@ -592,7 +592,7 @@
      * If not specified then makes the description invisible.
      */
     private void overrideDescriptionIfSupplied(String descriptionOverride) {
-      TextView descriptionView = (TextView) findViewById(R.id.description);
+      TextView descriptionView = findViewById(R.id.description);
       if (!TextUtils.isEmpty(descriptionOverride)) {
           descriptionView.setText(descriptionOverride);
       } else {
@@ -605,7 +605,7 @@
      * based on {@code mSelectedItemIndex} member variable.
      */
     private final void populateUIAccountList(String[] listItems) {
-      ListView list = (ListView) findViewById(android.R.id.list);
+      ListView list = findViewById(android.R.id.list);
       list.setAdapter(new ArrayAdapter<String>(this,
               android.R.layout.simple_list_item_single_choice, listItems));
       list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
diff --git a/core/java/android/accounts/GrantCredentialsPermissionActivity.java b/core/java/android/accounts/GrantCredentialsPermissionActivity.java
index 38eab29..af74b03 100644
--- a/core/java/android/accounts/GrantCredentialsPermissionActivity.java
+++ b/core/java/android/accounts/GrantCredentialsPermissionActivity.java
@@ -84,7 +84,7 @@
             return;
         }
 
-        final TextView authTokenTypeView = (TextView) findViewById(R.id.authtoken_type);
+        final TextView authTokenTypeView = findViewById(R.id.authtoken_type);
         authTokenTypeView.setVisibility(View.GONE);
 
         final AccountManagerCallback<String> callback = new AccountManagerCallback<String>() {
@@ -116,7 +116,7 @@
         findViewById(R.id.allow_button).setOnClickListener(this);
         findViewById(R.id.deny_button).setOnClickListener(this);
 
-        LinearLayout packagesListView = (LinearLayout) findViewById(R.id.packages_list);
+        LinearLayout packagesListView = findViewById(R.id.packages_list);
 
         for (String pkg : packages) {
             String packageLabel;
diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java
index 9928512..7d81c4c 100644
--- a/core/java/android/app/AlertDialog.java
+++ b/core/java/android/app/AlertDialog.java
@@ -48,7 +48,7 @@
  * and add your view to it:
  *
  * <pre>
- * FrameLayout fl = (FrameLayout) findViewById(android.R.id.custom);
+ * FrameLayout fl = findViewById(android.R.id.custom);
  * fl.addView(myView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));
  * </pre>
  *
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 9c18df8..4abca9a 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -165,7 +165,7 @@
         setContentView(com.android.internal.R.layout.search_bar);
 
         // get the view elements for local access
-        mSearchView = (SearchView) findViewById(com.android.internal.R.id.search_view);
+        mSearchView = findViewById(com.android.internal.R.id.search_view);
         mSearchView.setIconified(false);
         mSearchView.setOnCloseListener(mOnCloseListener);
         mSearchView.setOnQueryTextListener(mOnQueryChangeListener);
@@ -184,7 +184,7 @@
         mBadgeLabel = (TextView) mSearchView.findViewById(com.android.internal.R.id.search_badge);
         mSearchAutoComplete = (AutoCompleteTextView)
                 mSearchView.findViewById(com.android.internal.R.id.search_src_text);
-        mAppIcon = (ImageView) findViewById(com.android.internal.R.id.search_app_icon);
+        mAppIcon = findViewById(com.android.internal.R.id.search_app_icon);
         mSearchPlate = mSearchView.findViewById(com.android.internal.R.id.search_plate);
         mWorkingSpinner = getContext().getDrawable(com.android.internal.R.drawable.search_spinner);
         // TODO: Restore the spinner for slow suggestion lookups
diff --git a/core/java/android/app/TabActivity.java b/core/java/android/app/TabActivity.java
index 637c8c1..ad8b0db 100644
--- a/core/java/android/app/TabActivity.java
+++ b/core/java/android/app/TabActivity.java
@@ -108,7 +108,7 @@
     @Override
     public void onContentChanged() {
         super.onContentChanged();
-        mTabHost = (TabHost) findViewById(com.android.internal.R.id.tabhost);
+        mTabHost = findViewById(com.android.internal.R.id.tabhost);
 
         if (mTabHost == null) {
             throw new RuntimeException(
diff --git a/core/java/android/inputmethodservice/ExtractEditLayout.java b/core/java/android/inputmethodservice/ExtractEditLayout.java
index 37ca4b4..af69f0f 100644
--- a/core/java/android/inputmethodservice/ExtractEditLayout.java
+++ b/core/java/android/inputmethodservice/ExtractEditLayout.java
@@ -41,6 +41,6 @@
     @Override
     public void onFinishInflate() {
         super.onFinishInflate();
-        mExtractActionButton = (Button) findViewById(com.android.internal.R.id.inputExtractAction);
+        mExtractActionButton = findViewById(com.android.internal.R.id.inputExtractAction);
     }
 }
diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java
index fe91978..20f7ace 100644
--- a/core/java/android/view/NotificationHeaderView.java
+++ b/core/java/android/view/NotificationHeaderView.java
@@ -94,8 +94,8 @@
         super.onFinishInflate();
         mAppName = findViewById(com.android.internal.R.id.app_name_text);
         mHeaderText = findViewById(com.android.internal.R.id.header_text);
-        mExpandButton = (ImageView) findViewById(com.android.internal.R.id.expand_button);
-        mIcon = (CachingIconView) findViewById(com.android.internal.R.id.icon);
+        mExpandButton = findViewById(com.android.internal.R.id.expand_button);
+        mIcon = findViewById(com.android.internal.R.id.icon);
         mProfileBadge = findViewById(com.android.internal.R.id.profile_badge);
     }
 
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 9072bf9..3092265 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -321,7 +321,7 @@
  * </pre></li>
  * <li>From the onCreate method of an Activity, find the Button
  * <pre class="prettyprint">
- *      Button myButton = (Button) findViewById(R.id.my_button);
+ *      Button myButton = findViewById(R.id.my_button);
  * </pre></li>
  * </ul>
  * <p>
diff --git a/core/java/android/view/ViewStub.java b/core/java/android/view/ViewStub.java
index 85d10f1..e9d1b87 100644
--- a/core/java/android/view/ViewStub.java
+++ b/core/java/android/view/ViewStub.java
@@ -58,7 +58,7 @@
  * The preferred way to perform the inflation of the layout resource is the following:
  *
  * <pre>
- *     ViewStub stub = (ViewStub) findViewById(R.id.stub);
+ *     ViewStub stub = findViewById(R.id.stub);
  *     View inflated = stub.inflate();
  * </pre>
  *
diff --git a/core/java/android/widget/AppSecurityPermissions.java b/core/java/android/widget/AppSecurityPermissions.java
index 06d4868..6df76fa 100644
--- a/core/java/android/widget/AppSecurityPermissions.java
+++ b/core/java/android/widget/AppSecurityPermissions.java
@@ -151,8 +151,8 @@
             mShowRevokeUI = showRevokeUI;
             mPackageName = packageName;
 
-            ImageView permGrpIcon = (ImageView) findViewById(R.id.perm_icon);
-            TextView permNameView = (TextView) findViewById(R.id.perm_name);
+            ImageView permGrpIcon = findViewById(R.id.perm_icon);
+            TextView permNameView = findViewById(R.id.perm_name);
 
             PackageManager pm = getContext().getPackageManager();
             Drawable icon = null;
diff --git a/core/java/android/widget/Button.java b/core/java/android/widget/Button.java
index 09e09b7..09ba553 100644
--- a/core/java/android/widget/Button.java
+++ b/core/java/android/widget/Button.java
@@ -37,7 +37,7 @@
  *
  *         setContentView(R.layout.content_layout_id);
  *
- *         final Button button = (Button) findViewById(R.id.button_id);
+ *         final Button button = findViewById(R.id.button_id);
  *         button.setOnClickListener(new View.OnClickListener() {
  *             public void onClick(View v) {
  *                 // Perform action on click
diff --git a/core/java/android/widget/DayPickerView.java b/core/java/android/widget/DayPickerView.java
index 0f0e6c3..be0967f 100644
--- a/core/java/android/widget/DayPickerView.java
+++ b/core/java/android/widget/DayPickerView.java
@@ -124,13 +124,13 @@
             addView(child);
         }
 
-        mPrevButton = (ImageButton) findViewById(R.id.prev);
+        mPrevButton = findViewById(R.id.prev);
         mPrevButton.setOnClickListener(mOnClickListener);
 
-        mNextButton = (ImageButton) findViewById(R.id.next);
+        mNextButton = findViewById(R.id.next);
         mNextButton.setOnClickListener(mOnClickListener);
 
-        mViewPager = (ViewPager) findViewById(R.id.day_picker_view_pager);
+        mViewPager = findViewById(R.id.day_picker_view_pager);
         mViewPager.setAdapter(mAdapter);
         mViewPager.setOnPageChangeListener(mOnPageChangedListener);
 
diff --git a/core/java/android/widget/MultiAutoCompleteTextView.java b/core/java/android/widget/MultiAutoCompleteTextView.java
index 2152e43..f348d73 100644
--- a/core/java/android/widget/MultiAutoCompleteTextView.java
+++ b/core/java/android/widget/MultiAutoCompleteTextView.java
@@ -43,7 +43,7 @@
  *
  *         ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
  *                 android.R.layout.simple_dropdown_item_1line, COUNTRIES);
- *         MultiAutoCompleteTextView textView = (MultiAutoCompleteTextView) findViewById(R.id.edit);
+ *         MultiAutoCompleteTextView textView = findViewById(R.id.edit);
  *         textView.setAdapter(adapter);
  *         textView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
  *     }
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 662e640..7bdd6da 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -706,7 +706,7 @@
 
         // increment button
         if (!mHasSelectorWheel) {
-            mIncrementButton = (ImageButton) findViewById(R.id.increment);
+            mIncrementButton = findViewById(R.id.increment);
             mIncrementButton.setOnClickListener(onClickListener);
             mIncrementButton.setOnLongClickListener(onLongClickListener);
         } else {
@@ -715,7 +715,7 @@
 
         // decrement button
         if (!mHasSelectorWheel) {
-            mDecrementButton = (ImageButton) findViewById(R.id.decrement);
+            mDecrementButton = findViewById(R.id.decrement);
             mDecrementButton.setOnClickListener(onClickListener);
             mDecrementButton.setOnLongClickListener(onLongClickListener);
         } else {
@@ -723,7 +723,7 @@
         }
 
         // input text
-        mInputText = (EditText) findViewById(R.id.numberpicker_input);
+        mInputText = findViewById(R.id.numberpicker_input);
         mInputText.setOnFocusChangeListener(new OnFocusChangeListener() {
             public void onFocusChange(View v, boolean hasFocus) {
                 if (hasFocus) {
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java
index 7e2cadf..8de17c0 100644
--- a/core/java/android/widget/TabHost.java
+++ b/core/java/android/widget/TabHost.java
@@ -136,7 +136,7 @@
 mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1");
       */
     public void setup() {
-        mTabWidget = (TabWidget) findViewById(com.android.internal.R.id.tabs);
+        mTabWidget = findViewById(com.android.internal.R.id.tabs);
         if (mTabWidget == null) {
             throw new RuntimeException(
                     "Your TabHost must have a TabWidget whose id attribute is 'android.R.id.tabs'");
@@ -171,7 +171,7 @@
             }
         });
 
-        mTabContent = (FrameLayout) findViewById(com.android.internal.R.id.tabcontent);
+        mTabContent = findViewById(com.android.internal.R.id.tabcontent);
         if (mTabContent == null) {
             throw new RuntimeException(
                     "Your TabHost must have a FrameLayout whose id attribute is "
diff --git a/core/java/android/widget/TextInputTimePickerView.java b/core/java/android/widget/TextInputTimePickerView.java
index 0183343..11b7514d 100644
--- a/core/java/android/widget/TextInputTimePickerView.java
+++ b/core/java/android/widget/TextInputTimePickerView.java
@@ -76,12 +76,12 @@
 
         inflate(context, R.layout.time_picker_text_input_material, this);
 
-        mHourEditText = (EditText) findViewById(R.id.input_hour);
-        mMinuteEditText = (EditText) findViewById(R.id.input_minute);
-        mInputSeparatorView = (TextView) findViewById(R.id.input_separator);
-        mErrorLabel = (TextView) findViewById(R.id.label_error);
-        mHourLabel = (TextView) findViewById(R.id.label_hour);
-        mMinuteLabel = (TextView) findViewById(R.id.label_minute);
+        mHourEditText = findViewById(R.id.input_hour);
+        mMinuteEditText = findViewById(R.id.input_minute);
+        mInputSeparatorView = findViewById(R.id.input_separator);
+        mErrorLabel = findViewById(R.id.label_error);
+        mHourLabel = findViewById(R.id.label_hour);
+        mMinuteLabel = findViewById(R.id.label_minute);
 
         mHourEditText.addTextChangedListener(new TextWatcher() {
             @Override
@@ -109,7 +109,7 @@
             }
         });
 
-        mAmPmSpinner = (Spinner) findViewById(R.id.am_pm_spinner);
+        mAmPmSpinner = findViewById(R.id.am_pm_spinner);
         final String[] amPmStrings = TimePicker.getAmPmStrings(context);
         ArrayAdapter<CharSequence> adapter =
                 new ArrayAdapter<CharSequence>(context, R.layout.simple_spinner_dropdown_item);
diff --git a/core/java/android/widget/TwoLineListItem.java b/core/java/android/widget/TwoLineListItem.java
index 0445ebd..553b86e 100644
--- a/core/java/android/widget/TwoLineListItem.java
+++ b/core/java/android/widget/TwoLineListItem.java
@@ -70,8 +70,8 @@
     protected void onFinishInflate() {
         super.onFinishInflate();
 
-        mText1 = (TextView) findViewById(com.android.internal.R.id.text1);
-        mText2 = (TextView) findViewById(com.android.internal.R.id.text2);
+        mText1 = findViewById(com.android.internal.R.id.text1);
+        mText2 = findViewById(com.android.internal.R.id.text2);
     }
 
     /**
diff --git a/core/java/com/android/internal/app/AccessibilityButtonChooserActivity.java b/core/java/com/android/internal/app/AccessibilityButtonChooserActivity.java
index ee5d339..9d90429 100644
--- a/core/java/com/android/internal/app/AccessibilityButtonChooserActivity.java
+++ b/core/java/com/android/internal/app/AccessibilityButtonChooserActivity.java
@@ -59,7 +59,7 @@
         String component = Settings.Secure.getString(getContentResolver(),
                 Settings.Secure.ACCESSIBILITY_BUTTON_TARGET_COMPONENT);
         if (TextUtils.isEmpty(component)) {
-            TextView prompt = (TextView) findViewById(R.id.accessibility_button_prompt);
+            TextView prompt = findViewById(R.id.accessibility_button_prompt);
             prompt.setVisibility(View.VISIBLE);
         }
 
@@ -78,7 +78,7 @@
             finish();
         }
 
-        GridView gridview = (GridView) findViewById(R.id.accessibility_button_chooser_grid);
+        GridView gridview = findViewById(R.id.accessibility_button_chooser_grid);
         gridview.setAdapter(new TargetAdapter());
         gridview.setOnItemClickListener((parent, view, position, id) -> {
             onTargetSelected(mTargets.get(position));
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java
index 622b708..b596678 100644
--- a/core/java/com/android/internal/app/ResolverActivity.java
+++ b/core/java/com/android/internal/app/ResolverActivity.java
@@ -287,7 +287,7 @@
             return;
         }
 
-        final ResolverDrawerLayout rdl = (ResolverDrawerLayout) findViewById(R.id.contentPanel);
+        final ResolverDrawerLayout rdl = findViewById(R.id.contentPanel);
         if (rdl != null) {
             rdl.setOnDismissedListener(new ResolverDrawerLayout.OnDismissedListener() {
                 @Override
@@ -922,10 +922,10 @@
         }
 
 
-        mAdapterView = (AbsListView) findViewById(R.id.resolver_list);
+        mAdapterView = findViewById(R.id.resolver_list);
 
         if (count == 0 && mAdapter.mPlaceholderCount == 0) {
-            final TextView emptyView = (TextView) findViewById(R.id.empty);
+            final TextView emptyView = findViewById(R.id.empty);
             emptyView.setVisibility(View.VISIBLE);
             mAdapterView.setVisibility(View.GONE);
         } else {
@@ -959,7 +959,7 @@
 
     public void setTitleAndIcon() {
         if (mAdapter.getCount() == 0 && mAdapter.mPlaceholderCount == 0) {
-            final TextView titleView = (TextView) findViewById(R.id.title);
+            final TextView titleView = findViewById(R.id.title);
             if (titleView != null) {
                 titleView.setVisibility(View.GONE);
             }
@@ -970,14 +970,14 @@
                 : getTitleForAction(getTargetIntent().getAction(), mDefaultTitleResId);
 
         if (!TextUtils.isEmpty(title)) {
-            final TextView titleView = (TextView) findViewById(R.id.title);
+            final TextView titleView = findViewById(R.id.title);
             if (titleView != null) {
                 titleView.setText(title);
             }
             setTitle(title);
 
             // Try to initialize the title icon if we have a view for it and a title to match
-            final ImageView titleIcon = (ImageView) findViewById(R.id.title_icon);
+            final ImageView titleIcon = findViewById(R.id.title_icon);
             if (titleIcon != null) {
                 ApplicationInfo ai = null;
                 try {
@@ -994,7 +994,7 @@
             }
         }
 
-        final ImageView iconView = (ImageView) findViewById(R.id.icon);
+        final ImageView iconView = findViewById(R.id.icon);
         final DisplayResolveInfo iconInfo = mAdapter.getFilteredItem();
         if (iconView != null && iconInfo != null) {
             new LoadIconIntoViewTask(iconInfo, iconView).execute();
@@ -1003,7 +1003,7 @@
 
     public void resetAlwaysOrOnceButtonBar() {
         if (mSupportsAlwaysUseOption) {
-            final ViewGroup buttonLayout = (ViewGroup) findViewById(R.id.button_bar);
+            final ViewGroup buttonLayout = findViewById(R.id.button_bar);
             if (buttonLayout != null) {
                 buttonLayout.setVisibility(View.VISIBLE);
                 mAlwaysButton = (Button) buttonLayout.findViewById(R.id.button_always);
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index c4540f5..baf6db9 100644
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -1688,7 +1688,7 @@
                     }
                 };
             } else {
-                ViewStub stub = (ViewStub) findViewById(R.id.action_mode_bar_stub);
+                ViewStub stub = findViewById(R.id.action_mode_bar_stub);
                 if (stub != null) {
                     mPrimaryActionModeView = (ActionBarContextView) stub.inflate();
                     mPrimaryActionModePopup = null;
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java
index 7b966de..243916b 100644
--- a/core/java/com/android/internal/policy/PhoneWindow.java
+++ b/core/java/com/android/internal/policy/PhoneWindow.java
@@ -1593,7 +1593,7 @@
         if (featureId == FEATURE_PROGRESS || featureId == FEATURE_INDETERMINATE_PROGRESS) {
             updateProgressBars(value);
         } else if (featureId == FEATURE_CUSTOM_TITLE) {
-            FrameLayout titleContainer = (FrameLayout) findViewById(R.id.title_container);
+            FrameLayout titleContainer = findViewById(R.id.title_container);
             if (titleContainer != null) {
                 mLayoutInflater.inflate(value, titleContainer);
             }
@@ -2690,7 +2690,7 @@
                     invalidatePanelMenu(FEATURE_ACTION_BAR);
                 }
             } else {
-                mTitleView = (TextView) findViewById(R.id.title);
+                mTitleView = findViewById(R.id.title);
                 if (mTitleView != null) {
                     if ((getLocalFeatures() & (1 << FEATURE_NO_TITLE)) != 0) {
                         final View titleContainer = findViewById(R.id.title_container);
@@ -2967,7 +2967,7 @@
         if (mContentParent == null && shouldInstallDecor) {
             installDecor();
         }
-        mCircularProgressBar = (ProgressBar) findViewById(R.id.progress_circular);
+        mCircularProgressBar = findViewById(R.id.progress_circular);
         if (mCircularProgressBar != null) {
             mCircularProgressBar.setVisibility(View.INVISIBLE);
         }
@@ -2981,7 +2981,7 @@
         if (mContentParent == null && shouldInstallDecor) {
             installDecor();
         }
-        mHorizontalProgressBar = (ProgressBar) findViewById(R.id.progress_horizontal);
+        mHorizontalProgressBar = findViewById(R.id.progress_horizontal);
         if (mHorizontalProgressBar != null) {
             mHorizontalProgressBar.setVisibility(View.INVISIBLE);
         }
diff --git a/core/java/com/android/internal/view/menu/ListMenuItemView.java b/core/java/com/android/internal/view/menu/ListMenuItemView.java
index 919cf99..83a2838 100644
--- a/core/java/com/android/internal/view/menu/ListMenuItemView.java
+++ b/core/java/com/android/internal/view/menu/ListMenuItemView.java
@@ -89,14 +89,14 @@
         
         setBackgroundDrawable(mBackground);
         
-        mTitleView = (TextView) findViewById(com.android.internal.R.id.title);
+        mTitleView = findViewById(com.android.internal.R.id.title);
         if (mTextAppearance != -1) {
             mTitleView.setTextAppearance(mTextAppearanceContext,
                                          mTextAppearance);
         }
         
-        mShortcutView = (TextView) findViewById(com.android.internal.R.id.shortcut);
-        mSubMenuArrowView = (ImageView) findViewById(com.android.internal.R.id.submenuarrow);
+        mShortcutView = findViewById(com.android.internal.R.id.shortcut);
+        mSubMenuArrowView = findViewById(com.android.internal.R.id.submenuarrow);
         if (mSubMenuArrowView != null) {
             mSubMenuArrowView.setImageDrawable(mSubMenuArrow);
         }
diff --git a/core/java/com/android/internal/widget/ActionBarOverlayLayout.java b/core/java/com/android/internal/widget/ActionBarOverlayLayout.java
index c3a7460..65cd4fa2 100644
--- a/core/java/com/android/internal/widget/ActionBarOverlayLayout.java
+++ b/core/java/com/android/internal/widget/ActionBarOverlayLayout.java
@@ -569,10 +569,10 @@
     void pullChildren() {
         if (mContent == null) {
             mContent = findViewById(com.android.internal.R.id.content);
-            mActionBarTop = (ActionBarContainer) findViewById(
+            mActionBarTop = findViewById(
                     com.android.internal.R.id.action_bar_container);
             mDecorToolbar = getDecorToolbar(findViewById(com.android.internal.R.id.action_bar));
-            mActionBarBottom = (ActionBarContainer) findViewById(
+            mActionBarBottom = findViewById(
                     com.android.internal.R.id.split_action_bar);
         }
     }
@@ -707,7 +707,7 @@
                 mDecorToolbar.setSplitToolbar(splitActionBar);
                 mDecorToolbar.setSplitWhenNarrow(splitWhenNarrow);
 
-                final ActionBarContextView cab = (ActionBarContextView) findViewById(
+                final ActionBarContextView cab = findViewById(
                         com.android.internal.R.id.action_context_bar);
                 cab.setSplitView(mActionBarBottom);
                 cab.setSplitToolbar(splitActionBar);
diff --git a/core/java/com/android/internal/widget/MediaNotificationView.java b/core/java/com/android/internal/widget/MediaNotificationView.java
index f63afad..afb2a5e 100644
--- a/core/java/com/android/internal/widget/MediaNotificationView.java
+++ b/core/java/com/android/internal/widget/MediaNotificationView.java
@@ -152,7 +152,7 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mRightIcon = (ImageView) findViewById(com.android.internal.R.id.right_icon);
+        mRightIcon = findViewById(com.android.internal.R.id.right_icon);
         mActions = findViewById(com.android.internal.R.id.media_actions);
         mHeader = findViewById(com.android.internal.R.id.notification_header);
         mMainColumn = findViewById(com.android.internal.R.id.notification_main_column);
diff --git a/core/tests/coretests/src/android/animation/BasicAnimatorActivity.java b/core/tests/coretests/src/android/animation/BasicAnimatorActivity.java
index 6bcf8fc..0e1e6ac 100644
--- a/core/tests/coretests/src/android/animation/BasicAnimatorActivity.java
+++ b/core/tests/coretests/src/android/animation/BasicAnimatorActivity.java
@@ -27,6 +27,6 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.animator_basic);
-        mAnimatingButton = (Button) findViewById(R.id.animatingButton);
+        mAnimatingButton = findViewById(R.id.animatingButton);
     }
 }
diff --git a/core/tests/coretests/src/android/os/BrightnessLimit.java b/core/tests/coretests/src/android/os/BrightnessLimit.java
index f4a5e09..43cd373 100644
--- a/core/tests/coretests/src/android/os/BrightnessLimit.java
+++ b/core/tests/coretests/src/android/os/BrightnessLimit.java
@@ -40,7 +40,7 @@
         
         setContentView(R.layout.brightness_limit);
         
-        Button b = (Button) findViewById(R.id.go);
+        Button b = findViewById(R.id.go);
         b.setOnClickListener(this);
     }
 
diff --git a/core/tests/coretests/src/android/view/Disabled.java b/core/tests/coretests/src/android/view/Disabled.java
index fa92107..d3c7470 100644
--- a/core/tests/coretests/src/android/view/Disabled.java
+++ b/core/tests/coretests/src/android/view/Disabled.java
@@ -34,16 +34,16 @@
         setContentView(R.layout.disabled);
 
         // Find our buttons
-        Button disabledButton = (Button) findViewById(R.id.disabledButton);
+        Button disabledButton = findViewById(R.id.disabledButton);
         disabledButton.setEnabled(false);
         
         // Find our buttons
-        Button disabledButtonA = (Button) findViewById(R.id.disabledButtonA);
+        Button disabledButtonA = findViewById(R.id.disabledButtonA);
         disabledButtonA.setOnClickListener(this);
     }
 
     public void onClick(View v) {
-        Button disabledButtonB = (Button) findViewById(R.id.disabledButtonB);
+        Button disabledButtonB = findViewById(R.id.disabledButtonB);
         disabledButtonB.setEnabled(!disabledButtonB.isEnabled());
     }
 }
diff --git a/core/tests/coretests/src/android/view/DrawableBgMinSize.java b/core/tests/coretests/src/android/view/DrawableBgMinSize.java
index a75b23a..58bfb8a 100644
--- a/core/tests/coretests/src/android/view/DrawableBgMinSize.java
+++ b/core/tests/coretests/src/android/view/DrawableBgMinSize.java
@@ -58,14 +58,14 @@
         mBackgroundDrawable = getResources().getDrawable(R.drawable.drawable_background);
         mBigBackgroundDrawable = getResources().getDrawable(R.drawable.big_drawable_background);
  
-        mChangeBackgroundsButton = (Button) findViewById(R.id.change_backgrounds);
+        mChangeBackgroundsButton = findViewById(R.id.change_backgrounds);
         mChangeBackgroundsButton.setOnClickListener(this);
         
-        mTextView = (TextView) findViewById(R.id.text_view);
-        mLinearLayout = (LinearLayout) findViewById(R.id.linear_layout);
-        mRelativeLayout = (RelativeLayout) findViewById(R.id.relative_layout);
-        mFrameLayout = (FrameLayout) findViewById(R.id.frame_layout);
-        mAbsoluteLayout = (AbsoluteLayout) findViewById(R.id.absolute_layout);
+        mTextView = findViewById(R.id.text_view);
+        mLinearLayout = findViewById(R.id.linear_layout);
+        mRelativeLayout = findViewById(R.id.relative_layout);
+        mFrameLayout = findViewById(R.id.frame_layout);
+        mAbsoluteLayout = findViewById(R.id.absolute_layout);
 
         changeBackgrounds(mBackgroundDrawable);
     }
diff --git a/core/tests/coretests/src/android/view/PopupWindowVisibility.java b/core/tests/coretests/src/android/view/PopupWindowVisibility.java
index 6e11ede..85ce04f 100644
--- a/core/tests/coretests/src/android/view/PopupWindowVisibility.java
+++ b/core/tests/coretests/src/android/view/PopupWindowVisibility.java
@@ -45,13 +45,13 @@
 
         mFrame = findViewById(R.id.frame);
         
-        mHide = (Button) findViewById(R.id.hide);
+        mHide = findViewById(R.id.hide);
         mHide.setOnClickListener(this);
         
-        mShow = (Button) findViewById(R.id.show);
+        mShow = findViewById(R.id.show);
         mShow.setOnClickListener(this);
         
-        Spinner spinner = (Spinner) findViewById(R.id.spinner);
+        Spinner spinner = findViewById(R.id.spinner);
         ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,
                 android.R.layout.simple_spinner_item, mStrings);
         spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
@@ -59,7 +59,7 @@
         
         ArrayAdapter<String> autoAdapter = new ArrayAdapter<String>(this,
                 android.R.layout.simple_dropdown_item_1line, COUNTRIES);
-        AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.auto);
+        AutoCompleteTextView textView = findViewById(R.id.auto);
         textView.setAdapter(autoAdapter);
     }
 
diff --git a/core/tests/coretests/src/android/view/PreDrawListener.java b/core/tests/coretests/src/android/view/PreDrawListener.java
index 981c6c0..60bbee4 100644
--- a/core/tests/coretests/src/android/view/PreDrawListener.java
+++ b/core/tests/coretests/src/android/view/PreDrawListener.java
@@ -75,9 +75,9 @@
         super.onCreate(icicle);
         setContentView(R.layout.pre_draw_listener);
 
-        mFrame = (MyLinearLayout) findViewById(R.id.frame);
+        mFrame = findViewById(R.id.frame);
 
-        Button mGoButton = (Button) findViewById(R.id.go);
+        Button mGoButton = findViewById(R.id.go);
         mGoButton.setOnClickListener(this);
     }
 
diff --git a/core/tests/coretests/src/android/view/Visibility.java b/core/tests/coretests/src/android/view/Visibility.java
index 97ff252..031568c 100644
--- a/core/tests/coretests/src/android/view/Visibility.java
+++ b/core/tests/coretests/src/android/view/Visibility.java
@@ -37,9 +37,9 @@
         mVictim = findViewById(R.id.victim);
 
         // Find our buttons
-        Button visibleButton = (Button) findViewById(R.id.vis);
-        Button invisibleButton = (Button) findViewById(R.id.invis);
-        Button goneButton = (Button) findViewById(R.id.gone);
+        Button visibleButton = findViewById(R.id.vis);
+        Button invisibleButton = findViewById(R.id.invis);
+        Button goneButton = findViewById(R.id.gone);
 
         // Wire each button to a click listener
         visibleButton.setOnClickListener(mVisibleListener);
diff --git a/core/tests/coretests/src/android/view/VisibilityCallback.java b/core/tests/coretests/src/android/view/VisibilityCallback.java
index 7290a62..f98a0a8 100644
--- a/core/tests/coretests/src/android/view/VisibilityCallback.java
+++ b/core/tests/coretests/src/android/view/VisibilityCallback.java
@@ -45,9 +45,9 @@
         mVictim = (MonitoredTextView)findViewById(R.id.victim);
 
         // Find our buttons
-        Button visibleButton = (Button) findViewById(R.id.vis);
-        Button invisibleButton = (Button) findViewById(R.id.invis);
-        Button goneButton = (Button) findViewById(R.id.gone);
+        Button visibleButton = findViewById(R.id.vis);
+        Button invisibleButton = findViewById(R.id.invis);
+        Button goneButton = findViewById(R.id.gone);
 
         // Wire each button to a click listener
         visibleButton.setOnClickListener(mVisibleListener);
diff --git a/core/tests/coretests/src/android/widget/AutoCompleteTextViewSimple.java b/core/tests/coretests/src/android/widget/AutoCompleteTextViewSimple.java
index f6cec26..b4e05aa 100644
--- a/core/tests/coretests/src/android/widget/AutoCompleteTextViewSimple.java
+++ b/core/tests/coretests/src/android/widget/AutoCompleteTextViewSimple.java
@@ -47,7 +47,7 @@
 
         // setup layout & views
         setContentView(R.layout.autocompletetextview_simple);
-        mTextView = (AutoCompleteTextView) findViewById(R.id.autocompletetextview1);
+        mTextView = findViewById(R.id.autocompletetextview1);
         
         // configure callbacks used for monitoring
         mTextView.setOnItemClickListener(this);
diff --git a/core/tests/coretests/src/android/widget/focus/DescendantFocusability.java b/core/tests/coretests/src/android/widget/focus/DescendantFocusability.java
index f7d91aa..f6b0520 100644
--- a/core/tests/coretests/src/android/widget/focus/DescendantFocusability.java
+++ b/core/tests/coretests/src/android/widget/focus/DescendantFocusability.java
@@ -40,13 +40,13 @@
 
         setContentView(R.layout.descendant_focusability);
 
-        beforeDescendants = (ViewGroup) findViewById(R.id.beforeDescendants);
+        beforeDescendants = findViewById(R.id.beforeDescendants);
         beforeDescendantsChild = (Button) beforeDescendants.getChildAt(0);
 
-        afterDescendants = (ViewGroup) findViewById(R.id.afterDescendants);
+        afterDescendants = findViewById(R.id.afterDescendants);
         afterDescendantsChild = (Button) afterDescendants.getChildAt(0);
 
-        blocksDescendants = (ViewGroup) findViewById(R.id.blocksDescendants);
+        blocksDescendants = findViewById(R.id.blocksDescendants);
         blocksDescendantsChild = (Button) blocksDescendants.getChildAt(0);
     }
 
diff --git a/core/tests/coretests/src/android/widget/focus/FocusAfterRemoval.java b/core/tests/coretests/src/android/widget/focus/FocusAfterRemoval.java
index 93245e7..b3d5ec5 100644
--- a/core/tests/coretests/src/android/widget/focus/FocusAfterRemoval.java
+++ b/core/tests/coretests/src/android/widget/focus/FocusAfterRemoval.java
@@ -35,10 +35,10 @@
         super.onCreate(icicle);
         setContentView(R.layout.focus_after_removal);
 
-        final LinearLayout left = (LinearLayout) findViewById(R.id.leftLayout);
+        final LinearLayout left = findViewById(R.id.leftLayout);
 
         // top left makes parent layout GONE
-        Button topLeftButton = (Button) findViewById(R.id.topLeftButton);
+        Button topLeftButton = findViewById(R.id.topLeftButton);
         topLeftButton.setOnClickListener(new View.OnClickListener() {
 
             public void onClick(View v) {
@@ -48,7 +48,7 @@
 
         // bottom left makes parent layout INVISIBLE
         // top left makes parent layout GONE
-        Button bottomLeftButton = (Button) findViewById(R.id.bottomLeftButton);
+        Button bottomLeftButton = findViewById(R.id.bottomLeftButton);
         bottomLeftButton.setOnClickListener(new View.OnClickListener() {
 
             public void onClick(View v) {
@@ -57,7 +57,7 @@
         });
 
         // top right button makes top right button GONE
-        final Button topRightButton = (Button) findViewById(R.id.topRightButton);
+        final Button topRightButton = findViewById(R.id.topRightButton);
         topRightButton.setOnClickListener(new View.OnClickListener() {
 
             public void onClick(View v) {
@@ -66,7 +66,7 @@
         });
 
         // bottom right button makes bottom right button INVISIBLE
-        final Button bottomRightButton = (Button) findViewById(R.id.bottomRightButton);
+        final Button bottomRightButton = findViewById(R.id.bottomRightButton);
         bottomRightButton.setOnClickListener(new View.OnClickListener() {
 
             public void onClick(View v) {
diff --git a/core/tests/coretests/src/android/widget/focus/LinearLayoutGrid.java b/core/tests/coretests/src/android/widget/focus/LinearLayoutGrid.java
index db082ec..acd632f 100644
--- a/core/tests/coretests/src/android/widget/focus/LinearLayoutGrid.java
+++ b/core/tests/coretests/src/android/widget/focus/LinearLayoutGrid.java
@@ -33,7 +33,7 @@
     }
 
     public ViewGroup getRootView() {
-        return (ViewGroup) findViewById(R.id.layout);
+        return findViewById(R.id.layout);
     }
 
     public Button getButtonAt(int column, int row) {
@@ -51,11 +51,11 @@
     private LinearLayout getColumn(int column) {
         switch (column) {
             case 0:
-                return (LinearLayout) findViewById(R.id.column1);
+                return findViewById(R.id.column1);
             case 1:
-                return (LinearLayout) findViewById(R.id.column2);
+                return findViewById(R.id.column2);
             case 2:
-                return (LinearLayout) findViewById(R.id.column3);
+                return findViewById(R.id.column3);
             default:
                 throw new IllegalArgumentException("column out of range");
         }
diff --git a/core/tests/coretests/src/android/widget/focus/ListWithFooterViewAndNewLabels.java b/core/tests/coretests/src/android/widget/focus/ListWithFooterViewAndNewLabels.java
index ceb0e95..b908201 100644
--- a/core/tests/coretests/src/android/widget/focus/ListWithFooterViewAndNewLabels.java
+++ b/core/tests/coretests/src/android/widget/focus/ListWithFooterViewAndNewLabels.java
@@ -54,7 +54,7 @@
         setListAdapter(mMyAdapter);
 
         // not in list
-        Button topButton = (Button) findViewById(R.id.button);
+        Button topButton = findViewById(R.id.button);
         topButton.setText("click to add new item");
         topButton.setOnClickListener(new View.OnClickListener() {
 
diff --git a/core/tests/coretests/src/android/widget/focus/RequestFocus.java b/core/tests/coretests/src/android/widget/focus/RequestFocus.java
index 21d762a..4daf0b4 100644
--- a/core/tests/coretests/src/android/widget/focus/RequestFocus.java
+++ b/core/tests/coretests/src/android/widget/focus/RequestFocus.java
@@ -34,7 +34,7 @@
         setContentView(R.layout.focus_after_removal);
 
         // bottom right button starts with the focus.
-        final Button bottomRightButton = (Button) findViewById(R.id.bottomRightButton);
+        final Button bottomRightButton = findViewById(R.id.bottomRightButton);
         bottomRightButton.requestFocus();
         bottomRightButton.setText("I should have focus");
     }
diff --git a/core/tests/coretests/src/android/widget/gridview/GridPadding.java b/core/tests/coretests/src/android/widget/gridview/GridPadding.java
index 0b9e4c5..c3156dc 100644
--- a/core/tests/coretests/src/android/widget/gridview/GridPadding.java
+++ b/core/tests/coretests/src/android/widget/gridview/GridPadding.java
@@ -40,7 +40,7 @@
             values[i] = String.valueOf(i);
         }
 
-        mGridView = (GridView) findViewById(R.id.grid);
+        mGridView = findViewById(R.id.grid);
         mGridView.setAdapter(new ArrayAdapter<String>(this,
                 android.R.layout.simple_list_item_1, values));
     }
diff --git a/core/tests/coretests/src/android/widget/gridview/GridScrollListener.java b/core/tests/coretests/src/android/widget/gridview/GridScrollListener.java
index 4290941..0ce5a31 100644
--- a/core/tests/coretests/src/android/widget/gridview/GridScrollListener.java
+++ b/core/tests/coretests/src/android/widget/gridview/GridScrollListener.java
@@ -46,8 +46,8 @@
             values[i] = ((Integer)i).toString();
         }
         
-        mText = (TextView) findViewById(R.id.text);
-        mGridView = (GridView) findViewById(R.id.grid);
+        mText = findViewById(R.id.text);
+        mGridView = findViewById(R.id.grid);
         mGridView.setAdapter(new ArrayAdapter<String>(this,
                 android.R.layout.simple_list_item_1, values));
 
diff --git a/core/tests/coretests/src/android/widget/gridview/GridThrasher.java b/core/tests/coretests/src/android/widget/gridview/GridThrasher.java
index 0ef5db9..ad89bb6 100644
--- a/core/tests/coretests/src/android/widget/gridview/GridThrasher.java
+++ b/core/tests/coretests/src/android/widget/gridview/GridThrasher.java
@@ -115,9 +115,9 @@
         
         setContentView(R.layout.grid_thrasher);
         
-        mText = (TextView) findViewById(R.id.text);
+        mText = findViewById(R.id.text);
         mAdapter = new ThrashListAdapter(this);
-        GridView g = (GridView) findViewById(R.id.grid);
+        GridView g = findViewById(R.id.grid);
         g.setAdapter(mAdapter);
         
         mHandler.postDelayed(mThrash, 5000);
diff --git a/core/tests/coretests/src/android/widget/layout/linear/LLEditTextThenButton.java b/core/tests/coretests/src/android/widget/layout/linear/LLEditTextThenButton.java
index fe2525f..83331ca 100644
--- a/core/tests/coretests/src/android/widget/layout/linear/LLEditTextThenButton.java
+++ b/core/tests/coretests/src/android/widget/layout/linear/LLEditTextThenButton.java
@@ -36,9 +36,9 @@
 
         setContentView(R.layout.linear_layout_edittext_then_button);
 
-        mLayout = (LinearLayout) findViewById(R.id.layout);
-        mEditText = (EditText) findViewById(R.id.editText);
-        mButton = (Button) findViewById(R.id.button);
+        mLayout = findViewById(R.id.layout);
+        mEditText = findViewById(R.id.editText);
+        mButton = findViewById(R.id.button);
     }
 
     public LinearLayout getLayout() {
diff --git a/core/tests/coretests/src/android/widget/layout/linear/LLOfButtons1.java b/core/tests/coretests/src/android/widget/layout/linear/LLOfButtons1.java
index 3d0144f..ab2f060 100644
--- a/core/tests/coretests/src/android/widget/layout/linear/LLOfButtons1.java
+++ b/core/tests/coretests/src/android/widget/layout/linear/LLOfButtons1.java
@@ -37,7 +37,7 @@
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(R.layout.linear_layout_buttons);
-        mFirstButton = (Button) findViewById(R.id.button1);
+        mFirstButton = findViewById(R.id.button1);
 
         mFirstButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
@@ -48,7 +48,7 @@
     }
 
     public LinearLayout getLayout() {
-        return (LinearLayout) findViewById(R.id.layout);
+        return findViewById(R.id.layout);
     }
 
     public Button getFirstButton() {
diff --git a/core/tests/coretests/src/android/widget/listview/ListDividers.java b/core/tests/coretests/src/android/widget/listview/ListDividers.java
index 3928c03..9b5a087 100644
--- a/core/tests/coretests/src/android/widget/listview/ListDividers.java
+++ b/core/tests/coretests/src/android/widget/listview/ListDividers.java
@@ -40,7 +40,7 @@
             values[i] = ((Integer) i).toString();
         }
 
-        mListView = (ListView) findViewById(android.R.id.list);
+        mListView = findViewById(android.R.id.list);
         mListView.setAdapter(new ArrayAdapter<String>(this,
                 android.R.layout.simple_list_item_1, values));
 
diff --git a/core/tests/coretests/src/android/widget/listview/ListFilter.java b/core/tests/coretests/src/android/widget/listview/ListFilter.java
index 9e9d1b0..c2ac90e 100644
--- a/core/tests/coretests/src/android/widget/listview/ListFilter.java
+++ b/core/tests/coretests/src/android/widget/listview/ListFilter.java
@@ -46,10 +46,10 @@
         getListView().setTextFilterEnabled(true);
         mFrame = findViewById(R.id.frame);
         
-        mHide = (Button) findViewById(R.id.hide);
+        mHide = findViewById(R.id.hide);
         mHide.setOnClickListener(this);
         
-        mShow = (Button) findViewById(R.id.show);
+        mShow = findViewById(R.id.show);
         mShow.setOnClickListener(this);
     }
     
diff --git a/core/tests/coretests/src/android/widget/listview/ListInHorizontal.java b/core/tests/coretests/src/android/widget/listview/ListInHorizontal.java
index 5f09ff6..a373a5b 100644
--- a/core/tests/coretests/src/android/widget/listview/ListInHorizontal.java
+++ b/core/tests/coretests/src/android/widget/listview/ListInHorizontal.java
@@ -43,7 +43,7 @@
             values[i] = ((Integer) i).toString();
         }
 
-        mListView = (ListView) findViewById(R.id.list);
+        mListView = findViewById(R.id.list);
         mListView.setAdapter(new ArrayAdapter<String>(this,
                 android.R.layout.simple_list_item_1, values));
 
diff --git a/core/tests/coretests/src/android/widget/listview/ListRecyclerProfiling.java b/core/tests/coretests/src/android/widget/listview/ListRecyclerProfiling.java
index d5d7261..76814fb 100644
--- a/core/tests/coretests/src/android/widget/listview/ListRecyclerProfiling.java
+++ b/core/tests/coretests/src/android/widget/listview/ListRecyclerProfiling.java
@@ -38,14 +38,14 @@
             values[i] = ((Integer) i).toString();
         }
 
-        ListView listView = (ListView) findViewById(R.id.list);
+        ListView listView = findViewById(R.id.list);
 
         ViewDebug.startRecyclerTracing("SimpleList", listView);
 
         listView.setAdapter(new ArrayAdapter<String>(this,
                 android.R.layout.simple_list_item_1, values));
 
-        ImageButton stopProfiling = (ImageButton) findViewById(R.id.pause);
+        ImageButton stopProfiling = findViewById(R.id.pause);
         stopProfiling.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 ViewDebug.stopRecyclerTracing();
diff --git a/core/tests/coretests/src/android/widget/listview/ListScrollListener.java b/core/tests/coretests/src/android/widget/listview/ListScrollListener.java
index 58a31dc..f349dc6 100644
--- a/core/tests/coretests/src/android/widget/listview/ListScrollListener.java
+++ b/core/tests/coretests/src/android/widget/listview/ListScrollListener.java
@@ -46,7 +46,7 @@
             values[i] = ((Integer)i).toString();
         }
         
-        mText = (TextView) findViewById(R.id.text);
+        mText = findViewById(R.id.text);
         setListAdapter(new ArrayAdapter<String>(this,
                 android.R.layout.simple_list_item_1, values));
 
diff --git a/core/tests/coretests/src/android/widget/listview/ListThrasher.java b/core/tests/coretests/src/android/widget/listview/ListThrasher.java
index ba3d590..0237a95 100644
--- a/core/tests/coretests/src/android/widget/listview/ListThrasher.java
+++ b/core/tests/coretests/src/android/widget/listview/ListThrasher.java
@@ -112,7 +112,7 @@
 
         setContentView(R.layout.list_thrasher);
 
-        mText = (TextView) findViewById(R.id.text);
+        mText = findViewById(R.id.text);
         mAdapter = new ThrashListAdapter(this);
         setListAdapter(mAdapter);
 
diff --git a/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisible.java b/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisible.java
index 9cc8544..afc275f 100644
--- a/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisible.java
+++ b/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisible.java
@@ -43,8 +43,8 @@
         final Rect rect = new Rect();
         final View childToMakeVisible = findViewById(R.id.childToMakeVisible);
 
-        final TextView topBlob = (TextView) findViewById(R.id.topBlob);
-        final TextView bottomBlob = (TextView) findViewById(R.id.bottomBlob);
+        final TextView topBlob = findViewById(R.id.topBlob);
+        final TextView bottomBlob = findViewById(R.id.bottomBlob);
 
         // estimate to get blobs larger than screen
         int screenHeight = getWindowManager().getDefaultDisplay().getHeight();
diff --git a/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisibleWithInternalScroll.java b/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisibleWithInternalScroll.java
index 0e2586d..731b25a 100644
--- a/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisibleWithInternalScroll.java
+++ b/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisibleWithInternalScroll.java
@@ -53,11 +53,11 @@
 
         setContentView(R.layout.scroll_to_rect_with_internal_scroll);
 
-        mTextBlob = (TextView) findViewById(R.id.blob);
+        mTextBlob = findViewById(R.id.blob);
         mTextBlob.scrollBy(0, scrollYofBlob);
 
 
-        mScrollToBlob = (Button) findViewById(R.id.scrollToBlob);
+        mScrollToBlob = findViewById(R.id.scrollToBlob);
         mScrollToBlob.setOnClickListener(new View.OnClickListener() {
 
             public void onClick(View v) {
diff --git a/core/tests/coretests/src/android/widget/scroll/ScrollViewButtonsAndLabels.java b/core/tests/coretests/src/android/widget/scroll/ScrollViewButtonsAndLabels.java
index 4d0892c..027ea0f 100644
--- a/core/tests/coretests/src/android/widget/scroll/ScrollViewButtonsAndLabels.java
+++ b/core/tests/coretests/src/android/widget/scroll/ScrollViewButtonsAndLabels.java
@@ -66,8 +66,8 @@
         int screenHeight = getWindowManager().getDefaultDisplay().getHeight();
         mNumGroups = screenHeight / 30;
 
-        mScrollView = (ScrollView) findViewById(R.id.scrollView);
-        mLinearLayout = (LinearLayout) findViewById(R.id.layout);
+        mScrollView = findViewById(R.id.scrollView);
+        mLinearLayout = findViewById(R.id.layout);
 
         LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(
                 LinearLayout.LayoutParams.MATCH_PARENT,
diff --git a/media/mca/samples/CameraEffectsRecordingSample/java/android/media/filterfw/samples/CameraEffectsRecordingSample.java b/media/mca/samples/CameraEffectsRecordingSample/java/android/media/filterfw/samples/CameraEffectsRecordingSample.java
index c0c3034..0b62bca 100644
--- a/media/mca/samples/CameraEffectsRecordingSample/java/android/media/filterfw/samples/CameraEffectsRecordingSample.java
+++ b/media/mca/samples/CameraEffectsRecordingSample/java/android/media/filterfw/samples/CameraEffectsRecordingSample.java
@@ -45,8 +45,8 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
-        mRunButton = (Button) findViewById(R.id.runbutton);
-        mCameraView = (SurfaceView) findViewById(R.id.cameraview);
+        mRunButton = findViewById(R.id.runbutton);
+        mCameraView = findViewById(R.id.cameraview);
         mRunButton.setOnClickListener(mRunButtonClick);
 
         Intent intent = getIntent();
diff --git a/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java b/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java
index 1a10d64..cce2acc 100644
--- a/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java
+++ b/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java
@@ -70,7 +70,7 @@
 
         setContentView(R.layout.bassboosttest);
 
-        mSessionText = (EditText) findViewById(R.id.sessionEdit);
+        mSessionText = findViewById(R.id.sessionEdit);
         mSessionText.setOnKeyListener(mSessionKeyListener);
 
         mSessionText.setText(Integer.toString(sSession));
diff --git a/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java b/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java
index 594e844..1731dba 100644
--- a/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java
+++ b/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java
@@ -73,9 +73,9 @@
         ToggleButton button;
         setContentView(R.layout.envreverbtest);
 
-        ImageView playPause = (ImageView) findViewById(R.id.playPause1);
-        ImageView stop = (ImageView) findViewById(R.id.stop1);
-        textView = (TextView) findViewById(R.id.sessionText);
+        ImageView playPause = findViewById(R.id.playPause1);
+        ImageView stop = findViewById(R.id.stop1);
+        textView = findViewById(R.id.sessionText);
         if (sPlayerController == null) {
             sPlayerController = new SimplePlayer(this, R.id.playPause1, playPause,
                     R.id.stop1, stop, textView,
diff --git a/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java b/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java
index f30a26f..fd56956 100644
--- a/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java
+++ b/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java
@@ -72,7 +72,7 @@
 
         setContentView(R.layout.equalizertest);
 
-        mSessionText = (EditText) findViewById(R.id.sessionEdit);
+        mSessionText = findViewById(R.id.sessionEdit);
         mSessionText.setOnKeyListener(mSessionKeyListener);
 
         mSessionText.setText(Integer.toString(sSession));
diff --git a/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java b/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java
index bb32e6f..4f2180f 100644
--- a/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java
+++ b/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java
@@ -70,7 +70,7 @@
 
         setContentView(R.layout.virtualizertest);
 
-        mSessionText = (EditText) findViewById(R.id.sessionEdit);
+        mSessionText = findViewById(R.id.sessionEdit);
         mSessionText.setOnKeyListener(mSessionKeyListener);
         mSessionText.setText(Integer.toString(sSession));
 
diff --git a/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java b/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java
index 60583e0..7db1d8d 100644
--- a/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java
+++ b/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java
@@ -72,7 +72,7 @@
 
         setContentView(R.layout.visualizertest);
 
-        mSessionText = (EditText) findViewById(R.id.sessionEdit);
+        mSessionText = findViewById(R.id.sessionEdit);
         mSessionText.setOnKeyListener(mSessionKeyListener);
         mSessionText.setText(Integer.toString(sSession));
 
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewActivity.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewActivity.java
index c3dd842..963b20d 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewActivity.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewActivity.java
@@ -43,7 +43,7 @@
         super.onCreate(savedInstanceState);
 
         setContentView(R.layout.surface_view_2);
-        mSurfaceView = (SurfaceView) findViewById(R.id.surface_view);
+        mSurfaceView = findViewById(R.id.surface_view);
         mSurfaceView.getHolder().addCallback(this);
 
         //Acquire the full wake lock to keep the device up
diff --git a/media/tests/NativeMidiDemo/java/com/example/android/nativemididemo/NativeMidi.java b/media/tests/NativeMidiDemo/java/com/example/android/nativemididemo/NativeMidi.java
index 0969b10..b0ca0bb 100644
--- a/media/tests/NativeMidiDemo/java/com/example/android/nativemididemo/NativeMidi.java
+++ b/media/tests/NativeMidiDemo/java/com/example/android/nativemididemo/NativeMidi.java
@@ -269,12 +269,12 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
 
-        mCallbackStatusTextView = (TextView) findViewById(R.id.callback_status);
-        mJavaMidiStatusTextView = (TextView) findViewById(R.id.java_midi_status);
-        mMessagesTextView = (TextView) findViewById(R.id.messages);
-        mMessagesContainer = (TouchableScrollView) findViewById(R.id.messages_scroll);
-        mMidiDevicesRadioGroup = (RadioGroup) findViewById(R.id.devices);
-        RadioButton deviceNone = (RadioButton) findViewById(R.id.device_none);
+        mCallbackStatusTextView = findViewById(R.id.callback_status);
+        mJavaMidiStatusTextView = findViewById(R.id.java_midi_status);
+        mMessagesTextView = findViewById(R.id.messages);
+        mMessagesContainer = findViewById(R.id.messages_scroll);
+        mMidiDevicesRadioGroup = findViewById(R.id.devices);
+        RadioButton deviceNone = findViewById(R.id.device_none);
         deviceNone.setOnClickListener(new MidiOutputPortSelector());
 
         AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
diff --git a/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java b/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java
index 7e21876..8427d16 100644
--- a/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java
+++ b/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java
@@ -97,8 +97,8 @@
         
         setContentView(R.layout.scoaudiotest);
 
-        mScoStateTxt = (TextView) findViewById(R.id.scoStateTxt);
-        mVdStateTxt = (TextView) findViewById(R.id.vdStateTxt);
+        mScoStateTxt = findViewById(R.id.scoStateTxt);
+        mVdStateTxt = findViewById(R.id.vdStateTxt);
 
         IntentFilter intentFilter =
             new IntentFilter(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED);
@@ -112,7 +112,7 @@
         
         mMediaControllers[0] = new SimplePlayerController(this, R.id.playPause1, R.id.stop1,
                 R.raw.sine440_mo_16b_16k, AudioManager.STREAM_BLUETOOTH_SCO);
-        TextView name = (TextView) findViewById(R.id.playPause1Text);
+        TextView name = findViewById(R.id.playPause1Text);
         name.setText("VOICE_CALL stream");
         
         mScoButton = (ToggleButton)findViewById(R.id.ForceScoButton);
@@ -135,7 +135,7 @@
         mTtsParams.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID,
                 UTTERANCE);
 
-        mSpeakText = (EditText) findViewById(R.id.speakTextEdit);        
+        mSpeakText = findViewById(R.id.speakTextEdit);
         mSpeakText.setOnKeyListener(mSpeakKeyListener);
         mSpeakText.setText("sco audio test sentence");
         mTtsToFileButton = (ToggleButton)findViewById(R.id.TtsToFileButton);
@@ -143,7 +143,7 @@
         mTtsToFile = true;
         mTtsToFileButton.setChecked(mTtsToFile);
 
-        mModeSpinner = (Spinner) findViewById(R.id.modeSpinner);
+        mModeSpinner = findViewById(R.id.modeSpinner);
         ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                 android.R.layout.simple_spinner_item, mModeStrings);
         adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
@@ -208,12 +208,12 @@
                 mForceScoOn = isChecked;
                 AudioManager mngr = mAudioManager;
                 boolean useVirtualCall = false;
-                CheckBox box = (CheckBox) findViewById(R.id.useSecondAudioManager);
+                CheckBox box = findViewById(R.id.useSecondAudioManager);
                 if (box.isChecked()) {
                     Log.i(TAG, "Using 2nd audio manager");
                     mngr = mAudioManager2;
                 }
-                box = (CheckBox) findViewById(R.id.useVirtualCallCheckBox);
+                box = findViewById(R.id.useVirtualCallCheckBox);
                 useVirtualCall = box.isChecked();
 
                 if (mForceScoOn) {
@@ -278,8 +278,8 @@
             mPlayPauseButtonId = playPausebuttonId;
             mStopButtonId = stopButtonId;
             mFileNameBase = fileName;
-            mPlayPauseButton = (ImageButton) findViewById(playPausebuttonId);
-            ImageButton stop = (ImageButton) findViewById(stopButtonId);
+            mPlayPauseButton = findViewById(playPausebuttonId);
+            ImageButton stop = findViewById(stopButtonId);
 
             mPlayPauseButton.setOnClickListener(this);
             mPlayPauseButton.requestFocus();
@@ -294,8 +294,8 @@
             mStopButtonId = stopButtonId;
             mFileNameBase = "";
             mFileResId = fileResId;
-            mPlayPauseButton = (ImageButton) findViewById(playPausebuttonId);
-            ImageButton stop = (ImageButton) findViewById(stopButtonId);
+            mPlayPauseButton = findViewById(playPausebuttonId);
+            ImageButton stop = findViewById(stopButtonId);
 
             mPlayPauseButton.setOnClickListener(this);
             mPlayPauseButton.requestFocus();
diff --git a/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java b/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java
index 7fa5736..9fa7a664 100644
--- a/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java
+++ b/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java
@@ -173,13 +173,13 @@
         setContentView(layoutId);
 
         // Same resource IDs for each layout variant (backup / restore)
-        mStatusView = (TextView) findViewById(R.id.package_name);
-        mAllowButton = (Button) findViewById(R.id.button_allow);
-        mDenyButton = (Button) findViewById(R.id.button_deny);
+        mStatusView = findViewById(R.id.package_name);
+        mAllowButton = findViewById(R.id.button_allow);
+        mDenyButton = findViewById(R.id.button_deny);
 
-        mCurPassword = (TextView) findViewById(R.id.password);
-        mEncPassword = (TextView) findViewById(R.id.enc_password);
-        TextView curPwDesc = (TextView) findViewById(R.id.password_desc);
+        mCurPassword = findViewById(R.id.password);
+        mEncPassword = findViewById(R.id.enc_password);
+        TextView curPwDesc = findViewById(R.id.password_desc);
 
         mAllowButton.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -214,7 +214,7 @@
             curPwDesc.setVisibility(View.GONE);
             mCurPassword.setVisibility(View.GONE);
             if (layoutId == R.layout.confirm_backup) {
-                TextView encPwDesc = (TextView) findViewById(R.id.enc_password_desc);
+                TextView encPwDesc = findViewById(R.id.enc_password_desc);
                 if (mIsEncrypted) {
                     encPwDesc.setText(R.string.backup_enc_password_required);
                     monitorEncryptionPassword();
diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
index 6394c64..5d20cf3 100644
--- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -117,7 +117,7 @@
         }
         mCm.registerNetworkCallback(builder.build(), mNetworkCallback);
 
-        final WebView myWebView = (WebView) findViewById(R.id.webview);
+        final WebView myWebView = findViewById(R.id.webview);
         myWebView.clearCache(true);
         WebSettings webSettings = myWebView.getSettings();
         webSettings.setJavaScriptEnabled(true);
@@ -184,7 +184,7 @@
 
     @Override
     public void onBackPressed() {
-        WebView myWebView = (WebView) findViewById(R.id.webview);
+        WebView myWebView = findViewById(R.id.webview);
         if (myWebView.canGoBack() && mWebViewClient.allowBack()) {
             myWebView.goBack();
         } else {
@@ -326,7 +326,7 @@
             // For internally generated pages, leave URL bar listing prior URL as this is the URL
             // the page refers to.
             if (!url.startsWith(INTERNAL_ASSETS)) {
-                final TextView myUrlBar = (TextView) findViewById(R.id.url_bar);
+                final TextView myUrlBar = findViewById(R.id.url_bar);
                 myUrlBar.setText(url);
             }
             testForCaptivePortal();
@@ -407,7 +407,7 @@
     private class MyWebChromeClient extends WebChromeClient {
         @Override
         public void onProgressChanged(WebView view, int newProgress) {
-            final ProgressBar myProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
+            final ProgressBar myProgressBar = findViewById(R.id.progress_bar);
             myProgressBar.setProgress(newProgress);
         }
     }
diff --git a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
index a5820f2..6276ce3 100644
--- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
+++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
@@ -91,7 +91,7 @@
         setContentView(R.layout.activity_captive_portal_login);
         getActionBar().setDisplayShowHomeEnabled(false);
 
-        mWebView = (WebView) findViewById(R.id.webview);
+        mWebView = findViewById(R.id.webview);
         mWebView.clearCache(true);
         WebSettings webSettings = mWebView.getSettings();
         webSettings.setJavaScriptEnabled(true);
@@ -113,7 +113,7 @@
 
     @Override
     public void onBackPressed() {
-        WebView myWebView = (WebView) findViewById(R.id.webview);
+        WebView myWebView = findViewById(R.id.webview);
         if (myWebView.canGoBack() && mWebViewClient.allowBack()) {
             myWebView.goBack();
         } else {
@@ -328,7 +328,7 @@
             // For internally generated pages, leave URL bar listing prior URL as this is the URL
             // the page refers to.
             if (!url.startsWith(INTERNAL_ASSETS)) {
-                final TextView myUrlBar = (TextView) findViewById(R.id.url_bar);
+                final TextView myUrlBar = findViewById(R.id.url_bar);
                 myUrlBar.setText(url);
             }
             if (mNetwork != null) {
@@ -412,7 +412,7 @@
     private class MyWebChromeClient extends WebChromeClient {
         @Override
         public void onProgressChanged(WebView view, int newProgress) {
-            final ProgressBar myProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
+            final ProgressBar myProgressBar = findViewById(R.id.progress_bar);
             myProgressBar.setProgress(newProgress);
         }
     }
diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java
index 14b9de5..76a64e5 100644
--- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java
+++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java
@@ -65,7 +65,7 @@
         } else {
             setContentView(R.layout.device_chooser);
             setTitle(Html.fromHtml(getString(R.string.chooser_title, getCallingAppName()), 0));
-            mDeviceListView = (ListView) findViewById(R.id.device_list);
+            mDeviceListView = findViewById(R.id.device_list);
             final DeviceDiscoveryService.DevicesAdapter adapter = getService().mDevicesAdapter;
             mDeviceListView.setAdapter(adapter);
             adapter.registerDataSetObserver(new DataSetObserver() {
@@ -101,7 +101,7 @@
 
     @Override
     public void setTitle(CharSequence title) {
-        final TextView titleView = (TextView) findViewById(R.id.title);
+        final TextView titleView = findViewById(R.id.title);
         final int padding = getPadding(getResources());
         titleView.setPadding(padding, padding, padding, padding);
         titleView.setText(title);
diff --git a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
index f59f0d9..689e381 100644
--- a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
+++ b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
@@ -82,7 +82,7 @@
 
         mPrefs = new PrefState(this);
         mPrefs.setListener(this);
-        final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.holder);
+        final RecyclerView recyclerView = findViewById(R.id.holder);
         mAdapter = new CatAdapter();
         recyclerView.setAdapter(mAdapter);
         recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
diff --git a/packages/Osu/src/com/android/hotspot2/app/MainActivity.java b/packages/Osu/src/com/android/hotspot2/app/MainActivity.java
index ae0a45c..7fd2238 100644
--- a/packages/Osu/src/com/android/hotspot2/app/MainActivity.java
+++ b/packages/Osu/src/com/android/hotspot2/app/MainActivity.java
@@ -123,7 +123,7 @@
         if (osuData.size() > 0) {
             noOsuView.setVisibility(View.GONE);
             osuListAdapter = new OsuListAdapter(this, osuData);
-            osuListView = (ListView) findViewById(R.id.profile_list);
+            osuListView = findViewById(R.id.profile_list);
             osuListView.setAdapter(osuListAdapter);
             osuListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                 @Override
diff --git a/packages/Osu/src/com/android/hotspot2/osu/OSUWebView.java b/packages/Osu/src/com/android/hotspot2/osu/OSUWebView.java
index afbd0d1..a6778c8 100644
--- a/packages/Osu/src/com/android/hotspot2/osu/OSUWebView.java
+++ b/packages/Osu/src/com/android/hotspot2/osu/OSUWebView.java
@@ -37,7 +37,7 @@
         setContentView(R.layout.osu_web_view);
         getActionBar().setDisplayShowHomeEnabled(false);
 
-        final WebView myWebView = (WebView) findViewById(R.id.webview);
+        final WebView myWebView = findViewById(R.id.webview);
         myWebView.clearCache(true);
         WebSettings webSettings = myWebView.getSettings();
         webSettings.setJavaScriptEnabled(true);
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
index 4cce166..ccdec62 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
@@ -1290,11 +1290,11 @@
     private void bindUi() {
         // Summary
         mSummaryContainer = findViewById(R.id.summary_content);
-        mSummaryCopies = (TextView) findViewById(R.id.copies_count_summary);
-        mSummaryPaperSize = (TextView) findViewById(R.id.paper_size_summary);
+        mSummaryCopies = findViewById(R.id.copies_count_summary);
+        mSummaryPaperSize = findViewById(R.id.paper_size_summary);
 
         // Options container
-        mOptionsContent = (PrintContentView) findViewById(R.id.options_content);
+        mOptionsContent = findViewById(R.id.options_content);
         mOptionsContent.setOptionsStateChangeListener(this);
         mOptionsContent.setOpenOptionsController(this);
 
@@ -1302,7 +1302,7 @@
         OnClickListener clickListener = new MyClickListener();
 
         // Copies
-        mCopiesEditText = (EditText) findViewById(R.id.copies_edittext);
+        mCopiesEditText = findViewById(R.id.copies_edittext);
         mCopiesEditText.setOnFocusChangeListener(mSelectAllOnFocusListener);
         mCopiesEditText.setText(MIN_COPIES_STRING);
         mCopiesEditText.setSelection(mCopiesEditText.getText().length());
@@ -1311,28 +1311,28 @@
         // Destination.
         mPrintersObserver = new PrintersObserver();
         mDestinationSpinnerAdapter.registerDataSetObserver(mPrintersObserver);
-        mDestinationSpinner = (Spinner) findViewById(R.id.destination_spinner);
+        mDestinationSpinner = findViewById(R.id.destination_spinner);
         mDestinationSpinner.setAdapter(mDestinationSpinnerAdapter);
         mDestinationSpinner.setOnItemSelectedListener(itemSelectedListener);
 
         // Media size.
         mMediaSizeSpinnerAdapter = new ArrayAdapter<>(
                 this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1);
-        mMediaSizeSpinner = (Spinner) findViewById(R.id.paper_size_spinner);
+        mMediaSizeSpinner = findViewById(R.id.paper_size_spinner);
         mMediaSizeSpinner.setAdapter(mMediaSizeSpinnerAdapter);
         mMediaSizeSpinner.setOnItemSelectedListener(itemSelectedListener);
 
         // Color mode.
         mColorModeSpinnerAdapter = new ArrayAdapter<>(
                 this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1);
-        mColorModeSpinner = (Spinner) findViewById(R.id.color_spinner);
+        mColorModeSpinner = findViewById(R.id.color_spinner);
         mColorModeSpinner.setAdapter(mColorModeSpinnerAdapter);
         mColorModeSpinner.setOnItemSelectedListener(itemSelectedListener);
 
         // Duplex mode.
         mDuplexModeSpinnerAdapter = new ArrayAdapter<>(
                 this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1);
-        mDuplexModeSpinner = (Spinner) findViewById(R.id.duplex_spinner);
+        mDuplexModeSpinner = findViewById(R.id.duplex_spinner);
         mDuplexModeSpinner.setAdapter(mDuplexModeSpinnerAdapter);
         mDuplexModeSpinner.setOnItemSelectedListener(itemSelectedListener);
 
@@ -1345,32 +1345,32 @@
                 ORIENTATION_PORTRAIT, orientationLabels[0]));
         mOrientationSpinnerAdapter.add(new SpinnerItem<>(
                 ORIENTATION_LANDSCAPE, orientationLabels[1]));
-        mOrientationSpinner = (Spinner) findViewById(R.id.orientation_spinner);
+        mOrientationSpinner = findViewById(R.id.orientation_spinner);
         mOrientationSpinner.setAdapter(mOrientationSpinnerAdapter);
         mOrientationSpinner.setOnItemSelectedListener(itemSelectedListener);
 
         // Range options
         ArrayAdapter<SpinnerItem<Integer>> rangeOptionsSpinnerAdapter = new ArrayAdapter<>(
                 this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1);
-        mRangeOptionsSpinner = (Spinner) findViewById(R.id.range_options_spinner);
+        mRangeOptionsSpinner = findViewById(R.id.range_options_spinner);
         mRangeOptionsSpinner.setAdapter(rangeOptionsSpinnerAdapter);
         mRangeOptionsSpinner.setOnItemSelectedListener(itemSelectedListener);
         updatePageRangeOptions(PrintDocumentInfo.PAGE_COUNT_UNKNOWN);
 
         // Page range
-        mPageRangeTitle = (TextView) findViewById(R.id.page_range_title);
-        mPageRangeEditText = (EditText) findViewById(R.id.page_range_edittext);
+        mPageRangeTitle = findViewById(R.id.page_range_title);
+        mPageRangeEditText = findViewById(R.id.page_range_edittext);
         mPageRangeEditText.setVisibility(View.GONE);
         mPageRangeTitle.setVisibility(View.GONE);
         mPageRangeEditText.setOnFocusChangeListener(mSelectAllOnFocusListener);
         mPageRangeEditText.addTextChangedListener(new RangeTextWatcher());
 
         // Advanced options button.
-        mMoreOptionsButton = (Button) findViewById(R.id.more_options_button);
+        mMoreOptionsButton = findViewById(R.id.more_options_button);
         mMoreOptionsButton.setOnClickListener(clickListener);
 
         // Print button
-        mPrintButton = (ImageView) findViewById(R.id.print_button);
+        mPrintButton = findViewById(R.id.print_button);
         mPrintButton.setOnClickListener(clickListener);
 
         // The UI is now initialized
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java
index 6f0caa2..a9a6cbd 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java
@@ -134,7 +134,7 @@
                 LOADER_ID_PRINT_REGISTRY_INT);
 
         // Hook up the list view.
-        mListView = (ListView) findViewById(android.R.id.list);
+        mListView = findViewById(android.R.id.list);
         final DestinationAdapter adapter = new DestinationAdapter();
         adapter.registerDataSetObserver(new DataSetObserver() {
             @Override
@@ -411,7 +411,7 @@
             View emptyView = findViewById(R.id.empty_print_state);
             mListView.setEmptyView(emptyView);
         }
-        TextView titleView = (TextView) findViewById(R.id.title);
+        TextView titleView = findViewById(R.id.title);
         View progressBar = findViewById(R.id.progress_bar);
         if (mEnabledPrintServices.size() == 0) {
             titleView.setText(R.string.print_no_print_services);
diff --git a/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java b/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java
index 0bb4bfa..8b00ed0 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java
@@ -136,12 +136,12 @@
     @Override
     protected void onFinishInflate() {
         mStaticContent = findViewById(R.id.static_content);
-        mSummaryContent = (ViewGroup) findViewById(R.id.summary_content);
+        mSummaryContent = findViewById(R.id.summary_content);
         mDynamicContent = findViewById(R.id.dynamic_content);
         mDraggableContent = findViewById(R.id.draggable_content);
         mPrintButton = findViewById(R.id.print_button);
         mMoreOptionsButton = findViewById(R.id.more_options_button);
-        mOptionsContainer = (ViewGroup) findViewById(R.id.options_container);
+        mOptionsContainer = findViewById(R.id.options_container);
         mEmbeddedContentContainer = findViewById(R.id.embedded_content_container);
         mEmbeddedContentScrim = findViewById(R.id.embedded_content_scrim);
         mExpandCollapseHandle = findViewById(R.id.expand_collapse_handle);
diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java b/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java
index c6a45bc..e2c05a1 100644
--- a/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java
+++ b/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java
@@ -35,15 +35,15 @@
     public UsageView(Context context, AttributeSet attrs) {
         super(context, attrs);
         LayoutInflater.from(context).inflate(R.layout.usage_view, this);
-        mUsageGraph = (UsageGraph) findViewById(R.id.usage_graph);
+        mUsageGraph = findViewById(R.id.usage_graph);
         mLabels = new TextView[] {
-                (TextView) findViewById(R.id.label_bottom),
-                (TextView) findViewById(R.id.label_middle),
-                (TextView) findViewById(R.id.label_top),
+                findViewById(R.id.label_bottom),
+                findViewById(R.id.label_middle),
+                findViewById(R.id.label_top),
         };
         mBottomLabels = new TextView[] {
-                (TextView) findViewById(R.id.label_start),
-                (TextView) findViewById(R.id.label_end),
+                findViewById(R.id.label_start),
+                findViewById(R.id.label_end),
         };
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.UsageView, 0, 0);
         if (a.hasValue(R.styleable.UsageView_sideLabels)) {
@@ -64,15 +64,15 @@
         if (a.hasValue(R.styleable.UsageView_android_gravity)) {
             int gravity = a.getInt(R.styleable.UsageView_android_gravity, 0);
             if (gravity == Gravity.END) {
-                LinearLayout layout = (LinearLayout) findViewById(R.id.graph_label_group);
-                LinearLayout labels = (LinearLayout) findViewById(R.id.label_group);
+                LinearLayout layout = findViewById(R.id.graph_label_group);
+                LinearLayout labels = findViewById(R.id.label_group);
                 // Swap the children order.
                 layout.removeView(labels);
                 layout.addView(labels);
                 // Set gravity.
                 labels.setGravity(Gravity.END);
                 // Swap the bottom space order.
-                LinearLayout bottomLabels = (LinearLayout) findViewById(R.id.bottom_label_group);
+                LinearLayout bottomLabels = findViewById(R.id.bottom_label_group);
                 View bottomSpace = bottomLabels.findViewById(R.id.bottom_label_space);
                 bottomLabels.removeView(bottomSpace);
                 bottomLabels.addView(bottomSpace);
diff --git a/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java b/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java
index 0a89d9b..e98ef06 100644
--- a/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java
+++ b/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java
@@ -37,8 +37,8 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mCarrierText = (CarrierText) findViewById(R.id.carrier_text);
-        mEmergencyButton = (EmergencyButton) findViewById(R.id.emergency_call_button);
+        mCarrierText = findViewById(R.id.carrier_text);
+        mEmergencyButton = findViewById(R.id.emergency_call_button);
 
         // The emergency button overlaps the carrier text, only noticeable when highlighted.
         // So temporarily hide the carrier text while the emergency button is pressed.
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
index 5aa673b..abc3b94 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
@@ -98,7 +98,7 @@
         mSecurityMessageDisplay = KeyguardMessageArea.findSecurityMessageDisplay(this);
         mEcaView = findViewById(R.id.keyguard_selector_fade_container);
 
-        EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button);
+        EmergencyButton button = findViewById(R.id.emergency_call_button);
         if (button != null) {
             button.setCallback(this);
         }
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java
index dd5544d..27a3f7d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java
@@ -143,7 +143,7 @@
     @Override
     protected void onFinishInflate() {
         mSecurityContainer =
-                (KeyguardSecurityContainer) findViewById(R.id.keyguard_security_container);
+                findViewById(R.id.keyguard_security_container);
         mLockPatternUtils = new LockPatternUtils(mContext);
         mSecurityContainer.setLockPatternUtils(mLockPatternUtils);
         mSecurityContainer.setSecurityCallback(this);
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
index 590d8d5..c1cff9e 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
@@ -79,11 +79,11 @@
     protected void onFinishInflate() {
         super.onFinishInflate();
 
-        mContainer = (ViewGroup) findViewById(R.id.container);
-        mRow0 = (ViewGroup) findViewById(R.id.row0);
-        mRow1 = (ViewGroup) findViewById(R.id.row1);
-        mRow2 = (ViewGroup) findViewById(R.id.row2);
-        mRow3 = (ViewGroup) findViewById(R.id.row3);
+        mContainer = findViewById(R.id.container);
+        mRow0 = findViewById(R.id.row0);
+        mRow1 = findViewById(R.id.row1);
+        mRow2 = findViewById(R.id.row2);
+        mRow3 = findViewById(R.id.row3);
         mDivider = findViewById(R.id.divider);
         mViews = new View[][]{
                 new View[]{
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
index d49ff97..b6184a8 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
@@ -174,7 +174,7 @@
         mImm = (InputMethodManager) getContext().getSystemService(
                 Context.INPUT_METHOD_SERVICE);
 
-        mPasswordEntry = (TextView) findViewById(getPasswordTextViewId());
+        mPasswordEntry = findViewById(getPasswordTextViewId());
         mPasswordEntryDisabler = new TextViewInputDisabler(mPasswordEntry);
         mPasswordEntry.setKeyListener(TextKeyListener.getInstance());
         mPasswordEntry.setInputType(InputType.TYPE_CLASS_TEXT
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
index c2b57ff..3c9a6b9 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
@@ -140,7 +140,7 @@
         mLockPatternUtils = mLockPatternUtils == null
                 ? new LockPatternUtils(mContext) : mLockPatternUtils;
 
-        mLockPatternView = (LockPatternView) findViewById(R.id.lockPatternView);
+        mLockPatternView = findViewById(R.id.lockPatternView);
         mLockPatternView.setSaveEnabled(false);
         mLockPatternView.setOnPatternListener(new UnlockPatternListener());
 
@@ -150,9 +150,9 @@
         mSecurityMessageDisplay =
                 (KeyguardMessageArea) KeyguardMessageArea.findSecurityMessageDisplay(this);
         mEcaView = findViewById(R.id.keyguard_selector_fade_container);
-        mContainer = (ViewGroup) findViewById(R.id.container);
+        mContainer = findViewById(R.id.container);
 
-        EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button);
+        EmergencyButton button = findViewById(R.id.emergency_call_button);
         if (button != null) {
             button.setCallback(this);
         }
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
index 108b466..c04ae68 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
@@ -171,7 +171,7 @@
 
     @Override
     protected void onFinishInflate() {
-        mPasswordEntry = (PasswordTextView) findViewById(getPasswordTextViewId());
+        mPasswordEntry = findViewById(getPasswordTextViewId());
         mPasswordEntry.setOnKeyListener(this);
 
         // Set selected property on so the view can send accessibility events.
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
index 8cdb906..b447979 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -160,7 +160,7 @@
     }
 
     protected void onFinishInflate() {
-        mSecurityViewFlipper = (KeyguardSecurityViewFlipper) findViewById(R.id.view_flipper);
+        mSecurityViewFlipper = findViewById(R.id.view_flipper);
         mSecurityViewFlipper.setLockPatternUtils(mLockPatternUtils);
     }
 
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
index 839d3ce..0cf8900 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
@@ -144,7 +144,7 @@
         if (mEcaView instanceof EmergencyCarrierArea) {
             ((EmergencyCarrierArea) mEcaView).setCarrierTextVisible(true);
         }
-        mSimImageView = (ImageView) findViewById(R.id.keyguard_sim);
+        mSimImageView = findViewById(R.id.keyguard_sim);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java
index 3871448..fb3cee7 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java
@@ -187,7 +187,7 @@
         if (mEcaView instanceof EmergencyCarrierArea) {
             ((EmergencyCarrierArea) mEcaView).setCarrierTextVisible(true);
         }
-        mSimImageView = (ImageView) findViewById(R.id.keyguard_sim);
+        mSimImageView = findViewById(R.id.keyguard_sim);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
index b2b0ee4..162faa5 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
@@ -115,14 +115,14 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mClockContainer = (ViewGroup) findViewById(R.id.keyguard_clock_container);
-        mAlarmStatusView = (TextView) findViewById(R.id.alarm_status);
-        mDateView = (TextClock) findViewById(R.id.date_view);
-        mClockView = (TextClock) findViewById(R.id.clock_view);
+        mClockContainer = findViewById(R.id.keyguard_clock_container);
+        mAlarmStatusView = findViewById(R.id.alarm_status);
+        mDateView = findViewById(R.id.date_view);
+        mClockView = findViewById(R.id.clock_view);
         mDateView.setShowCurrentUserTime(true);
         mClockView.setShowCurrentUserTime(true);
-        mOwnerInfo = (TextView) findViewById(R.id.owner_info);
-        mBatteryDoze = (ChargingView) findViewById(R.id.battery_doze);
+        mOwnerInfo = findViewById(R.id.owner_info);
+        mBatteryDoze = findViewById(R.id.battery_doze);
         mVisibleInDoze = new View[]{mBatteryDoze, mClockView};
 
         boolean shouldMarquee = KeyguardUpdateMonitor.getInstance(mContext).isDeviceInteractive();
diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java b/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java
index abcf27d..1d032e8 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java
@@ -137,7 +137,7 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mLogo = (ImageView) findViewById(R.id.search_logo);
+        mLogo = findViewById(R.id.search_logo);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/egg/MLandActivity.java b/packages/SystemUI/src/com/android/systemui/egg/MLandActivity.java
index cdda45f..f06ea45 100644
--- a/packages/SystemUI/src/com/android/systemui/egg/MLandActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/egg/MLandActivity.java
@@ -30,8 +30,8 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.mland);
-        mLand = (MLand) findViewById(R.id.world);
-        mLand.setScoreFieldHolder((ViewGroup) findViewById(R.id.scores));
+        mLand = findViewById(R.id.world);
+        mLand.setScoreFieldHolder(findViewById(R.id.scores));
         final View welcome = findViewById(R.id.welcome);
         mLand.setSplash(welcome);
         final int numControllers = mLand.getGameControllers().size();
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java
index c06e56a..9c4f16b 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java
@@ -188,10 +188,10 @@
         mDismissButton.setOnClickListener((v) -> {
             dismissPip();
         });
-        mActionsGroup = (LinearLayout) findViewById(R.id.actions_group);
+        mActionsGroup = findViewById(R.id.actions_group);
         mBetweenActionPaddingLand = getResources().getDimensionPixelSize(
                 R.dimen.pip_between_action_padding_land);
-        mExpandButton = (ImageView) findViewById(R.id.expand_button);
+        mExpandButton = findViewById(R.id.expand_button);
 
         updateFromIntent(getIntent());
         setTitle(R.string.pip_menu_title);
@@ -392,8 +392,8 @@
     }
 
     private void updateActionViews(Rect stackBounds) {
-        ViewGroup expandContainer = (ViewGroup) findViewById(R.id.expand_container);
-        ViewGroup actionsContainer = (ViewGroup) findViewById(R.id.actions_container);
+        ViewGroup expandContainer = findViewById(R.id.expand_container);
+        ViewGroup actionsContainer = findViewById(R.id.actions_container);
         actionsContainer.setOnTouchListener((v, ev) -> {
             // Do nothing, prevent click through to parent
             return true;
diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlButtonView.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlButtonView.java
index 59cb086..40a63d7 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlButtonView.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlButtonView.java
@@ -77,9 +77,9 @@
                 .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         inflater.inflate(R.layout.tv_pip_control_button, this);
 
-        mIconImageView = (ImageView) findViewById(R.id.icon);
-        mButtonImageView = (ImageView) findViewById(R.id.button);
-        mDescriptionTextView = (TextView) findViewById(R.id.desc);
+        mIconImageView = findViewById(R.id.icon);
+        mButtonImageView = findViewById(R.id.button);
+        mDescriptionTextView = findViewById(R.id.desc);
 
         int[] values = new int[] {android.R.attr.src, android.R.attr.text};
         TypedArray typedArray =
diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsView.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsView.java
index a2aff2d..4c81907 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsView.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsView.java
@@ -107,7 +107,7 @@
     public void onFinishInflate() {
         super.onFinishInflate();
 
-        mFullButtonView = (PipControlButtonView) findViewById(R.id.full_button);
+        mFullButtonView = findViewById(R.id.full_button);
         mFullButtonView.setOnFocusChangeListener(mFocusChangeListener);
         mFullButtonView.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -116,7 +116,7 @@
             }
         });
 
-        mCloseButtonView = (PipControlButtonView) findViewById(R.id.close_button);
+        mCloseButtonView = findViewById(R.id.close_button);
         mCloseButtonView.setOnFocusChangeListener(mFocusChangeListener);
         mCloseButtonView.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -128,7 +128,7 @@
             }
         });
 
-        mPlayPauseButtonView = (PipControlButtonView) findViewById(R.id.play_pause_button);
+        mPlayPauseButtonView = findViewById(R.id.play_pause_button);
         mPlayPauseButtonView.setOnFocusChangeListener(mFocusChangeListener);
         mPlayPauseButtonView.setOnClickListener(new View.OnClickListener() {
             @Override
diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java
index 01d86b6..9945079 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java
@@ -44,7 +44,7 @@
         mPipManager.addListener(this);
 
         mRestorePipSizeWhenClose = true;
-        mPipControlsView = (PipControlsView) findViewById(R.id.pip_controls);
+        mPipControlsView = findViewById(R.id.pip_controls);
         mFadeInAnimation = AnimatorInflater.loadAnimator(
                 this, R.anim.tv_pip_menu_fade_in_animation);
         mFadeInAnimation.setTarget(mPipControlsView);
diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipOnboardingActivity.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipOnboardingActivity.java
index 57952f4..423530a 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipOnboardingActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipOnboardingActivity.java
@@ -65,7 +65,7 @@
         mEnterAnimator.addListener(new AnimatorListenerAdapter() {
             @Override
             public void onAnimationStart(Animator animation) {
-                ImageView button = (ImageView) findViewById(R.id.remote_button);
+                ImageView button = findViewById(R.id.remote_button);
                 ((AnimationDrawable) button.getDrawable()).start();
             }
         });
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java
index d2a2919..f124e86 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java
@@ -92,14 +92,14 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mDetailContent = (ViewGroup) findViewById(android.R.id.content);
-        mDetailSettingsButton = (TextView) findViewById(android.R.id.button2);
-        mDetailDoneButton = (TextView) findViewById(android.R.id.button1);
+        mDetailContent = findViewById(android.R.id.content);
+        mDetailSettingsButton = findViewById(android.R.id.button2);
+        mDetailDoneButton = findViewById(android.R.id.button1);
 
         mQsDetailHeader = findViewById(R.id.qs_detail_header);
         mQsDetailHeaderTitle = (TextView) mQsDetailHeader.findViewById(android.R.id.title);
         mQsDetailHeaderSwitch = (Switch) mQsDetailHeader.findViewById(android.R.id.toggle);
-        mQsDetailHeaderProgress = (ImageView) findViewById(R.id.qs_detail_header_progress);
+        mQsDetailHeaderProgress = findViewById(R.id.qs_detail_header_progress);
 
         updateDetailText();
 
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java
index efc0668..f91aa9a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java
@@ -76,7 +76,7 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mItemList = (AutoSizingList) findViewById(android.R.id.list);
+        mItemList = findViewById(android.R.id.list);
         mItemList.setVisibility(GONE);
         mItemList.setAdapter(mAdapter);
         mEmpty = findViewById(android.R.id.empty);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
index 596d3bc..30053e3 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
@@ -82,7 +82,7 @@
 
         LayoutInflater.from(getContext()).inflate(R.layout.qs_customize_panel_content, this);
 
-        mToolbar = (Toolbar) findViewById(com.android.internal.R.id.action_bar);
+        mToolbar = findViewById(com.android.internal.R.id.action_bar);
         TypedValue value = new TypedValue();
         mContext.getTheme().resolveAttribute(android.R.attr.homeAsUpIndicator, value, true);
         mToolbar.setNavigationIcon(
@@ -98,7 +98,7 @@
                 mContext.getString(com.android.internal.R.string.reset));
         mToolbar.setTitle(R.string.qs_edit);
 
-        mRecyclerView = (RecyclerView) findViewById(android.R.id.list);
+        mRecyclerView = findViewById(android.R.id.list);
         mTileAdapter = new TileAdapter(getContext());
         mRecyclerView.setAdapter(mTileAdapter);
         mTileAdapter.getItemTouchHelper().attachToRecyclerView(mRecyclerView);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java
index 9cd79f8..7224ae6 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java
@@ -98,21 +98,21 @@
             usageColor = Utils.getColorAccent(mContext);
         }
 
-        final TextView title = (TextView) findViewById(android.R.id.title);
+        final TextView title = findViewById(android.R.id.title);
         title.setText(titleId);
-        final TextView usage = (TextView) findViewById(R.id.usage_text);
+        final TextView usage = findViewById(R.id.usage_text);
         usage.setText(formatBytes(bytes));
         usage.setTextColor(usageColor);
-        final DataUsageGraph graph = (DataUsageGraph) findViewById(R.id.usage_graph);
+        final DataUsageGraph graph = findViewById(R.id.usage_graph);
         graph.setLevels(info.limitLevel, info.warningLevel, info.usageLevel);
-        final TextView carrier = (TextView) findViewById(R.id.usage_carrier_text);
+        final TextView carrier = findViewById(R.id.usage_carrier_text);
         carrier.setText(info.carrier);
-        final TextView period = (TextView) findViewById(R.id.usage_period_text);
+        final TextView period = findViewById(R.id.usage_period_text);
         period.setText(info.period);
-        final TextView infoTop = (TextView) findViewById(R.id.usage_info_top_text);
+        final TextView infoTop = findViewById(R.id.usage_info_top_text);
         infoTop.setVisibility(top != null ? View.VISIBLE : View.GONE);
         infoTop.setText(top);
-        final TextView infoBottom = (TextView) findViewById(R.id.usage_info_bottom_text);
+        final TextView infoBottom = findViewById(R.id.usage_info_bottom_text);
         infoBottom.setVisibility(bottom != null ? View.VISIBLE : View.GONE);
         infoBottom.setText(bottom);
         boolean showLevel = info.warningLevel > 0 || info.limitLevel > 0;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailItemView.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailItemView.java
index c485a9e..1e9a618 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailItemView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailItemView.java
@@ -117,8 +117,8 @@
 
     @Override
     protected void onFinishInflate() {
-        mAvatar = (UserAvatarView) findViewById(R.id.user_picture);
-        mName = (TextView) findViewById(R.id.user_name);
+        mAvatar = findViewById(R.id.user_picture);
+        mName = findViewById(R.id.user_name);
         if (mRegularTypeface == null) {
             mRegularTypeface = mName.getTypeface();
         }
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index f0a9bc3..143d934 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -325,7 +325,7 @@
         // Set the Recents layout
         setContentView(R.layout.recents);
         takeKeyEvents(true);
-        mRecentsView = (RecentsView) findViewById(R.id.recents_view);
+        mRecentsView = findViewById(R.id.recents_view);
         mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
                 View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
                 View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
index b8be580..e34987b 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
@@ -222,8 +222,8 @@
     @Override
     protected void onFinishInflate() {
         // Bind the views
-        mHeaderView = (TaskViewHeader) findViewById(R.id.task_view_bar);
-        mThumbnailView = (TaskViewThumbnail) findViewById(R.id.task_view_thumbnail);
+        mHeaderView = findViewById(R.id.task_view_bar);
+        mThumbnailView = findViewById(R.id.task_view_thumbnail);
         mThumbnailView.updateClipToTaskBar(mHeaderView);
         mActionButtonView = findViewById(R.id.lock_to_app_fab);
         mActionButtonView.setOutlineProvider(new ViewOutlineProvider() {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
index 311f8ff..ae922fc 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
@@ -244,12 +244,12 @@
         SystemServicesProxy ssp = Recents.getSystemServices();
 
         // Initialize the icon and description views
-        mIconView = (ImageView) findViewById(R.id.icon);
+        mIconView = findViewById(R.id.icon);
         mIconView.setOnLongClickListener(this);
-        mTitleView = (TextView) findViewById(R.id.title);
-        mDismissButton = (ImageView) findViewById(R.id.dismiss_task);
+        mTitleView = findViewById(R.id.title);
+        mDismissButton = findViewById(R.id.dismiss_task);
         if (ssp.hasFreeformWorkspaceSupport()) {
-            mMoveTaskButton = (ImageView) findViewById(R.id.move_task);
+            mMoveTaskButton = findViewById(R.id.move_task);
         }
 
         onConfigurationChanged();
diff --git a/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java b/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java
index 7d847a3..6918a63 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java
@@ -54,8 +54,8 @@
                 R.layout.quick_settings_brightness_dialog, null);
         setContentView(v);
 
-        final ImageView icon = (ImageView) findViewById(R.id.brightness_icon);
-        final ToggleSliderView slider = (ToggleSliderView) findViewById(R.id.brightness_slider);
+        final ImageView icon = findViewById(R.id.brightness_icon);
+        final ToggleSliderView slider = findViewById(R.id.brightness_slider);
         mBrightnessController = new BrightnessController(this, icon, slider);
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/settings/ToggleSliderView.java b/packages/SystemUI/src/com/android/systemui/settings/ToggleSliderView.java
index afe89ec..5b234e9 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/ToggleSliderView.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/ToggleSliderView.java
@@ -60,13 +60,13 @@
         final TypedArray a = context.obtainStyledAttributes(
                 attrs, R.styleable.ToggleSliderView, defStyle, 0);
 
-        mToggle = (CompoundButton) findViewById(R.id.toggle);
+        mToggle = findViewById(R.id.toggle);
         mToggle.setOnCheckedChangeListener(mCheckListener);
 
-        mSlider = (ToggleSeekBar) findViewById(R.id.slider);
+        mSlider = findViewById(R.id.slider);
         mSlider.setOnSeekBarChangeListener(mSeekListener);
 
-        mLabel = (TextView) findViewById(R.id.label);
+        mLabel = findViewById(R.id.label);
         mLabel.setText(a.getString(R.styleable.ToggleSliderView_text));
 
         mSlider.setAccessibilityLabel(getContentDescription().toString());
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
index c48ecdb..da56e62 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
@@ -269,9 +269,9 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mHandle = (DividerHandleView) findViewById(R.id.docked_divider_handle);
+        mHandle = findViewById(R.id.docked_divider_handle);
         mBackground = findViewById(R.id.docked_divider_background);
-        mMinimizedShadow = (MinimizedDockShadow) findViewById(R.id.minimized_dock_shadow);
+        mMinimizedShadow = findViewById(R.id.minimized_dock_shadow);
         mHandle.setOnTouchListener(this);
         mDividerWindowWidth = getResources().getDimensionPixelSize(
                 com.android.internal.R.dimen.docked_stack_divider_thickness);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
index d4997ea..469f3ad 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java
@@ -203,10 +203,10 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mBackgroundNormal = (NotificationBackgroundView) findViewById(R.id.backgroundNormal);
-        mFakeShadow = (FakeShadowView) findViewById(R.id.fake_shadow);
+        mBackgroundNormal = findViewById(R.id.backgroundNormal);
+        mFakeShadow = findViewById(R.id.fake_shadow);
         mShadowHidden = mFakeShadow.getVisibility() != VISIBLE;
-        mBackgroundDimmed = (NotificationBackgroundView) findViewById(R.id.backgroundDimmed);
+        mBackgroundDimmed = findViewById(R.id.backgroundDimmed);
         mBackgroundNormal.setCustomBackground(R.drawable.notification_material_bg);
         mBackgroundDimmed.setCustomBackground(R.drawable.notification_material_bg_dim);
         updateBackground();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutAppItemLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutAppItemLayout.java
index 507b665..5377dee 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutAppItemLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutAppItemLayout.java
@@ -44,8 +44,8 @@
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY) {
-            ImageView shortcutIcon = (ImageView) findViewById(R.id.keyboard_shortcuts_icon);
-            TextView shortcutKeyword = (TextView) findViewById(R.id.keyboard_shortcuts_keyword);
+            ImageView shortcutIcon = findViewById(R.id.keyboard_shortcuts_icon);
+            TextView shortcutKeyword = findViewById(R.id.keyboard_shortcuts_keyword);
             int totalMeasuredWidth = MeasureSpec.getSize(widthMeasureSpec);
             int totalPadding = getPaddingLeft() + getPaddingRight();
             int availableWidth = totalMeasuredWidth - totalPadding;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java
index fab4e59..7928575 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java
@@ -151,7 +151,7 @@
                 pkg, mAppUid, false /* includeDeleted */);
 
         String channelsDescText;
-        mNumChannelsView = (TextView) (findViewById(R.id.num_channels_desc));
+        mNumChannelsView = findViewById(R.id.num_channels_desc);
         if (isSingleDefaultChannel) {
             channelsDescText = mContext.getString(R.string.notification_default_channel_desc);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index 51345c2..b134fc5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -79,7 +79,7 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mShelfIcons = (NotificationIconContainer) findViewById(R.id.content);
+        mShelfIcons = findViewById(R.id.content);
         mShelfIcons.setClipChildren(false);
         mShelfIcons.setClipToPadding(false);
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java
index 0de3e02..4a3f112 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java
@@ -63,9 +63,9 @@
         createOptionViews();
 
         // Snackbar
-        mSelectedOptionText = (TextView) findViewById(R.id.snooze_option_default);
+        mSelectedOptionText = findViewById(R.id.snooze_option_default);
         mSelectedOptionText.setOnClickListener(this);
-        mUndoButton = (TextView) findViewById(R.id.undo);
+        mUndoButton = findViewById(R.id.undo);
         mUndoButton.setOnClickListener(this);
 
         // Default to first option in list
@@ -102,7 +102,7 @@
     }
 
     private void createOptionViews() {
-        mSnoozeOptionView = (ViewGroup) findViewById(R.id.snooze_options);
+        mSnoozeOptionView = findViewById(R.id.snooze_options);
         mSnoozeOptionView.removeAllViews();
         mSnoozeOptionView.setVisibility(View.GONE);
         final Resources res = getResources();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index c5e1438..d5f0e7c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -177,22 +177,22 @@
     protected void onFinishInflate() {
         super.onFinishInflate();
 
-        mVpn            = (ImageView) findViewById(R.id.vpn);
-        mEthernetGroup  = (ViewGroup) findViewById(R.id.ethernet_combo);
-        mEthernet       = (ImageView) findViewById(R.id.ethernet);
-        mEthernetDark   = (ImageView) findViewById(R.id.ethernet_dark);
-        mWifiGroup      = (ViewGroup) findViewById(R.id.wifi_combo);
-        mWifi           = (ImageView) findViewById(R.id.wifi_signal);
-        mWifiDark       = (ImageView) findViewById(R.id.wifi_signal_dark);
-        mWifiActivityIn = (ImageView) findViewById(R.id.wifi_in);
-        mWifiActivityOut= (ImageView) findViewById(R.id.wifi_out);
-        mAirplane       = (ImageView) findViewById(R.id.airplane);
-        mNoSims         = (ImageView) findViewById(R.id.no_sims);
-        mNoSimsDark     = (ImageView) findViewById(R.id.no_sims_dark);
+        mVpn            = findViewById(R.id.vpn);
+        mEthernetGroup  = findViewById(R.id.ethernet_combo);
+        mEthernet       = findViewById(R.id.ethernet);
+        mEthernetDark   = findViewById(R.id.ethernet_dark);
+        mWifiGroup      = findViewById(R.id.wifi_combo);
+        mWifi           = findViewById(R.id.wifi_signal);
+        mWifiDark       = findViewById(R.id.wifi_signal_dark);
+        mWifiActivityIn = findViewById(R.id.wifi_in);
+        mWifiActivityOut= findViewById(R.id.wifi_out);
+        mAirplane       = findViewById(R.id.airplane);
+        mNoSims         = findViewById(R.id.no_sims);
+        mNoSimsDark     = findViewById(R.id.no_sims_dark);
         mNoSimsCombo    =             findViewById(R.id.no_sims_combo);
         mWifiAirplaneSpacer =         findViewById(R.id.wifi_airplane_spacer);
         mWifiSignalSpacer =           findViewById(R.id.wifi_signal_spacer);
-        mMobileSignalGroup = (LinearLayout) findViewById(R.id.mobile_signal_group);
+        mMobileSignalGroup = findViewById(R.id.mobile_signal_group);
 
         maybeScaleVpnAndNoSimsIcons();
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java
index d530759..6cbbd6c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java
@@ -40,8 +40,8 @@
 
     @Override
     public void onFinishInflate() {
-        mNavButtons = (LinearLayout) findViewById(R.id.nav_buttons);
-        mLightsOutButtons = (LinearLayout) findViewById(R.id.lights_out);
+        mNavButtons = findViewById(R.id.nav_buttons);
+        mLightsOutButtons = findViewById(R.id.lights_out);
     }
 
     public void addButton(CarNavigationButton button, CarNavigationButton lightsOutButton){
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java
index f46fc67..2de358f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java
@@ -41,13 +41,13 @@
     @Override
     public void onFinishInflate() {
         super.onFinishInflate();
-        mIcon = (AlphaOptimizedImageButton) findViewById(R.id.car_nav_button_icon);
+        mIcon = findViewById(R.id.car_nav_button_icon);
         mIcon.setScaleType(ImageView.ScaleType.CENTER);
         mIcon.setClickable(false);
         mIcon.setBackgroundColor(android.R.color.transparent);
         mIcon.setAlpha(UNSELECTED_ALPHA);
 
-        mMoreIcon = (AlphaOptimizedImageButton) findViewById(R.id.car_nav_button_more_icon);
+        mMoreIcon = findViewById(R.id.car_nav_button_more_icon);
         mMoreIcon.setClickable(false);
         mMoreIcon.setBackgroundColor(android.R.color.transparent);
         mMoreIcon.setVisibility(INVISIBLE);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index 9a49d67..41a60e2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -227,14 +227,14 @@
     protected void onFinishInflate() {
         super.onFinishInflate();
         mLockPatternUtils = new LockPatternUtils(mContext);
-        mPreviewContainer = (ViewGroup) findViewById(R.id.preview_container);
-        mRightAffordanceView = (KeyguardAffordanceView) findViewById(R.id.camera_button);
-        mLeftAffordanceView = (KeyguardAffordanceView) findViewById(R.id.left_button);
-        mLockIcon = (LockIcon) findViewById(R.id.lock_icon);
-        mIndicationArea = (ViewGroup) findViewById(R.id.keyguard_indication_area);
-        mEnterpriseDisclosure = (TextView) findViewById(
+        mPreviewContainer = findViewById(R.id.preview_container);
+        mRightAffordanceView = findViewById(R.id.camera_button);
+        mLeftAffordanceView = findViewById(R.id.left_button);
+        mLockIcon = findViewById(R.id.lock_icon);
+        mIndicationArea = findViewById(R.id.keyguard_indication_area);
+        mEnterpriseDisclosure = findViewById(
                 R.id.keyguard_indication_enterprise_disclosure);
-        mIndicationText = (TextView) findViewById(R.id.keyguard_indication_text);
+        mIndicationText = findViewById(R.id.keyguard_indication_text);
         watchForCameraPolicyChanges();
         updateCameraVisibility();
         mUnlockMethodCache = UnlockMethodCache.getInstance(getContext());
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 307a8c7..f1b4498 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -231,9 +231,9 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mKeyguardStatusBar = (KeyguardStatusBarView) findViewById(R.id.keyguard_header);
-        mKeyguardStatusView = (KeyguardStatusView) findViewById(R.id.keyguard_status_view);
-        mClockView = (TextView) findViewById(R.id.clock_view);
+        mKeyguardStatusBar = findViewById(R.id.keyguard_header);
+        mKeyguardStatusView = findViewById(R.id.keyguard_status_view);
+        mClockView = findViewById(R.id.clock_view);
 
         mNotificationContainerParent = (NotificationsQuickSettingsContainer)
                 findViewById(R.id.notification_container_parent);
@@ -242,13 +242,13 @@
         mNotificationStackScroller.setOnHeightChangedListener(this);
         mNotificationStackScroller.setOverscrollTopChangedListener(this);
         mNotificationStackScroller.setOnEmptySpaceClickListener(this);
-        mKeyguardBottomArea = (KeyguardBottomAreaView) findViewById(R.id.keyguard_bottom_area);
+        mKeyguardBottomArea = findViewById(R.id.keyguard_bottom_area);
         mQsNavbarScrim = findViewById(R.id.qs_navbar_scrim);
         mAffordanceHelper = new KeyguardAffordanceHelper(this, getContext());
         mKeyguardBottomArea.setAffordanceHelper(mAffordanceHelper);
         mLastOrientation = getResources().getConfiguration().orientation;
 
-        mQsFrame = (FrameLayout) findViewById(R.id.qs_frame);
+        mQsFrame = findViewById(R.id.qs_frame);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index 4dc593b..916b603 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -75,7 +75,7 @@
     @Override
     public void onFinishInflate() {
         mBarTransitions.init();
-        mBattery = (DarkReceiver) findViewById(R.id.battery);
+        mBattery = findViewById(R.id.battery);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
index 784f25e..37b0de4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
@@ -101,9 +101,9 @@
     protected void onFinishInflate() {
         super.onFinishInflate();
 
-        mProgressBar = (ProgressBar) findViewById(R.id.remote_input_progress);
+        mProgressBar = findViewById(R.id.remote_input_progress);
 
-        mSendButton = (ImageButton) findViewById(R.id.remote_input_send);
+        mSendButton = findViewById(R.id.remote_input_send);
         mSendButton.setOnClickListener(this);
 
         mEditText = (RemoteEditText) getChildAt(0);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitClockView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitClockView.java
index faa1a28..9f61574 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitClockView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitClockView.java
@@ -59,8 +59,8 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mTimeView = (TextClock) findViewById(R.id.time_view);
-        mAmPmView = (TextClock) findViewById(R.id.am_pm_view);
+        mTimeView = findViewById(R.id.time_view);
+        mAmPmView = findViewById(R.id.am_pm_view);
         mTimeView.setShowCurrentUserTime(true);
         mAmPmView.setShowCurrentUserTime(true);
     }
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java b/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java
index 4e4832c..10b6ff5 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java
@@ -60,10 +60,10 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mIcon = (ImageView) findViewById(R.id.volume_zen_icon);
-        mSummaryLine1 = (TextView) findViewById(R.id.volume_zen_summary_line_1);
-        mSummaryLine2 = (TextView) findViewById(R.id.volume_zen_summary_line_2);
-        mEndNowButton = (TextView) findViewById(R.id.volume_zen_end_now);
+        mIcon = findViewById(R.id.volume_zen_icon);
+        mSummaryLine1 = findViewById(R.id.volume_zen_summary_line_1);
+        mSummaryLine2 = findViewById(R.id.volume_zen_summary_line_2);
+        mEndNowButton = findViewById(R.id.volume_zen_end_now);
         mConfigurableTexts.add(mSummaryLine1);
         mConfigurableTexts.add(mSummaryLine2);
         mConfigurableTexts.add(mEndNowButton, R.string.volume_zen_end_now);
diff --git a/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/ClientTest.java b/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/ClientTest.java
index 78fd174..63b6a11 100644
--- a/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/ClientTest.java
+++ b/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/ClientTest.java
@@ -49,21 +49,21 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
 
-        Button addpbtn = (Button) findViewById(R.id.addpkg);
-        Button procbtn = (Button) findViewById(R.id.procmsg);
-        Button delbtn = (Button) findViewById(R.id.delpkg);
+        Button addpbtn = findViewById(R.id.addpkg);
+        Button procbtn = findViewById(R.id.procmsg);
+        Button delbtn = findViewById(R.id.delpkg);
 
         Log.v(LOG_TAG, "activity created!!");
 
         addpbtn.setOnClickListener(new View.OnClickListener() {
                 public void onClick(View v) {
-                    EditText app_id = (EditText) findViewById(R.id.app_id);
-                    EditText cont = (EditText) findViewById(R.id.cont);
-                    EditText pkg = (EditText) findViewById(R.id.pkg);
-                    EditText cls = (EditText) findViewById(R.id.cls);
-                    RadioButton act = (RadioButton) findViewById(R.id.act);
-                    CheckBox sig = (CheckBox) findViewById(R.id.sig);
-                    CheckBox ftr = (CheckBox) findViewById(R.id.ftr);
+                    EditText app_id = findViewById(R.id.app_id);
+                    EditText cont = findViewById(R.id.cont);
+                    EditText pkg = findViewById(R.id.pkg);
+                    EditText cls = findViewById(R.id.cls);
+                    RadioButton act = findViewById(R.id.act);
+                    CheckBox sig = findViewById(R.id.sig);
+                    CheckBox ftr = findViewById(R.id.ftr);
 
                     try {
                         if (!mWapPushMan.addPackage(
@@ -93,11 +93,11 @@
 
         delbtn.setOnClickListener(new View.OnClickListener() {
                 public void onClick(View v) {
-                    EditText app_id = (EditText) findViewById(R.id.app_id);
-                    EditText cont = (EditText) findViewById(R.id.cont);
-                    EditText pkg = (EditText) findViewById(R.id.pkg);
-                    EditText cls = (EditText) findViewById(R.id.cls);
-                    // CheckBox delall = (CheckBox) findViewById(R.id.delall);
+                    EditText app_id = findViewById(R.id.app_id);
+                    EditText cont = findViewById(R.id.cont);
+                    EditText pkg = findViewById(R.id.pkg);
+                    EditText cls = findViewById(R.id.cls);
+                    // CheckBox delall = findViewById(R.id.delall);
                     // Log.d(LOG_TAG, "button clicked");
 
                     try {
@@ -115,9 +115,9 @@
 
         procbtn.setOnClickListener(new View.OnClickListener() {
                 public void onClick(View v) {
-                    EditText pdu = (EditText) findViewById(R.id.pdu);
-                    EditText app_id = (EditText) findViewById(R.id.app_id);
-                    EditText cont = (EditText) findViewById(R.id.cont);
+                    EditText pdu = findViewById(R.id.pdu);
+                    EditText app_id = findViewById(R.id.app_id);
+                    EditText cont = findViewById(R.id.cont);
 
                     // WapPushOverSms wap = new WapPushOverSms();
                     // wap.dispatchWapPdu(strToHex(pdu.getText().toString()));
diff --git a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
index a319beb..f878b4d 100644
--- a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
+++ b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
@@ -88,7 +88,7 @@
     protected void init() {
         setContentView(R.layout.wallpaper_cropper);
 
-        mCropView = (CropView) findViewById(R.id.cropView);
+        mCropView = findViewById(R.id.cropView);
 
         Intent cropIntent = getIntent();
         final Uri imageUri = cropIntent.getData();
diff --git a/samples/training/network-usage/src/com/example/android/networkusage/NetworkActivity.java b/samples/training/network-usage/src/com/example/android/networkusage/NetworkActivity.java
index b7ed331..27d230b 100644
--- a/samples/training/network-usage/src/com/example/android/networkusage/NetworkActivity.java
+++ b/samples/training/network-usage/src/com/example/android/networkusage/NetworkActivity.java
@@ -158,7 +158,7 @@
         setContentView(R.layout.main);
 
         // The specified network connection is not available. Displays error message.
-        WebView myWebView = (WebView) findViewById(R.id.webview);
+        WebView myWebView = findViewById(R.id.webview);
         myWebView.loadData(getResources().getString(R.string.connection_error),
                 "text/html", null);
     }
@@ -205,7 +205,7 @@
         protected void onPostExecute(String result) {
             setContentView(R.layout.main);
             // Displays the HTML string in the UI via a WebView
-            WebView myWebView = (WebView) findViewById(R.id.webview);
+            WebView myWebView = findViewById(R.id.webview);
             myWebView.loadData(result, "text/html", null);
         }
     }
diff --git a/services/core/java/com/android/server/am/AppErrorDialog.java b/services/core/java/com/android/server/am/AppErrorDialog.java
index 646f6ce..02ec075 100644
--- a/services/core/java/com/android/server/am/AppErrorDialog.java
+++ b/services/core/java/com/android/server/am/AppErrorDialog.java
@@ -106,7 +106,7 @@
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        final FrameLayout frame = (FrameLayout) findViewById(android.R.id.custom);
+        final FrameLayout frame = findViewById(android.R.id.custom);
         final Context context = getContext();
         LayoutInflater.from(context).inflate(
                 com.android.internal.R.layout.app_error_dialog, frame, true);
@@ -114,19 +114,19 @@
         boolean hasRestart = !mRepeating && mIsRestartable;
         final boolean hasReceiver = mProc.errorReportReceiver != null;
 
-        final TextView restart = (TextView) findViewById(com.android.internal.R.id.aerr_restart);
+        final TextView restart = findViewById(com.android.internal.R.id.aerr_restart);
         restart.setOnClickListener(this);
         restart.setVisibility(hasRestart ? View.VISIBLE : View.GONE);
-        final TextView report = (TextView) findViewById(com.android.internal.R.id.aerr_report);
+        final TextView report = findViewById(com.android.internal.R.id.aerr_report);
         report.setOnClickListener(this);
         report.setVisibility(hasReceiver ? View.VISIBLE : View.GONE);
-        final TextView close = (TextView) findViewById(com.android.internal.R.id.aerr_close);
+        final TextView close = findViewById(com.android.internal.R.id.aerr_close);
         close.setVisibility(!hasRestart ? View.VISIBLE : View.GONE);
         close.setOnClickListener(this);
 
         boolean showMute = !IS_USER_BUILD && Settings.Global.getInt(context.getContentResolver(),
                 Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
-        final TextView mute = (TextView) findViewById(com.android.internal.R.id.aerr_mute);
+        final TextView mute = findViewById(com.android.internal.R.id.aerr_mute);
         mute.setOnClickListener(this);
         mute.setVisibility(showMute ? View.VISIBLE : View.GONE);
 
diff --git a/services/core/java/com/android/server/am/AppNotRespondingDialog.java b/services/core/java/com/android/server/am/AppNotRespondingDialog.java
index 9e29725..a3a6778 100644
--- a/services/core/java/com/android/server/am/AppNotRespondingDialog.java
+++ b/services/core/java/com/android/server/am/AppNotRespondingDialog.java
@@ -104,18 +104,18 @@
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        final FrameLayout frame = (FrameLayout) findViewById(android.R.id.custom);
+        final FrameLayout frame = findViewById(android.R.id.custom);
         final Context context = getContext();
         LayoutInflater.from(context).inflate(
                 com.android.internal.R.layout.app_anr_dialog, frame, true);
 
-        final TextView report = (TextView) findViewById(com.android.internal.R.id.aerr_report);
+        final TextView report = findViewById(com.android.internal.R.id.aerr_report);
         report.setOnClickListener(this);
         final boolean hasReceiver = mProc.errorReportReceiver != null;
         report.setVisibility(hasReceiver ? View.VISIBLE : View.GONE);
-        final TextView close = (TextView) findViewById(com.android.internal.R.id.aerr_close);
+        final TextView close = findViewById(com.android.internal.R.id.aerr_close);
         close.setOnClickListener(this);
-        final TextView wait = (TextView) findViewById(com.android.internal.R.id.aerr_wait);
+        final TextView wait = findViewById(com.android.internal.R.id.aerr_wait);
         wait.setOnClickListener(this);
 
         findViewById(com.android.internal.R.id.customPanel).setVisibility(View.VISIBLE);
diff --git a/services/retaildemo/java/com/android/server/retaildemo/UserInactivityCountdownDialog.java b/services/retaildemo/java/com/android/server/retaildemo/UserInactivityCountdownDialog.java
index d14f4eb..013eab8 100644
--- a/services/retaildemo/java/com/android/server/retaildemo/UserInactivityCountdownDialog.java
+++ b/services/retaildemo/java/com/android/server/retaildemo/UserInactivityCountdownDialog.java
@@ -67,7 +67,7 @@
     @Override
     public void show() {
         super.show();
-        final TextView messageView = (TextView) findViewById(R.id.message);
+        final TextView messageView = findViewById(R.id.message);
         messageView.post(new Runnable() {
             @Override
             public void run() {
diff --git a/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/SinkActivity.java b/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/SinkActivity.java
index 6fe2cfb..fc1d47b 100644
--- a/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/SinkActivity.java
+++ b/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/SinkActivity.java
@@ -95,13 +95,13 @@
 
         setContentView(R.layout.sink_activity);
 
-        mLogTextView = (TextView) findViewById(R.id.logTextView);
+        mLogTextView = findViewById(R.id.logTextView);
         mLogTextView.setMovementMethod(ScrollingMovementMethod.getInstance());
         mLogger = new TextLogger();
 
-        mFpsTextView = (TextView) findViewById(R.id.fpsTextView);
+        mFpsTextView = findViewById(R.id.fpsTextView);
 
-        mSurfaceView = (SurfaceView) findViewById(R.id.surfaceView);
+        mSurfaceView = findViewById(R.id.surfaceView);
         mSurfaceView.setOnTouchListener(new View.OnTouchListener() {
             @Override
             public boolean onTouch(View v, MotionEvent event) {
diff --git a/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/SourceActivity.java b/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/SourceActivity.java
index c59c958..a216102 100644
--- a/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/SourceActivity.java
+++ b/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/SourceActivity.java
@@ -63,7 +63,7 @@
 
         setContentView(R.layout.source_activity);
 
-        mLogTextView = (TextView) findViewById(R.id.logTextView);
+        mLogTextView = findViewById(R.id.logTextView);
         mLogTextView.setMovementMethod(ScrollingMovementMethod.getInstance());
         mLogger = new TextLogger();
         mPresenter = new Presenter();
diff --git a/tests/AmSlam/Android.mk b/tests/AmSlam/Android.mk
index 8dafac7..934bae0 100644
--- a/tests/AmSlam/Android.mk
+++ b/tests/AmSlam/Android.mk
@@ -21,7 +21,7 @@
 
 LOCAL_PACKAGE_NAME := AmSlam
 
-LOCAL_SDK_VERSION := 21
+LOCAL_SDK_VERSION := current
 LOCAL_MIN_SDK_VERSION := 21
 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 
diff --git a/tests/AmSlam/src/test/amslam/MainActivity.java b/tests/AmSlam/src/test/amslam/MainActivity.java
index cce955e..17fca09 100644
--- a/tests/AmSlam/src/test/amslam/MainActivity.java
+++ b/tests/AmSlam/src/test/amslam/MainActivity.java
@@ -60,7 +60,7 @@
         super.onCreate(savedInstanceState);
         sAppContext = getApplicationContext();
         setContentView(R.layout.activity_main);
-        mOutput = (TextView) findViewById(R.id.output);
+        mOutput = findViewById(R.id.output);
         PongReceiver.addListener(this);
 
         findViewById(R.id.run).setOnClickListener(view -> {
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
index b88a885..f85e82d 100644
--- a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
@@ -75,7 +75,7 @@
 
         setContentView(R.layout.main);
 
-        mList = (ListView) findViewById(R.id.testlist);
+        mList = findViewById(R.id.testlist);
         mList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
         mList.setFocusableInTouchMode(true);
         
diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/AutomaticActivity.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/AutomaticActivity.java
index 1ed4723..8ccd4e2 100644
--- a/tests/CanvasCompare/src/com/android/test/hwuicompare/AutomaticActivity.java
+++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/AutomaticActivity.java
@@ -111,8 +111,8 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.automatic_layout);
 
-        mSoftwareImageView = (ImageView) findViewById(R.id.software_image_view);
-        mHardwareImageView = (ImageView) findViewById(R.id.hardware_image_view);
+        mSoftwareImageView = findViewById(R.id.software_image_view);
+        mHardwareImageView = findViewById(R.id.hardware_image_view);
 
         onCreateCommon(mRunnable);
         beginTest();
diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java
index 8d8d9de..0dec1de 100644
--- a/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java
+++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java
@@ -57,7 +57,7 @@
         getWindow().setBackgroundDrawable(new ColorDrawable(0xffefefef));
         ResourceModifiers.init(getResources());
 
-        mHardwareView = (MainView) findViewById(R.id.hardware_view);
+        mHardwareView = findViewById(R.id.hardware_view);
         mHardwareView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
         mHardwareView.setBackgroundColor(Color.WHITE);
         mHardwareView.addDrawCallback(mDrawCallback);
diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java
index 78e360b..723c460 100644
--- a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java
+++ b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java
@@ -162,19 +162,19 @@
         // in res/layout/hello_activity.xml
         setContentView(R.layout.main);
 
-        mFgSpinner = (Spinner) findViewById(R.id.fgspinner);
+        mFgSpinner = findViewById(R.id.fgspinner);
         ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                 android.R.layout.simple_spinner_item, mAvailOpLabels);
         adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
         mFgSpinner.setAdapter(adapter);
         mFgSpinner.setOnItemSelectedListener(this);
-        mBgSpinner = (Spinner) findViewById(R.id.bgspinner);
+        mBgSpinner = findViewById(R.id.bgspinner);
         adapter = new ArrayAdapter<String>(this,
                 android.R.layout.simple_spinner_item, mAvailOpLabels);
         adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
         mBgSpinner.setAdapter(adapter);
         mBgSpinner.setOnItemSelectedListener(this);
-        mLimitSpinner = (Spinner) findViewById(R.id.limitspinner);
+        mLimitSpinner = findViewById(R.id.limitspinner);
         adapter = new ArrayAdapter<String>(this,
                 android.R.layout.simple_spinner_item, mLimitLabels);
         adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
diff --git a/tests/HugeBackup/src/com/android/hugebackup/HugeBackupActivity.java b/tests/HugeBackup/src/com/android/hugebackup/HugeBackupActivity.java
index 84e31aa..83c27fb 100644
--- a/tests/HugeBackup/src/com/android/hugebackup/HugeBackupActivity.java
+++ b/tests/HugeBackup/src/com/android/hugebackup/HugeBackupActivity.java
@@ -71,9 +71,9 @@
         setContentView(R.layout.backup_restore);
 
         /** Once the UI has been inflated, cache the controls for later */
-        mFillingGroup = (RadioGroup) findViewById(R.id.filling_group);
-        mAddMayoCheckbox = (CheckBox) findViewById(R.id.mayo);
-        mAddTomatoCheckbox = (CheckBox) findViewById(R.id.tomato);
+        mFillingGroup = findViewById(R.id.filling_group);
+        mAddMayoCheckbox = findViewById(R.id.mayo);
+        mAddTomatoCheckbox = findViewById(R.id.tomato);
 
         /** Set up our file bookkeeping */
         mDataFile = new File(getFilesDir(), HugeBackupActivity.DATA_FILE_NAME);
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java b/tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java
index eb4e3fd..492d158 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java
@@ -101,7 +101,7 @@
                         Context.LAYOUT_INFLATER_SERVICE);
         inflater.inflate(R.layout.date_picker, this, true);
 
-        mDayPicker = (NumberPicker) findViewById(R.id.day);
+        mDayPicker = findViewById(R.id.day);
         mDayPicker.setFormatter(NumberPicker.getTwoDigitFormatter());
         mDayPicker.setOnLongPressUpdateInterval(100);
         mDayPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
@@ -110,7 +110,7 @@
                 notifyDateChanged();
             }
         });
-        mMonthPicker = (NumberPicker) findViewById(R.id.month);
+        mMonthPicker = findViewById(R.id.month);
         mMonthPicker.setFormatter(NumberPicker.getTwoDigitFormatter());
         DateFormatSymbols dfs = new DateFormatSymbols();
         String[] months = dfs.getShortMonths();
@@ -146,7 +146,7 @@
                 updateDaySpinner();
             }
         });
-        mYearPicker = (NumberPicker) findViewById(R.id.year);
+        mYearPicker = findViewById(R.id.year);
         mYearPicker.setOnLongPressUpdateInterval(100);
         mYearPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
             public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
@@ -158,7 +158,7 @@
             }
         });
 
-        mYearToggle = (CheckBox) findViewById(R.id.yearToggle);
+        mYearToggle = findViewById(R.id.yearToggle);
         mYearToggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@@ -229,7 +229,7 @@
         /* Remove the 3 pickers from their parent and then add them back in the
          * required order.
          */
-        LinearLayout parent = (LinearLayout) findViewById(R.id.parent);
+        LinearLayout parent = findViewById(R.id.parent);
         parent.removeAllViews();
 
         boolean quoted = false;
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java
index 0defe92..134c2e0 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java
@@ -82,7 +82,7 @@
 
         ListAdapter adapter = new SimpleListAdapter(this);
 
-        final ListView list = (ListView) findViewById(R.id.list);
+        final ListView list = findViewById(R.id.list);
         list.setAdapter(adapter);
         
         registerForContextMenu(list);
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java
index 5655adf..262b0e9 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java
@@ -35,7 +35,7 @@
 
         setContentView(R.layout.stack);
 
-        StackView stack = (StackView) findViewById(R.id.stack_view);
+        StackView stack = findViewById(R.id.stack_view);
         stack.setAdapter(new ArrayAdapter<Drawable>(this, android.R.layout.simple_list_item_1,
                 android.R.id.text1, new Drawable[] {
             getResources().getDrawable(R.drawable.sunset1),
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java
index 684d179..b5a5e02 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java
@@ -55,23 +55,23 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.transforms_and_animations);
 
-        button1 = (Button) findViewById(R.id.button1);
-        button2 = (Button) findViewById(R.id.button2);
-        button3 = (Button) findViewById(R.id.button3);
-        button1a = (Button) findViewById(R.id.button1a);
-        button2a = (Button) findViewById(R.id.button2a);
-        button3a = (Button) findViewById(R.id.button3a);
-        button1b = (Button) findViewById(R.id.button1b);
-        button2b = (Button) findViewById(R.id.button2b);
-        button3b = (Button) findViewById(R.id.button3b);
-        button4 = (Button) findViewById(R.id.button4);
-        button5 = (Button) findViewById(R.id.button5);
-        button6 = (Button) findViewById(R.id.button6);
-        button7 = (Button) findViewById(R.id.button7);
-        button8 = (Button) findViewById(R.id.button8);
-        layersNoneCB = (CheckBox) findViewById(R.id.layersNoneCB);
-        layersHardwareCB = (CheckBox) findViewById(R.id.layersHwCB);
-        layersSoftwareCB = (CheckBox) findViewById(R.id.layersSwCB);
+        button1 = findViewById(R.id.button1);
+        button2 = findViewById(R.id.button2);
+        button3 = findViewById(R.id.button3);
+        button1a = findViewById(R.id.button1a);
+        button2a = findViewById(R.id.button2a);
+        button3a = findViewById(R.id.button3a);
+        button1b = findViewById(R.id.button1b);
+        button2b = findViewById(R.id.button2b);
+        button3b = findViewById(R.id.button3b);
+        button4 = findViewById(R.id.button4);
+        button5 = findViewById(R.id.button5);
+        button6 = findViewById(R.id.button6);
+        button7 = findViewById(R.id.button7);
+        button8 = findViewById(R.id.button8);
+        layersNoneCB = findViewById(R.id.layersNoneCB);
+        layersHardwareCB = findViewById(R.id.layersHwCB);
+        layersSoftwareCB = findViewById(R.id.layersSwCB);
 
         layersNoneCB.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener() {
             @Override
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java
index ffb8689..deb8585 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java
@@ -84,7 +84,7 @@
 
         ListAdapter adapter = new SimpleListAdapter(this);
 
-        ListView list = (ListView) findViewById(R.id.list);
+        ListView list = findViewById(R.id.list);
         list.setAdapter(adapter);
         list.setCacheColorHint(0);
         list.setVerticalFadingEdgeEnabled(true);
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java
index 6d47d6c..a261fb7 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java
@@ -49,13 +49,13 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.view_layer_invalidation);
 
-        container = (LinearLayout) findViewById(R.id.container);
-        final LinearLayout container1 = (LinearLayout) findViewById(R.id.container1);
-        final LinearLayout container2 = (LinearLayout) findViewById(R.id.container2);
-        final LinearLayout container3 = (LinearLayout) findViewById(R.id.container3);
-        nestedStatusTV = (TextView) findViewById(R.id.nestedStatus);
-        invalidateStatusTV = (TextView) findViewById(R.id.invalidateStatus);
-        final TextView tva = (TextView) findViewById(R.id.textviewa);
+        container = findViewById(R.id.container);
+        final LinearLayout container1 = findViewById(R.id.container1);
+        final LinearLayout container2 = findViewById(R.id.container2);
+        final LinearLayout container3 = findViewById(R.id.container3);
+        nestedStatusTV = findViewById(R.id.nestedStatus);
+        invalidateStatusTV = findViewById(R.id.invalidateStatus);
+        final TextView tva = findViewById(R.id.textviewa);
 
         topLayouts.add(container1);
         topLayouts.add(container2);
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java
index 7168478..07dc0a1 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java
@@ -94,7 +94,7 @@
     }
 
     private void setupList(int listId) {
-        final ListView list = (ListView) findViewById(listId);
+        final ListView list = findViewById(listId);
         list.setAdapter(new SimpleListAdapter(this));
     }
 
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java
index e65dd63..96cf43e 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java
@@ -39,7 +39,7 @@
     }
 
     private void setupList(int listId) {
-        final ListView list = (ListView) findViewById(listId);
+        final ListView list = findViewById(listId);
         list.setAdapter(new SimpleListAdapter(this));
         list.setLayerType(View.LAYER_TYPE_HARDWARE, null);
         ((View) list.getParent()).setLayerType(View.LAYER_TYPE_HARDWARE, null);
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java
index 17f78af..1f3f874 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java
@@ -47,7 +47,7 @@
     }
     
     private void setupList(int listId) {
-        final ListView list = (ListView) findViewById(listId);
+        final ListView list = findViewById(listId);
         list.setAdapter(new SimpleListAdapter(this));
         list.setLayerType(View.LAYER_TYPE_HARDWARE, null);
     }
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java
index 2dd7b6a..715da20 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java
@@ -113,7 +113,7 @@
     }
     
     private void setupList(int listId) {
-        final ListView list = (ListView) findViewById(listId);
+        final ListView list = findViewById(listId);
         list.setAdapter(new SimpleListAdapter(this));
     }
 
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java
index 738801d..9ae3811 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java
@@ -60,12 +60,12 @@
                 startAnim(R.id.imageview);
                 startAnim(myViewAlphaDefault);
                 startAnim(myViewAlphaHandled);
-                EditText selectedText = (EditText) findViewById(R.id.selectedtext);
+                EditText selectedText = findViewById(R.id.selectedtext);
                 selectedText.setSelection(3, 8);
             }
         }, 2000);
         
-        Button invalidator = (Button) findViewById(R.id.invalidateButton);
+        Button invalidator = findViewById(R.id.invalidateButton);
         invalidator.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -74,7 +74,7 @@
             }
         });
 
-        TextView textView = (TextView) findViewById(R.id.spantext);
+        TextView textView = findViewById(R.id.spantext);
         if (textView != null) {
             SpannableStringBuilder text =
                     new SpannableStringBuilder("Now this is a short text message with spans");
@@ -93,7 +93,7 @@
             textView.setText(text);
         }
         
-        LinearLayout container = (LinearLayout) findViewById(R.id.container);
+        LinearLayout container = findViewById(R.id.container);
         myViewAlphaDefault = new MyView(this, false);
         myViewAlphaDefault.setLayoutParams(new LinearLayout.LayoutParams(75, 75));
         container.addView(myViewAlphaDefault);
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java
index 45e77ed..08979bc 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java
@@ -12,7 +12,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.z_ordering);
 
-        ViewGroup grandParent = (ViewGroup) findViewById(R.id.parent);
+        ViewGroup grandParent = findViewById(R.id.parent);
         if (grandParent == null) throw new IllegalStateException();
         View.OnClickListener l = new View.OnClickListener() {
             @Override
diff --git a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java
index 292bbd2..6115fd5 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java
@@ -50,7 +50,7 @@
 
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, 
                android.R.layout.simple_dropdown_item_1line, COUNTRIES);
-       AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit);
+       AutoCompleteTextView textView = findViewById(R.id.edit);
        textView.setAdapter(adapter);
    }
 
diff --git a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java
index 570cb6b..253c50f 100644
--- a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java
+++ b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java
@@ -45,7 +45,7 @@
 
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, 
                android.R.layout.simple_dropdown_item_1line, COUNTRIES);
-       AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit);
+       AutoCompleteTextView textView = findViewById(R.id.edit);
        textView.setAdapter(adapter);
    }
 
diff --git a/tests/JobSchedulerTestApp/src/com/android/demo/jobSchedulerApp/MainActivity.java b/tests/JobSchedulerTestApp/src/com/android/demo/jobSchedulerApp/MainActivity.java
index 5aa0d4f..51cdbb5 100644
--- a/tests/JobSchedulerTestApp/src/com/android/demo/jobSchedulerApp/MainActivity.java
+++ b/tests/JobSchedulerTestApp/src/com/android/demo/jobSchedulerApp/MainActivity.java
@@ -56,16 +56,16 @@
         stopJobColor = getColor(R.color.stop_received);
 
         // Set up UI.
-        mShowStartView = (TextView) findViewById(R.id.onstart_textview);
-        mShowStopView = (TextView) findViewById(R.id.onstop_textview);
-        mParamsTextView = (TextView) findViewById(R.id.task_params);
-        mDelayEditText = (EditText) findViewById(R.id.delay_time);
-        mDeadlineEditText = (EditText) findViewById(R.id.deadline_time);
-        mWiFiConnectivityRadioButton = (RadioButton) findViewById(R.id.checkbox_unmetered);
-        mAnyConnectivityRadioButton = (RadioButton) findViewById(R.id.checkbox_any);
-        mRequiresChargingCheckBox = (CheckBox) findViewById(R.id.checkbox_charging);
-        mRequiresIdleCheckbox = (CheckBox) findViewById(R.id.checkbox_idle);
-        mIsPersistedCheckbox = (CheckBox) findViewById(R.id.checkbox_persisted);
+        mShowStartView = findViewById(R.id.onstart_textview);
+        mShowStopView = findViewById(R.id.onstop_textview);
+        mParamsTextView = findViewById(R.id.task_params);
+        mDelayEditText = findViewById(R.id.delay_time);
+        mDeadlineEditText = findViewById(R.id.deadline_time);
+        mWiFiConnectivityRadioButton = findViewById(R.id.checkbox_unmetered);
+        mAnyConnectivityRadioButton = findViewById(R.id.checkbox_any);
+        mRequiresChargingCheckBox = findViewById(R.id.checkbox_charging);
+        mRequiresIdleCheckbox = findViewById(R.id.checkbox_idle);
+        mIsPersistedCheckbox = findViewById(R.id.checkbox_persisted);
 
         mServiceComponent = new ComponentName(this, TestJobService.class);
         // Start service and provide it a way to communicate with us.
diff --git a/tests/LargeAssetTest/src/com/android/largeassettest/LargeAssetTest.java b/tests/LargeAssetTest/src/com/android/largeassettest/LargeAssetTest.java
index e3a9cf4..612c53e 100644
--- a/tests/LargeAssetTest/src/com/android/largeassettest/LargeAssetTest.java
+++ b/tests/LargeAssetTest/src/com/android/largeassettest/LargeAssetTest.java
@@ -43,8 +43,8 @@
         super.onCreate(icicle);
         setContentView(R.layout.lat);
 
-        mResultText = (TextView) findViewById(R.id.result);
-        mValidateButton = (Button) findViewById(R.id.validate);
+        mResultText = findViewById(R.id.result);
+        mValidateButton = findViewById(R.id.validate);
 
         mValidateButton.setOnClickListener(mClickListener);
     }
diff --git a/tests/LowStorageTest/src/com/android/lowstoragetest/LowStorageTest.java b/tests/LowStorageTest/src/com/android/lowstoragetest/LowStorageTest.java
index 9f297aa..c0091ad 100644
--- a/tests/LowStorageTest/src/com/android/lowstoragetest/LowStorageTest.java
+++ b/tests/LowStorageTest/src/com/android/lowstoragetest/LowStorageTest.java
@@ -52,9 +52,9 @@
         StatFs stat = new StatFs(path.getPath());
         int totalBlocks = stat.getBlockCount();
         mBlockSize = (int) (stat.getBlockSize());
-        TextView startSizeTextView = (TextView) findViewById(R.id.totalsize);
+        TextView startSizeTextView = findViewById(R.id.totalsize);
         startSizeTextView.setText(Long.toString((totalBlocks * mBlockSize) / BYTE_SIZE));
-        Button button = (Button) findViewById(R.id.button_run);
+        Button button = findViewById(R.id.button_run);
         button.setOnClickListener(mStartListener);
     }
 
@@ -121,9 +121,9 @@
             File path = Environment.getDataDirectory();
             StatFs stat = new StatFs(path.getPath());
             long availableBlocks = stat.getAvailableBlocks();
-            TextView freeSizeTextView = (TextView) findViewById(R.id.freesize);
+            TextView freeSizeTextView = findViewById(R.id.freesize);
             freeSizeTextView.setText(Long.toString((availableBlocks * mBlockSize) / BYTE_SIZE));
-            TextView statusTextView = (TextView) findViewById(R.id.status);
+            TextView statusTextView = findViewById(R.id.status);
             statusTextView.setText("Finished. You can start the test now.");
         } catch (Exception e) {
             Log.v(TAG, e.toString());
diff --git a/tests/OneMedia/src/com/android/onemedia/OnePlayerActivity.java b/tests/OneMedia/src/com/android/onemedia/OnePlayerActivity.java
index 2ff3e20..85cc8fb 100644
--- a/tests/OneMedia/src/com/android/onemedia/OnePlayerActivity.java
+++ b/tests/OneMedia/src/com/android/onemedia/OnePlayerActivity.java
@@ -68,16 +68,16 @@
         mPlayer = new PlayerController(this, OnePlayerService.getServiceIntent(this));
 
 
-        mStartButton = (Button) findViewById(R.id.start_button);
-        mPlayButton = (Button) findViewById(R.id.play_button);
-        mRouteButton = (Button) findViewById(R.id.route_button);
-        mStatusView = (TextView) findViewById(R.id.status);
-        mContentText = (EditText) findViewById(R.id.content);
-        mNextContentText = (EditText) findViewById(R.id.next_content);
-        mHasVideo = (CheckBox) findViewById(R.id.has_video);
-        mArtView = (ImageView) findViewById(R.id.art);
+        mStartButton = findViewById(R.id.start_button);
+        mPlayButton = findViewById(R.id.play_button);
+        mRouteButton = findViewById(R.id.route_button);
+        mStatusView = findViewById(R.id.status);
+        mContentText = findViewById(R.id.content);
+        mNextContentText = findViewById(R.id.next_content);
+        mHasVideo = findViewById(R.id.has_video);
+        mArtView = findViewById(R.id.art);
 
-        final Button artPicker = (Button) findViewById(R.id.art_picker);
+        final Button artPicker = findViewById(R.id.art_picker);
         artPicker.setOnClickListener(mButtonListener);
 
         mStartButton.setOnClickListener(mButtonListener);
diff --git a/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java b/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java
index ee4c834..241206d 100644
--- a/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java
+++ b/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java
@@ -43,7 +43,7 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
-        ListView lv = (ListView) findViewById(android.R.id.list);
+        ListView lv = findViewById(android.R.id.list);
         lv.setDrawSelectorOnTop(true);
         lv.setAdapter(new SimpleAdapter(this, SAMPLES,
                 R.layout.item_layout, new String[] { KEY_NAME },
@@ -55,7 +55,7 @@
     @Override
     protected void onResume() {
         super.onResume();
-        ListView lv = (ListView) findViewById(android.R.id.list);
+        ListView lv = findViewById(android.R.id.list);
         for (int i = 0; i < lv.getChildCount(); i++) {
             lv.getChildAt(i).animate().translationY(0).setDuration(DURATION);
         }
diff --git a/tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java b/tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java
index 892cbae..22fc691 100644
--- a/tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java
+++ b/tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java
@@ -39,7 +39,7 @@
     @Override
     protected void onResume() {
         super.onResume();
-        ViewGroup container = (ViewGroup) findViewById(R.id.my_container);
+        ViewGroup container = findViewById(R.id.my_container);
         int dx = getWindowManager().getDefaultDisplay().getWidth();
         for (int i = 0; i < container.getChildCount(); i++) {
             View child = container.getChildAt(i);
diff --git a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestActivity.java b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestActivity.java
index 4841bc5..c3c4cf5 100644
--- a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestActivity.java
+++ b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestActivity.java
@@ -81,14 +81,14 @@
 
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
-        mDebugView = (TextView) findViewById(R.id.console);
-        mScrollView = (ScrollView) findViewById(R.id.scroller_id);
-        mRadioGroup = (RadioGroup) findViewById(R.id.model_group_id);
-        mPlayTriggerButton = (Button) findViewById(R.id.play_trigger_id);
+        mDebugView = findViewById(R.id.console);
+        mScrollView = findViewById(R.id.scroller_id);
+        mRadioGroup = findViewById(R.id.model_group_id);
+        mPlayTriggerButton = findViewById(R.id.play_trigger_id);
         mDebugView.setText(mDebugView.getText(), TextView.BufferType.EDITABLE);
         mDebugView.setMovementMethod(new ScrollingMovementMethod());
-        mCaptureAudioCheckBox = (CheckBox) findViewById(R.id.caputre_check_box);
-        mPlayCapturedAudioButton = (Button) findViewById(R.id.play_captured_id);
+        mCaptureAudioCheckBox = findViewById(R.id.caputre_check_box);
+        mPlayCapturedAudioButton = findViewById(R.id.play_captured_id);
         mHandler = new Handler();
         mButtonModelUuidMap = new HashMap();
         mModelButtons = new HashMap();
diff --git a/tests/TouchLatency/app/src/main/java/com/prefabulated/touchlatency/TouchLatencyActivity.java b/tests/TouchLatency/app/src/main/java/com/prefabulated/touchlatency/TouchLatencyActivity.java
index 7c13974..7632a6e 100644
--- a/tests/TouchLatency/app/src/main/java/com/prefabulated/touchlatency/TouchLatencyActivity.java
+++ b/tests/TouchLatency/app/src/main/java/com/prefabulated/touchlatency/TouchLatencyActivity.java
@@ -180,7 +180,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_touch_latency);
 
-        mTouchView = (TouchLatencyView) findViewById(R.id.canvasView);
+        mTouchView = findViewById(R.id.canvasView);
     }
 
 
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java b/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java
index 54c44e2..9985357 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java
@@ -42,7 +42,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.clipping_text_1);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.clipping_text_1, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java b/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java
index f687da3..86ecf8e 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java
@@ -49,7 +49,7 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.contacts_list);
-        ViewGroup contactsContainer = (ViewGroup) findViewById(R.id.contactsContainer);
+        ViewGroup contactsContainer = findViewById(R.id.contactsContainer);
 
         int contactsIndex = 0;
         addContact(contactsContainer, contactsIndex, R.drawable.self_portrait_square_100);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java b/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java
index 5bb0e77..0d41d64 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java
@@ -38,7 +38,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.crossfade);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java
index 1f278b9..1fb732e 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java
@@ -41,10 +41,10 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.crossfade_image);
 
-        ViewGroup container = (ViewGroup) findViewById(R.id.container);
+        ViewGroup container = findViewById(R.id.container);
         mSceneRoot = container;
 
-        mImageView = (ImageView) findViewById(R.id.contact_picture);
+        mImageView = findViewById(R.id.contact_picture);
         mImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
 
         Crossfade mCrossfade = new Crossfade();
diff --git a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java
index 469ee8b..15d15351 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java
@@ -49,12 +49,12 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.crossfade_multiple);
 
-        ViewGroup container = (ViewGroup) findViewById(R.id.container);
+        ViewGroup container = findViewById(R.id.container);
         mSceneRoot = container;
 
-        mButton = (Button) findViewById(R.id.button);
-        mImageView = (ImageView) findViewById(R.id.imageview);
-        mTextView = (TextView) findViewById(R.id.textview);
+        mButton = findViewById(R.id.button);
+        mImageView = findViewById(R.id.imageview);
+        mTextView = findViewById(R.id.textview);
 
         mCrossfade = new Crossfade();
         mCrossfade.addTarget(R.id.button).addTarget(R.id.textview).addTarget(R.id.imageview);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo0.java b/tests/TransitionTests/src/com/android/transitiontests/Demo0.java
index d52ab1d..e172904 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo0.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo0.java
@@ -35,7 +35,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mCurrentScene = SEARCH_SCREEN;
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo1.java b/tests/TransitionTests/src/com/android/transitiontests/Demo1.java
index 5b5eb15..e92dd03 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo1.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo1.java
@@ -40,7 +40,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
 //        mResultsScreen = new MyScene(mSceneRoot, R.layout.results_screen);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo2.java b/tests/TransitionTests/src/com/android/transitiontests/Demo2.java
index 0f3257b..c26723b 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo2.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo2.java
@@ -38,7 +38,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
     }
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo3.java b/tests/TransitionTests/src/com/android/transitiontests/Demo3.java
index 0ffa1f5..094ab97 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo3.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo3.java
@@ -38,7 +38,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo4.java b/tests/TransitionTests/src/com/android/transitiontests/Demo4.java
index 3aadbb0..af67f26 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo4.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo4.java
@@ -38,7 +38,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo5.java b/tests/TransitionTests/src/com/android/transitiontests/Demo5.java
index c36abda..f01a29d 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Demo5.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Demo5.java
@@ -33,7 +33,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java b/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java
index d497abe..40bf975 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java
@@ -34,11 +34,11 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.fading_hierarchy);
 
-        mContainer = (ViewGroup) findViewById(R.id.container);
-        mRemovingContainer = (ViewGroup) findViewById(R.id.removingContainer);
+        mContainer = findViewById(R.id.container);
+        mRemovingContainer = findViewById(R.id.removingContainer);
         mInnerContainerParent = (ViewGroup) mRemovingContainer.getParent();
 
-        mRemovingButton = (Button) findViewById(R.id.removingButton);
+        mRemovingButton = findViewById(R.id.removingButton);
     }
 
     public void sendMessage(View view) {
diff --git a/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java b/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java
index 29fb868..8307366 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java
@@ -43,13 +43,13 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.fading_test);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
 
-        mRemovingButton = (Button) findViewById(R.id.removingButton);
-        mInvisibleButton = (Button) findViewById(R.id.invisibleButton);
-        mGoneButton = (Button) findViewById(R.id.goneButton);
+        mRemovingButton = findViewById(R.id.removingButton);
+        mInvisibleButton = findViewById(R.id.invisibleButton);
+        mGoneButton = findViewById(R.id.goneButton);
 
         mGoneButton.setOnClickListener(new View.OnClickListener() {
             @Override
diff --git a/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java b/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java
index a06ba8f..025e4e3 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java
@@ -37,7 +37,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.instance_targets);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container;
     }
 
diff --git a/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java b/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java
index c26e93f..6186150 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java
@@ -40,17 +40,17 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.interruption);
 
-        ViewGroup sceneRoot = (ViewGroup) findViewById(R.id.sceneRoot);
+        ViewGroup sceneRoot = findViewById(R.id.sceneRoot);
 
         mScene1 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_1, this);
         mScene2 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_2, this);
         mScene3 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_3, this);
         mScene4 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_4, this);
 
-        mScene1RB = (RadioButton) findViewById(R.id.scene1RB);
-        mScene2RB = (RadioButton) findViewById(R.id.scene2RB);
-        mScene3RB = (RadioButton) findViewById(R.id.scene3RB);
-        mScene4RB = (RadioButton) findViewById(R.id.scene4RB);
+        mScene1RB = findViewById(R.id.scene1RB);
+        mScene2RB = findViewById(R.id.scene2RB);
+        mScene3RB = findViewById(R.id.scene3RB);
+        mScene4RB = findViewById(R.id.scene4RB);
 
         ChangeBounds changeBounds1 = new ChangeBounds();
         changeBounds1.addTarget(R.id.button);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java b/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java
index 251bf24..45b8286 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java
@@ -47,9 +47,9 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.list_view_add_remove);
 
-        final LinearLayout container = (LinearLayout) findViewById(R.id.container);
+        final LinearLayout container = findViewById(R.id.container);
 
-        final ListView listview = (ListView) findViewById(R.id.listview);
+        final ListView listview = findViewById(R.id.listview);
         for (int i = 0; i < 200; ++i) {
             numList.add(Integer.toString(i));
         }
diff --git a/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java b/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java
index 92bbb85..96b018b 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java
@@ -40,7 +40,7 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_login);
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mLoginScene = Scene.getSceneForLayout(mSceneRoot, R.layout.activity_login, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/OverlayTest.java b/tests/TransitionTests/src/com/android/transitiontests/OverlayTest.java
index ef8cd37..384762b 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/OverlayTest.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/OverlayTest.java
@@ -32,12 +32,12 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.overlay_test);
 
-        mContainer = (ViewGroup) findViewById(R.id.container);
+        mContainer = findViewById(R.id.container);
         mRoot = (ViewGroup) mContainer.getParent();
     }
 
     public void onClick(View view) {
-        final Button fadingButton = (Button) findViewById(R.id.fadingButton);
+        final Button fadingButton = findViewById(R.id.fadingButton);
         if (fadingButton != null) {
             mContainer.removeView(fadingButton);
             mRoot.getOverlay().add(fadingButton);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java b/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java
index 1ee8621..772ddc7 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java
@@ -34,9 +34,9 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.reparenting);
 
-        ViewGroup container = (ViewGroup) findViewById(R.id.container);
-        mContainer1 = (ViewGroup) findViewById(R.id.container1);
-        mContainer2 = (ViewGroup) findViewById(R.id.container2);
+        ViewGroup container = findViewById(R.id.container);
+        mContainer1 = findViewById(R.id.container1);
+        mContainer2 = findViewById(R.id.container2);
         System.out.println("container 1 and 2 " + mContainer1 + ", " + mContainer2);
 
         setupButtons(0, mContainer1);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java b/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java
index 1aee258..96d3ae1 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java
@@ -39,7 +39,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mCurrentScene = SEARCH_SCREEN;
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java
index 7504058..7ee4b3e 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java
@@ -39,7 +39,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java
index 23b28ec..9333ea1 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java
@@ -37,7 +37,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java
index ecf5ef3..a01f638 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java
@@ -39,7 +39,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.search_screen);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
         mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java b/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java
index c550e92..5f4560cc 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java
@@ -41,12 +41,12 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.fading_test);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
-        mRemovingButton = (Button) findViewById(R.id.removingButton);
-        mInvisibleButton = (Button) findViewById(R.id.invisibleButton);
-        mGoneButton = (Button) findViewById(R.id.goneButton);
+        mRemovingButton = findViewById(R.id.removingButton);
+        mInvisibleButton = findViewById(R.id.invisibleButton);
+        mGoneButton = findViewById(R.id.goneButton);
 
         mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test, this);
         mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_scene_2, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java b/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java
index 92b169e..f478cb8 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java
@@ -42,10 +42,10 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.fading_test_simple);
 
-        View container = (View) findViewById(R.id.container);
+        View container = findViewById(R.id.container);
         mSceneRoot = (ViewGroup) container.getParent();
 
-        mRemovingButton = (Button) findViewById(R.id.removingButton);
+        mRemovingButton = findViewById(R.id.removingButton);
 
         mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple, this);
         mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple2, this);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java b/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java
index 9b246ad..8819c40 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java
@@ -48,8 +48,8 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.surface_texture_views);
 
-        final ViewGroup container = (ViewGroup) findViewById(R.id.container);
-        Button toggleButton = (Button) findViewById(R.id.toggleButton);
+        final ViewGroup container = findViewById(R.id.container);
+        Button toggleButton = findViewById(R.id.toggleButton);
 
         mView = new SimpleView(this);
         mView.setId(0);
diff --git a/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java b/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java
index c824956..b2b24bc 100644
--- a/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java
+++ b/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java
@@ -40,7 +40,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.unique_id_test);
 
-        LinearLayout container = (LinearLayout) findViewById(R.id.container);
+        LinearLayout container = findViewById(R.id.container);
         LayoutInflater inflater = getLayoutInflater();
         Button button = (Button) inflater.inflate(R.layout.button_template, null);
         container.addView(button);
diff --git a/tests/UiBench/src/com/android/test/uibench/ActivityTransition.java b/tests/UiBench/src/com/android/test/uibench/ActivityTransition.java
index 0a069c2..c212c4c 100644
--- a/tests/UiBench/src/com/android/test/uibench/ActivityTransition.java
+++ b/tests/UiBench/src/com/android/test/uibench/ActivityTransition.java
@@ -94,7 +94,7 @@
         setupHero();
 
         // Ensure that all images are visible regardless of orientation.
-        GridLayout gridLayout = (GridLayout) findViewById(R.id.transition_grid_layout);
+        GridLayout gridLayout = findViewById(R.id.transition_grid_layout);
         boolean isPortrait =
                 getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
         gridLayout.setRowCount(isPortrait ? 4 : 2);
@@ -105,7 +105,7 @@
         String name = getIntent().getStringExtra(KEY_ID);
         mHero = null;
         if (name != null) {
-            mHero = (ImageView) findViewById(getIdForKey(name));
+            mHero = findViewById(getIdForKey(name));
             setEnterSharedElementCallback(new SharedElementCallback() {
                 @Override
                 public void onMapSharedElements(List<String> names,
diff --git a/tests/UiBench/src/com/android/test/uibench/ActivityTransitionDetails.java b/tests/UiBench/src/com/android/test/uibench/ActivityTransitionDetails.java
index a654c61..a4d57e1 100644
--- a/tests/UiBench/src/com/android/test/uibench/ActivityTransitionDetails.java
+++ b/tests/UiBench/src/com/android/test/uibench/ActivityTransitionDetails.java
@@ -39,7 +39,7 @@
         super.onCreate(savedInstanceState);
         getWindow().setBackgroundDrawable(new ColorDrawable(Color.DKGRAY));
         setContentView(R.layout.activity_transition_details);
-        ImageView titleImage = (ImageView) findViewById(R.id.titleImage);
+        ImageView titleImage = findViewById(R.id.titleImage);
         titleImage.setImageDrawable(getHeroDrawable());
     }
 
diff --git a/tests/UiBench/src/com/android/test/uibench/BitmapUploadActivity.java b/tests/UiBench/src/com/android/test/uibench/BitmapUploadActivity.java
index e2bf897..235e0e6 100644
--- a/tests/UiBench/src/com/android/test/uibench/BitmapUploadActivity.java
+++ b/tests/UiBench/src/com/android/test/uibench/BitmapUploadActivity.java
@@ -80,7 +80,7 @@
         setContentView(R.layout.activity_bitmap_upload);
 
         // animate color to force bitmap uploads
-        UploadView uploadView = (UploadView) findViewById(R.id.upload_view);
+        UploadView uploadView = findViewById(R.id.upload_view);
         ObjectAnimator colorValueAnimator = ObjectAnimator.ofInt(uploadView, "colorValue", 0, 255);
         colorValueAnimator.setRepeatMode(ValueAnimator.REVERSE);
         colorValueAnimator.setRepeatCount(ValueAnimator.INFINITE);
diff --git a/tests/UiBench/src/com/android/test/uibench/ClippedListActivity.java b/tests/UiBench/src/com/android/test/uibench/ClippedListActivity.java
index 7454124..fee7480 100644
--- a/tests/UiBench/src/com/android/test/uibench/ClippedListActivity.java
+++ b/tests/UiBench/src/com/android/test/uibench/ClippedListActivity.java
@@ -35,16 +35,16 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_navigation_drawer);
-        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+        DrawerLayout drawer = findViewById(R.id.drawer_layout);
         ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                 this, drawer, toolbar, R.string.navigation_drawer_open,
                 R.string.navigation_drawer_close);
         drawer.setDrawerListener(toggle);
         toggle.syncState();
 
-        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
+        NavigationView navigationView = findViewById(R.id.nav_view);
         navigationView.setNavigationItemSelectedListener(this);
 
         FragmentManager fm = getSupportFragmentManager();
@@ -59,7 +59,7 @@
 
     @Override
     public boolean onNavigationItemSelected(MenuItem item) {
-        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+        DrawerLayout drawer = findViewById(R.id.drawer_layout);
         drawer.closeDrawer(GravityCompat.START);
         return true;
     }
diff --git a/tests/UiBench/src/com/android/test/uibench/NavigationDrawerActivity.java b/tests/UiBench/src/com/android/test/uibench/NavigationDrawerActivity.java
index 1d68767..a541104 100644
--- a/tests/UiBench/src/com/android/test/uibench/NavigationDrawerActivity.java
+++ b/tests/UiBench/src/com/android/test/uibench/NavigationDrawerActivity.java
@@ -31,22 +31,22 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_navigation_drawer);
-        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+        DrawerLayout drawer = findViewById(R.id.drawer_layout);
         ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                 this, drawer, toolbar, R.string.navigation_drawer_open,
                 R.string.navigation_drawer_close);
         drawer.setDrawerListener(toggle);
         toggle.syncState();
 
-        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
+        NavigationView navigationView = findViewById(R.id.nav_view);
         navigationView.setNavigationItemSelectedListener(this);
     }
 
     @Override
     public boolean onNavigationItemSelected(MenuItem item) {
-        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+        DrawerLayout drawer = findViewById(R.id.drawer_layout);
         drawer.closeDrawer(GravityCompat.START);
         return true;
     }
diff --git a/tests/UiBench/src/com/android/test/uibench/RenderingJitter.java b/tests/UiBench/src/com/android/test/uibench/RenderingJitter.java
index e2a9bcb..e1df7d3 100644
--- a/tests/UiBench/src/com/android/test/uibench/RenderingJitter.java
+++ b/tests/UiBench/src/com/android/test/uibench/RenderingJitter.java
@@ -85,12 +85,12 @@
         View content = findViewById(android.R.id.content);
         content.setBackground(new AnimatedBackgroundDrawable());
         content.setKeepScreenOn(true);
-        mJitterReport = (TextView) findViewById(R.id.jitter_mma);
-        mMostlyTotalFrameTimeReport = (TextView) findViewById(R.id.totalish_mma);
-        mUiFrameTimeReport = (TextView) findViewById(R.id.ui_frametime_mma);
-        mRenderThreadTimeReport = (TextView) findViewById(R.id.rt_frametime_mma);
-        mTotalFrameTimeReport = (TextView) findViewById(R.id.total_mma);
-        mGraph = (PointGraphView) findViewById(R.id.graph);
+        mJitterReport = findViewById(R.id.jitter_mma);
+        mMostlyTotalFrameTimeReport = findViewById(R.id.totalish_mma);
+        mUiFrameTimeReport = findViewById(R.id.ui_frametime_mma);
+        mRenderThreadTimeReport = findViewById(R.id.rt_frametime_mma);
+        mTotalFrameTimeReport = findViewById(R.id.total_mma);
+        mGraph = findViewById(R.id.graph);
         mJitterReport.setText("abcdefghijklmnopqrstuvwxyz");
         mMostlyTotalFrameTimeReport.setText("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
         mUiFrameTimeReport.setText("0123456789");
diff --git a/tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/src/com/android/hardware/usb/externalmanagementtest/UsbHostManagementActivity.java b/tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/src/com/android/hardware/usb/externalmanagementtest/UsbHostManagementActivity.java
index 2d9226f..af8b846 100644
--- a/tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/src/com/android/hardware/usb/externalmanagementtest/UsbHostManagementActivity.java
+++ b/tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/src/com/android/hardware/usb/externalmanagementtest/UsbHostManagementActivity.java
@@ -68,12 +68,12 @@
         Log.i(TAG, "onCreate");
         super.onCreate(savedInstanceState);
         setContentView(R.layout.host_management);
-        mDeviceInfoText = (TextView) findViewById(R.id.device_info_text);
-        mStartAoapButton = (Button) findViewById(R.id.start_aoap_button);
-        mStartAoapActivityButton = (Button) findViewById(R.id.start_aoap_activity_button);
-        mAoapAppLog = (TextView) findViewById(R.id.aoap_apps_text);
-        mResetUsbButton = (Button) findViewById(R.id.reset_button);
-        mFinishButton = (Button) findViewById(R.id.finish_button);
+        mDeviceInfoText = findViewById(R.id.device_info_text);
+        mStartAoapButton = findViewById(R.id.start_aoap_button);
+        mStartAoapActivityButton = findViewById(R.id.start_aoap_activity_button);
+        mAoapAppLog = findViewById(R.id.aoap_apps_text);
+        mResetUsbButton = findViewById(R.id.reset_button);
+        mFinishButton = findViewById(R.id.finish_button);
 
         Intent intent = getIntent();
         if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(intent.getAction())) {
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java
index 8de2f6b..47ca482 100644
--- a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java
+++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java
@@ -25,7 +25,7 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_animated_vector_drawable_attr);
 
-        ImageView avdIv = (ImageView) findViewById(R.id.avd);
+        ImageView avdIv = findViewById(R.id.avd);
         AnimatedVectorDrawable avd = (AnimatedVectorDrawable) avdIv.getDrawable();
         avd.start();
     }
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/StartVoiceInteractionActivity.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/StartVoiceInteractionActivity.java
index 41058c9..733f602 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/StartVoiceInteractionActivity.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/StartVoiceInteractionActivity.java
@@ -55,9 +55,9 @@
         mPickButton.setOnClickListener(this);
         mCancelButton = (Button)findViewById(R.id.cancel);
         mCancelButton.setOnClickListener(this);
-        mStartButton = (Button) findViewById(R.id.start);
+        mStartButton = findViewById(R.id.start);
         mStartButton.setOnClickListener(this);
-        mStopButton = (Button) findViewById(R.id.stop);
+        mStopButton = findViewById(R.id.stop);
         mStopButton.setOnClickListener(this);
 
         mLog.append("Local Voice Interaction Supported = " + isLocalVoiceInteractionSupported());
diff --git a/tests/WallpaperTest/src/com/example/wallpapertest/MainActivity.java b/tests/WallpaperTest/src/com/example/wallpapertest/MainActivity.java
index 7880f67..63e11a7 100644
--- a/tests/WallpaperTest/src/com/example/wallpapertest/MainActivity.java
+++ b/tests/WallpaperTest/src/com/example/wallpapertest/MainActivity.java
@@ -58,28 +58,28 @@
         mWallpaperManager = (WallpaperManager)getSystemService(Context.WALLPAPER_SERVICE);
         mWindowManager = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
 
-        mDimenWidthView = (TextView) findViewById(R.id.dimen_width);
+        mDimenWidthView = findViewById(R.id.dimen_width);
         mDimenWidthView.addTextChangedListener(mTextWatcher);
-        mDimenHeightView = (TextView) findViewById(R.id.dimen_height);
+        mDimenHeightView = findViewById(R.id.dimen_height);
         mDimenHeightView.addTextChangedListener(mTextWatcher);
 
-        mWallOffXView = (TextView) findViewById(R.id.walloff_x);
+        mWallOffXView = findViewById(R.id.walloff_x);
         mWallOffXView.addTextChangedListener(mTextWatcher);
-        mWallOffYView = (TextView) findViewById(R.id.walloff_y);
+        mWallOffYView = findViewById(R.id.walloff_y);
         mWallOffYView.addTextChangedListener(mTextWatcher);
 
-        mPaddingLeftView = (TextView) findViewById(R.id.padding_left);
+        mPaddingLeftView = findViewById(R.id.padding_left);
         mPaddingLeftView.addTextChangedListener(mTextWatcher);
-        mPaddingRightView = (TextView) findViewById(R.id.padding_right);
+        mPaddingRightView = findViewById(R.id.padding_right);
         mPaddingRightView.addTextChangedListener(mTextWatcher);
-        mPaddingTopView = (TextView) findViewById(R.id.padding_top);
+        mPaddingTopView = findViewById(R.id.padding_top);
         mPaddingTopView.addTextChangedListener(mTextWatcher);
-        mPaddingBottomView = (TextView) findViewById(R.id.padding_bottom);
+        mPaddingBottomView = findViewById(R.id.padding_bottom);
         mPaddingBottomView.addTextChangedListener(mTextWatcher);
 
-        mDispOffXView = (TextView) findViewById(R.id.dispoff_x);
+        mDispOffXView = findViewById(R.id.dispoff_x);
         mDispOffXView.addTextChangedListener(mTextWatcher);
-        mDispOffYView = (TextView) findViewById(R.id.dispoff_y);
+        mDispOffYView = findViewById(R.id.dispoff_y);
         mDispOffYView.addTextChangedListener(mTextWatcher);
 
         updateDimens();