Merge "Do not allow draw on top for App notification settings" into oc-dev
am: 811229a2fd
Change-Id: Ie5ed40b8f573b974850234987bacc5ae7db925a4
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
package com.android.settings.notification;
|
package com.android.settings.notification;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
|
||||||
|
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
import android.app.NotificationChannelGroup;
|
import android.app.NotificationChannelGroup;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
@@ -32,6 +34,8 @@ import android.util.Log;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
import com.android.settings.AppHeader;
|
import com.android.settings.AppHeader;
|
||||||
@@ -76,6 +80,9 @@ public class AppNotificationSettings extends NotificationSettingsBase {
|
|||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
|
getActivity().getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
|
||||||
|
android.util.EventLog.writeEvent(0x534e4554, "119115683", -1, "");
|
||||||
|
|
||||||
if (mUid < 0 || TextUtils.isEmpty(mPkg) || mPkgInfo == null) {
|
if (mUid < 0 || TextUtils.isEmpty(mPkg) || mPkgInfo == null) {
|
||||||
Log.w(TAG, "Missing package or uid or packageinfo");
|
Log.w(TAG, "Missing package or uid or packageinfo");
|
||||||
finish();
|
finish();
|
||||||
@@ -125,6 +132,15 @@ public class AppNotificationSettings extends NotificationSettingsBase {
|
|||||||
updateDependents(mAppRow.banned);
|
updateDependents(mAppRow.banned);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
final Window window = getActivity().getWindow();
|
||||||
|
final WindowManager.LayoutParams attrs = window.getAttributes();
|
||||||
|
attrs.privateFlags &= ~PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
|
||||||
|
window.setAttributes(attrs);
|
||||||
|
}
|
||||||
|
|
||||||
private void addHeaderPref() {
|
private void addHeaderPref() {
|
||||||
ArrayMap<String, AppRow> rows = new ArrayMap<>();
|
ArrayMap<String, AppRow> rows = new ArrayMap<>();
|
||||||
rows.put(mAppRow.pkg, mAppRow);
|
rows.put(mAppRow.pkg, mAppRow);
|
||||||
|
Reference in New Issue
Block a user