Job Scheduler TARE page implementation

A Job Scheduler policy page is needed in the TARE developer options
settings to allow developers to both view and edit the current values of
all the factors under the job scheduler policy. The page uses a dropdown
so that the user can easily switch between the different policies. For
the factors with subfactors, the user simply clicks on the factor and
the subfactors wil pop up under it.

Bug: 191877052

Test: Manual (open Settings > System > Developer Options > TARE >
JobScheduler and verify all factors are there)

Change-Id: Icea6cda5e4b59d1736f85defcb9532839c3720f5
This commit is contained in:
alinasuarez
2021-07-26 21:04:16 +00:00
parent 32ef854a8d
commit 8073d4eb92
6 changed files with 261 additions and 6 deletions

View File

@@ -16,6 +16,10 @@
package com.android.settings.development.tare;
import static com.android.settings.development.tare.DropdownActivity.EXTRA_POLICY;
import static com.android.settings.development.tare.DropdownActivity.POLICY_ALARM_MANAGER;
import static com.android.settings.development.tare.DropdownActivity.POLICY_JOB_SCHEDULER;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
@@ -66,6 +70,15 @@ public class TareHomePage extends Activity {
/** Opens up the AlarmManager TARE policy page with its factors to view and edit */
public void launchAlarmManagerPage(View v) {
startActivity(new Intent(getApplicationContext(), DropdownActivity.class));
Intent i = new Intent(getApplicationContext(), DropdownActivity.class);
i.putExtra(EXTRA_POLICY, POLICY_ALARM_MANAGER);
startActivity(i);
}
/** Opens up the JobScheduler TARE policy page with its factors to view and edit */
public void launchJobSchedulerPage(View v) {
Intent i = new Intent(getApplicationContext(), DropdownActivity.class);
i.putExtra(EXTRA_POLICY, POLICY_JOB_SCHEDULER);
startActivity(i);
}
}