Snap for 9519047 from 2b80fa789a to tm-qpr3-release
Change-Id: Ifca501caf4408b161ea25e42141f8ee8ef5d02c6
This commit is contained in:
@@ -2973,7 +2973,6 @@
|
|||||||
<activity android:name=".FallbackHome"
|
<activity android:name=".FallbackHome"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:label=""
|
android:label=""
|
||||||
android:screenOrientation="nosensor"
|
|
||||||
android:taskAffinity="com.android.settings.FallbackHome"
|
android:taskAffinity="com.android.settings.FallbackHome"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:theme="@style/FallbackHome"
|
android:theme="@style/FallbackHome"
|
||||||
|
|||||||
@@ -14,16 +14,14 @@
|
|||||||
~ See the License for the specific language governing permissions and
|
~ See the License for the specific language governing permissions and
|
||||||
~ limitations under the License
|
~ limitations under the License
|
||||||
-->
|
-->
|
||||||
<com.google.android.setupdesign.GlifLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/setup_wizard_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:layout="@layout/sud_glif_blank_template">
|
|
||||||
|
|
||||||
<include
|
<include
|
||||||
layout="@layout/confirm_lock_password_base"
|
layout="@layout/confirm_lock_password_base"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_gravity="center_horizontal" />
|
||||||
</com.google.android.setupdesign.GlifLayout>
|
</FrameLayout>
|
||||||
|
|||||||
@@ -13,16 +13,14 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<com.google.android.setupdesign.GlifLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/setup_wizard_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:layout="@layout/sud_glif_blank_template">
|
|
||||||
|
|
||||||
<include
|
<include
|
||||||
layout="@layout/confirm_lock_pattern_base"
|
layout="@layout/confirm_lock_pattern_base"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_gravity="center_horizontal" />
|
||||||
</com.google.android.setupdesign.GlifLayout>
|
</FrameLayout>
|
||||||
|
|||||||
@@ -16,14 +16,14 @@
|
|||||||
|
|
||||||
package com.android.settings.applications.specialaccess.notificationaccess;
|
package com.android.settings.applications.specialaccess.notificationaccess;
|
||||||
|
|
||||||
|
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||||
|
|
||||||
import static com.android.settings.applications.AppInfoBase.ARG_PACKAGE_NAME;
|
import static com.android.settings.applications.AppInfoBase.ARG_PACKAGE_NAME;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.Manifest;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.companion.ICompanionDeviceManager;
|
import android.companion.ICompanionDeviceManager;
|
||||||
import android.compat.annotation.ChangeId;
|
|
||||||
import android.compat.annotation.EnabledAfter;
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -37,8 +37,8 @@ import android.os.ServiceManager;
|
|||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.service.notification.NotificationListenerFilter;
|
|
||||||
import android.service.notification.NotificationListenerService;
|
import android.service.notification.NotificationListenerService;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
|
||||||
@@ -48,7 +48,6 @@ import androidx.preference.PreferenceScreen;
|
|||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.SettingsActivity;
|
import com.android.settings.SettingsActivity;
|
||||||
import com.android.settings.applications.AppInfoBase;
|
import com.android.settings.applications.AppInfoBase;
|
||||||
import com.android.settings.applications.manageapplications.ManageApplications;
|
|
||||||
import com.android.settings.bluetooth.Utils;
|
import com.android.settings.bluetooth.Utils;
|
||||||
import com.android.settings.core.SubSettingLauncher;
|
import com.android.settings.core.SubSettingLauncher;
|
||||||
import com.android.settings.dashboard.DashboardFragment;
|
import com.android.settings.dashboard.DashboardFragment;
|
||||||
@@ -208,8 +207,12 @@ public class NotificationAccessDetails extends DashboardFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (intent != null && intent.hasExtra(Intent.EXTRA_USER_HANDLE)) {
|
if (intent != null && intent.hasExtra(Intent.EXTRA_USER_HANDLE)) {
|
||||||
mUserId = ((UserHandle) intent.getParcelableExtra(
|
if (hasInteractAcrossUsersPermission()) {
|
||||||
Intent.EXTRA_USER_HANDLE)).getIdentifier();
|
mUserId = ((UserHandle) intent.getParcelableExtra(
|
||||||
|
Intent.EXTRA_USER_HANDLE)).getIdentifier();
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mUserId = UserHandle.myUserId();
|
mUserId = UserHandle.myUserId();
|
||||||
}
|
}
|
||||||
@@ -224,6 +227,26 @@ public class NotificationAccessDetails extends DashboardFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hasInteractAcrossUsersPermission() {
|
||||||
|
final String callingPackageName =
|
||||||
|
((SettingsActivity) getActivity()).getInitialCallingPackage();
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(callingPackageName)) {
|
||||||
|
Log.w(TAG, "Not able to get calling package name for permission check");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getContext().getPackageManager().checkPermission(
|
||||||
|
Manifest.permission.INTERACT_ACROSS_USERS_FULL, callingPackageName)
|
||||||
|
!= PERMISSION_GRANTED) {
|
||||||
|
Log.w(TAG, "Package " + callingPackageName + " does not have required permission "
|
||||||
|
+ Manifest.permission.INTERACT_ACROSS_USERS_FULL);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Dialogs only have access to the parent fragment, not the controller, so pass the information
|
// Dialogs only have access to the parent fragment, not the controller, so pass the information
|
||||||
// along to keep business logic out of this file
|
// along to keep business logic out of this file
|
||||||
public void disable(final ComponentName cn) {
|
public void disable(final ComponentName cn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user