精华内容
下载资源
问答
  • 应用自动启动”和“关联启动”权限
    万次阅读
    2017-12-06 18:51:13

    1、无法调用服务端的service,不能唤起服务端进程,是因为服务端应用的“关联启动”权限没手动打开。

    2、貌似“关联启动”这个权限功能是6.0以后部分品牌手机有的。

    3、调用activity不需要“关联启动”权限,service需要,其他两个没试。

    4、新装一个应用时,你打开它的权限是没有“关联启动“这一项的,应该是默认不可以关联启动。当这个应用被其他应用关联启动一次以后(启动失败了),此时你再打开权限管理,就有关联启动了。
    “应用自动启动”应该也是这个道理。

    5、以下是从别的地方摘抄的一段话,关于“应用自动启动”和“关联启动”:
    安卓每个程序(软件)都可以设置监听广播,广播的来源有两大类:一类是常见的的系统广播如:开机广播、解锁屏广播、电量变化广播、网络状态广播等等,格式举例:(开机广播),手机上所有的安卓程序(软件)开发时都可以设置监听这些广播,当然监听有些系统广播需要在程序里声明权限。接收系统广播唤醒软件,一般称之为软件自启动。另一类是软件(程序)自定义的广播,这些广播可以在程序运行的任何过程发出,比如:该程序启动时发出,联网时发出,等等。所有知道该广播的软件(程序)都可以接受。接收广播主要用于唤醒软件(软件关联启动)。一般来说,软件(程序)自定义的广播属于商业机密,比如说阿里给支付宝定义了广播A,给淘宝定义了广播B,同一家的软件支付宝就能通过淘宝发出的广播B启动,淘宝亦然。微信和QQ的也是这样。假如有一天,用户只装了支付宝和微信,那么支付宝和微信如何关联启动?阿里对腾讯说,我把支付宝发出的广播告诉你,你把微信发出的广播告诉我。腾讯说,好。于是你会发现支付宝唤醒了微信,微信唤醒了支付宝。

    更多相关内容
  • 启动管理用于管理应用的开机自启动/后台自启动/关联自启动。应用自启动的管理,以包名(应 用名)进行限制,不区分 user(用户)。 (1)自启动 指开机自启动和后台自启动。应用可以监听系统的一些开机广播,从而...

    自启动和管理启动管理介绍

    自启动管理用于管理应用的开机自启动/后台自启动/关联自启动。应用自启动的管理,以包名(应
    用名)进行限制,不区分 user(用户)。

    (1)自启动
    指开机自启动和后台自启动。应用可以监听系统的一些开机广播,从而在系统开机后自动进行启动。
    同时应用也可以监听系统的任何广播,如网络连接的广播,从而在网络连接上的时候,进行自启动。
    (2)关联启动
    关联启动指不同的应用之间进行互起。这里指的是,该应用被其他应用后台启动。

    流程分析

    1)自启动reason

        private static final String REASON_START_SERVICE = "start-service";
        private static final String REASON_BIND_SERVICE = "bind-service";
        private static final String REASON_CONTENT_PROVIDER = "contentprovider";
        private static final String REASON_BROADCAST = "send-broadcast";
        private static final String REASON_START_ACTIVITY = "start-activity";

     

    1.1 start-activity

    在ActivityStarter.java-->startActivity()判断是否是异常启动

        private int startActivity(IApplicationThread caller, Intent intent, Intent ephemeralIntent,
                String resolvedType, ActivityInfo aInfo, ResolveInfo rInfo,
                IVoiceInteractionSession voiceSession, IVoiceInteractor voiceInteractor,
                IBinder resultTo, String resultWho, int requestCode, int callingPid, int callingUid,
                String callingPackage, int realCallingPid, int realCallingUid, int startFlags,
                ActivityOptions options, boolean ignoreTargetSecurity, boolean componentSpecified,
                ActivityRecord[] outActivity, TaskRecord inTask) {
                  
            .......
            String targetPkg = null;
            int targetUid = aInfo != null ? aInfo.applicationInfo.uid : 0;
            if (intent.getComponent() != null) targetPkg = intent.getComponent().getPackageName();
            if(!mService.judgeStartAllowLocked(intent, targetPkg, targetUid, callingUid, callingPackage, "start-activity")){
                return ActivityManager.START_INTENT_NOT_RESOLVED;
            }
            .......
    }

    1.2 start-service

    在ActiveServices.java-->startServiceLocked()

        ComponentName startServiceLocked(IApplicationThread caller, Intent service, String resolvedType,
                int callingPid, int callingUid, boolean fgRequired, String callingPackage, final int userId)
                throws TransactionTooLargeException {
            ......
                    int targetUid = r.appInfo != null ? r.appInfo.uid : 0 ;
            if(!mAm.judgeStartAllowLocked(service, r.packageName, targetUid, callingUid, callingPackage,"start-service")) {
                return null;
            }
            ......

    1.3 bind-service

    在ActiveServices.java-->bindServiceLocked()

        int bindServiceLocked(IApplicationThread caller, IBinder token, Intent service,
                String resolvedType, final IServiceConnection connection, int flags,
                String callingPackage, final int userId) throws TransactionTooLargeException {
              ......
                      String targetPkg = s != null ? s.packageName : null;
            int targetUid = (s != null && s.appInfo != null) ? s.appInfo.uid : 0;
            int callingUid = (callerApp != null && callerApp.info != null) ? callerApp.info.uid : 0;
            if(!mAm.judgeStartAllowLocked(service, targetPkg, targetUid, callingUid, callingPackage,"bind-service")) {
                return 0;
            }
              ......

    1.4 send-broadcast

    final void processNextBroadcast(boolean fromMsg) {
            ......
                            skip = skip || !mService.judgeStartAllowLocked(r.intent, info.activityInfo.applicationInfo.packageName,
                        info.activityInfo.applicationInfo.uid, r.callingUid, r.callerPackage,"send-broadcast");
            ......
    }

    1.5 contentprovider

    ActivityManagerService.java -->getContentProviderImpl()

    
        private ContentProviderHolder getContentProviderImpl(IApplicationThread caller,
                String name, IBinder token, boolean stable, int userId) {
            ContentProviderRecord cpr;
            ......
                            String targetPkg = (cpr != null && cpr.appInfo != null) ? cpr.appInfo.packageName : null;
                    int targetUid = (cpr != null && cpr.appInfo != null) ? cpr.appInfo.uid : 0;
                    if (r != null && r.info != null) {
                        String callingPackage = r.info.packageName;
                        int callerUid = r.info.uid;
                        if(!judgeStartAllowLocked(null, targetPkg, targetUid, callerUid, callingPackage,"contentprovider")) {
                            return null;
                        }
                    }
            ......

    可以看出自启动的拦截,就是在四大组件启动流程中进行的

    2)judgeStartAllowLocked()流程分析

    ActivityManagerServerEx.java-->judgeStartAllowLocked()

        protected boolean judgeStartAllowLocked(Intent intent, String targetPkg, int targetUid,
            int callingUid, String callingPackage, String reason) {
    
            boolean allowed = true;
            if (allowed && mPowerControllerInternal != null) {
                try {
                    allowed = mPowerControllerInternal.judgeAppLaunchAllowed(intent, targetPkg, targetUid, callingUid, callingPackage, reason);
                } catch (Exception e) {}
            }
            

    BackgroundCleanHelper.java-->judgeAppLaunchAllowed()

         boolean judgeAppLaunchAllowed(Intent intent, String targetApp, int targetUid,
                int callerUid, String callerApp, String reason) {
            mPowerHintSceneForGts.noteAppLaunched(targetApp, callerApp, callerUid);
    
            boolean ret = judgeAppLaunchAllowedInternal(intent, targetApp, targetUid, callerUid, callerApp, reason);
            if (mCurrentUserId == 0 && ret && targetApp != null) {
                if (!targetApp.equals(callerApp) && !mFirstCallerAppList.containsKey(targetApp)
                    && isInstalledApp(targetApp, 0)) {
                    mFirstCallerAppList.put(targetApp, new CallerAppInfo(callerApp, callerUid, reason));
                }
            }
            return ret;
    

    BackgroundCleanHelper.java-->judgeAppLaunchAllowedInternal()

    /*
         * Third app can not self started:
         * 1. not allow system broadcast from "systemserver" or "com.android.systemui"
         * 2. not allow start service from ""com.android.shell"
         * 3. not allow background app to launch other third party app
         * 4. not allow self started third party app to start other third party app
         * 5. not allow third party app to start other third party app during standby
         *
         * Note: This api is call from AMS in other threads and may be in variable calling context
         *  SO BE CAREFULL : avoid call other system API that may hold lock. Otherwise, a deadlock may HAPPEN
         */
         boolean judgeAppLaunchAllowedInternal(Intent intent, String targetApp, int targetUid,
                int callerUid, String callerApp, String reason) {
    
            // if this function is disabled, just return true
            if (!mEnabled) return true;
    
            if (DEBUG_MORE) Slog.d(TAG,"judgeAppLaunchAllowed : "+targetApp+"(uid:" + targetUid
                + "), callingPackage = "+callerApp+"(uid:" + callerUid + "), reason = "+reason);
            if (DEBUG_MORE && intent != null) Slog.d(TAG,"judgeAppLaunchAllowed : intent action:" + intent);
    
            if (targetApp == null) return true;
    
            // bug#768670
            if (handleStartServiceStartAction(intent, targetApp, targetUid, callerApp, callerUid, reason)) {
                return true;
            }
    
            if (handleBindServiceStartAction(intent, targetApp, targetUid, callerApp, callerUid, reason)) {
                return true;
            }
    
            if (handleContentProviderStartAction(intent, targetApp, targetUid, callerApp, callerUid, reason)) {
                return true;
            }
    
            //handle inputmethod
            if (isLaunchingIMEApp(intent, targetApp, targetUid, callerApp, reason)) {
                return true;
            }
    
            if (handleBroadcastAction(intent, targetApp, targetUid, callerApp, callerUid, reason)) {
                return true;
            }
    
            //handle speech recognition
            if (isRecognizerIntent(intent, targetApp, targetUid, callerApp, callerUid, reason)) {
                return true;
            }
    
            // allow cts app to start any other app
            // allow autotest app
            if (Util.isCts(callerApp) || isAutoTest(callerUid, callerApp, targetApp)) {
                return true;
            }
    
            // check deny for ultra saving mode
            //if (denyBecauseOfUltraSavingMode(intent, targetApp, targetUid, callerApp, callerUid, reason)) {
            //    return false;
            //}
    
            int targetUserId = UserHandle.getUserId(targetUid);
            int callUserId = UserHandle.getUserId(callerUid);
            AppState callerAppState = mAppStateInfoCollector.getAppState(callerApp, callUserId);
            AppState targetAppState = mAppStateInfoCollector.getAppState(targetApp, targetUserId);
    
            // if target app already exist
            /*if (targetAppState != null
                && targetAppState.mProcState < ActivityManager.PROCESS_STATE_CACHED_EMPTY
                && targetAppState.mProcState != ActivityManager.PROCESS_STATE_NONEXISTENT) {*/
            if (isAlreadyStarted(targetAppState)) {
                if (DEBUG_MORE) Slog.d(TAG,"Start Proc : "+targetApp+", callingPackage = "+callerApp+", reason = "+reason + ": already started!!"
                    + " (ProcState:" +  Util.ProcState2Str(targetAppState.mProcState)
                    + " mState:" + Util.AppState2Str(targetAppState.mState)
                    + ")");
                return true;
            }
    
            // check system app
            // allow to launch system app
            int launchState = checkLaunchStateByPreset(intent, targetApp, targetUid, callerApp, callerUid, reason);
            if (launchState == LAUNCH_STATE_ALLOW)
                return true;
            else if (launchState == LAUNCH_STATE_DENY)
                return false;
    
            // check user setting for third-party app(重点)
            launchState = checkLaunchStateByUserSetting(intent, targetApp, targetUid, callerApp, callerUid, reason);
            if (DEBUG_MORE) Slog.d(TAG, "launchState: " + launchState);
            if (launchState == LAUNCH_STATE_ALLOW)
                return true;
            else if (launchState == LAUNCH_STATE_DENY)
                return false;
    
            // not allow third party app that has been force stopped during standby
            // to be started again
            if (mStandbyStartTime > 0 && isForceStoppedAppDuringStandby(targetApp, targetUid)) {
                if (DEBUG) Slog.d(TAG,"Start Proc : "+targetApp+", callingPackage = "+callerApp+", reason = "+reason + ": denyed (has been force stopped)!!");
                return false;
            }
    
            // not allow system broadcast to launch third party app
            if ((callerAppState == null ||(callerApp != null && callerApp.equals("android")))
                && REASON_BROADCAST.equals(reason)) {
                if (DEBUG) Slog.d(TAG,"Start Proc : "+targetApp+", callingPackage = "+callerApp+", reason = "+reason + ": denyed!!");
                return false;
            }
    
            // not allow "com.android.systemui" broadcast to launch third party app
            if (callerApp != null && callerApp.equals("com.android.systemui")
                && REASON_BROADCAST.equals(reason)) {
                if (DEBUG) Slog.d(TAG,"Start Proc : "+targetApp+", callingPackage = "+callerApp+", reason = "+reason + ": denyed!!");
                return false;
            }
    
            // allow app to launch itself
            if (targetApp.equals(callerApp)) {
                return true;
            }
    
            // not allow non-top app to launch other app, except launched by UserActivity
            if (!launchedByUserActivity(intent, targetApp, targetUid, callerApp, callerUid, reason, true)) {
                if (DEBUG) {
                    Slog.d(TAG,"Start Proc : "+targetApp
                        +", callingPackage = "+callerApp
                        + " (ProcState:" + (callerAppState != null ? Util.ProcState2Str(callerAppState.mProcState):"none")
                        +"), reason = "+reason
                        + ": non-UserActivity denyed!!");
                }
                return false;
            }
    
            // not allow background app to launch other third party app
            if (callerAppState != null && callerAppState.mProcState > ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE
                && !REASON_START_ACTIVITY.equals(reason)) {
                if (DEBUG) {
                    Slog.d(TAG,"Start Proc : "+targetApp
                        +", callingPackage = "+callerApp
                        + " (ProcState:" + (callerAppState != null ? Util.ProcState2Str(callerAppState.mProcState):"none")
                        +"), reason = "+reason
                        + ": denyed!!");
                }
                return false;
            }
    
            // not allow self started third party app to start other third party app
            if (callerAppState != null && callerAppState.mLaunchCount == 0 && !isSystemApp(callerAppState)
                && !REASON_START_ACTIVITY.equals(reason)) {
                if (DEBUG) Slog.d(TAG,"Start Proc : "+targetApp+", callingPackage = "+callerApp+", reason = "+reason + ": denyed!!");
                return false;
            }
    
            // not allow long idle third party app to start other third party app
            if (callerAppState != null && !isSystemApp(callerAppState)
                && callerAppState.mState != Event.MOVE_TO_FOREGROUND
                && callerAppState.mProcState != ActivityManager.PROCESS_STATE_TOP
                && !REASON_START_ACTIVITY.equals(reason)) {
    
                long nowELAPSED = SystemClock.elapsedRealtime();
                long idleDuration = 0;
                idleDuration = (callerAppState.mLastTimeUsed > 0 ? (nowELAPSED -callerAppState.mLastTimeUsed) : -1);
                if (idleDuration > DENY_START_APP_THRESHOLD) {
                    if (DEBUG) Slog.d(TAG,"Start Proc : "+targetApp+", callingPackage = "+callerApp+", reason = "+reason + ": denyed!! long idle");
                    return false;
                }
            }
    
    
            // not allow third party app to start other third party app during standby
            if (mStandbyStartTime > 0
                && !REASON_START_ACTIVITY.equals(reason)) {
                if (DEBUG) {
                    Slog.d(TAG,"Start Proc : "+targetApp
                        +", callingPackage = "+callerApp
                        + " (ProcState:" + (callerAppState != null ? Util.ProcState2Str(callerAppState.mProcState):"none")
                        +"), reason = "+reason
                        + ": denyed during standby!!");
                }
                return false;
            }
    
    
            return true;
    
        }

    BackgroundCleanHelper.java-->checkLaunchStateByUserSetting()

    private int checkLaunchStateByUserSetting(Intent intent, String targetApp, int targetUid,
                String callerApp, int callerUid, String reason) {
    
            if (targetApp == null || targetApp.equals(callerApp))
                return LAUNCH_STATE_AUTO;
    
            boolean launchByOther = autoLaunchByOtherApp(targetApp, targetUid, callerApp, callerUid, reason);
    
            // allow app in whitelist
            if (inSelfStartWhiteAppList(targetApp)) {
                return LAUNCH_STATE_ALLOW;
            }
    
            // if in ultrasaving mode, don't allow autostart except apps in ultrasve applist
            if (!launchByOther && (PowerManagerEx.MODE_ULTRASAVING == mPowerSaveMode)
                && (PowerManagerEx.MODE_ULTRASAVING == mNextPowerSaveMode)) {
                List<String> appList = mPowerControllerInternal.getAppList_UltraMode();
                if (!appList.contains(targetApp)) {
                    if (DEBUG) Slog.d(TAG, "app: " + targetApp + " in applist of ultramode, refuse to autostart, denyed");
                    return LAUNCH_STATE_DENY;
                }
            }
    
            int autoLaunch = mPowerControllerInternal.getAppPowerSaveConfgWithTypeInternal(targetApp,AppPowerSaveConfig.ConfigType.TYPE_AUTOLAUNCH.value);
            int secondLaunch = mPowerControllerInternal.getAppPowerSaveConfgWithTypeInternal(targetApp,AppPowerSaveConfig.ConfigType.TYPE_SECONDARYLAUNCH.value);
            if (((autoLaunch == AppPowerSaveConfig.VALUE_NO_OPTIMIZE) && !launchByOther)
                || ((secondLaunch == AppPowerSaveConfig.VALUE_NO_OPTIMIZE) && launchByOther)) {
                if (DEBUG) Slog.d(TAG, "bgclean judgeAppLaunchAllowed: "+targetApp
                    + ", callingPackage = "+callerApp+", reason = "+reason +" in my whitelist");
                return LAUNCH_STATE_ALLOW;
            }
    
            //check whether app is in black list
            boolean bInBlackList = false;
            if ((autoLaunch == AppPowerSaveConfig.VALUE_OPTIMIZE) && !launchByOther) {
                if (DEBUG_MORE) Slog.d(TAG, "in apppowerconfig autolaunch black list: " + targetApp);
                bInBlackList = true;
            }
            if ((secondLaunch == AppPowerSaveConfig.VALUE_OPTIMIZE) && launchByOther) {
                if (DEBUG_MORE) Slog.d(TAG, "in apppowerconfig 2ndlaunch black list: " + targetApp);
                bInBlackList = true;
            }
    
            // check whether blacklist app is in exception
            if (bInBlackList) {
                // not allow auto start app that in auto start black list
                // 1. in mAutoLaunch_BlackList AND is not launched by other app (that is launched by system broadcast etc)
                // 2. NOTE: Exception:
                //     1) Start reason is REASON_START_ACTIVITY  (this is alway happened in case of
                //         app use another app to do something, including launcher to launch a app)
                //     2) Self start self ( that is this app is alreadby started, and is start some activity internal)
                if (!launchByOther && !REASON_START_ACTIVITY.equals(reason)) {
                    if (DEBUG) Slog.d(TAG, "in autolaunch black list: "+targetApp
                        + ", callingPackage = "+callerApp+", reason = "+reason +" denyed!");
                    return LAUNCH_STATE_DENY;
                }
                // not allow auto start by other app that in secondary start black list
                // 1. in m2ndLaunch_BlackList AND is launched by other app
                // 2. NOTE: Exception:
                //     1) when callerApp is top AND Start reason is REASON_START_ACTIVITY  (this is alway happened in case of
                //         app use another app to do something, including launcher to launch a app)
                //     2) Self start self ( that is this app is alreadby started, and is start some activity internal)
                //     3) when callerApp is top AND targetApp is in AssociateLaunchExceptionAppList
                if (launchByOther && !launchedByUserActivity(intent, targetApp, targetUid, callerApp, callerUid, reason, true)) {
                    if (DEBUG) Slog.d(TAG, "in 2ndlaunch black list: "+targetApp
                        + ", callingPackage = "+callerApp+", reason = "+ reason + " intent:" + intent + " denyed!");
                    return LAUNCH_STATE_DENY;
                }
    
                // Although it is black list, but it start by user, so allowed to start
                return LAUNCH_STATE_ALLOW;
            }
            return LAUNCH_STATE_AUTO;
        }

    BackgroundCleanHelper.java-->checkLaunchStateByUserSetting()

    这个方法就是根据用户的设置,来判断是否拦截自启

    private int checkLaunchStateByUserSetting(Intent intent, String targetApp, int targetUid,
                String callerApp, int callerUid, String reason) {
    
            if (targetApp == null || targetApp.equals(callerApp))
                return LAUNCH_STATE_AUTO;
    
            boolean launchByOther = autoLaunchByOtherApp(targetApp, targetUid, callerApp, callerUid, reason);
    
            // allow app in whitelist
            if (inSelfStartWhiteAppList(targetApp)) {
                return LAUNCH_STATE_ALLOW;
            }
    
            // if in ultrasaving mode, don't allow autostart except apps in ultrasve applist
            if (!launchByOther && (PowerManagerEx.MODE_ULTRASAVING == mPowerSaveMode)
                && (PowerManagerEx.MODE_ULTRASAVING == mNextPowerSaveMode)) {
                List<String> appList = mPowerControllerInternal.getAppList_UltraMode();
                if (!appList.contains(targetApp)) {
                    if (DEBUG) Slog.d(TAG, "app: " + targetApp + " in applist of ultramode, refuse to autostart, denyed");
                    return LAUNCH_STATE_DENY;
                }
            }
    
            int autoLaunch = mPowerControllerInternal.getAppPowerSaveConfgWithTypeInternal(targetApp,AppPowerSaveConfig.ConfigType.TYPE_AUTOLAUNCH.value);
            int secondLaunch = mPowerControllerInternal.getAppPowerSaveConfgWithTypeInternal(targetApp,AppPowerSaveConfig.ConfigType.TYPE_SECONDARYLAUNCH.value);
            if (((autoLaunch == AppPowerSaveConfig.VALUE_NO_OPTIMIZE) && !launchByOther)
                || ((secondLaunch == AppPowerSaveConfig.VALUE_NO_OPTIMIZE) && launchByOther)) {
                if (DEBUG) Slog.d(TAG, "bgclean judgeAppLaunchAllowed: "+targetApp
                    + ", callingPackage = "+callerApp+", reason = "+reason +" in my whitelist");
                return LAUNCH_STATE_ALLOW;
            }
    
            //check whether app is in black list
            boolean bInBlackList = false;
            if ((autoLaunch == AppPowerSaveConfig.VALUE_OPTIMIZE) && !launchByOther) {
                if (DEBUG_MORE) Slog.d(TAG, "in apppowerconfig autolaunch black list: " + targetApp);
                bInBlackList = true;
            }
            if ((secondLaunch == AppPowerSaveConfig.VALUE_OPTIMIZE) && launchByOther) {
                if (DEBUG_MORE) Slog.d(TAG, "in apppowerconfig 2ndlaunch black list: " + targetApp);
                bInBlackList = true;
            }
    
            // check whether blacklist app is in exception
            if (bInBlackList) {
                // not allow auto start app that in auto start black list
                // 1. in mAutoLaunch_BlackList AND is not launched by other app (that is launched by system broadcast etc)
                // 2. NOTE: Exception:
                //     1) Start reason is REASON_START_ACTIVITY  (this is alway happened in case of
                //         app use another app to do something, including launcher to launch a app)
                //     2) Self start self ( that is this app is alreadby started, and is start some activity internal)
                if (!launchByOther && !REASON_START_ACTIVITY.equals(reason)) {
                    if (DEBUG) Slog.d(TAG, "in autolaunch black list: "+targetApp
                        + ", callingPackage = "+callerApp+", reason = "+reason +" denyed!");
                    return LAUNCH_STATE_DENY;
                }
                // not allow auto start by other app that in secondary start black list
                // 1. in m2ndLaunch_BlackList AND is launched by other app
                // 2. NOTE: Exception:
                //     1) when callerApp is top AND Start reason is REASON_START_ACTIVITY  (this is alway happened in case of
                //         app use another app to do something, including launcher to launch a app)
                //     2) Self start self ( that is this app is alreadby started, and is start some activity internal)
                //     3) when callerApp is top AND targetApp is in AssociateLaunchExceptionAppList
                if (launchByOther && !launchedByUserActivity(intent, targetApp, targetUid, callerApp, callerUid, reason, true)) {
                    if (DEBUG) Slog.d(TAG, "in 2ndlaunch black list: "+targetApp
                        + ", callingPackage = "+callerApp+", reason = "+ reason + " intent:" + intent + " denyed!");
                    return LAUNCH_STATE_DENY;
                }
    
                // Although it is black list, but it start by user, so allowed to start
                return LAUNCH_STATE_ALLOW;
            }
            return LAUNCH_STATE_AUTO;
        }

    继续逐个分析涉及到的主要方法

    BackgroundCleanHelper.java-->checkLaunchStateByUserSetting()-->autoLaunchByOtherApp()

        // return true, if app is start by system broadcast
        private boolean autoLaunchByOtherApp(String targetApp, int targetUid,
                    String callerApp, int callerUid, String reason) {
            if (callerApp == null
                ||callerApp.equals("android")
                || callerApp.equals("com.android.systemui"))
                return false;
    
            AppState callerAppState = mAppStateInfoCollector.getAppState(callerApp, UserHandle.getUserId(callerUid));
            if (callerAppState != null && callerAppState.mUid < Process.FIRST_APPLICATION_UID)
                return false;
    
            return true;
        }
    

    BackgroundCleanHelper.java-->checkLaunchStateByUserSetting()-->launchedByUserActivity()

     private boolean launchedByUserActivity(Intent intent, String targetApp, int targetUid,
                String callerApp, int callerUid, String reason, boolean ignoreTouchTime) {
            boolean userLaunched = false;
    
            long now = SystemClock.elapsedRealtime();
            long lastTouchTime = 0;
            AppState callerAppState = mAppStateInfoCollector.getAppState(callerApp, UserHandle.getUserId(callerUid));
            if (mPowerControllerInternal != null) {
                lastTouchTime = mPowerControllerInternal.getLastTouchEventTimeStamp();
            }
    
            boolean isCallerTopApp  =  false;
            if (callerAppState != null
                &&((callerAppState.mProcState == ActivityManager.PROCESS_STATE_TOP)
                    || (callerAppState.mProcState == ActivityManager.PROCESS_STATE_HOME)
                    || (callerAppState.mState == Event.MOVE_TO_FOREGROUND)
                    || (now - callerAppState.mLastTimeUsed) < 1000
                    || isLauncherApp(callerApp)) // for Bug#712736
            ) {
    
                isCallerTopApp = true;
            }
    
            // check the associated-starting because of third party push service
            if (isCallerTopApp &&
                REASON_START_ACTIVITY.equals(reason)
                && !isLauncherAction(intent)
                && intent != null
                && ThirdpartyPush.isAssociatedComponent(intent.getComponent())) {
                if (DEBUG) Slog.d(TAG,"launchedByUserActivity : Start Proc : "+targetApp
                    +", callingPackage = "+callerApp
                    + " (ProcState:" + (callerAppState != null ? Util.ProcState2Str(callerAppState.mProcState):"none")
                    +"), reason = "+reason
                    + " Associated-Starting ThirdParty Push Service");
                isCallerTopApp = false;
            }
    
            // see the caller of a launcher action as top app
            // add for bug#776461
            if (!isCallerTopApp && intent != null && isLauncherAction(intent)) {
                isCallerTopApp = true;
            }
    
            if (DEBUG_MORE) {
                Slog.d(TAG,"launchedByUserActivity : Start Proc : "+targetApp
                    +", callingPackage = "+callerApp
                    + " (ProcState:" + (callerAppState != null ? Util.ProcState2Str(callerAppState.mProcState):"none")
                    +"), reason = "+reason);
            }
    
            long lastTouchElasedTime = now - lastTouchTime;
            if (DEBUG) Slog.d(TAG, "lastTouchElasedTime: "+lastTouchElasedTime);
    
            if (isCallerTopApp
                && (REASON_START_ACTIVITY.equals(reason)
                        || (!ignoreTouchTime && lastTouchElasedTime <= (1*1000)))
                ) {
                userLaunched = true;
            }
    
            // check if this call from "android"
            if (!isCallerTopApp && REASON_START_ACTIVITY.equals(reason) && lastTouchElasedTime <= (1*1000)) {
                AppState androidState = mAppStateInfoCollector.getAppState("android", UserHandle.USER_SYSTEM);
                if (androidState != null
                    && (androidState.mState == Event.MOVE_TO_FOREGROUND)
                        || (now - androidState.mLastTimeUsed) < 1000) {
                    userLaunched = true;
                }
            }
    
            // Bug#707888 setting monkey fail --> BEG
            // for callerApp is system app, and use "start-activity", then allow
            if ((callerAppState == null || callerAppState.mUid < Process.FIRST_APPLICATION_UID)
                && REASON_START_ACTIVITY.equals(reason)) {
                userLaunched = true;
            }
            // Bug#707888 setting monkey fail <-- END
    
            return userLaunched;
        }

    BackgroundCleanHelper.java-->checkLaunchStateByUserSetting()-->launchedByUserActivity()-->isLauncherApp()

        private boolean isLauncherApp(String pkgName) {
            int index = mLauncherAppList.indexOf(pkgName);
            if (index >= 0) {
                return true;
            }
            return false;
        }

    isLauncherApp主要是通过是否有CATEGORY_HOME属性判断的

    
        private void loadLauncherApps() {
            try {
    
                Intent intent = new Intent(Intent.ACTION_MAIN);
                intent.addCategory(Intent.CATEGORY_HOME);
    
                final List<UserInfo> users = mUserManager.getUsers();
                for (int ui = users.size() - 1; ui >= 0; ui--) {
                    UserInfo user = users.get(ui);
                    if (DEBUG) Slog.d(TAG, "- loadLauncherApps() for user: " + user.id);
                    List<ResolveInfo> resolves =
                        mContext.getPackageManager().queryIntentActivitiesAsUser(intent, PackageManager.MATCH_DISABLED_COMPONENTS, user.id);
    
                    // Look for the original activity in the list...
                    final int N = resolves != null ? resolves.size() : 0;
                    for (int i=0; i<N; i++) {
                        final ResolveInfo candidate = resolves.get(i);
                        final ActivityInfo info = candidate.activityInfo;
                        if (info != null && info.packageName != null
                            && !mLauncherAppList.contains(info.packageName)) {
            ......
                /*check if contains the default launcher*/
                for(String s : mDefaultLauncherAppList) {
                    if(!mLauncherAppList.contains(s)) {
                        mLauncherAppList.add(s);
                    }
                }
            ......
                            
    }
        // default launcher app list
        private String[] mDefaultLauncherAppList = new String[] {
            "com.android.launcher3",
            "com.android.settings"
        };
    

    这一篇就分析到这里!

    展开全文
  • android 关联启动第三方应用

    千次阅读 2016-09-02 16:41:36
    若是同一家公司应用,比如淘宝,支付宝,为了保持彼此存活率,通常会设置关联启动,那么该如何做呢?我们首先做个开机自启的Service: package com.example.myapplication; import android.app.Notification...

    若是同一家公司应用,比如淘宝,支付宝,为了保持彼此存活率,通常会设置关联启动,那么该如何做呢?我们首先做个开机自启的Service:


    package com.example.myapplication;
    
    import android.app.Notification;
    import android.app.NotificationManager;
    import android.app.PendingIntent;
    import android.app.Service;
    import android.content.Context;
    import android.content.Intent;
    import android.os.IBinder;
    import android.util.Log;
    
    public class MyService extends Service {
    
    
        @Override
        public IBinder onBind(Intent intent) {
            // TODO: Return the communication channel to the service.
            return null ;
        }
    
        @Override
        public void onCreate() {
            super.onCreate();
    
            NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
            //Notification notification = new Notification(R.mipmap.ic_launcher, "myService", System.currentTimeMillis());
            Intent notificationIntent  = new Intent(this,MainActivity.class);
            PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, notificationIntent, 0);
            Notification notify3 = new Notification.Builder(this)
                    .setSmallIcon(R.mipmap.ic_launcher)
                    .setTicker("TickerText:" + "您有新短消息,请注意查收!")
                    .setContentTitle("Notification Title")
                    .setContentText("This is the notification message")
                    .setContentIntent(pendingIntent).setNumber(1).build(); // 需要注意build()是在API
            // level16及之后增加的,API11可以使用getNotificatin()来替代
            notify3.flags |= Notification.FLAG_NO_CLEAR; // FLAG_AUTO_CANCEL表明当通知被用户点击时,通知将被清除。
           // manager.notify(1, notify3);// 步骤4:通过通知管理器来发起通知。如果id不同,则每click,在status哪里增加一个提示
            startForeground(1, notify3);
            Log.e("myService", "onCreate");
        }
    }
    

    然后注册一个开机广播,开机权限:

     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    注册:

     <receiver
                android:name=".BootReceiver"
                android:enabled="true"
                android:exported="true">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
    
                    <category android:name="android.intent.category.HOME" />
                </intent-filter>
            </receiver>

    然后重写一个广播接收器:

    package com.example.myapplication;
    
    import android.content.BroadcastReceiver;
    import android.content.Context;
    import android.content.Intent;
    import android.util.Log;
    import android.widget.Toast;
    
    public class BootReceiver extends BroadcastReceiver {
    
        static final String action_boot="android.intent.action.BOOT_COMPLETED";
        @Override
        public void onReceive(Context context, Intent intent) {
            // TODO: This method is called when the BroadcastReceiver is receiving
            // an Intent broadcast.
    
            //
            if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)){
               Toast.makeText(context,"开机了",Toast.LENGTH_LONG).show();
                Log.e("boot","开机了————————");
                Intent intentService = new Intent(context, MyService.class);
    
                context.startService(intentService);
            }
        }
    }
    
    在这里启动自己的service,这里需要在手机里打开开机自启权限。

    这个应用已经做好了,那么其他应用怎么启动它呢:首先对MyService加入Action:

    <service
                android:name=".MyService"
                android:enabled="true"
                android:exported="true">
                <intent-filter android:priority="1000" >
                    <action android:name="com.example.myapplication.myservice" />
                </intent-filter>
            </service>

    那么其它应用启动它的时候只要拿到其包名和这个Action就可:

    package com.example.myapplication;
    
    import android.content.ComponentName;
    import android.content.Intent;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    
    public class MainActivity extends AppCompatActivity {
    
        Intent intent ;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            ComponentName componet = new ComponentName("com.example.myapplication.boot","com.example.myapplication.MyService");
            intent = new Intent();
    
            intent.setAction("com.example.myapplication.myservice");
            intent.setComponent(componet);
    
           startService(intent);
        }
    }
    

    然后把打开关联启动权限,这样我们就能启动第三方应用了。

    源码1,开机自启demo:点击打开链接

    源码2,启动第三方应用demo: 点击打开链接

    展开全文
  •  2015年1月26日 小恐龙 应用技巧 前言简述 Android生态系统原本提供了类似于Apple iOS推送服务APNS的GCM(Google Cloud Messaging for Android),以前叫C2DM,但是由于某些原因,导致这项服务在国内不是很好使...









    Android手机APP常见后台服务

    前言简述

    Android生态系统原本提供了类似于Apple iOS推送服务APNS的GCM(Google Cloud Messaging for Android),以前叫C2DM,但是由于某些原因,导致这项服务在国内不是很好使,为了弥补这个不足,并且我朝各大同胞又想使用Android推送服务,所以国内各大平台陆续推出了GCM的替代品。

    好点的推送服务如果在一台设备上安装了多款Push SDK的应用,不会为每个应用都创建PushService,而是会采用多应用共享一个PushService的模式,如果是差点的,就会每个应用都创建PushService。

    但不论是哪一种,其中一个app的PushService开启,就意味着其他应用都可能关联启动,尤其以百度、阿里、腾讯为甚。

    最糟糕的是,国内后台推送服务提供商太多了,他们的功能有不同的侧重点,有的专攻推送消息,有的可以获取大数据,有的还附带广告。

    所以很多App会使用多家公司的sdk,由于App使用的PushService不是同一家,所以安装的App越多,开启的后台服务也就越多,电量消耗的也越快。

    我们可以使用禁止服务(Disable Service)这个APP来禁用后台耗电服务。

    下载地址:http://www.coolapk.com/apk/cn.wq.disableservice

    当然,魔高一尺道高一丈,你要使用这个app需要获得root权限才能实现。但是像金山快盘app,如果被禁用服务后,会自动恢复被禁用的服务,这类病毒型App,趁早卸载为上。

     


    友盟推送
    SDK文档http://dev.umeng.com/
    com.umeng.message.UmengDownloadResourceService(负责下载推送的内容)
    com.umeng.message.UmengIntentService(负责推送的核心服务)
    com.umeng.message.UmengService(负责推送的后台务)
    com.umeng.update.net.DownloadingService(后台升级更新下载服务)
    com.umeng.common.net.DownloadingService(交换网络sdk,其实就是广告下载服务)
    小米推送
    SDK文档http://dev.xiaomi.com/doc/?p=544
    com.xiaomi.push.service.XMPushService (小米后台推送服务)
    com.xiaomi.push.service.PushMessageHandler (小米后台推送服务定义句柄)
    com.xiaomi.mipush.sdk.MessageHandleService(小米后台推送服务消息句柄服务)
    com.xiaomi.mipush.sdk.PushMessageHandler(小米后台推送服务定义句柄)
    极光推送
    SDK文档http://docs.jpush.io/guideline/android_guide/
    cn.jpush.android.service.PushService(极光推送服务)
    cn.jpush.android.ui.PushActivity(极光推送激活)
    cn.jpush.android.service.DownloadService(推送内容下载服务)
    cn.jpush.android.service.AlarmReceiver(提醒接收)
    魔桥推送
    SDK文档http://www.18ti.net/document2.jsp
    com.mobridge.MoPushService(魔桥推送服务)
    个推
    SDK技术文档 http://docs.getui.com/
    com.igexin.sdk.PushService(推送服务)
    com.igexin.download.DownloadService(资源下载服务)
    com.igexin.getuiext.service.GetuiExtService(个推执行服务)
    Bmob推送
    cn.bmob.push.lib.service.PushService(比目推送服务)
    cn.bmob.push.PushReceiver(推送接收服务)
    力美广告平台IMmob
    Cn.immob.sdk.net.DownloadService(广告资源下载服务)
    盛大云推送
    技术文档http://www.grandcloud.cn/product/push#doc
    cn.grandmobile.sdk.android.PushService
    cn.grandmobile.sdk.android.PushBroadcastReceiver
    云巴推送
    技术文档http://yunba.io/developers/
    io.yunba.android.core.YunBaService(云巴推送服务)
    原子推送
    com.atom.push.sdk.AtomPushService
    com.atom.push.sdk.AtomAlarmReceiver
    com.atom.push.sdk.AtomPushActionCustomReceiver
    魔泊网(MoPaaS)推送
    com.mopaas.pushservice.sdk.MPSPushService(推送服务)
    com.mopaas.backendmonitor.MonitorService(监视服务)
    有推推送(中国移动消息推送)
    com.cmcc.aoe.AoeService
    com.cmcc.aoe.push.AOEService
    WeCloud推送(这厮推送名称很杂乱,显得小公司)
    com.jiubang.go.push.PushServiceReceiver(九帮推送接收服务)
    com.jiubang.go.push.PushService(九帮推送服务)
    com.zihao.service.MyMsgService(子皓消息推送服务)
    AVOS Cloud推送(美味书签公司推送)
    com.avos.avoscloud.PushService(推送服务)
    com.avos.avoscloud.AVDefaultNotificationReceiver(推送消息通知栏展示服务)
    Cocos Push摩羯推送
    com.cocos.push.service.CCPushService(摩羯推送服务)
    com.cocos.push.client.CCPushClientReceiver(摩羯客户端接收服务)
    mPush魔推
    com.mrocker.push.service.PushService
    com.mrocker.push.service.PushServiceReceiver
    魔方推送
    com.imofan.android.basic.update.MFUpdateService(自动更新服务)
    爱心推
    com.ixintui.push.PushService(爱心推的推送服务)
    com.ixintui.push.MediateService(爱心推的富媒体推送)
    DDPush 任意门推送
    org.ddpush.im.v1.client.appuser.Message
    华为云推送
    技术文档http://developer.huawei.com/wiki/index.php?title=PushSDK%E4%B8%8B%E8%BD%BD
    com.huawei.deviceCloud.microKernel.push.EventReceiver(云推送事件接收器)
    com.huawei.deviceCloud.microKernel.push.PushBootReceiver(云推送接收服务)
    com.huawei.deviceCloud.microKernel.push.PushMKService(云推送富媒体服务)
    腾讯云信鸽推送
    技术文档http://www.qcloud.com/product/dove.html
    Com.tencent.android.tpush.service.XGPushService(信鸽推送服务)
    com.tencent.android.tpush.XGPushActivity(推送的展示型通知)
    Com.tencent.android.tpush.rpc.XGRemoteService(通知service,此选项有助于提高抵达率)
    大众点评推送后台
    com.dianping.base.push.pushservice.dp.DPPushService(大众点评推送服务)
    com.dianping.base.push.pushservice.dp.FakeService(大众点评伪装服务?)
    com.dianping.base.push.pushservice.PullService(推送内容的资源下载)
    百度云推送
    技术文档http://developer.baidu.com/wiki/index.php?title=docs/cplat/push/sdk/android
    Com.baidu.android.pushservice.PushService(百度云推送服务)
    百度定位SDK
    com.baidu.location.f(百度地图的定位服务),不需要定位功能的app可以禁用这个。
    支付宝推送后台
    com.alipay.pushsdk.push.NotificationService(支付宝推送通知栏服务)
    com.alipay.pushsdk.deliver.PushReportIntentService(快递推送报告网络服务)
    淘宝广告联盟后台
    com.taobao.munion.base.download.DownloadingService(淘宝广告联盟下载服务)
    agoo推送中心(这个暂时没有查到技术文档)

     



    --------------------------------------------------------------




    安卓app关联启动的问题,抱抱会自动启动好几个其他app

    2015-03-12 02:03 isurrender  |  浏览 569 次
      App
    最近下了app“抱抱”,发现启动后,后台会自动启动 喜马拉雅、暴风影音、唱吧等等,有手机开发大神知道这是为什么吗?怎么才能禁止这种关联启动?
    2015-03-12 09:14 提问者采纳
    这个是有多种原因的。
    可能是这几个软件是同一家公司开发的,启动某一个软件后会监控其他软件的服务有没有启动,没有的话则把它们都启动起来。
    也可能是这几个软件的消息推送机制采用的是同一家推送提供商,例如百度推送、友盟推送等,有推送到达时会启动相对应APP的后台服务。
    我们公司开发的软件这两种方式都有采用的,有时候启动并不一定是坏事,后台服务能让APP更好的为你服务。
    应该还有其他的原因,我想。。
    禁止关联应该很难,但是可以禁止自启,我用的安全软件就有这个功能,但不排除某些流氓软件。。你是无法禁止的。。(纯手打,\(^o^)/~)



    -----------------------------------------------------------------------------------------------------------------------------------------------------------------




    android 关联启动是什么原理?

    如题, 各种全家桶、大杂烩都是怎么个原理实现关联启动的?

    如果是单单接入相同的推送渠道,那么为什么同样接入小米推送的wps和youku,wps能启动youku youku缺没有启动wps?






    -------------------------------------



    Android教程:新型广告「应用静默关联启动」的解决方法

    穿越
    穿越
    2014-05-28

    Android 平台因其开放的特性,各种广告层出不穷,开放给用户带来自由的同时也带来了很多的问题。如今笔者发现除了应用内置广告条、弹出通知等广告形式外,Android 平台又出现了种隐蔽性非常高的广告形式:应用静默关联启动。

    Screenshot_2014-05-24-08-55-27.png
    Screenshot_2014-05-24-08-56-00.png

    何谓「应用静默关联启动」?以上图为例今天笔者在使用「爱帮公交」这个应用时突然弹出傲游浏览器窗口,而且显示的还是个游戏下载推荐页面。整个过程没有任何征兆,笔者也没有任何操作会导致启动「傲游浏览器」,打开「绿色守护」这才发现「傲游浏览器」果然是被爱帮公交唤醒的。这种唤醒无迹可寻,时间也不固定,如果没装「绿色守护」笔者也会找不着头绪,搞不清「傲游浏览器」是怎么突然启动的,隐藏性非常高。

    经过笔者的观察,以同样方式唤醒别的应用来散播广告的除了「爱帮公交」,还有「掌阅iRader」会偶尔唤醒「新浪微博」,「中华万年历」、「酷我音乐」等都出现过类似的问题,而阿里巴巴等一系列的应用就更是一个唤醒一个,基本打开一个就会都醒了,当然淘宝系的唤醒不一定会弹出广告。

    知道了问题的起因,如何解决呢?解决起来还真不是容易件的事,甚至如果手机没有ROOT权限就根本无法解决!这也体现了安卓平台权限管理的混乱。下面说下解决的方法:

    绿色守护

    9d2fc54c93ed2b1aa1cf801a71543e6d_mw_640_wm_0_wmp_3.png
    c9897ec26498e4cd79999dc0a6804904_mw_640_wm_0_wmp_3.png

    有些应用在「绿色守护」中根本没有切断唤醒路径的选项,不知其中是否有利益关系。我们可以试试「LBE安全大师」的软件权限管理功能,关闭相关应用的系统设置权限,这个方法笔者也在验证中,可能并不有效,毕竟「LBE安全大师」的软件权限管理功能稍弱了些。

    XPrivacy

    19c7f294464ea61c8576d94cb2147805_mw_640_wm_0_wmp_3.png
    81682cd68a7bfdff6ac0e22edf5f1191_mw_640_wm_0_wmp_3.png
    Android
    相关文章

    使用「XPrivacy」控制软件权限,把关于唤醒别的应用的权限都禁止即可。其实这个是最有效的方法,不过「XPrivacy」使用难度较大,适合极客类的用户。关于「XPrivacy」可参考下这篇文章: http://sspai.com/24535

    开发应用谋利是无可厚非的,但谋利却不考虑用户的感受,把莫名的广告强加给用户,这就有些过分了,笔者真心希望Android平台可以健康一些。




    ----------------------------------------------------------------------



    如何评价滴滴出行安卓版关联启动多个应用?

    …  显示全部
    按时间排序 按投票排序

    4 个回答





    ---------------------




    一、首先,我们先来说明后台软件自启动和关联启动是什么?

    “手机后台软件自启动”是指各种broadcast receiver,但具体是指的是哪个没有明确定义,经常发生的例子就是我们关闭手机360卫士进程以后它会自动唤醒程序使得360软件后台继续运行。

    “关联启动”就是一款软件在执行某一操作时能够启动另一款软件,例如,用户在淘宝选购了商品,然后付款时,可以选择登录支付宝进行付款,就会启动支付宝。有了“关联启动”功能,用户就可以更好地节约系统资源和手机电量。

    二、我们如何去管理华为P9的后台软件启动和关联启动呢?

    首先,从华为P9桌面的设置进入,找到【手机管家】里面的自启记录,就能看到哪些软件在后台启动,然后返回上一层进入【自动启动管理】关闭掉不需要自启动的软件,如图所示:

    www.jb51.net

    人民币白银
    人民币白银
    电玩打鱼
    电玩打鱼
    55电玩
    55电玩
    银子报价
    银子报价
    三国群英传
    三国群英传


    华为P9自启动管理

    管理关联启动,在上右图点击上端被其他应用启动,进入【被启动管理】,就可以管理被启动软件,建议开启支付宝,否则淘宝购物无法启动支付宝付款,如图所示:

    www.jb51.net

    金条多少钱一克
    金条多少钱一克
    今天白银价格
    今天白银价格
    搬家一般多少钱
    搬家一般多少钱
    微信二次开发
    微信二次开发


    华为P9被启动管理

    以上就是华为P9关闭自启动和关联启动方法介绍的全部内容了,希望对各位有所帮助。如果各位还有其他方面的问题,或者想要了解最新的资讯,请持续关注脚本之家!





    --------------------------------------------------------------------------------------------------------------------------------





    展开全文
  • H5唤起android app,启动关联应用

    千次阅读 2020-05-11 22:12:04
    H5也好,用js也和行, 代码如下: (请前端同学来...启动应用程序</a> </body> </html> 说明:href里就是自己定义的schema,请android开发和H5开发一起商量定一个就好。 然后android的And...
  • ----稍作记录,避免下次忘了又得我去查官方文档---- 有时候,我们开发的app需要支持打开...2.有时候我们app支持分享图片,那用户在系统相册选择分享时,怎么关联上我们app可供选择 3.最常见的一种情况,就是我们...
  • 华为手机APP启动管理为分自动管理和手动管理,开启自动管理后将采用智能方式开启或关闭手机APP应用是否随手机启动自启或后台自启,采用手动管理模式可以最大可能的保证指定的手机APP应用开机或后台中自启动、允许...
  • 无法启动服务,原因可能是已被禁用或与其相关联的设备没有启动 更新了一个win10系统,安装某软件并启动后提示需要使用.NET Framework 3.5 点击下载并安装此应用后,页面显示无法安装。错误原因为:无法启动服务,...
  • 鸿蒙系统的启动流程,建议收藏!

    千次阅读 2021-05-31 19:22:44
    声明:严格来说本文档并非真正原创的,这是上了朱有鹏老师的免费课《想读懂鸿蒙 2.0 源码,也许你需要先懂...这里仅摘取课程中的鸿蒙系统在 HI3516DV300 平台上的启动流程部分(从 30:00 开始讲解启动过程)进行汇...
  • 无法启动服务,原因可能是已被禁用或与其他关联的设备没有启动...计算机→右键选中“管理”→选中"服务和应用程序"中"服务"→找到"Windows Update",双击→"启动类型"选择"自动"→“应用”→“确定”。完成!!! ...
  • 3、完成后输入:sc config http start=disabled其他方法:(若80端口不能解除占用,可使用下方解决方案)解决方案一:1、Ctrl+x,然后选择“计算机管理”,展开“服务和应用程序”,找到“服务”;2、找到“World Wide ...
  • 【转载原因:win7安装windows Update独立安装程序,报错。】 【转载原文: ...】 ...右击 此电脑(我的电脑)——管理——服务,找到Windows Update,双击,将启动类型切换为自动即可正常下载。
  • adb 命令大全(简洁明了)adb命令启动应用

    千次阅读 多人点赞 2019-08-06 19:18:01
    启动adb客户端时,客户端首先检测adb服务端进程是否运行,如果没有运行,则启动服务端。当服务端启动时,它会绑定到本地的TCP5037端口,并且监听从adb客户端发来的命令——所有的adb客户端都使用5037端口与adb...
  • QT中使用以管理员权限启动一个进程

    千次阅读 2018-02-02 11:09:23
    在windows中,启动一个进程可以使用API ShellExecute来实现,详细参数可参考MSDN获悉。 #ifdef Q_OS_WIN #include #endif 具体实现可参考: #ifdef Q_OS_WIN/** 以下代码为宽字符,若改变字符集会导致编译不过,需...
  • ① 无法启动服务,原因可能是已被禁用或与其相关联的设备没有启动 ② Win 10 安装VMware-viclient报错28173 原因 我这里是因为刚做的系统,需要安装VMware-viclient 提示我: 然后我就安装某软件并启动后提示...
  • Windows 中一个应用程序的启动过程

    千次阅读 2018-05-04 14:23:46
    # 1. Explorer.exe Windows 能够流行起来,很大一个原因是它有友好的用户图形界面,操作方便简单,容易上手。在Windows环境下打开一个程序,...Explorer.exe是Windows程序管理器 或者叫 文件资源管理器,用于管理...
  • 所以更好的办法是程序直接主动申请权限,具体的做法是在项目中添加“应用程序清单文件”,默认会以 app.manifest 为文件名添加至项目根目录,如下所示。 &amp;amp;lt;?xml version=&amp;quot;1...
  • 日期 内核版本 架构 作者 GitHub CSDN 2016-06-14 ...在内存管理的上下文中, 初始化(initialization)可以有多种含义. 在许多CPU上, 必须显式设置适用于Linux内核的内存模型. 例如在x86_32上需要切换
  • 最近在一台新的电脑上安装weblogic,创建了新的server,但是一直无法启动,一直报下面这个错误: 对于服务器test-server, 与计算机java相关联的节点管理器无法访问。 消息图标 - 警告 所有所选服务器当前都处于与...
  • Android App启动流程详解

    万次阅读 多人点赞 2019-06-26 15:26:19
    前言:在之前的文章中已经写了apk的打包流程、安装流程,今天就是梳理一下apk系列的最后的流程--app启动流程。经过今天的梳理以后咱们就可以对apk包是怎么编译生成的、apk是怎么被安装到安卓手机的、用户点击了桌面...
  • 1. 电脑连WIFI时,总是显示找不到应用程序,这种情况是怎么回事1....点击开始按钮,打开“控制面板”,选择“系统和安全”,选择“管理工具”,最后选择“服务”请确定如下五个服务状态全部为“已启动”:Networ...
  • 当另一个应用启动特定的文件类型或 URI 方案时,您可以...您也可以使用关联启动 API 以相同的方式启动另一个应用。本主题描述了文件和 URI 关联以及如何在应用中使用它们。 提示: 类似于 Windows
  • 文章目录APM(应用性能管理)与Dapper原理介绍什么是APMAPM介绍APM三大特征APM的发展历程DevOpsAPM 的核心思想为什么要使用APM好的APM应满足的条件Dapper的介绍以及基本原理如何将每个服务的日志与每一条记录与特定...
  • Android - Activity 启动过程 概述 从点击桌面应用图标到应用显示的过程我们再熟悉不过了,下面我们来分析下这个过程都做了什么。 本文主要对以下问题分析: ActivityThread 是什么,它是一个线程吗,如何被...
  • 前言  因为恶作剧或其他方面的原因,你可能不想让电脑上的某个软件启动或开机自动启动方式一  ”开始”—>”运行”—>输入gpedit.msc,打开本地组策略编辑器   依次打开”用户配置”—>”管理模板”,点击”...
  • 今天推荐一个Gartner魔力象限的APM应用性能监控产品AppDynamics,一个应用可以一直免费使用。本文主要包含以下4部分内容注册AppDynamics Saas账号安装监控代理Agent监控效果简介使用AppDynamics进行故障排查注册...
  • 博客推荐系统--mahout FP关联规则算法应用1

    千次阅读 热门讨论 2014-02-19 08:52:17
    调用算法模块仍旧采用之前系统的步骤:首先在参数界面输入参数,然后提到到一个action中,这个action会启动一个线程启动云平台Fp关联规则算法,然后连接到另外一个action中,另外的这个action会去根据云平台的信息,...
  • Android应用实现文件关联

    千次阅读 2012-01-17 16:11:02
    如题,如果要实现文件关联,首先要修改AndroidManifest.xml,例子如下:   package="com.android.sample" android:versionCode="1" android:versionName="1.0">  android:debuggable=...
  • 2、如何判断应用程序是以提升的权限来启动的,还是正在使用筛选的令牌运行。 下面这个名为GetProcessElevation的辅助函数能返回提升类型和一个指出进程是否正在以管理员身份运行的布尔值。 BOOL ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 241,425
精华内容 96,570
关键字:

应用关联启动管理好处