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

Commit 987af858 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10306978 from decc4288 to udc-release

Change-Id: I48bcab4f28d9750df250f50c6a9b10c75b8a40a7
parents 0cfd76f0 decc4288
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@
    <!-- Connected devices settings. Title of the preference to show the entrance of the hearing device controls related page. [CHAR LIMIT=65] -->
    <string name="bluetooth_device_controls_title">Hearing device settings</string>
    <!-- Connected devices settings. Title of the preference to show the entrance of the hearing device controls related page. [CHAR LIMIT=65] -->
    <string name="bluetooth_device_controls_summary">Audio output, shortcut, hearing aid compatibility</string>
    <string name="bluetooth_device_controls_summary">Shortcut, hearing aid compatibility</string>
    <!-- Title for this device specific controls section. [CHAR LIMIT=30] -->
    <string name="bluetooth_device_controls_specific">For this device</string>
    <!-- Connected devices settings. Title of the preference to show the entrance of the audio output page. It can change different types of audio are played on phone or other bluetooth devices. [CHAR LIMIT=35] -->
@@ -2642,6 +2642,8 @@
    <string name="model_info">Model</string>
    <!-- Label for device's hardware revision value [CHAR LIMIT=40] -->
    <string name="hardware_revision">Hardware version</string>
    <!-- Label for device's manufactured year value [CHAR LIMIT=40] -->
    <string name="manufactured_year">Manufactured year</string>
    <!-- About phone screen, fcc equipment id label  [CHAR LIMIT=40] -->
    <string name="fcc_equipment_id">Equipment ID</string>
    <!-- About phone screen,  setting option name  [CHAR LIMIT=40] -->
+9 −0
Original line number Diff line number Diff line
@@ -48,4 +48,13 @@
        settings:controller="com.android.settings.deviceinfo.hardwareinfo.HardwareRevisionPreferenceController"
        settings:enableCopying="true"/>

    <!-- Manufactured year -->
    <Preference
        android:key="hardware_info_manufactured_year"
        android:title="@string/manufactured_year"
        android:summary="@string/summary_placeholder"
        android:selectable="false"
        settings:controller="com.android.settings.deviceinfo.hardwareinfo.ManufacturedYearPreferenceController"
        settings:enableCopying="true"/>

</PreferenceScreen>
+66 −59
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ import android.text.TextUtils.TruncateAt;
import android.util.EventLog;
import android.util.Log;
import android.view.Display;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -155,8 +156,8 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {

        mHandler = new Handler(getMainLooper());

        mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
        mAppOps = (AppOpsManager)getSystemService(Context.APP_OPS_SERVICE);
        mDPM = getSystemService(DevicePolicyManager.class);
        mAppOps = getSystemService(AppOpsManager.class);
        mLayoutInflaternflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        PackageManager packageManager = getPackageManager();

@@ -420,8 +421,8 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {

        final View restrictedAction = findViewById(R.id.restricted_action);
        restrictedAction.setFilterTouchesWhenObscured(true);
        restrictedAction.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

        final View.OnClickListener restrictedActionClickListener = v -> {
            if (!mActionButton.isEnabled()) {
                showPolicyTransparencyDialogIfRequired();
                return;
@@ -464,14 +465,20 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
                            }
                        }, mHandler));
                // Don't want to wait too long.
                    getWindow().getDecorView().getHandler().postDelayed(new Runnable() {
                        @Override public void run() {
                            continueRemoveAction(null);
                        }
                    }, 2*1000);
                }
                getWindow().getDecorView().getHandler().postDelayed(
                        () -> continueRemoveAction(null), 2 * 1000);
            }
        };
        restrictedAction.setOnKeyListener((view, keyCode, keyEvent) -> {
            if ((keyEvent.getFlags() & KeyEvent.FLAG_FROM_SYSTEM) == 0) {
                Log.e(TAG, "Can not activate device-admin with KeyEvent from non-system app.");
                // Consume event to suppress click.
                return true;
            }
            // Fallback to view click handler.
            return false;
        });
        restrictedAction.setOnClickListener(restrictedActionClickListener);
    }

    /**
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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.
 */
package com.android.settings.deviceinfo.hardwareinfo

/**
 * Feature provider for hardware info
 */
interface HardwareInfoFeatureProvider {
    /**
     * Returns the manufactured year
     */
    val manufacturedYear: String?
}
 No newline at end of file
+24 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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.
 */
package com.android.settings.deviceinfo.hardwareinfo

/**
 * Feature provider for hardware info
 */
object HardwareInfoFeatureProviderImpl : HardwareInfoFeatureProvider {
    override val manufacturedYear: String?
        get() = null
}
 No newline at end of file
Loading