Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e85775f5 authored by Kun Liang's avatar Kun Liang Committed by Gerrit - the friendly Code Review server
Browse files

AppOps: fix framework reboot issue when AppOps enabled

When AppOps security feature enabled, there will be a prompt when
someone call the protected operation. If no user click on the
dialog button, it will be always blocked there. This action may
cause watchdog timeout in some service.

Change-Id: I114bfef22502b81887a84b218e1548de29be3f69
parent 0d957642
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -50,9 +50,9 @@ class PermissionDialog extends BasePermissionDialog {
    static final int ACTION_IGNORED = 0x4;
    static final int ACTION_IGNORED_TIMEOUT = 0x8;

    // 1-minute timeout, then we automatically dismiss the permission
    // dialog
    static final long DISMISS_TIMEOUT = 1000 * 60 * 1;
    // 15s timeout, then we automatically dismiss the permission
    // dialog. Otherwise, it may cause watchdog timeout sometimes.
    static final long DISMISS_TIMEOUT = 1000 * 15 * 1;

    public PermissionDialog(Context context, AppOpsService service,
            int code, int uid, String packageName) {
@@ -97,9 +97,8 @@ class PermissionDialog extends BasePermissionDialog {
        setView(mView);

        // After the timeout, pretend the user clicked the quit button
        //mHandler.sendMessageDelayed(
        //        mHandler.obtainMessage(ACTION_IGNORED_TIMEOUT),
        //        DISMISS_TIMEOUT);
        mHandler.sendMessageDelayed(
                mHandler.obtainMessage(ACTION_IGNORED_TIMEOUT), DISMISS_TIMEOUT);
    }

    private String getAppName(String packageName) {