Snap for 7908497 from d8e3836c10 to tm-release
Change-Id: Id111b443e67f2e6521f9adfede2e659f67638aa9
This commit is contained in:
@@ -234,6 +234,11 @@
|
|||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden">
|
android:configChanges="orientation|screenSize|keyboardHidden">
|
||||||
|
<!-- Note: Since the framework does not support the multiple requests of network scan
|
||||||
|
from the UI, this singleTask can protect that there is only one
|
||||||
|
Settings$NetworkSelectActivity which can request the network scan.
|
||||||
|
If removing the "singleTask" in the future, please also modify the
|
||||||
|
Settings$NetworkSelectActivity's structure. -->
|
||||||
<intent-filter android:priority="1">
|
<intent-filter android:priority="1">
|
||||||
<!-- Displays the MobileNetworkActivity and opt-in dialog for capability discovery. -->
|
<!-- Displays the MobileNetworkActivity and opt-in dialog for capability discovery. -->
|
||||||
<action android:name="android.telephony.ims.action.SHOW_CAPABILITY_DISCOVERY_OPT_IN" />
|
<action android:name="android.telephony.ims.action.SHOW_CAPABILITY_DISCOVERY_OPT_IN" />
|
||||||
@@ -351,6 +356,16 @@
|
|||||||
android:value="true" />
|
android:value="true" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name="Settings$NetworkSelectActivity"
|
||||||
|
android:label="@string/choose_network_title"
|
||||||
|
android:configChanges="orientation|keyboard|keyboardHidden|screenSize|screenLayout|smallestScreenSize">
|
||||||
|
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
|
||||||
|
android:value="com.android.settings.network.telephony.NetworkSelectSettings" />
|
||||||
|
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
|
||||||
|
android:value="true" />
|
||||||
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="Settings$WifiDetailsSettingsActivity"
|
android:name="Settings$WifiDetailsSettingsActivity"
|
||||||
android:label="@string/wifi_details_title"
|
android:label="@string/wifi_details_title"
|
||||||
|
|||||||
Binary file not shown.
@@ -1,167 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2021 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:textDirection="locale"
|
|
||||||
android:scrollbarStyle="outsideOverlay"
|
|
||||||
android:gravity="top">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:theme="@style/Theme.AlertDialog"
|
|
||||||
style="@style/AccessibilityDialog">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:paddingLeft="24dp"
|
|
||||||
android:paddingRight="24dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/app_icon"
|
|
||||||
style="@style/AccessibilityDialogServiceIcon" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
style="@style/AccessibilityDialogTitle" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/prompt"
|
|
||||||
android:text="@string/nls_warning_prompt"
|
|
||||||
style="@style/AccessibilityDialogDescription" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginBottom="24dp" >
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/read_icon"
|
|
||||||
android:src="@drawable/ic_visibility_18dp"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
style="@style/AccessibilityDialogIcon" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/read_title"
|
|
||||||
android:text="@string/nls_feature_read_title"
|
|
||||||
style="@style/AccessibilityDialogPermissionTitle" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/read_description"
|
|
||||||
android:text="@string/nls_feature_read_summary"
|
|
||||||
style="@style/AccessibilityDialogPermissionDescription" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginBottom="24dp" >
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/reply_icon"
|
|
||||||
android:src="@drawable/ic_promote_conversation"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
style="@style/AccessibilityDialogIcon" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/reply_title"
|
|
||||||
android:text="@string/nls_feature_reply_title"
|
|
||||||
style="@style/AccessibilityDialogPermissionTitle" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/reply_description"
|
|
||||||
android:text="@string/nls_feature_reply_summary"
|
|
||||||
style="@style/AccessibilityDialogPermissionDescription" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginBottom="24dp" >
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/settings_icon"
|
|
||||||
android:src="@drawable/ic_do_not_disturb_on_24dp"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
style="@style/AccessibilityDialogIcon" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/settings_title"
|
|
||||||
android:text="@string/nls_feature_settings_title"
|
|
||||||
style="@style/AccessibilityDialogPermissionTitle" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/settings_description"
|
|
||||||
android:text="@string/nls_feature_settings_summary"
|
|
||||||
style="@style/AccessibilityDialogPermissionDescription" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Buttons on bottom of dialog -->
|
|
||||||
<LinearLayout
|
|
||||||
style="@style/AccessibilityDialogButtonList">
|
|
||||||
|
|
||||||
<Space
|
|
||||||
style="@style/AccessibilityDialogButtonBarSpace"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/allow_button"
|
|
||||||
android:text="@string/accessibility_dialog_button_allow"
|
|
||||||
style="@style/AccessibilityDialogButton" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/deny_button"
|
|
||||||
android:text="@string/accessibility_dialog_button_deny"
|
|
||||||
style="@style/AccessibilityDialogButton" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
@@ -9392,17 +9392,10 @@
|
|||||||
listener, displayed as a dialog message. [CHAR LIMIT=NONE] -->
|
listener, displayed as a dialog message. [CHAR LIMIT=NONE] -->
|
||||||
<string name="notification_listener_security_warning_summary">
|
<string name="notification_listener_security_warning_summary">
|
||||||
<xliff:g id="notification_listener_name">%1$s</xliff:g> will be able to read all notifications,
|
<xliff:g id="notification_listener_name">%1$s</xliff:g> will be able to read all notifications,
|
||||||
including personal information such as contact names, photos, and the text of messages you receive.
|
including personal information such as contact names and the text of messages you receive.
|
||||||
This app will also be able to snooze or dismiss notifications or take action on buttons in notifications, including answering phone calls.
|
This app will also be able to snooze or dismiss notifications or take action on buttons in notifications, including answering phone calls.
|
||||||
\n\nThis will also give the app the ability to turn Do Not Disturb on or off and change related settings.
|
\n\nThis will also give the app the ability to turn Do Not Disturb on or off and change related settings.
|
||||||
</string>
|
</string>
|
||||||
<string name="nls_warning_prompt"><xliff:g id="notification_listener_name">%1$s</xliff:g> will be able to:</string>
|
|
||||||
<string name="nls_feature_read_title">Read your notifications</string>
|
|
||||||
<string name="nls_feature_read_summary">It can read your notifications, including personal information such as contacts, messages, and photos.</string>
|
|
||||||
<string name="nls_feature_reply_title">Reply to messages</string>
|
|
||||||
<string name="nls_feature_reply_summary">It can reply to messages and take action on buttons in notifications, including snoozing or dismissing notifications and answering calls.</string>
|
|
||||||
<string name="nls_feature_settings_title">Change settings</string>
|
|
||||||
<string name="nls_feature_settings_summary">It can turn Do Not Disturb on or off and change related settings.</string>
|
|
||||||
<string name="notification_listener_disable_warning_summary">
|
<string name="notification_listener_disable_warning_summary">
|
||||||
If you turn off notification access for <xliff:g id="notification_listener_name">%1$s</xliff:g>, Do Not Disturb access may also be turned off.
|
If you turn off notification access for <xliff:g id="notification_listener_name">%1$s</xliff:g>, Do Not Disturb access may also be turned off.
|
||||||
</string>
|
</string>
|
||||||
|
|||||||
@@ -223,7 +223,6 @@
|
|||||||
<Preference
|
<Preference
|
||||||
android:key="choose_network_key"
|
android:key="choose_network_key"
|
||||||
android:title="@string/choose_network_title"
|
android:title="@string/choose_network_title"
|
||||||
android:fragment="com.android.phone.NetworkSelectSetting"
|
|
||||||
settings:controller="com.android.settings.network.telephony.gsm.OpenNetworkSelectPagePreferenceController"/>
|
settings:controller="com.android.settings.network.telephony.gsm.OpenNetworkSelectPagePreferenceController"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ public class Settings extends SettingsActivity {
|
|||||||
public static class WifiSettingsActivity extends SettingsActivity { /* empty */ }
|
public static class WifiSettingsActivity extends SettingsActivity { /* empty */ }
|
||||||
public static class WifiSettings2Activity extends SettingsActivity { /* empty */ }
|
public static class WifiSettings2Activity extends SettingsActivity { /* empty */ }
|
||||||
public static class NetworkProviderSettingsActivity extends SettingsActivity { /* empty */ }
|
public static class NetworkProviderSettingsActivity extends SettingsActivity { /* empty */ }
|
||||||
|
public static class NetworkSelectActivity extends SettingsActivity { /* empty */ }
|
||||||
/** Activity for the Wi-Fi network details settings. */
|
/** Activity for the Wi-Fi network details settings. */
|
||||||
public static class WifiDetailsSettingsActivity extends SettingsActivity { /* empty */ }
|
public static class WifiDetailsSettingsActivity extends SettingsActivity { /* empty */ }
|
||||||
public static class WifiP2pSettingsActivity extends SettingsActivity { /* empty */ }
|
public static class WifiP2pSettingsActivity extends SettingsActivity { /* empty */ }
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import androidx.window.embedding.SplitController;
|
|||||||
import androidx.window.embedding.SplitPairFilter;
|
import androidx.window.embedding.SplitPairFilter;
|
||||||
import androidx.window.embedding.SplitPairRule;
|
import androidx.window.embedding.SplitPairRule;
|
||||||
import androidx.window.embedding.SplitPlaceholderRule;
|
import androidx.window.embedding.SplitPlaceholderRule;
|
||||||
|
import androidx.window.embedding.SplitRule;
|
||||||
|
|
||||||
import com.android.settings.Settings;
|
import com.android.settings.Settings;
|
||||||
import com.android.settings.SubSettings;
|
import com.android.settings.SubSettings;
|
||||||
@@ -81,8 +82,8 @@ public class ActivityEmbeddingRulesController {
|
|||||||
secondaryIntentAction));
|
secondaryIntentAction));
|
||||||
|
|
||||||
SplitController.getInstance().registerRule(new SplitPairRule(filters,
|
SplitController.getInstance().registerRule(new SplitPairRule(filters,
|
||||||
finishPrimaryWithSecondary,
|
finishPrimaryWithSecondary ? SplitRule.FINISH_ADJACENT : SplitRule.FINISH_NEVER,
|
||||||
finishSecondaryWithPrimary,
|
finishSecondaryWithPrimary ? SplitRule.FINISH_ADJACENT : SplitRule.FINISH_NEVER,
|
||||||
clearTop,
|
clearTop,
|
||||||
ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthPx(context),
|
ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthPx(context),
|
||||||
ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthPx(context),
|
ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthPx(context),
|
||||||
@@ -154,6 +155,8 @@ public class ActivityEmbeddingRulesController {
|
|||||||
final SplitPlaceholderRule placeholderRule = new SplitPlaceholderRule(
|
final SplitPlaceholderRule placeholderRule = new SplitPlaceholderRule(
|
||||||
activityFilters,
|
activityFilters,
|
||||||
intent,
|
intent,
|
||||||
|
true /* stickyPlaceholder */,
|
||||||
|
SplitRule.FINISH_ADJACENT,
|
||||||
ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthPx(mContext),
|
ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthPx(mContext),
|
||||||
ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthPx(mContext),
|
ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthPx(mContext),
|
||||||
ActivityEmbeddingUtils.SPLIT_RATIO,
|
ActivityEmbeddingUtils.SPLIT_RATIO,
|
||||||
|
|||||||
@@ -18,15 +18,8 @@ package com.android.settings.applications.specialaccess.notificationaccess;
|
|||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.DialogInterface;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
@@ -62,49 +55,25 @@ public class ScaryWarningDialogFragment extends InstrumentedDialogFragment {
|
|||||||
.getString(KEY_COMPONENT));
|
.getString(KEY_COMPONENT));
|
||||||
NotificationAccessDetails parent = (NotificationAccessDetails) getTargetFragment();
|
NotificationAccessDetails parent = (NotificationAccessDetails) getTargetFragment();
|
||||||
|
|
||||||
|
final String title = getResources().getString(
|
||||||
|
R.string.notification_listener_security_warning_title, label);
|
||||||
|
final String summary = getResources().getString(
|
||||||
|
R.string.notification_listener_security_warning_summary, label);
|
||||||
return new AlertDialog.Builder(getContext())
|
return new AlertDialog.Builder(getContext())
|
||||||
.setView(getDialogView(getContext(), label, parent, cn))
|
.setMessage(summary)
|
||||||
|
.setTitle(title)
|
||||||
.setCancelable(true)
|
.setCancelable(true)
|
||||||
|
.setPositiveButton(R.string.allow,
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
parent.enable(cn);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(R.string.deny,
|
||||||
|
(dialog, id) -> {
|
||||||
|
// pass
|
||||||
|
})
|
||||||
.create();
|
.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
private View getDialogView(Context context, CharSequence label,
|
|
||||||
NotificationAccessDetails parent, ComponentName cn) {
|
|
||||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
|
|
||||||
Context.LAYOUT_INFLATER_SERVICE);
|
|
||||||
|
|
||||||
View content = inflater.inflate(R.layout.enable_nls_dialog_content, null);
|
|
||||||
|
|
||||||
Drawable icon = null;
|
|
||||||
try {
|
|
||||||
icon = context.getPackageManager().getApplicationIcon(cn.getPackageName());
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageView appIcon = content.findViewById(R.id.app_icon);
|
|
||||||
if (icon != null) {
|
|
||||||
appIcon.setImageDrawable(icon);
|
|
||||||
} else {
|
|
||||||
appIcon.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
final String title = context.getResources().getString(
|
|
||||||
R.string.notification_listener_security_warning_title, label);
|
|
||||||
((TextView) content.findViewById(R.id.title)).setText(title);
|
|
||||||
|
|
||||||
final String prompt = context.getResources().getString(
|
|
||||||
R.string.nls_warning_prompt, label);
|
|
||||||
((TextView) content.findViewById(R.id.prompt)).setText(prompt);
|
|
||||||
|
|
||||||
Button allowButton = content.findViewById(R.id.allow_button);
|
|
||||||
allowButton.setOnClickListener((view) -> {
|
|
||||||
parent.enable(cn);
|
|
||||||
dismiss();
|
|
||||||
});
|
|
||||||
Button denyButton = content.findViewById(R.id.deny_button);
|
|
||||||
denyButton.setOnClickListener((view) -> {
|
|
||||||
dismiss();
|
|
||||||
});
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -120,6 +120,7 @@ import com.android.settings.network.NetworkDashboardFragment;
|
|||||||
import com.android.settings.network.NetworkProviderSettings;
|
import com.android.settings.network.NetworkProviderSettings;
|
||||||
import com.android.settings.network.apn.ApnEditor;
|
import com.android.settings.network.apn.ApnEditor;
|
||||||
import com.android.settings.network.apn.ApnSettings;
|
import com.android.settings.network.apn.ApnSettings;
|
||||||
|
import com.android.settings.network.telephony.NetworkSelectSettings;
|
||||||
import com.android.settings.nfc.AndroidBeam;
|
import com.android.settings.nfc.AndroidBeam;
|
||||||
import com.android.settings.nfc.PaymentSettings;
|
import com.android.settings.nfc.PaymentSettings;
|
||||||
import com.android.settings.notification.ConfigureNotificationSettings;
|
import com.android.settings.notification.ConfigureNotificationSettings;
|
||||||
@@ -319,6 +320,7 @@ public class SettingsGateway {
|
|||||||
InteractAcrossProfilesDetails.class.getName(),
|
InteractAcrossProfilesDetails.class.getName(),
|
||||||
MediaControlsSettings.class.getName(),
|
MediaControlsSettings.class.getName(),
|
||||||
NetworkProviderSettings.class.getName(),
|
NetworkProviderSettings.class.getName(),
|
||||||
|
NetworkSelectSettings.class.getName(),
|
||||||
AlarmsAndRemindersDetails.class.getName(),
|
AlarmsAndRemindersDetails.class.getName(),
|
||||||
MediaManagementAppsDetails.class.getName(),
|
MediaManagementAppsDetails.class.getName(),
|
||||||
AutoBrightnessSettings.class.getName()
|
AutoBrightnessSettings.class.getName()
|
||||||
@@ -343,6 +345,7 @@ public class SettingsGateway {
|
|||||||
Settings.WifiSettingsActivity.class.getName(),
|
Settings.WifiSettingsActivity.class.getName(),
|
||||||
Settings.DataUsageSummaryActivity.class.getName(),
|
Settings.DataUsageSummaryActivity.class.getName(),
|
||||||
Settings.NetworkProviderSettingsActivity.class.getName(),
|
Settings.NetworkProviderSettingsActivity.class.getName(),
|
||||||
|
Settings.NetworkSelectActivity.class.getName(),
|
||||||
// Home page > Connected devices
|
// Home page > Connected devices
|
||||||
Settings.BluetoothSettingsActivity.class.getName(),
|
Settings.BluetoothSettingsActivity.class.getName(),
|
||||||
Settings.WifiDisplaySettingsActivity.class.getName(),
|
Settings.WifiDisplaySettingsActivity.class.getName(),
|
||||||
|
|||||||
@@ -272,8 +272,6 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
|
|||||||
if (mWifiManager != null) {
|
if (mWifiManager != null) {
|
||||||
setLoading(true, false);
|
setLoading(true, false);
|
||||||
mIsViewLoading = true;
|
mIsViewLoading = true;
|
||||||
getView().postDelayed(mRemoveLoadingRunnable,
|
|
||||||
mWifiManager.isWifiEnabled() ? 1000 : 100);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,6 +429,10 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
if (mIsViewLoading) {
|
||||||
|
final long delayMillis = mWifiManager.isWifiEnabled() ? 1000 : 100;
|
||||||
|
getView().postDelayed(mRemoveLoadingRunnable, delayMillis);
|
||||||
|
}
|
||||||
if (mIsRestricted) {
|
if (mIsRestricted) {
|
||||||
restrictUi();
|
restrictUi();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.android.settings.network.telephony;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
@@ -101,7 +102,7 @@ public class NetworkSelectSettings extends DashboardFragment {
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
protected void onCreateInitialization() {
|
protected void onCreateInitialization() {
|
||||||
mUseNewApi = enableNewAutoSelectNetworkUI(getContext());
|
mUseNewApi = enableNewAutoSelectNetworkUI(getContext());
|
||||||
mSubId = getArguments().getInt(Settings.EXTRA_SUB_ID);
|
mSubId = getSubId();
|
||||||
|
|
||||||
mPreferenceCategory = getPreferenceCategory(PREF_KEY_NETWORK_OPERATORS);
|
mPreferenceCategory = getPreferenceCategory(PREF_KEY_NETWORK_OPERATORS);
|
||||||
mStatusMessagePreference = new Preference(getContext());
|
mStatusMessagePreference = new Preference(getContext());
|
||||||
@@ -120,7 +121,7 @@ public class NetworkSelectSettings extends DashboardFragment {
|
|||||||
mMetricsFeatureProvider = getMetricsFeatureProvider(getContext());
|
mMetricsFeatureProvider = getMetricsFeatureProvider(getContext());
|
||||||
mIsAggregationEnabled = enableAggregation(getContext());
|
mIsAggregationEnabled = enableAggregation(getContext());
|
||||||
Log.d(TAG, "init: mUseNewApi:" + mUseNewApi
|
Log.d(TAG, "init: mUseNewApi:" + mUseNewApi
|
||||||
+ " ,mIsAggregationEnabled:" + mIsAggregationEnabled);
|
+ " ,mIsAggregationEnabled:" + mIsAggregationEnabled + " ,mSubId:" + mSubId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Keep
|
@Keep
|
||||||
@@ -174,6 +175,18 @@ public class NetworkSelectSettings extends DashboardFragment {
|
|||||||
getPreferenceScreen().setEnabled(enable);
|
getPreferenceScreen().setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
@VisibleForTesting
|
||||||
|
protected int getSubId() {
|
||||||
|
int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
|
Intent intent = getActivity().getIntent();
|
||||||
|
if (intent != null) {
|
||||||
|
subId = intent.getIntExtra(Settings.EXTRA_SUB_ID,
|
||||||
|
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
|
||||||
|
}
|
||||||
|
return subId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|||||||
@@ -20,9 +20,8 @@ import static androidx.lifecycle.Lifecycle.Event.ON_START;
|
|||||||
import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
|
import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.app.settings.SettingsEnums;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.content.Intent;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.HandlerExecutor;
|
import android.os.HandlerExecutor;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
@@ -43,10 +42,8 @@ import androidx.preference.PreferenceScreen;
|
|||||||
import androidx.preference.SwitchPreference;
|
import androidx.preference.SwitchPreference;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.core.SubSettingLauncher;
|
|
||||||
import com.android.settings.network.AllowedNetworkTypesListener;
|
import com.android.settings.network.AllowedNetworkTypesListener;
|
||||||
import com.android.settings.network.telephony.MobileNetworkUtils;
|
import com.android.settings.network.telephony.MobileNetworkUtils;
|
||||||
import com.android.settings.network.telephony.NetworkSelectSettings;
|
|
||||||
import com.android.settings.network.telephony.TelephonyTogglePreferenceController;
|
import com.android.settings.network.telephony.TelephonyTogglePreferenceController;
|
||||||
import com.android.settingslib.utils.ThreadUtils;
|
import com.android.settingslib.utils.ThreadUtils;
|
||||||
|
|
||||||
@@ -151,25 +148,26 @@ public class AutoSelectPreferenceController extends TelephonyTogglePreferenceCon
|
|||||||
public boolean setChecked(boolean isChecked) {
|
public boolean setChecked(boolean isChecked) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
setAutomaticSelectionMode();
|
setAutomaticSelectionMode();
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
final Bundle bundle = new Bundle();
|
if (mSwitchPreference != null) {
|
||||||
bundle.putInt(Settings.EXTRA_SUB_ID, mSubId);
|
Intent intent = new Intent();
|
||||||
new SubSettingLauncher(mContext)
|
intent.setClassName("com.android.settings",
|
||||||
.setDestination(NetworkSelectSettings.class.getName())
|
"com.android.settings.Settings$NetworkSelectActivity");
|
||||||
.setSourceMetricsCategory(SettingsEnums.MOBILE_NETWORK_SELECT)
|
intent.putExtra(Settings.EXTRA_SUB_ID, mSubId);
|
||||||
.setTitleRes(R.string.choose_network_title)
|
mSwitchPreference.setIntent(intent);
|
||||||
.setArguments(bundle)
|
}
|
||||||
.launch();
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
Future setAutomaticSelectionMode() {
|
Future setAutomaticSelectionMode() {
|
||||||
final long startMillis = SystemClock.elapsedRealtime();
|
final long startMillis = SystemClock.elapsedRealtime();
|
||||||
showAutoSelectProgressBar();
|
showAutoSelectProgressBar();
|
||||||
mSwitchPreference.setEnabled(false);
|
if (mSwitchPreference != null) {
|
||||||
|
mSwitchPreference.setIntent(null);
|
||||||
|
mSwitchPreference.setEnabled(false);
|
||||||
|
}
|
||||||
return ThreadUtils.postOnBackgroundThread(() -> {
|
return ThreadUtils.postOnBackgroundThread(() -> {
|
||||||
// set network selection mode in background
|
// set network selection mode in background
|
||||||
mTelephonyManager.setNetworkSelectionModeAutomatic();
|
mTelephonyManager.setNetworkSelectionModeAutomatic();
|
||||||
|
|||||||
@@ -19,14 +19,12 @@ package com.android.settings.network.telephony.gsm;
|
|||||||
import static androidx.lifecycle.Lifecycle.Event.ON_START;
|
import static androidx.lifecycle.Lifecycle.Event.ON_START;
|
||||||
import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
|
import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
|
||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.content.Intent;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.telephony.ServiceState;
|
import android.telephony.ServiceState;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import androidx.lifecycle.Lifecycle;
|
import androidx.lifecycle.Lifecycle;
|
||||||
import androidx.lifecycle.LifecycleObserver;
|
import androidx.lifecycle.LifecycleObserver;
|
||||||
@@ -35,10 +33,8 @@ import androidx.preference.Preference;
|
|||||||
import androidx.preference.PreferenceScreen;
|
import androidx.preference.PreferenceScreen;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.core.SubSettingLauncher;
|
|
||||||
import com.android.settings.network.AllowedNetworkTypesListener;
|
import com.android.settings.network.AllowedNetworkTypesListener;
|
||||||
import com.android.settings.network.telephony.MobileNetworkUtils;
|
import com.android.settings.network.telephony.MobileNetworkUtils;
|
||||||
import com.android.settings.network.telephony.NetworkSelectSettings;
|
|
||||||
import com.android.settings.network.telephony.TelephonyBasePreferenceController;
|
import com.android.settings.network.telephony.TelephonyBasePreferenceController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,6 +98,12 @@ public class OpenNetworkSelectPagePreferenceController extends
|
|||||||
super.updateState(preference);
|
super.updateState(preference);
|
||||||
preference.setEnabled(mTelephonyManager.getNetworkSelectionMode()
|
preference.setEnabled(mTelephonyManager.getNetworkSelectionMode()
|
||||||
!= TelephonyManager.NETWORK_SELECTION_MODE_AUTO);
|
!= TelephonyManager.NETWORK_SELECTION_MODE_AUTO);
|
||||||
|
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setClassName("com.android.settings",
|
||||||
|
"com.android.settings.Settings$NetworkSelectActivity");
|
||||||
|
intent.putExtra(Settings.EXTRA_SUB_ID, mSubId);
|
||||||
|
preference.setIntent(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -114,23 +116,6 @@ public class OpenNetworkSelectPagePreferenceController extends
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
|
||||||
if (TextUtils.equals(preference.getKey(), getPreferenceKey())) {
|
|
||||||
final Bundle bundle = new Bundle();
|
|
||||||
bundle.putInt(Settings.EXTRA_SUB_ID, mSubId);
|
|
||||||
new SubSettingLauncher(mContext)
|
|
||||||
.setDestination(NetworkSelectSettings.class.getName())
|
|
||||||
.setSourceMetricsCategory(SettingsEnums.MOBILE_NETWORK_SELECT)
|
|
||||||
.setTitleRes(R.string.choose_network_title)
|
|
||||||
.setArguments(bundle)
|
|
||||||
.launch();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OpenNetworkSelectPagePreferenceController init(Lifecycle lifecycle, int subId) {
|
public OpenNetworkSelectPagePreferenceController init(Lifecycle lifecycle, int subId) {
|
||||||
mSubId = subId;
|
mSubId = subId;
|
||||||
mTelephonyManager = mContext.getSystemService(TelephonyManager.class)
|
mTelephonyManager = mContext.getSystemService(TelephonyManager.class)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import android.content.Context;
|
|||||||
import android.content.pm.UserInfo;
|
import android.content.pm.UserInfo;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
import android.os.Trace;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -344,6 +345,7 @@ public class UserDetailsSettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void switchUser() {
|
void switchUser() {
|
||||||
|
Trace.beginSection("UserDetailSettings.switchUser");
|
||||||
try {
|
try {
|
||||||
if (mUserInfo.isGuest()) {
|
if (mUserInfo.isGuest()) {
|
||||||
mMetricsFeatureProvider.action(getActivity(), SettingsEnums.ACTION_SWITCH_TO_GUEST);
|
mMetricsFeatureProvider.action(getActivity(), SettingsEnums.ACTION_SWITCH_TO_GUEST);
|
||||||
@@ -352,6 +354,7 @@ public class UserDetailsSettings extends SettingsPreferenceFragment
|
|||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
Log.e(TAG, "Error while switching to other user.");
|
Log.e(TAG, "Error while switching to other user.");
|
||||||
} finally {
|
} finally {
|
||||||
|
Trace.endSection();
|
||||||
finishFragment();
|
finishFragment();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import android.os.Handler;
|
|||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
import android.os.Trace;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.provider.ContactsContract;
|
import android.provider.ContactsContract;
|
||||||
@@ -798,6 +799,7 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addUserNow(final int userType) {
|
private void addUserNow(final int userType) {
|
||||||
|
Trace.beginAsyncSection("UserSettings.addUserNow", 0);
|
||||||
synchronized (mUserLock) {
|
synchronized (mUserLock) {
|
||||||
mAddingUser = true;
|
mAddingUser = true;
|
||||||
mAddingUserName = userType == USER_TYPE_USER
|
mAddingUserName = userType == USER_TYPE_USER
|
||||||
@@ -824,6 +826,11 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
runAddUser();
|
||||||
|
Trace.endAsyncSection("UserSettings.addUserNow", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void runAddUser() {
|
||||||
UserInfo user;
|
UserInfo user;
|
||||||
String username;
|
String username;
|
||||||
|
|
||||||
@@ -1198,8 +1205,10 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
} else if (pref == mAddGuest) {
|
} else if (pref == mAddGuest) {
|
||||||
mAddGuest.setEnabled(false); // prevent multiple tap issue
|
mAddGuest.setEnabled(false); // prevent multiple tap issue
|
||||||
mMetricsFeatureProvider.action(getActivity(), SettingsEnums.ACTION_USER_GUEST_ADD);
|
mMetricsFeatureProvider.action(getActivity(), SettingsEnums.ACTION_USER_GUEST_ADD);
|
||||||
|
Trace.beginSection("UserSettings.addGuest");
|
||||||
UserInfo guest = mUserManager.createGuest(
|
UserInfo guest = mUserManager.createGuest(
|
||||||
getContext(), getString(com.android.settingslib.R.string.user_guest));
|
getContext(), getString(com.android.settingslib.R.string.user_guest));
|
||||||
|
Trace.endSection();
|
||||||
if (guest == null) {
|
if (guest == null) {
|
||||||
Toast.makeText(getContext(),
|
Toast.makeText(getContext(),
|
||||||
com.android.settingslib.R.string.add_user_failed,
|
com.android.settingslib.R.string.add_user_failed,
|
||||||
|
|||||||
@@ -122,10 +122,6 @@ public class NetworkSelectSettingsTest {
|
|||||||
|
|
||||||
public TargetClass(NetworkSelectSettingsTest env) {
|
public TargetClass(NetworkSelectSettingsTest env) {
|
||||||
mTestEnv = env;
|
mTestEnv = env;
|
||||||
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putInt(Settings.EXTRA_SUB_ID, SUB_ID);
|
|
||||||
setArguments(bundle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -184,6 +180,11 @@ public class NetworkSelectSettingsTest {
|
|||||||
protected boolean enableAggregation(Context context) {
|
protected boolean enableAggregation(Context context) {
|
||||||
return mTestEnv.mIsAggregationEnabled;
|
return mTestEnv.mIsAggregationEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getSubId() {
|
||||||
|
return SUB_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user