Android 8.1 1、开机后“融合通信”APK自启动运行 2、连按5次返回物理按键,然后输密钥“112288”确认后,入进allApps 界面

— a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -739,6 +739,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean mAllowLockscreenWhenOn;
int mLockScreenTimeout;
boolean mLockScreenTimerActive;
+

  •   /* add ycj */
    
  •   private int mcount = 0;
    
  •   private long mtime_1 = 0;
    
  •   private long mtime_2 = 0;
    
 // Behavior of ENDCALL Button.  (See Settings.System.END_BUTTON_BEHAVIOR.)
 int mEndcallBehavior;

@@ -1256,6 +1262,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
msg.setAsynchronous(true);
mHandler.sendMessageDelayed(msg, ViewConfiguration.getMultiPressTimeout());
}
+
}

     // Reset back long press state

@@ -3967,8 +3974,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}

     }else if (keyCode == KeyEvent.KEYCODE_BACK) { //lxb 20230529
  •                   int count = 0;
                      if (down) {
    
  •            if (event.getRepeatCount() == 0) {
    
  •            if (event.getRepeatCount() == 0) {                                                                                                                              
                                       mContext.sendBroadcast(    
                               new Intent("com.dw.action.back.short"));
               } else {
    

@@ -3987,7 +3995,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
}
} else {

  •        }
        
       }else if (keyCode == KeyEvent.KEYCODE_HOME) { //lxb 20230529
    

@@ -6679,9 +6687,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
android.util.Log.d(“tydtech”, “tydtech action = android.intent.action.p2.up”);

                 // add start by tangcf
  •                if  (!isTopActivity("com.airbus.pmr.application")) {
    
  •                /* if  (!isTopActivity("com.airbus.pmr.application")) {
                       bringApplicationToFront(mContext, "com.airbus.pmr.application");
    
  •                }
    
  •                } */
                   //add end
               }
    

@@ -6726,9 +6734,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
android.util.Log.d(“tydtech”, “tydtech action = android.intent.action.p1.up”);

                 // add start by tangcf
  •                if  (!isTopActivity("com.airbus.pmr.application")) {
    
  •                /* if  (!isTopActivity("com.airbus.pmr.application")) {
                       bringApplicationToFront(mContext, "com.airbus.pmr.application");
    
  •                }
    
  •                } */
                   //add end
               }
    

@@ -6790,7 +6798,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
} else {
if (!mIsATLongPressedBack) {

  •                // 处理短按                                   
    
  •                // 处理短按                                                
               }
               mIsATLongPressedFirstBack = true;
               mContext.sendBroadcast(
    

@@ -6940,7 +6948,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// {
// mContext.sendBroadcastAsUser(keycodeIntent,UserHandle.CURRENT);
// }else{

  •                           // if(cn.getPackageName().equals("com.airbus.pmr.application")){
    
  •                           // if(cn.getPackageName().equals("com.aemulaapp")){
                                       // mContext.sendBroadcastAsUser(keycodeIntent,UserHandle.CURRENT);                     
                              // }else{
                               // return 0;
    

@@ -6961,7 +6969,23 @@ public class PhoneWindowManager implements WindowManagerPolicy {
case KeyEvent.KEYCODE_BACK: {
if (down) {
interceptBackKeyDown();

  •            } else {
    
  •            } else {                                       
    
  •                                   ++mcount;
    
  •                                   if(mcount == 1){
    
  •                                           mtime_1 = System.currentTimeMillis();
    
  •                                   }else if(mcount == 5){
    
  •                                           mtime_2 = System.currentTimeMillis();
    
  •                                   }else if(mcount >5){
    
  •                                           mcount = 0;
    
  •                                   }                               
    
  •                                   if((mtime_2 - mtime_1)/1000 >= 5){
    
  •                                           mcount = 0;
    
  •                                   }                               
    
  •                                   android.util.Log.d("ycj_1", " mtime_1  = "+mtime_1 +" mtime_2 = "+mtime_2 +" mcount = "+mcount );       
    
  •                                   if(mcount >= 5 && (mtime_2 - mtime_1)/1000 < 5){                                                
    
  •                                           mcount = 0;
    
  •                                           mContext.sendBroadcast(new Intent("com.android.dw"));
    
  •                                   }                                               
                   boolean handled = interceptBackKeyUp(event);
    
                   // Don't pass back press to app if we've already handled it via long press
    

@@ -7659,11 +7683,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
android.util.Log.d(“tydtech”, “tydtech action = com.intent.blueled.off” );
}
else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {

  •           /*       Intent intentEm = new Intent();
    
  •                                   android.util.Log.d("ycj", " == Intent.ACTION_BOOT_COMPLETED == ");       
    
  •                  Intent intentEm = new Intent();
                                        // intentEm.setClassName("com.mediatek.factorymodenew", "com.mediatek.factorymodenew.MainActivity11"); //工厂模式
    
  •                                     intentEm.setClassName("com.veclink.vecsipsimple", "com.inrico.iconvnet.activity.LoadingActivity");//客户app
    
  •                                     intentEm.setClassName("com.airbus.pmr.application", "com.airbus.pmr.application.SplashscreenActivity");//客户app
                                        intentEm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    
  •                                     context.startActivity(intentEm); */
    
  •                                     context.startActivity(intentEm);
                                        
                                      // Intent ifIntent =new Intent();
                                      // ComponentName cn =new ComponentName("com.iflytek.speechcloud", "com.iflytek.speechcloud.TtsService");
    

@@ -9817,7 +9842,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
List<ActivityManager.RunningTaskInfo> tasksinfo = mActivityManager.getRunningTasks(1);
if (!tasksinfo.isEmpty()) {
String packageName = tasksinfo.get(0).topActivity.getPackageName();

  •            if (packageName != null && (packageName.equals("com.airbus.pmr.application"))) {
    
  •            if (packageName != null && (packageName.equals("com.aemulaapp"))) {
                   return true;
               }
           }
    

diff --git a/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java b/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
index e0debf959a…391048cbbd 100755
— a/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
+++ b/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
@@ -138,7 +138,6 @@ import com.android.launcher3.widget.WidgetAddFlowHandler;
import com.android.launcher3.widget.WidgetHostViewLoader;
import com.android.launcher3.widget.WidgetsContainerView;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -164,6 +163,10 @@ import android.os.Looper;
import android.os.Message;
import android.widget.Toast;

+//add by ycj
+import android.widget.EditText;
+//end
+
/**

  • Default launcher application.
    */
    @@ -292,6 +295,9 @@ public class Launcher extends BaseActivity
    private LauncherAccessibilityDelegate mAccessibilityDelegate;
    private final Handler mHandler = new Handler();
    private boolean mHasFocus = false;
  •   //add ycj
    
  •   public static Context mContext;
    

    private ObjectAnimator mScrimAnimator;
    private boolean mShouldFadeInScrim;
    @@ -349,7 +355,7 @@ public class Launcher extends BaseActivity

    public ViewGroupFocusHelper mFocusHandler;
    private boolean mRotationEnabled = false;

  • @Thunk void setOrientation() {
    if (mRotationEnabled) {
    unlockScreenOrientation(true);
    @@ -384,8 +390,7 @@ public class Launcher extends BaseActivity
    if (mLauncherCallbacks != null) {
    mLauncherCallbacks.preOnCreate();
    }
     WallpaperColorInfo wallpaperColorInfo = WallpaperColorInfo.getInstance(this);
     wallpaperColorInfo.setOnThemeChangeListener(this);

@@ -395,6 +400,11 @@ public class Launcher extends BaseActivity

     LauncherAppState app = LauncherAppState.getInstance(this);
  •           //mContext = getApplicationContext();
    
  •           IntentFilter LauncherFilter = new IntentFilter();
    
  •    LauncherFilter.addAction("com.android.dw");
    
  •    this.registerReceiver(mLauncherFilterReceiver, LauncherFilter);        
    
  •    // Load configuration-specific DeviceProfile
       mDeviceProfile = app.getInvariantDeviceProfile().getDeviceProfile(this);
       if (isInMultiWindowModeCompat()) {
    

@@ -514,7 +524,40 @@ public class Launcher extends BaseActivity

 }
  • BroadcastReceiver mLauncherFilterReceiver = new BroadcastReceiver() {
  •   public void onReceive(Context context, Intent intent) {
    
  •           String action = intent.getAction();
    
  •        if(action.equals("com.android.dw")) {
    
  •            Log.d("LauncherFilter","action="+action);
    
  •                           showAllapps();
    
  •                           //mAllAppsController.setProgress(0f);
    
  •                           //showAppsView(true /* animated */, true /* updatePredictedApps */);                     
    
  •           }
    
  •   }
    
  • };
  •   private void showAllapps(){
    
  •               //add by lhs
    
  •        final EditText editText = new EditText(mContext);
    
  •        AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
    
  •        builder.setTitle("password")
    
  •               .setView(editText)
    
  •               .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
    
  •                    @Override
    
  •                    public void onClick(DialogInterface dialogInterface, int i) {
    
  •                           String inputcode = editText.getText().toString();
    
  •                           Log.e("com.hra.lhs", "editText.getText().toString() = "+editText.getText().toString());
    
  •                           if (inputcode.equals("112288")) {
    
  •                                  Log.e("ycj", "inputcode = "+inputcode);
    
  •                                  mAllAppsController.setProgress(0f);
    
  •                                                                     showAppsView(true /* animated */, true /* updatePredictedApps */); 
    
  •                            }
    
  •                    }
    
  •             })
    
  •                            .create()
    
  •                            .show();
    
  •   }
    
    private static final String Charger_FILE = "sys/class/misc/seat_charger_eint/state";    
    public static String readStringFromFile(String path) {

@@ -4090,6 +4133,7 @@ public class Launcher extends BaseActivity
}

 public static Launcher getLauncher(Context context) {
  •           mContext = context;
       if (context instanceof Launcher) {
           return (Launcher) context;
       }
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值