Align SETTINGS_PACKAGE_NAME reference to a single place
This CL migrated some fragmented declarations of Settings packageName. When we want to referece package name of Settings, we prefer using Utils#SETTINGS_PACKAGE_NAME. Bug: 262123382 Test: make Settings -j64 Change-Id: Ice6afd993d5991bb3c50f676c637b9a5487261f7
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.settings.connecteddevice;
|
||||
|
||||
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
@@ -36,7 +38,6 @@ import com.android.settingslib.search.SearchIndexable;
|
||||
public class ConnectedDeviceDashboardFragment extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "ConnectedDeviceFrag";
|
||||
private static final String SETTINGS_PACKAGE_NAME = "com.android.settings";
|
||||
private static final String SYSTEMUI_PACKAGE_NAME = "com.android.systemui";
|
||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final String SLICE_ACTION = "com.android.settings.SEARCH_RESULT_TRAMPOLINE";
|
||||
|
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.settings.network;
|
||||
|
||||
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
@@ -51,7 +53,7 @@ public class MobileNetworkIntentConverter implements Function<Intent, Intent> {
|
||||
private static final String TAG = "MobileNetworkIntentConverter";
|
||||
|
||||
private static final ComponentName sTargetComponent = ComponentName
|
||||
.createRelative("com.android.settings",
|
||||
.createRelative(SETTINGS_PACKAGE_NAME,
|
||||
MobileNetworkActivity.class.getTypeName());
|
||||
private static final String INTENT_TRAMPOLINE = "android.settings.SEARCH_RESULT_TRAMPOLINE";
|
||||
/**
|
||||
|
@@ -19,6 +19,8 @@ package com.android.settings.network.telephony.gsm;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_START;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
|
||||
|
||||
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -170,8 +172,8 @@ public class AutoSelectPreferenceController extends TelephonyTogglePreferenceCon
|
||||
} else {
|
||||
if (mSwitchPreference != null) {
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName("com.android.settings",
|
||||
"com.android.settings.Settings$NetworkSelectActivity");
|
||||
intent.setClassName(SETTINGS_PACKAGE_NAME,
|
||||
SETTINGS_PACKAGE_NAME + ".Settings$NetworkSelectActivity");
|
||||
intent.putExtra(Settings.EXTRA_SUB_ID, mSubId);
|
||||
mSwitchPreference.setIntent(intent);
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@ package com.android.settings.network.telephony.gsm;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_START;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
|
||||
|
||||
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.provider.Settings;
|
||||
@@ -101,8 +103,8 @@ public class OpenNetworkSelectPagePreferenceController extends
|
||||
!= TelephonyManager.NETWORK_SELECTION_MODE_AUTO);
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName("com.android.settings",
|
||||
"com.android.settings.Settings$NetworkSelectActivity");
|
||||
intent.setClassName(SETTINGS_PACKAGE_NAME,
|
||||
SETTINGS_PACKAGE_NAME + ".Settings$NetworkSelectActivity");
|
||||
intent.putExtra(Settings.EXTRA_SUB_ID, mSubId);
|
||||
preference.setIntent(intent);
|
||||
}
|
||||
|
Reference in New Issue
Block a user