Skip to content

Commit

Permalink
Restore accidentally removed App-Pinning controller. WTF m(
Browse files Browse the repository at this point in the history
  • Loading branch information
pc-coholic committed Jul 31, 2017
1 parent d40c393 commit 2d94707
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/de/pccoholic/pretix/dpc/AdminActivities.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@ static void allowNonMarketAppsInstallation(Context context) {

dpm.setSecureSetting(deviceAdmin, Settings.Secure.INSTALL_NON_MARKET_APPS, "1");
}

static void setLockTaskApplications(Context context) {
ComponentName deviceAdmin = new ComponentName(context, AdminReceiver.class);
DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
dpm.setLockTaskPackages(deviceAdmin,
new String[] { context.getPackageName() });
}
}
1 change: 1 addition & 0 deletions src/de/pccoholic/pretix/dpc/DPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void onCreate(Bundle savedInstanceState) {
Common.setScannerToBroadcast();

AdminActivities.becomeHomeActivity(this);
AdminActivities.setLockTaskApplications(this);

startService(new Intent(this, StatusbarService.class));

Expand Down

0 comments on commit 2d94707

Please sign in to comment.