Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7dbbe131 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Add disabled by policy empty views to more screens.

Bug: 27214401
Change-Id: I6cd4292a63610671070bf2134105e9e348c3ab32
parent 5d8e963c
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -13,15 +13,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- Layout used for displaying admin support details in empty preference fragments. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/admin_support_details"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="@*android:dimen/preference_fragment_padding_side"
        android:gravity="center_vertical"
        android:orientation="vertical"
        android:visibility="gone">
<merge xmlns:android="http://schemas.android.com/apk/res/android">
    <TextView android:id="@+id/admin_support_msg"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
@@ -39,4 +31,4 @@
            android:textColor="?android:attr/colorAccent"
            android:clickable="true"
            android:background="?android:attr/selectableItemBackground" />
</LinearLayout>
 No newline at end of file
</merge>
 No newline at end of file
+1 −17
Original line number Diff line number Diff line
@@ -46,23 +46,7 @@
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
            <TextView android:id="@+id/admin_support_msg"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textAppearance="@android:style/TextAppearance.Material.Subhead"
                    android:text="@string/default_admin_support_msg"
                    android:maxLength="200"
                    android:autoLink="email|phone"
                    android:textColor="?android:attr/textColorSecondary" />
            <TextView android:id="@+id/admins_policies_list"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingTop="@dimen/admin_details_dialog_link_padding_top"
                    android:text="@string/admin_support_more_info"
                    android:textAppearance="@android:style/TextAppearance.Material.Subhead"
                    android:textColor="?android:attr/colorAccent"
                    android:clickable="true"
                    android:background="?android:attr/selectableItemBackground" />
            <include layout="@layout/admin_support_details_content" />
        </LinearLayout>
    </ScrollView>
</LinearLayout>
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- Layout used for displaying admin support details in empty preference fragments. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/admin_support_details"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="@*android:dimen/preference_fragment_padding_side"
        android:gravity="center_vertical"
        android:orientation="vertical"
        android:visibility="gone">
    <include layout="@layout/admin_support_details_content" />
</LinearLayout>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@
        android:gravity="center"
        android:visibility="gone" />

    <include layout="@layout/admin_support_details_content" />
    <include layout="@layout/admin_support_details_empty_view" />

    <RelativeLayout android:id="@+id/button_bar"
        android:layout_height="wrap_content"
+10 −8
Original line number Diff line number Diff line
@@ -76,7 +76,6 @@ import android.view.accessibility.AccessibilityManager;
import android.webkit.IWebViewUpdateService;
import android.webkit.WebViewProviderInfo;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;

import com.android.internal.app.LocalePicker;
@@ -95,7 +94,7 @@ import java.util.List;
/*
 * Displays preferences for application developers.
 */
public class DevelopmentSettings extends SettingsPreferenceFragment
public class DevelopmentSettings extends RestrictedSettingsFragment
        implements DialogInterface.OnClickListener, DialogInterface.OnDismissListener,
                OnPreferenceChangeListener, SwitchBar.OnSwitchChangeListener, Indexable {
    private static final String TAG = "DevelopmentSettings";
@@ -317,6 +316,10 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
    private Dialog mAdbKeysDialog;
    private boolean mUnavailable;

    public DevelopmentSettings() {
        super(UserManager.DISALLOW_DEBUGGING_FEATURES);
    }

    @Override
    protected int getMetricsCategory() {
        return MetricsEvent.DEVELOPMENT;
@@ -337,8 +340,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment

        mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);

        if (!mUm.isAdminUser()
                || mUm.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)
        setIfOnlyAvailableForAdmins(true);
        if (isUiRestricted()
                || Settings.Global.getInt(getActivity().getContentResolver(),
                        Settings.Global.DEVICE_PROVISIONED, 0) == 0) {
            // Block access to developer options if the user is not the owner, if user policy
@@ -582,11 +585,10 @@ public class DevelopmentSettings extends SettingsPreferenceFragment

        if (mUnavailable) {
            // Show error message
            TextView emptyView = (TextView) getView().findViewById(android.R.id.empty);
            setEmptyView(emptyView);
            if (emptyView != null) {
                emptyView.setText(R.string.development_settings_not_available);
            if (!isUiRestrictedByOnlyAdmin()) {
                getEmptyTextView().setText(R.string.development_settings_not_available);
            }
            getPreferenceScreen().removeAll();
            return;
        }

Loading