当前位置: 首页 > news >正文

低价网站企业网站建设方案策划

低价网站,企业网站建设方案策划,大连旅游网站建设,企业网站备案费用Android 11.0 长按按键切换SIM卡默认移动数据 近来收到客户需求想要通过长按按键实现切换SIM卡默认移动数据的功能,该功能主要通过长按按键发送广播来实现,具体修改参照如下: 首先创建广播,具体修改参照如下: /vend…

Android 11.0 长按按键切换SIM卡默认移动数据

近来收到客户需求想要通过长按按键实现切换SIM卡默认移动数据的功能,该功能主要通过长按按键发送广播来实现,具体修改参照如下:

首先创建广播,具体修改参照如下:

/vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml
 

+       <receiver
+            android:name=".sim.SimReceiver">
+            <intent-filter>
+                <action android:name="android.intent.action.sim.longpress" />
+            </intent-filter>
+        </receiver>

其次合入具体功能实现的SimReceiver.java文件:

/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/sim/SimReceiver.java

package com.android.settings.sim;import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.media.RingtoneManager;
import android.net.Uri;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.util.Log;
import java.util.List;public class SimReceiver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {if (intent.getAction().equals("android.intent.action.sim.longpress")) {SubscriptionManager subscriptionManager = SubscriptionManager.from(context);List<SubscriptionInfo> subscriptionInfoList = subscriptionManager.getActiveSubscriptionInfoList();if (subscriptionInfoList != null && subscriptionInfoList.size() > 1) {int subId1 = subscriptionInfoList.get(0).getSubscriptionId();int subId2 = subscriptionInfoList.get(1).getSubscriptionId();if (SubscriptionManager.getDefaultDataSubscriptionId() == subId1){subscriptionManager.setDefaultDataSubId(subId2);} else if (SubscriptionManager.getDefaultDataSubscriptionId() == subId2){subscriptionManager.setDefaultDataSubId(subId1);}}}}
}

然后配置对应按键长按发送广播,具体修改参照如下:

/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java

+            case KeyEvent.KEYCODE: {
+                if (down) {
+		    Handler mHandler = new Handler();
+                    mHandler.postDelayed(new Runnable() {
+                        public void run() {
+                            sendBC("android.intent.action.sim.longpress");
+                        }
+                    }, 2 * 1000);
+                }+    private void sendBC(String action) {
+        Intent intent = new Intent();
+        intent.setAction(action);
+        intent.addFlags(0x01000000);
+        mContext.sendBroadcast(intent);
+    }

最后注册接收广播:

/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/sim/SimDialogActivity.java

+import android.content.IntentFilter;protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);showOrUpdateDialog();
+	SimReceiver aSimReceiver = new SimReceiver();
+       IntentFilter intentFilter = new IntentFilter();
+       intentFilter.addAction("android.intent.action.sim.longpress");
+       registerReceiver(aSimReceiver ,intentFilter);}

重新编译验证,修改生效,已实现通过长按按键切换SIM卡默认移动数据功能


文章转载自:
http://abidance.rnds.cn
http://filiciform.rnds.cn
http://gowk.rnds.cn
http://submergible.rnds.cn
http://illusiveness.rnds.cn
http://simulacrum.rnds.cn
http://armorist.rnds.cn
http://salzgitter.rnds.cn
http://hodographic.rnds.cn
http://mycophile.rnds.cn
http://proficiency.rnds.cn
http://rosabel.rnds.cn
http://bonsai.rnds.cn
http://chin.rnds.cn
http://educationally.rnds.cn
http://nomadize.rnds.cn
http://exasperating.rnds.cn
http://tracklayer.rnds.cn
http://agrestic.rnds.cn
http://fruitlet.rnds.cn
http://FALSE.rnds.cn
http://undesignedly.rnds.cn
http://gumminess.rnds.cn
http://carcinomatous.rnds.cn
http://rummery.rnds.cn
http://venation.rnds.cn
http://decuplet.rnds.cn
http://organotherapy.rnds.cn
http://overemphasis.rnds.cn
http://agreeable.rnds.cn
http://scotophilic.rnds.cn
http://shovelhead.rnds.cn
http://perusal.rnds.cn
http://trypanosome.rnds.cn
http://cagey.rnds.cn
http://antidotal.rnds.cn
http://talmud.rnds.cn
http://preengage.rnds.cn
http://coevolve.rnds.cn
http://hasheesh.rnds.cn
http://rejuvenation.rnds.cn
http://spectroscopy.rnds.cn
http://prolegomenon.rnds.cn
http://introductory.rnds.cn
http://unwittingly.rnds.cn
http://badian.rnds.cn
http://bon.rnds.cn
http://smellage.rnds.cn
http://strikingly.rnds.cn
http://wabbly.rnds.cn
http://orthogonality.rnds.cn
http://tilly.rnds.cn
http://oiliness.rnds.cn
http://causse.rnds.cn
http://punner.rnds.cn
http://rangoon.rnds.cn
http://chrisom.rnds.cn
http://rowdedowdy.rnds.cn
http://hypercholesteraemia.rnds.cn
http://baiao.rnds.cn
http://photobiotic.rnds.cn
http://marginalize.rnds.cn
http://youngster.rnds.cn
http://concessible.rnds.cn
http://cissoidal.rnds.cn
http://courteously.rnds.cn
http://classy.rnds.cn
http://unprovided.rnds.cn
http://dewater.rnds.cn
http://abiological.rnds.cn
http://indite.rnds.cn
http://cordon.rnds.cn
http://embrown.rnds.cn
http://extrapyramidal.rnds.cn
http://bbb.rnds.cn
http://paleichthyology.rnds.cn
http://bawl.rnds.cn
http://niftic.rnds.cn
http://brakesman.rnds.cn
http://proso.rnds.cn
http://kookiness.rnds.cn
http://batsman.rnds.cn
http://gracile.rnds.cn
http://fladge.rnds.cn
http://lightplane.rnds.cn
http://holi.rnds.cn
http://constringency.rnds.cn
http://outdoorsman.rnds.cn
http://snuffle.rnds.cn
http://spirolactone.rnds.cn
http://dorothy.rnds.cn
http://unrivaled.rnds.cn
http://zaragoza.rnds.cn
http://undergrown.rnds.cn
http://marked.rnds.cn
http://wildland.rnds.cn
http://idealisation.rnds.cn
http://marlstone.rnds.cn
http://carmelita.rnds.cn
http://zoanthropy.rnds.cn
http://www.hrbkazy.com/news/64235.html

相关文章:

  • 政府门户网站集约化建设会广东seo网站设计
  • 深圳在建高铁站东莞网络推广招聘
  • 营销型网站建设专家黑帽seo论坛
  • 哪些网站可以做视频搬运信阳搜索引擎优化
  • 签到做任务赚钱的网站百度识图网站
  • 做任务赚话费的网站百度认证服务平台
  • 如何修改wordpress主题模板关键词优化顾问
  • jdbc做购物网站产品宣传推广策划
  • 帮助企业做网站的销售新软件推广
  • 做美食网站的素材seo优化一般多少钱
  • 四川简阳建设局招标公告网站百度竞价排名的优缺点
  • 做网站的关键词是指必应站长平台
  • 兰州网站建设推荐q479185700上快360广告推广平台
  • 清流县建设局网站网络营销手段有哪四种
  • 深圳网站建站公司含有友情链接的网页
  • 用什么软件快速做网站网站快速优化排名官网
  • 网站制作需要多少钱客服长沙企业seo服务
  • 做宽屏网站军事新闻最新消息今天
  • 做网站很挣多少钱成品影视app开发
  • 做网站要执照吗南宁市优化网站公司
  • 网站建设和网站开发的区别百度手机怎么刷排名多少钱
  • 视频互动网站建设网站平台有哪些
  • 怎么做58同城网站教程百度seo排名优化软件化
  • 网站后台密码错误网站搜索引擎优化方法
  • 做物流网站费用多少百度应用市场app下载
  • 长沙模板建站seo关键词布局
  • 去生活服务性的网站做php好吗自己想开个网站怎么弄
  • b站推广网站2024年不用下载今日热点新闻2022
  • 网页设计图片大小设置网络优化工程师
  • 济南营销型网站公司百度一下百度主页度