屏蔽关机全屏应用在recent列表中显示

屏蔽关机全屏应用在recent列表中显示

客户要求关机界面全屏,尝试修改framework无果,最后采用广播方法,调用自己写的关机APP。但是在按任务键的时候可以看到该应用,这是我们不希望看到的。所以想个办法隐藏掉它。

diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java 
old mode 100644
new mode 100755
index 1011fda..bc844fd
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java
@@ -151,12 +151,12 @@ public class RecentTasksLoader implements View.OnTouchListener {
         Intent i = new Intent("android.intent.action.MAIN");
         i.addCategory("android.intent.category.HOME");
         List<ResolveInfo> lst = pm.queryIntentActivities(i, 0);
         if (lst != null) {
             for (ResolveInfo resolveInfo : lst) {
                 homeAI = resolveInfo.activityInfo;

                if (homeAI != null 
                     && homeAI.packageName.equals(component.getPackageName())
                     && homeAI.name.equals(component.getClassName())){
                     return true;
@@ -167,6 +167,30 @@ public class RecentTasksLoader implements View.OnTouchListener {
         return false;
     }

+
+       private boolean isCurrentDyBootActivity(ComponentName component, ActivityInfo 
+               // Don't load DyBoot activity @xiabaoyuan
+               ActivityInfo DyBoot;
+               PackageManager pm_ = mContext.getPackageManager();
+               Intent i_ = new Intent("android.intent.action.DYNA_REBOOT");
+               i_.addCategory("android.intent.category.DEFAULT");
+               List<ResolveInfo> lst_ = pm_.queryIntentActivities(i_, 0);
+
+               if (lst_ != null) {
+                       for (ResolveInfo resolveInfo_ : lst_) {
+                               DyBoot = resolveInfo_.activityInfo;
+
+                               if (DyBoot != null
+                                       && DyBoot.packageName.equals(component.getPack
+                                       && DyBoot.name.equals(component.getClassName()
+                                       return true;
+                               }
+                       }
+               }
+
+               return false;
+    }
+
     // Create an TaskDescription, returning null if the title or icon is null
     TaskDescription createTaskDescription(int taskId, int persistentTaskId, Intent ba
             ComponentName origActivity, CharSequence description) {
@@ -396,11 +420,18 @@ public class RecentTasksLoader implements View.OnTouchListener {
                 return null;
             }

+            // Don't load DyBoot activity
+            if (isCurrentDyBootActivity(intent.getComponent(), null)) {
+                return null;
+            }
+
+
             // Don't load ourselves
             if (intent.getComponent().getPackageName().equals(mContext.getPackageName
                 return null;
             }

             item = createTaskDescription(recentInfo.id,
                     recentInfo.persistentId, recentInfo.baseIntent,
                     recentInfo.origActivity, recentInfo.description);
@@ -484,6 +515,11 @@ public class RecentTasksLoader implements View.OnTouchListener {
                         continue;
                     }

+                    // Don't load DyBoot activity
+                    if (isCurrentDyBootActivity(intent.getComponent(), null)) {
+                        continue;
+                    }
+
                     // Don't load ourselves
                     if (intent.getComponent().getPackageName().equals(mContext.getPac
                         continue;
 (END)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值