Commit dd2d6b5b authored by Michael W's avatar Michael W

Settings: Allow adding a shortcut for mobile network settings

* This is a forward port of commit
  72806b39
* Instead of directly accessing the network selection,
  we open the parent settings, as the network selection is
  not a subscreen anymore, but just two preferences

Change-Id: I3d56653157b1d773255d2cb34fd995f42572653a
parent 0224ac5d
......@@ -156,6 +156,15 @@
</intent-filter>
</activity>
<activity android:name=".shortcut.MobileNetworkSettings"
android:label="@string/network_settings_shortcut_title"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.android.settings.SHORTCUT" />
</intent-filter>
</activity>
<!-- Wireless Controls -->
<activity
android:name=".Settings$NetworkDashboardActivity"
......
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012-2016 The CyanogenMod Project
Copyright (C) 2019 The LineageOS 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.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Label for settings shortcut: mobile network -->
<string name="network_settings_shortcut_title">Mobile network</string>
</resources>
/*
* Copyright (C) 2014-2016 The CyanogenMod Project
* Copyright (C) 2019 The LineageOS 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.shortcut;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
public class MobileNetworkSettings extends Activity {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.android.phone",
"com.android.phone.MobileNetworkSettings"));
startActivity(intent);
finish();
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment