Enable the backup settings activity before launching
Bug: 34925593 Test: Manual Change-Id: Ib27efa2138f56af37fe83376496a0d4c7a494e5b
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
package com.android.settings.backup;
|
package com.android.settings.backup;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -41,8 +43,13 @@ public class BackupSettingsActivity extends Activity {
|
|||||||
Log.d(TAG,
|
Log.d(TAG,
|
||||||
"No manufacturer settings found, launching the backup settings directly");
|
"No manufacturer settings found, launching the backup settings directly");
|
||||||
}
|
}
|
||||||
|
Intent intent = backupHelper.getIntentForBackupSettings();
|
||||||
|
// enable the activity before launching it
|
||||||
|
getPackageManager().setComponentEnabledSetting(intent.getComponent(),
|
||||||
|
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
|
||||||
|
|
||||||
// use startActivityForResult to let the activity check the caller signature
|
// use startActivityForResult to let the activity check the caller signature
|
||||||
startActivityForResult(backupHelper.getIntentForBackupSettings(), 1);
|
startActivityForResult(intent, 1);
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
if (Log.isLoggable(TAG, Log.DEBUG)) {
|
if (Log.isLoggable(TAG, Log.DEBUG)) {
|
||||||
|
Reference in New Issue
Block a user