Disable system alert window permissions on low ram devices

Bug: 63697002
Bug: 117832554
Test: adb am start-activity -a
android.settings.action.MANAGE_OVERLAY_PERMISSION
Change-Id: I44c64001cd07fd4934cdc55f455384cebd5c9cfb
This commit is contained in:
Ng Zhi An
2019-02-01 12:39:31 -08:00
parent d3824aa426
commit b97bdc38da
9 changed files with 212 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.applications.specialaccess;
import static com.android.settings.Utils.isSystemAlertWindowEnabled;
import android.app.ActivityManager;
import android.content.Context;
import android.os.Build;
import com.android.settings.core.BasePreferenceController;
public class SystemAlertWindowPreferenceController extends BasePreferenceController {
public SystemAlertWindowPreferenceController(Context context, String preferenceKey) {
super(context, preferenceKey);
}
@Override
public int getAvailabilityStatus() {
return isSystemAlertWindowEnabled(mContext)
? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE ;
}
}